ocpp-types 0.1.1

Strongly typed OCPP 1.6J, 2.0.1, and 2.1 message types for Rust. no_std, no alloc, embedded-friendly.
Documentation
// @generated by ocpp-codegen from schemas/. Do not edit by hand -- run
// `scripts/generate.sh` to regenerate; manual changes will be overwritten.

use super::common::*;
#[cfg(feature = "alloc")]
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct HeartbeatResponse {
    /// Contains the current time of the CSMS.
    #[cfg_attr(feature = "serde", serde(rename = "currentTime"))]
    pub current_time: alloc::string::String,
    #[cfg_attr(feature = "serde", serde(rename = "customData"))]
    #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
    pub custom_data: Option<CustomData>,
}
#[cfg(feature = "alloc")]
impl crate::Action for HeartbeatResponse {
    const ACTION: &'static str = "Heartbeat";
}
#[cfg(not(feature = "alloc"))]
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct HeartbeatResponse<
    const HEARTBEAT_RESPONSE_CURRENT_TIME_CAP: usize = 1024usize,
> {
    /// Contains the current time of the CSMS.
    #[cfg_attr(feature = "serde", serde(rename = "currentTime"))]
    pub current_time: heapless::String<HEARTBEAT_RESPONSE_CURRENT_TIME_CAP>,
    #[cfg_attr(feature = "serde", serde(rename = "customData"))]
    #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
    pub custom_data: Option<CustomData>,
}
#[cfg(not(feature = "alloc"))]
impl<const HEARTBEAT_RESPONSE_CURRENT_TIME_CAP: usize> crate::Action
for HeartbeatResponse<HEARTBEAT_RESPONSE_CURRENT_TIME_CAP> {
    const ACTION: &'static str = "Heartbeat";
}