energy_api/spec_version.rs
1//! Specification versions implemented by this crate.
2//!
3//! Each constant identifies the OpenAPI / AsyncAPI document version that the
4//! corresponding module implements. All four EDI-Energy API-Webdienste are
5//! currently at version **1.0.0**.
6//!
7//! Use these constants in server implementations to populate
8//! `ApiRecord::major_version` when self-registering at the
9//! Verzeichnisdienst (the directory expects an `i32` `majorVersion` field
10//! whose value is `1` for all current specs).
11//!
12//! ```rust
13//! use energy_api::spec_version;
14//!
15//! assert_eq!(spec_version::DIRECTORY_SERVICE, "1.0.0");
16//! assert_eq!(spec_version::DIRECTORY_WEBSOCKET, "1.0.0");
17//! assert_eq!(spec_version::CONTROL_MEASURES, "1.0.0");
18//! assert_eq!(spec_version::MALO_IDENT, "1.0.0");
19//! ```
20
21/// `directoryServiceV1.yaml` — EDI-Energy Verzeichnisdienst REST API.
22pub const DIRECTORY_SERVICE: &str = "1.0.0";
23
24/// `webSocketV1.yaml` — EDI-Energy Verzeichnisdienst WebSocket subscription API.
25pub const DIRECTORY_WEBSOCKET: &str = "1.0.0";
26
27/// `controlMeasuresV1.yaml` — EDI-Energy Control Measures API.
28///
29/// **Note:** the Control Measures spec currently omits a `/v1` URL prefix
30/// (unlike the other APIs); the path layout is `/[Post]/steuerbefehl/<action>/`.
31pub const CONTROL_MEASURES: &str = "1.0.0";
32
33/// `maloIdentV1.yaml` — EDI-Energy MaLo Identification API.
34pub const MALO_IDENT: &str = "1.0.0";
35
36/// The `majorVersion` field value for all current specs as expected by the
37/// Verzeichnisdienst (`ApiRecord::major_version: i32`).
38pub const MAJOR: i32 = 1;