ocpp-types 0.3.0

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::*;
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ResetRequest<CustomDataType = crate::NoCustomData> {
    #[cfg_attr(feature = "serde", serde(rename = "customData"))]
    #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
    pub custom_data: Option<CustomDataType>,
    /// This contains the ID of a specific EVSE that needs to be reset, instead of the entire Charging Station.
    #[cfg_attr(feature = "serde", serde(rename = "evseId"))]
    #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
    pub evse_id: Option<i64>,
    pub r#type: ResetEnum,
}
impl<CustomDataType> crate::Action for ResetRequest<CustomDataType> {
    const ACTION: &'static str = "Reset";
}
#[cfg(feature = "validate")]
impl<CustomDataType> crate::validate::Validate for ResetRequest<CustomDataType> {
    fn validate(&self) -> Result<(), crate::validate::ValidationError> {
        crate::validate::Validate::validate(&self.r#type)
            .map_err(|error| error.in_field("type"))?;
        Ok(())
    }
}