use ocpp_core::validate::{Path, Validate, Violation};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AuthorizationStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Blocked")]
Blocked,
#[serde(rename = "Expired")]
Expired,
#[serde(rename = "Invalid")]
Invalid,
#[serde(rename = "ConcurrentTx")]
ConcurrentTx,
}
impl AuthorizationStatus {
pub const ALL: &'static [AuthorizationStatus] = &[
AuthorizationStatus::Accepted,
AuthorizationStatus::Blocked,
AuthorizationStatus::Expired,
AuthorizationStatus::Invalid,
AuthorizationStatus::ConcurrentTx,
];
pub const fn as_str(&self) -> &'static str {
match self {
AuthorizationStatus::Accepted => "Accepted",
AuthorizationStatus::Blocked => "Blocked",
AuthorizationStatus::Expired => "Expired",
AuthorizationStatus::Invalid => "Invalid",
AuthorizationStatus::ConcurrentTx => "ConcurrentTx",
}
}
}
impl std::fmt::Display for AuthorizationStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for AuthorizationStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for AuthorizationStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AvailabilityStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Rejected")]
Rejected,
#[serde(rename = "Scheduled")]
Scheduled,
}
impl AvailabilityStatus {
pub const ALL: &'static [AvailabilityStatus] = &[
AvailabilityStatus::Accepted,
AvailabilityStatus::Rejected,
AvailabilityStatus::Scheduled,
];
pub const fn as_str(&self) -> &'static str {
match self {
AvailabilityStatus::Accepted => "Accepted",
AvailabilityStatus::Rejected => "Rejected",
AvailabilityStatus::Scheduled => "Scheduled",
}
}
}
impl std::fmt::Display for AvailabilityStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for AvailabilityStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for AvailabilityStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AvailabilityType {
#[serde(rename = "Inoperative")]
Inoperative,
#[serde(rename = "Operative")]
Operative,
}
impl AvailabilityType {
pub const ALL: &'static [AvailabilityType] =
&[AvailabilityType::Inoperative, AvailabilityType::Operative];
pub const fn as_str(&self) -> &'static str {
match self {
AvailabilityType::Inoperative => "Inoperative",
AvailabilityType::Operative => "Operative",
}
}
}
impl std::fmt::Display for AvailabilityType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for AvailabilityType {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for AvailabilityType {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum CancelReservationStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Rejected")]
Rejected,
}
impl CancelReservationStatus {
pub const ALL: &'static [CancelReservationStatus] = &[
CancelReservationStatus::Accepted,
CancelReservationStatus::Rejected,
];
pub const fn as_str(&self) -> &'static str {
match self {
CancelReservationStatus::Accepted => "Accepted",
CancelReservationStatus::Rejected => "Rejected",
}
}
}
impl std::fmt::Display for CancelReservationStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for CancelReservationStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for CancelReservationStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ChargePointErrorCode {
#[serde(rename = "ConnectorLockFailure")]
ConnectorLockFailure,
#[serde(rename = "EVCommunicationError")]
EVCommunicationError,
#[serde(rename = "GroundFailure")]
GroundFailure,
#[serde(rename = "HighTemperature")]
HighTemperature,
#[serde(rename = "InternalError")]
InternalError,
#[serde(rename = "LocalListConflict")]
LocalListConflict,
#[serde(rename = "NoError")]
NoError,
#[serde(rename = "OtherError")]
OtherError,
#[serde(rename = "OverCurrentFailure")]
OverCurrentFailure,
#[serde(rename = "PowerMeterFailure")]
PowerMeterFailure,
#[serde(rename = "PowerSwitchFailure")]
PowerSwitchFailure,
#[serde(rename = "ReaderFailure")]
ReaderFailure,
#[serde(rename = "ResetFailure")]
ResetFailure,
#[serde(rename = "UnderVoltage")]
UnderVoltage,
#[serde(rename = "OverVoltage")]
OverVoltage,
#[serde(rename = "WeakSignal")]
WeakSignal,
}
impl ChargePointErrorCode {
pub const ALL: &'static [ChargePointErrorCode] = &[
ChargePointErrorCode::ConnectorLockFailure,
ChargePointErrorCode::EVCommunicationError,
ChargePointErrorCode::GroundFailure,
ChargePointErrorCode::HighTemperature,
ChargePointErrorCode::InternalError,
ChargePointErrorCode::LocalListConflict,
ChargePointErrorCode::NoError,
ChargePointErrorCode::OtherError,
ChargePointErrorCode::OverCurrentFailure,
ChargePointErrorCode::PowerMeterFailure,
ChargePointErrorCode::PowerSwitchFailure,
ChargePointErrorCode::ReaderFailure,
ChargePointErrorCode::ResetFailure,
ChargePointErrorCode::UnderVoltage,
ChargePointErrorCode::OverVoltage,
ChargePointErrorCode::WeakSignal,
];
pub const fn as_str(&self) -> &'static str {
match self {
ChargePointErrorCode::ConnectorLockFailure => "ConnectorLockFailure",
ChargePointErrorCode::EVCommunicationError => "EVCommunicationError",
ChargePointErrorCode::GroundFailure => "GroundFailure",
ChargePointErrorCode::HighTemperature => "HighTemperature",
ChargePointErrorCode::InternalError => "InternalError",
ChargePointErrorCode::LocalListConflict => "LocalListConflict",
ChargePointErrorCode::NoError => "NoError",
ChargePointErrorCode::OtherError => "OtherError",
ChargePointErrorCode::OverCurrentFailure => "OverCurrentFailure",
ChargePointErrorCode::PowerMeterFailure => "PowerMeterFailure",
ChargePointErrorCode::PowerSwitchFailure => "PowerSwitchFailure",
ChargePointErrorCode::ReaderFailure => "ReaderFailure",
ChargePointErrorCode::ResetFailure => "ResetFailure",
ChargePointErrorCode::UnderVoltage => "UnderVoltage",
ChargePointErrorCode::OverVoltage => "OverVoltage",
ChargePointErrorCode::WeakSignal => "WeakSignal",
}
}
}
impl std::fmt::Display for ChargePointErrorCode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ChargePointErrorCode {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ChargePointErrorCode {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ChargePointStatus {
#[serde(rename = "Available")]
Available,
#[serde(rename = "Preparing")]
Preparing,
#[serde(rename = "Charging")]
Charging,
#[serde(rename = "SuspendedEVSE")]
SuspendedEVSE,
#[serde(rename = "SuspendedEV")]
SuspendedEV,
#[serde(rename = "Finishing")]
Finishing,
#[serde(rename = "Reserved")]
Reserved,
#[serde(rename = "Unavailable")]
Unavailable,
#[serde(rename = "Faulted")]
Faulted,
}
impl ChargePointStatus {
pub const ALL: &'static [ChargePointStatus] = &[
ChargePointStatus::Available,
ChargePointStatus::Preparing,
ChargePointStatus::Charging,
ChargePointStatus::SuspendedEVSE,
ChargePointStatus::SuspendedEV,
ChargePointStatus::Finishing,
ChargePointStatus::Reserved,
ChargePointStatus::Unavailable,
ChargePointStatus::Faulted,
];
pub const fn as_str(&self) -> &'static str {
match self {
ChargePointStatus::Available => "Available",
ChargePointStatus::Preparing => "Preparing",
ChargePointStatus::Charging => "Charging",
ChargePointStatus::SuspendedEVSE => "SuspendedEVSE",
ChargePointStatus::SuspendedEV => "SuspendedEV",
ChargePointStatus::Finishing => "Finishing",
ChargePointStatus::Reserved => "Reserved",
ChargePointStatus::Unavailable => "Unavailable",
ChargePointStatus::Faulted => "Faulted",
}
}
}
impl std::fmt::Display for ChargePointStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ChargePointStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ChargePointStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ChargingProfileKindType {
#[serde(rename = "Absolute")]
Absolute,
#[serde(rename = "Recurring")]
Recurring,
#[serde(rename = "Relative")]
Relative,
}
impl ChargingProfileKindType {
pub const ALL: &'static [ChargingProfileKindType] = &[
ChargingProfileKindType::Absolute,
ChargingProfileKindType::Recurring,
ChargingProfileKindType::Relative,
];
pub const fn as_str(&self) -> &'static str {
match self {
ChargingProfileKindType::Absolute => "Absolute",
ChargingProfileKindType::Recurring => "Recurring",
ChargingProfileKindType::Relative => "Relative",
}
}
}
impl std::fmt::Display for ChargingProfileKindType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ChargingProfileKindType {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ChargingProfileKindType {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ChargingProfilePurposeType {
#[serde(rename = "ChargePointMaxProfile")]
ChargePointMaxProfile,
#[serde(rename = "TxDefaultProfile")]
TxDefaultProfile,
#[serde(rename = "TxProfile")]
TxProfile,
}
impl ChargingProfilePurposeType {
pub const ALL: &'static [ChargingProfilePurposeType] = &[
ChargingProfilePurposeType::ChargePointMaxProfile,
ChargingProfilePurposeType::TxDefaultProfile,
ChargingProfilePurposeType::TxProfile,
];
pub const fn as_str(&self) -> &'static str {
match self {
ChargingProfilePurposeType::ChargePointMaxProfile => "ChargePointMaxProfile",
ChargingProfilePurposeType::TxDefaultProfile => "TxDefaultProfile",
ChargingProfilePurposeType::TxProfile => "TxProfile",
}
}
}
impl std::fmt::Display for ChargingProfilePurposeType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ChargingProfilePurposeType {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ChargingProfilePurposeType {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ChargingProfileStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Rejected")]
Rejected,
#[serde(rename = "NotSupported")]
NotSupported,
}
impl ChargingProfileStatus {
pub const ALL: &'static [ChargingProfileStatus] = &[
ChargingProfileStatus::Accepted,
ChargingProfileStatus::Rejected,
ChargingProfileStatus::NotSupported,
];
pub const fn as_str(&self) -> &'static str {
match self {
ChargingProfileStatus::Accepted => "Accepted",
ChargingProfileStatus::Rejected => "Rejected",
ChargingProfileStatus::NotSupported => "NotSupported",
}
}
}
impl std::fmt::Display for ChargingProfileStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ChargingProfileStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ChargingProfileStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ChargingRateUnitType {
#[serde(rename = "A")]
A,
#[serde(rename = "W")]
W,
}
impl ChargingRateUnitType {
pub const ALL: &'static [ChargingRateUnitType] =
&[ChargingRateUnitType::A, ChargingRateUnitType::W];
pub const fn as_str(&self) -> &'static str {
match self {
ChargingRateUnitType::A => "A",
ChargingRateUnitType::W => "W",
}
}
}
impl std::fmt::Display for ChargingRateUnitType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ChargingRateUnitType {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ChargingRateUnitType {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ClearCacheStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Rejected")]
Rejected,
}
impl ClearCacheStatus {
pub const ALL: &'static [ClearCacheStatus] =
&[ClearCacheStatus::Accepted, ClearCacheStatus::Rejected];
pub const fn as_str(&self) -> &'static str {
match self {
ClearCacheStatus::Accepted => "Accepted",
ClearCacheStatus::Rejected => "Rejected",
}
}
}
impl std::fmt::Display for ClearCacheStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ClearCacheStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ClearCacheStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ClearChargingProfileStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Unknown")]
Unknown,
}
impl ClearChargingProfileStatus {
pub const ALL: &'static [ClearChargingProfileStatus] = &[
ClearChargingProfileStatus::Accepted,
ClearChargingProfileStatus::Unknown,
];
pub const fn as_str(&self) -> &'static str {
match self {
ClearChargingProfileStatus::Accepted => "Accepted",
ClearChargingProfileStatus::Unknown => "Unknown",
}
}
}
impl std::fmt::Display for ClearChargingProfileStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ClearChargingProfileStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ClearChargingProfileStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ConfigurationStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Rejected")]
Rejected,
#[serde(rename = "RebootRequired")]
RebootRequired,
#[serde(rename = "NotSupported")]
NotSupported,
}
impl ConfigurationStatus {
pub const ALL: &'static [ConfigurationStatus] = &[
ConfigurationStatus::Accepted,
ConfigurationStatus::Rejected,
ConfigurationStatus::RebootRequired,
ConfigurationStatus::NotSupported,
];
pub const fn as_str(&self) -> &'static str {
match self {
ConfigurationStatus::Accepted => "Accepted",
ConfigurationStatus::Rejected => "Rejected",
ConfigurationStatus::RebootRequired => "RebootRequired",
ConfigurationStatus::NotSupported => "NotSupported",
}
}
}
impl std::fmt::Display for ConfigurationStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ConfigurationStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ConfigurationStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DataTransferStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Rejected")]
Rejected,
#[serde(rename = "UnknownMessageId")]
UnknownMessageId,
#[serde(rename = "UnknownVendorId")]
UnknownVendorId,
}
impl DataTransferStatus {
pub const ALL: &'static [DataTransferStatus] = &[
DataTransferStatus::Accepted,
DataTransferStatus::Rejected,
DataTransferStatus::UnknownMessageId,
DataTransferStatus::UnknownVendorId,
];
pub const fn as_str(&self) -> &'static str {
match self {
DataTransferStatus::Accepted => "Accepted",
DataTransferStatus::Rejected => "Rejected",
DataTransferStatus::UnknownMessageId => "UnknownMessageId",
DataTransferStatus::UnknownVendorId => "UnknownVendorId",
}
}
}
impl std::fmt::Display for DataTransferStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for DataTransferStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for DataTransferStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DiagnosticsStatus {
#[serde(rename = "Idle")]
Idle,
#[serde(rename = "Uploaded")]
Uploaded,
#[serde(rename = "UploadFailed")]
UploadFailed,
#[serde(rename = "Uploading")]
Uploading,
}
impl DiagnosticsStatus {
pub const ALL: &'static [DiagnosticsStatus] = &[
DiagnosticsStatus::Idle,
DiagnosticsStatus::Uploaded,
DiagnosticsStatus::UploadFailed,
DiagnosticsStatus::Uploading,
];
pub const fn as_str(&self) -> &'static str {
match self {
DiagnosticsStatus::Idle => "Idle",
DiagnosticsStatus::Uploaded => "Uploaded",
DiagnosticsStatus::UploadFailed => "UploadFailed",
DiagnosticsStatus::Uploading => "Uploading",
}
}
}
impl std::fmt::Display for DiagnosticsStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for DiagnosticsStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for DiagnosticsStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum FirmwareStatus {
#[serde(rename = "Downloaded")]
Downloaded,
#[serde(rename = "DownloadFailed")]
DownloadFailed,
#[serde(rename = "Downloading")]
Downloading,
#[serde(rename = "Idle")]
Idle,
#[serde(rename = "InstallationFailed")]
InstallationFailed,
#[serde(rename = "Installing")]
Installing,
#[serde(rename = "Installed")]
Installed,
}
impl FirmwareStatus {
pub const ALL: &'static [FirmwareStatus] = &[
FirmwareStatus::Downloaded,
FirmwareStatus::DownloadFailed,
FirmwareStatus::Downloading,
FirmwareStatus::Idle,
FirmwareStatus::InstallationFailed,
FirmwareStatus::Installing,
FirmwareStatus::Installed,
];
pub const fn as_str(&self) -> &'static str {
match self {
FirmwareStatus::Downloaded => "Downloaded",
FirmwareStatus::DownloadFailed => "DownloadFailed",
FirmwareStatus::Downloading => "Downloading",
FirmwareStatus::Idle => "Idle",
FirmwareStatus::InstallationFailed => "InstallationFailed",
FirmwareStatus::Installing => "Installing",
FirmwareStatus::Installed => "Installed",
}
}
}
impl std::fmt::Display for FirmwareStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for FirmwareStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for FirmwareStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum GetCompositeScheduleStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Rejected")]
Rejected,
}
impl GetCompositeScheduleStatus {
pub const ALL: &'static [GetCompositeScheduleStatus] = &[
GetCompositeScheduleStatus::Accepted,
GetCompositeScheduleStatus::Rejected,
];
pub const fn as_str(&self) -> &'static str {
match self {
GetCompositeScheduleStatus::Accepted => "Accepted",
GetCompositeScheduleStatus::Rejected => "Rejected",
}
}
}
impl std::fmt::Display for GetCompositeScheduleStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for GetCompositeScheduleStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for GetCompositeScheduleStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Location {
#[serde(rename = "Cable")]
Cable,
#[serde(rename = "EV")]
EV,
#[serde(rename = "Inlet")]
Inlet,
#[serde(rename = "Outlet")]
Outlet,
#[serde(rename = "Body")]
Body,
}
impl Location {
pub const ALL: &'static [Location] = &[
Location::Cable,
Location::EV,
Location::Inlet,
Location::Outlet,
Location::Body,
];
pub const fn as_str(&self) -> &'static str {
match self {
Location::Cable => "Cable",
Location::EV => "EV",
Location::Inlet => "Inlet",
Location::Outlet => "Outlet",
Location::Body => "Body",
}
}
}
impl std::fmt::Display for Location {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for Location {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for Location {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Measurand {
#[serde(rename = "Energy.Active.Export.Register")]
EnergyActiveExportRegister,
#[serde(rename = "Energy.Active.Import.Register")]
EnergyActiveImportRegister,
#[serde(rename = "Energy.Reactive.Export.Register")]
EnergyReactiveExportRegister,
#[serde(rename = "Energy.Reactive.Import.Register")]
EnergyReactiveImportRegister,
#[serde(rename = "Energy.Active.Export.Interval")]
EnergyActiveExportInterval,
#[serde(rename = "Energy.Active.Import.Interval")]
EnergyActiveImportInterval,
#[serde(rename = "Energy.Reactive.Export.Interval")]
EnergyReactiveExportInterval,
#[serde(rename = "Energy.Reactive.Import.Interval")]
EnergyReactiveImportInterval,
#[serde(rename = "Power.Active.Export")]
PowerActiveExport,
#[serde(rename = "Power.Active.Import")]
PowerActiveImport,
#[serde(rename = "Power.Offered")]
PowerOffered,
#[serde(rename = "Power.Reactive.Export")]
PowerReactiveExport,
#[serde(rename = "Power.Reactive.Import")]
PowerReactiveImport,
#[serde(rename = "Power.Factor")]
PowerFactor,
#[serde(rename = "Current.Import")]
CurrentImport,
#[serde(rename = "Current.Export")]
CurrentExport,
#[serde(rename = "Current.Offered")]
CurrentOffered,
#[serde(rename = "Voltage")]
Voltage,
#[serde(rename = "Frequency")]
Frequency,
#[serde(rename = "Temperature")]
Temperature,
#[serde(rename = "SoC")]
SoC,
#[serde(rename = "RPM")]
RPM,
}
impl Measurand {
pub const ALL: &'static [Measurand] = &[
Measurand::EnergyActiveExportRegister,
Measurand::EnergyActiveImportRegister,
Measurand::EnergyReactiveExportRegister,
Measurand::EnergyReactiveImportRegister,
Measurand::EnergyActiveExportInterval,
Measurand::EnergyActiveImportInterval,
Measurand::EnergyReactiveExportInterval,
Measurand::EnergyReactiveImportInterval,
Measurand::PowerActiveExport,
Measurand::PowerActiveImport,
Measurand::PowerOffered,
Measurand::PowerReactiveExport,
Measurand::PowerReactiveImport,
Measurand::PowerFactor,
Measurand::CurrentImport,
Measurand::CurrentExport,
Measurand::CurrentOffered,
Measurand::Voltage,
Measurand::Frequency,
Measurand::Temperature,
Measurand::SoC,
Measurand::RPM,
];
pub const fn as_str(&self) -> &'static str {
match self {
Measurand::EnergyActiveExportRegister => "Energy.Active.Export.Register",
Measurand::EnergyActiveImportRegister => "Energy.Active.Import.Register",
Measurand::EnergyReactiveExportRegister => "Energy.Reactive.Export.Register",
Measurand::EnergyReactiveImportRegister => "Energy.Reactive.Import.Register",
Measurand::EnergyActiveExportInterval => "Energy.Active.Export.Interval",
Measurand::EnergyActiveImportInterval => "Energy.Active.Import.Interval",
Measurand::EnergyReactiveExportInterval => "Energy.Reactive.Export.Interval",
Measurand::EnergyReactiveImportInterval => "Energy.Reactive.Import.Interval",
Measurand::PowerActiveExport => "Power.Active.Export",
Measurand::PowerActiveImport => "Power.Active.Import",
Measurand::PowerOffered => "Power.Offered",
Measurand::PowerReactiveExport => "Power.Reactive.Export",
Measurand::PowerReactiveImport => "Power.Reactive.Import",
Measurand::PowerFactor => "Power.Factor",
Measurand::CurrentImport => "Current.Import",
Measurand::CurrentExport => "Current.Export",
Measurand::CurrentOffered => "Current.Offered",
Measurand::Voltage => "Voltage",
Measurand::Frequency => "Frequency",
Measurand::Temperature => "Temperature",
Measurand::SoC => "SoC",
Measurand::RPM => "RPM",
}
}
}
impl std::fmt::Display for Measurand {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for Measurand {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for Measurand {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum MessageTrigger {
#[serde(rename = "BootNotification")]
BootNotification,
#[serde(rename = "DiagnosticsStatusNotification")]
DiagnosticsStatusNotification,
#[serde(rename = "FirmwareStatusNotification")]
FirmwareStatusNotification,
#[serde(rename = "Heartbeat")]
Heartbeat,
#[serde(rename = "MeterValues")]
MeterValues,
#[serde(rename = "StatusNotification")]
StatusNotification,
}
impl MessageTrigger {
pub const ALL: &'static [MessageTrigger] = &[
MessageTrigger::BootNotification,
MessageTrigger::DiagnosticsStatusNotification,
MessageTrigger::FirmwareStatusNotification,
MessageTrigger::Heartbeat,
MessageTrigger::MeterValues,
MessageTrigger::StatusNotification,
];
pub const fn as_str(&self) -> &'static str {
match self {
MessageTrigger::BootNotification => "BootNotification",
MessageTrigger::DiagnosticsStatusNotification => "DiagnosticsStatusNotification",
MessageTrigger::FirmwareStatusNotification => "FirmwareStatusNotification",
MessageTrigger::Heartbeat => "Heartbeat",
MessageTrigger::MeterValues => "MeterValues",
MessageTrigger::StatusNotification => "StatusNotification",
}
}
}
impl std::fmt::Display for MessageTrigger {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for MessageTrigger {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for MessageTrigger {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Phase {
#[serde(rename = "L1")]
L1,
#[serde(rename = "L2")]
L2,
#[serde(rename = "L3")]
L3,
#[serde(rename = "N")]
N,
#[serde(rename = "L1-N")]
L1N,
#[serde(rename = "L2-N")]
L2N,
#[serde(rename = "L3-N")]
L3N,
#[serde(rename = "L1-L2")]
L1L2,
#[serde(rename = "L2-L3")]
L2L3,
#[serde(rename = "L3-L1")]
L3L1,
}
impl Phase {
pub const ALL: &'static [Phase] = &[
Phase::L1,
Phase::L2,
Phase::L3,
Phase::N,
Phase::L1N,
Phase::L2N,
Phase::L3N,
Phase::L1L2,
Phase::L2L3,
Phase::L3L1,
];
pub const fn as_str(&self) -> &'static str {
match self {
Phase::L1 => "L1",
Phase::L2 => "L2",
Phase::L3 => "L3",
Phase::N => "N",
Phase::L1N => "L1-N",
Phase::L2N => "L2-N",
Phase::L3N => "L3-N",
Phase::L1L2 => "L1-L2",
Phase::L2L3 => "L2-L3",
Phase::L3L1 => "L3-L1",
}
}
}
impl std::fmt::Display for Phase {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for Phase {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for Phase {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ReadingContext {
#[serde(rename = "Interruption.Begin")]
InterruptionBegin,
#[serde(rename = "Interruption.End")]
InterruptionEnd,
#[serde(rename = "Sample.Clock")]
SampleClock,
#[serde(rename = "Sample.Periodic")]
SamplePeriodic,
#[serde(rename = "Transaction.Begin")]
TransactionBegin,
#[serde(rename = "Transaction.End")]
TransactionEnd,
#[serde(rename = "Trigger")]
Trigger,
#[serde(rename = "Other")]
Other,
}
impl ReadingContext {
pub const ALL: &'static [ReadingContext] = &[
ReadingContext::InterruptionBegin,
ReadingContext::InterruptionEnd,
ReadingContext::SampleClock,
ReadingContext::SamplePeriodic,
ReadingContext::TransactionBegin,
ReadingContext::TransactionEnd,
ReadingContext::Trigger,
ReadingContext::Other,
];
pub const fn as_str(&self) -> &'static str {
match self {
ReadingContext::InterruptionBegin => "Interruption.Begin",
ReadingContext::InterruptionEnd => "Interruption.End",
ReadingContext::SampleClock => "Sample.Clock",
ReadingContext::SamplePeriodic => "Sample.Periodic",
ReadingContext::TransactionBegin => "Transaction.Begin",
ReadingContext::TransactionEnd => "Transaction.End",
ReadingContext::Trigger => "Trigger",
ReadingContext::Other => "Other",
}
}
}
impl std::fmt::Display for ReadingContext {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ReadingContext {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ReadingContext {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Reason {
#[serde(rename = "EmergencyStop")]
EmergencyStop,
#[serde(rename = "EVDisconnected")]
EVDisconnected,
#[serde(rename = "HardReset")]
HardReset,
#[serde(rename = "Local")]
Local,
#[serde(rename = "Other")]
Other,
#[serde(rename = "PowerLoss")]
PowerLoss,
#[serde(rename = "Reboot")]
Reboot,
#[serde(rename = "Remote")]
Remote,
#[serde(rename = "SoftReset")]
SoftReset,
#[serde(rename = "UnlockCommand")]
UnlockCommand,
#[serde(rename = "DeAuthorized")]
DeAuthorized,
}
impl Reason {
pub const ALL: &'static [Reason] = &[
Reason::EmergencyStop,
Reason::EVDisconnected,
Reason::HardReset,
Reason::Local,
Reason::Other,
Reason::PowerLoss,
Reason::Reboot,
Reason::Remote,
Reason::SoftReset,
Reason::UnlockCommand,
Reason::DeAuthorized,
];
pub const fn as_str(&self) -> &'static str {
match self {
Reason::EmergencyStop => "EmergencyStop",
Reason::EVDisconnected => "EVDisconnected",
Reason::HardReset => "HardReset",
Reason::Local => "Local",
Reason::Other => "Other",
Reason::PowerLoss => "PowerLoss",
Reason::Reboot => "Reboot",
Reason::Remote => "Remote",
Reason::SoftReset => "SoftReset",
Reason::UnlockCommand => "UnlockCommand",
Reason::DeAuthorized => "DeAuthorized",
}
}
}
impl std::fmt::Display for Reason {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for Reason {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for Reason {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum RecurrencyKindType {
#[serde(rename = "Daily")]
Daily,
#[serde(rename = "Weekly")]
Weekly,
}
impl RecurrencyKindType {
pub const ALL: &'static [RecurrencyKindType] =
&[RecurrencyKindType::Daily, RecurrencyKindType::Weekly];
pub const fn as_str(&self) -> &'static str {
match self {
RecurrencyKindType::Daily => "Daily",
RecurrencyKindType::Weekly => "Weekly",
}
}
}
impl std::fmt::Display for RecurrencyKindType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for RecurrencyKindType {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for RecurrencyKindType {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum RegistrationStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Pending")]
Pending,
#[serde(rename = "Rejected")]
Rejected,
}
impl RegistrationStatus {
pub const ALL: &'static [RegistrationStatus] = &[
RegistrationStatus::Accepted,
RegistrationStatus::Pending,
RegistrationStatus::Rejected,
];
pub const fn as_str(&self) -> &'static str {
match self {
RegistrationStatus::Accepted => "Accepted",
RegistrationStatus::Pending => "Pending",
RegistrationStatus::Rejected => "Rejected",
}
}
}
impl std::fmt::Display for RegistrationStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for RegistrationStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for RegistrationStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum RemoteStartStopStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Rejected")]
Rejected,
}
impl RemoteStartStopStatus {
pub const ALL: &'static [RemoteStartStopStatus] = &[
RemoteStartStopStatus::Accepted,
RemoteStartStopStatus::Rejected,
];
pub const fn as_str(&self) -> &'static str {
match self {
RemoteStartStopStatus::Accepted => "Accepted",
RemoteStartStopStatus::Rejected => "Rejected",
}
}
}
impl std::fmt::Display for RemoteStartStopStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for RemoteStartStopStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for RemoteStartStopStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ReservationStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Faulted")]
Faulted,
#[serde(rename = "Occupied")]
Occupied,
#[serde(rename = "Rejected")]
Rejected,
#[serde(rename = "Unavailable")]
Unavailable,
}
impl ReservationStatus {
pub const ALL: &'static [ReservationStatus] = &[
ReservationStatus::Accepted,
ReservationStatus::Faulted,
ReservationStatus::Occupied,
ReservationStatus::Rejected,
ReservationStatus::Unavailable,
];
pub const fn as_str(&self) -> &'static str {
match self {
ReservationStatus::Accepted => "Accepted",
ReservationStatus::Faulted => "Faulted",
ReservationStatus::Occupied => "Occupied",
ReservationStatus::Rejected => "Rejected",
ReservationStatus::Unavailable => "Unavailable",
}
}
}
impl std::fmt::Display for ReservationStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ReservationStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ReservationStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ResetStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Rejected")]
Rejected,
}
impl ResetStatus {
pub const ALL: &'static [ResetStatus] = &[ResetStatus::Accepted, ResetStatus::Rejected];
pub const fn as_str(&self) -> &'static str {
match self {
ResetStatus::Accepted => "Accepted",
ResetStatus::Rejected => "Rejected",
}
}
}
impl std::fmt::Display for ResetStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ResetStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ResetStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ResetType {
#[serde(rename = "Hard")]
Hard,
#[serde(rename = "Soft")]
Soft,
}
impl ResetType {
pub const ALL: &'static [ResetType] = &[ResetType::Hard, ResetType::Soft];
pub const fn as_str(&self) -> &'static str {
match self {
ResetType::Hard => "Hard",
ResetType::Soft => "Soft",
}
}
}
impl std::fmt::Display for ResetType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ResetType {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ResetType {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum TriggerMessageStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Rejected")]
Rejected,
#[serde(rename = "NotImplemented")]
NotImplemented,
}
impl TriggerMessageStatus {
pub const ALL: &'static [TriggerMessageStatus] = &[
TriggerMessageStatus::Accepted,
TriggerMessageStatus::Rejected,
TriggerMessageStatus::NotImplemented,
];
pub const fn as_str(&self) -> &'static str {
match self {
TriggerMessageStatus::Accepted => "Accepted",
TriggerMessageStatus::Rejected => "Rejected",
TriggerMessageStatus::NotImplemented => "NotImplemented",
}
}
}
impl std::fmt::Display for TriggerMessageStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for TriggerMessageStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for TriggerMessageStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum UnitOfMeasure {
#[serde(rename = "Wh")]
Wh,
#[serde(rename = "kWh")]
KWh,
#[serde(rename = "varh")]
Varh,
#[serde(rename = "kvarh")]
Kvarh,
#[serde(rename = "W")]
W,
#[serde(rename = "kW")]
KW,
#[serde(rename = "VA")]
VA,
#[serde(rename = "kVA")]
KVA,
#[serde(rename = "var")]
Var,
#[serde(rename = "kvar")]
Kvar,
#[serde(rename = "A")]
A,
#[serde(rename = "V")]
V,
#[serde(rename = "K")]
K,
#[serde(rename = "Celcius")]
Celcius,
#[serde(rename = "Celsius")]
Celsius,
#[serde(rename = "Fahrenheit")]
Fahrenheit,
#[serde(rename = "Percent")]
Percent,
}
impl UnitOfMeasure {
pub const ALL: &'static [UnitOfMeasure] = &[
UnitOfMeasure::Wh,
UnitOfMeasure::KWh,
UnitOfMeasure::Varh,
UnitOfMeasure::Kvarh,
UnitOfMeasure::W,
UnitOfMeasure::KW,
UnitOfMeasure::VA,
UnitOfMeasure::KVA,
UnitOfMeasure::Var,
UnitOfMeasure::Kvar,
UnitOfMeasure::A,
UnitOfMeasure::V,
UnitOfMeasure::K,
UnitOfMeasure::Celcius,
UnitOfMeasure::Celsius,
UnitOfMeasure::Fahrenheit,
UnitOfMeasure::Percent,
];
pub const fn as_str(&self) -> &'static str {
match self {
UnitOfMeasure::Wh => "Wh",
UnitOfMeasure::KWh => "kWh",
UnitOfMeasure::Varh => "varh",
UnitOfMeasure::Kvarh => "kvarh",
UnitOfMeasure::W => "W",
UnitOfMeasure::KW => "kW",
UnitOfMeasure::VA => "VA",
UnitOfMeasure::KVA => "kVA",
UnitOfMeasure::Var => "var",
UnitOfMeasure::Kvar => "kvar",
UnitOfMeasure::A => "A",
UnitOfMeasure::V => "V",
UnitOfMeasure::K => "K",
UnitOfMeasure::Celcius => "Celcius",
UnitOfMeasure::Celsius => "Celsius",
UnitOfMeasure::Fahrenheit => "Fahrenheit",
UnitOfMeasure::Percent => "Percent",
}
}
}
impl std::fmt::Display for UnitOfMeasure {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for UnitOfMeasure {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for UnitOfMeasure {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum UnlockStatus {
#[serde(rename = "Unlocked")]
Unlocked,
#[serde(rename = "UnlockFailed")]
UnlockFailed,
#[serde(rename = "NotSupported")]
NotSupported,
}
impl UnlockStatus {
pub const ALL: &'static [UnlockStatus] = &[
UnlockStatus::Unlocked,
UnlockStatus::UnlockFailed,
UnlockStatus::NotSupported,
];
pub const fn as_str(&self) -> &'static str {
match self {
UnlockStatus::Unlocked => "Unlocked",
UnlockStatus::UnlockFailed => "UnlockFailed",
UnlockStatus::NotSupported => "NotSupported",
}
}
}
impl std::fmt::Display for UnlockStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for UnlockStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for UnlockStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum UpdateStatus {
#[serde(rename = "Accepted")]
Accepted,
#[serde(rename = "Failed")]
Failed,
#[serde(rename = "NotSupported")]
NotSupported,
#[serde(rename = "VersionMismatch")]
VersionMismatch,
}
impl UpdateStatus {
pub const ALL: &'static [UpdateStatus] = &[
UpdateStatus::Accepted,
UpdateStatus::Failed,
UpdateStatus::NotSupported,
UpdateStatus::VersionMismatch,
];
pub const fn as_str(&self) -> &'static str {
match self {
UpdateStatus::Accepted => "Accepted",
UpdateStatus::Failed => "Failed",
UpdateStatus::NotSupported => "NotSupported",
UpdateStatus::VersionMismatch => "VersionMismatch",
}
}
}
impl std::fmt::Display for UpdateStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for UpdateStatus {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for UpdateStatus {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum UpdateType {
#[serde(rename = "Differential")]
Differential,
#[serde(rename = "Full")]
Full,
}
impl UpdateType {
pub const ALL: &'static [UpdateType] = &[UpdateType::Differential, UpdateType::Full];
pub const fn as_str(&self) -> &'static str {
match self {
UpdateType::Differential => "Differential",
UpdateType::Full => "Full",
}
}
}
impl std::fmt::Display for UpdateType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for UpdateType {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for UpdateType {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ValueFormat {
#[serde(rename = "Raw")]
Raw,
#[serde(rename = "SignedData")]
SignedData,
}
impl ValueFormat {
pub const ALL: &'static [ValueFormat] = &[ValueFormat::Raw, ValueFormat::SignedData];
pub const fn as_str(&self) -> &'static str {
match self {
ValueFormat::Raw => "Raw",
ValueFormat::SignedData => "SignedData",
}
}
}
impl std::fmt::Display for ValueFormat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
impl std::str::FromStr for ValueFormat {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
Self::ALL
.iter()
.copied()
.find(|v| v.as_str() == s)
.ok_or(())
}
}
impl Validate for ValueFormat {
#[inline]
fn validate(&self, _: &Path<'_>) -> Result<(), Violation> {
Ok(())
}
}