1#[derive(Debug, Clone, PartialEq, Eq)]
5#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6pub enum IdTagInfoStatus {
7 Accepted,
8 Blocked,
9 Expired,
10 Invalid,
11 ConcurrentTx,
12}
13#[cfg(feature = "validate")]
14impl crate::validate::Validate for IdTagInfoStatus {
15 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
16 Ok(())
17 }
18}
19#[derive(Debug, Clone, PartialEq, Eq)]
20#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
21pub struct IdTagInfo {
22 #[cfg_attr(feature = "serde", serde(rename = "expiryDate"))]
23 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
24 pub expiry_date: Option<crate::OcppTimestamp>,
25 #[cfg_attr(feature = "serde", serde(rename = "parentIdTag"))]
26 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
27 pub parent_id_tag: Option<heapless::String<20usize>>,
28 pub status: IdTagInfoStatus,
29}
30#[cfg(feature = "validate")]
31impl crate::validate::Validate for IdTagInfo {
32 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
33 crate::validate::Validate::validate(&self.status)
34 .map_err(|error| error.in_field("status"))?;
35 Ok(())
36 }
37}
38#[derive(Debug, Clone, PartialEq, Eq)]
39#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
40pub enum BootNotificationResponseStatus {
41 Accepted,
42 Pending,
43 Rejected,
44}
45#[cfg(feature = "validate")]
46impl crate::validate::Validate for BootNotificationResponseStatus {
47 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
48 Ok(())
49 }
50}
51#[derive(Debug, Clone, PartialEq, Eq)]
52#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
53pub enum CancelReservationResponseStatus {
54 Accepted,
55 Rejected,
56}
57#[cfg(feature = "validate")]
58impl crate::validate::Validate for CancelReservationResponseStatus {
59 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
60 Ok(())
61 }
62}
63#[derive(Debug, Clone, PartialEq, Eq)]
64#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
65pub enum CertificateSignedResponseStatus {
66 Accepted,
67 Rejected,
68}
69#[cfg(feature = "validate")]
70impl crate::validate::Validate for CertificateSignedResponseStatus {
71 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
72 Ok(())
73 }
74}
75#[derive(Debug, Clone, PartialEq, Eq)]
76#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
77pub enum ChangeAvailabilityRequestType {
78 Inoperative,
79 Operative,
80}
81#[cfg(feature = "validate")]
82impl crate::validate::Validate for ChangeAvailabilityRequestType {
83 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
84 Ok(())
85 }
86}
87#[derive(Debug, Clone, PartialEq, Eq)]
88#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
89pub enum ChangeAvailabilityResponseStatus {
90 Accepted,
91 Rejected,
92 Scheduled,
93}
94#[cfg(feature = "validate")]
95impl crate::validate::Validate for ChangeAvailabilityResponseStatus {
96 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
97 Ok(())
98 }
99}
100#[derive(Debug, Clone, PartialEq, Eq)]
101#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
102pub enum ChangeConfigurationResponseStatus {
103 Accepted,
104 Rejected,
105 RebootRequired,
106 NotSupported,
107}
108#[cfg(feature = "validate")]
109impl crate::validate::Validate for ChangeConfigurationResponseStatus {
110 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
111 Ok(())
112 }
113}
114#[derive(Debug, Clone, PartialEq, Eq)]
115#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
116pub enum ClearCacheResponseStatus {
117 Accepted,
118 Rejected,
119}
120#[cfg(feature = "validate")]
121impl crate::validate::Validate for ClearCacheResponseStatus {
122 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
123 Ok(())
124 }
125}
126#[derive(Debug, Clone, PartialEq, Eq)]
127#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
128pub enum ChargingProfilePurpose {
129 ChargePointMaxProfile,
130 TxDefaultProfile,
131 TxProfile,
132}
133#[cfg(feature = "validate")]
134impl crate::validate::Validate for ChargingProfilePurpose {
135 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
136 Ok(())
137 }
138}
139#[derive(Debug, Clone, PartialEq, Eq)]
140#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
141pub enum ClearChargingProfileResponseStatus {
142 Accepted,
143 Unknown,
144}
145#[cfg(feature = "validate")]
146impl crate::validate::Validate for ClearChargingProfileResponseStatus {
147 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
148 Ok(())
149 }
150}
151#[derive(Debug, Clone, PartialEq, Eq)]
152#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
153pub enum DataTransferResponseStatus {
154 Accepted,
155 Rejected,
156 UnknownMessageId,
157 UnknownVendorId,
158}
159#[cfg(feature = "validate")]
160impl crate::validate::Validate for DataTransferResponseStatus {
161 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
162 Ok(())
163 }
164}
165#[derive(Debug, Clone, PartialEq, Eq)]
166#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
167pub enum HashAlgorithm {
168 SHA256,
169 SHA384,
170 SHA512,
171}
172#[cfg(feature = "validate")]
173impl crate::validate::Validate for HashAlgorithm {
174 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
175 Ok(())
176 }
177}
178#[derive(Debug, Clone, PartialEq, Eq)]
179#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
180pub struct CertificateHashData {
181 #[cfg_attr(feature = "serde", serde(rename = "hashAlgorithm"))]
182 pub hash_algorithm: HashAlgorithm,
183 #[cfg_attr(feature = "serde", serde(rename = "issuerKeyHash"))]
184 pub issuer_key_hash: heapless::String<128usize>,
185 #[cfg_attr(feature = "serde", serde(rename = "issuerNameHash"))]
186 pub issuer_name_hash: heapless::String<128usize>,
187 #[cfg_attr(feature = "serde", serde(rename = "serialNumber"))]
188 pub serial_number: heapless::String<40usize>,
189}
190#[cfg(feature = "validate")]
191impl crate::validate::Validate for CertificateHashData {
192 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
193 crate::validate::Validate::validate(&self.hash_algorithm)
194 .map_err(|error| error.in_field("hashAlgorithm"))?;
195 Ok(())
196 }
197}
198#[derive(Debug, Clone, PartialEq, Eq)]
199#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
200pub enum DeleteCertificateResponseStatus {
201 Accepted,
202 Failed,
203 NotFound,
204}
205#[cfg(feature = "validate")]
206impl crate::validate::Validate for DeleteCertificateResponseStatus {
207 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
208 Ok(())
209 }
210}
211#[derive(Debug, Clone, PartialEq, Eq)]
212#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
213pub enum DiagnosticsStatusNotificationRequestStatus {
214 Idle,
215 Uploaded,
216 UploadFailed,
217 Uploading,
218}
219#[cfg(feature = "validate")]
220impl crate::validate::Validate for DiagnosticsStatusNotificationRequestStatus {
221 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
222 Ok(())
223 }
224}
225#[derive(Debug, Clone, PartialEq, Eq)]
226#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
227pub enum ExtendedTriggerMessageRequestRequestedMessage {
228 BootNotification,
229 LogStatusNotification,
230 FirmwareStatusNotification,
231 Heartbeat,
232 MeterValues,
233 SignChargePointCertificate,
234 StatusNotification,
235}
236#[cfg(feature = "validate")]
237impl crate::validate::Validate for ExtendedTriggerMessageRequestRequestedMessage {
238 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
239 Ok(())
240 }
241}
242#[derive(Debug, Clone, PartialEq, Eq)]
243#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
244pub enum ExtendedTriggerMessageResponseStatus {
245 Accepted,
246 Rejected,
247 NotImplemented,
248}
249#[cfg(feature = "validate")]
250impl crate::validate::Validate for ExtendedTriggerMessageResponseStatus {
251 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
252 Ok(())
253 }
254}
255#[derive(Debug, Clone, PartialEq, Eq)]
256#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
257pub enum FirmwareStatusNotificationRequestStatus {
258 Downloaded,
259 DownloadFailed,
260 Downloading,
261 Idle,
262 InstallationFailed,
263 Installing,
264 Installed,
265}
266#[cfg(feature = "validate")]
267impl crate::validate::Validate for FirmwareStatusNotificationRequestStatus {
268 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
269 Ok(())
270 }
271}
272#[derive(Debug, Clone, PartialEq, Eq)]
273#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
274pub enum ChargingRateUnit {
275 A,
276 W,
277}
278#[cfg(feature = "validate")]
279impl crate::validate::Validate for ChargingRateUnit {
280 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
281 Ok(())
282 }
283}
284#[derive(Debug, Clone, PartialEq)]
285#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
286pub struct ChargingSchedulePeriodItem {
287 pub limit: f64,
288 #[cfg_attr(feature = "serde", serde(rename = "numberPhases"))]
289 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
290 pub number_phases: Option<i64>,
291 #[cfg_attr(feature = "serde", serde(rename = "startPeriod"))]
292 pub start_period: i64,
293}
294#[cfg(feature = "validate")]
295impl crate::validate::Validate for ChargingSchedulePeriodItem {
296 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
297 crate::validate::check_multiple_of(self.limit, 0.1f64)
298 .map_err(|error| error.in_field("limit"))?;
299 Ok(())
300 }
301}
302#[cfg(feature = "alloc")]
303#[derive(Debug, Clone, PartialEq)]
304#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
305pub struct ChargingSchedule {
306 #[cfg_attr(feature = "serde", serde(rename = "chargingRateUnit"))]
307 pub charging_rate_unit: ChargingRateUnit,
308 #[cfg_attr(feature = "serde", serde(rename = "chargingSchedulePeriod"))]
309 pub charging_schedule_period: alloc::vec::Vec<ChargingSchedulePeriodItem>,
310 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
311 pub duration: Option<i64>,
312 #[cfg_attr(feature = "serde", serde(rename = "minChargingRate"))]
313 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
314 pub min_charging_rate: Option<f64>,
315 #[cfg_attr(feature = "serde", serde(rename = "startSchedule"))]
316 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
317 pub start_schedule: Option<crate::OcppTimestamp>,
318}
319#[cfg(all(feature = "validate", feature = "alloc"))]
320impl crate::validate::Validate for ChargingSchedule {
321 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
322 crate::validate::Validate::validate(&self.charging_rate_unit)
323 .map_err(|error| error.in_field("chargingRateUnit"))?;
324 for (index, item) in self.charging_schedule_period.iter().enumerate() {
325 crate::validate::Validate::validate(item)
326 .map_err(|error| {
327 error.in_index(index).in_field("chargingSchedulePeriod")
328 })?;
329 }
330 if let Some(value) = self.min_charging_rate {
331 crate::validate::check_multiple_of(value, 0.1f64)
332 .map_err(|error| error.in_field("minChargingRate"))?;
333 }
334 Ok(())
335 }
336}
337#[cfg(not(feature = "alloc"))]
338#[derive(Debug, Clone, PartialEq)]
339#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
340pub struct ChargingSchedule<
341 const CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP: usize = 8usize,
342> {
343 #[cfg_attr(feature = "serde", serde(rename = "chargingRateUnit"))]
344 pub charging_rate_unit: ChargingRateUnit,
345 #[cfg_attr(feature = "serde", serde(rename = "chargingSchedulePeriod"))]
346 pub charging_schedule_period: heapless::Vec<
347 ChargingSchedulePeriodItem,
348 CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP,
349 >,
350 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
351 pub duration: Option<i64>,
352 #[cfg_attr(feature = "serde", serde(rename = "minChargingRate"))]
353 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
354 pub min_charging_rate: Option<f64>,
355 #[cfg_attr(feature = "serde", serde(rename = "startSchedule"))]
356 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
357 pub start_schedule: Option<crate::OcppTimestamp>,
358}
359#[cfg(all(feature = "validate", not(feature = "alloc")))]
360impl<
361 const CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP: usize,
362> crate::validate::Validate
363for ChargingSchedule<CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP> {
364 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
365 crate::validate::Validate::validate(&self.charging_rate_unit)
366 .map_err(|error| error.in_field("chargingRateUnit"))?;
367 for (index, item) in self.charging_schedule_period.iter().enumerate() {
368 crate::validate::Validate::validate(item)
369 .map_err(|error| {
370 error.in_index(index).in_field("chargingSchedulePeriod")
371 })?;
372 }
373 if let Some(value) = self.min_charging_rate {
374 crate::validate::check_multiple_of(value, 0.1f64)
375 .map_err(|error| error.in_field("minChargingRate"))?;
376 }
377 Ok(())
378 }
379}
380#[derive(Debug, Clone, PartialEq, Eq)]
381#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
382pub enum GetCompositeScheduleResponseStatus {
383 Accepted,
384 Rejected,
385}
386#[cfg(feature = "validate")]
387impl crate::validate::Validate for GetCompositeScheduleResponseStatus {
388 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
389 Ok(())
390 }
391}
392#[derive(Debug, Clone, PartialEq, Eq)]
393#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
394pub struct ConfigurationKeyItem {
395 pub key: heapless::String<50usize>,
396 pub readonly: bool,
397 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
398 pub value: Option<heapless::String<500usize>>,
399}
400#[cfg(feature = "validate")]
401impl crate::validate::Validate for ConfigurationKeyItem {
402 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
403 Ok(())
404 }
405}
406#[derive(Debug, Clone, PartialEq, Eq)]
407#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
408pub enum CertificateType {
409 CentralSystemRootCertificate,
410 ManufacturerRootCertificate,
411}
412#[cfg(feature = "validate")]
413impl crate::validate::Validate for CertificateType {
414 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
415 Ok(())
416 }
417}
418#[derive(Debug, Clone, PartialEq, Eq)]
419#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
420pub enum GetInstalledCertificateIdsResponseStatus {
421 Accepted,
422 NotFound,
423}
424#[cfg(feature = "validate")]
425impl crate::validate::Validate for GetInstalledCertificateIdsResponseStatus {
426 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
427 Ok(())
428 }
429}
430#[derive(Debug, Clone, PartialEq, Eq)]
431#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
432pub struct Log {
433 #[cfg_attr(feature = "serde", serde(rename = "latestTimestamp"))]
434 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
435 pub latest_timestamp: Option<crate::OcppTimestamp>,
436 #[cfg_attr(feature = "serde", serde(rename = "oldestTimestamp"))]
437 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
438 pub oldest_timestamp: Option<crate::OcppTimestamp>,
439 #[cfg_attr(feature = "serde", serde(rename = "remoteLocation"))]
440 pub remote_location: heapless::String<512usize>,
441}
442#[cfg(feature = "validate")]
443impl crate::validate::Validate for Log {
444 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
445 Ok(())
446 }
447}
448#[derive(Debug, Clone, PartialEq, Eq)]
449#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
450pub enum LogType {
451 DiagnosticsLog,
452 SecurityLog,
453}
454#[cfg(feature = "validate")]
455impl crate::validate::Validate for LogType {
456 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
457 Ok(())
458 }
459}
460#[derive(Debug, Clone, PartialEq, Eq)]
461#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
462pub enum GetLogResponseStatus {
463 Accepted,
464 Rejected,
465 AcceptedCanceled,
466}
467#[cfg(feature = "validate")]
468impl crate::validate::Validate for GetLogResponseStatus {
469 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
470 Ok(())
471 }
472}
473#[derive(Debug, Clone, PartialEq, Eq)]
474#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
475pub enum InstallCertificateResponseStatus {
476 Accepted,
477 Failed,
478 Rejected,
479}
480#[cfg(feature = "validate")]
481impl crate::validate::Validate for InstallCertificateResponseStatus {
482 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
483 Ok(())
484 }
485}
486#[derive(Debug, Clone, PartialEq, Eq)]
487#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
488pub enum LogStatusNotificationRequestStatus {
489 BadMessage,
490 Idle,
491 NotSupportedOperation,
492 PermissionDenied,
493 Uploaded,
494 UploadFailure,
495 Uploading,
496}
497#[cfg(feature = "validate")]
498impl crate::validate::Validate for LogStatusNotificationRequestStatus {
499 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
500 Ok(())
501 }
502}
503#[derive(Debug, Clone, PartialEq, Eq)]
504#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
505pub enum Context {
506 #[cfg_attr(feature = "serde", serde(rename = "Interruption.Begin"))]
507 InterruptionBegin,
508 #[cfg_attr(feature = "serde", serde(rename = "Interruption.End"))]
509 InterruptionEnd,
510 #[cfg_attr(feature = "serde", serde(rename = "Sample.Clock"))]
511 SampleClock,
512 #[cfg_attr(feature = "serde", serde(rename = "Sample.Periodic"))]
513 SamplePeriodic,
514 #[cfg_attr(feature = "serde", serde(rename = "Transaction.Begin"))]
515 TransactionBegin,
516 #[cfg_attr(feature = "serde", serde(rename = "Transaction.End"))]
517 TransactionEnd,
518 Trigger,
519 Other,
520}
521#[cfg(feature = "validate")]
522impl crate::validate::Validate for Context {
523 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
524 Ok(())
525 }
526}
527#[derive(Debug, Clone, PartialEq, Eq)]
528#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
529pub enum Format {
530 Raw,
531 SignedData,
532}
533#[cfg(feature = "validate")]
534impl crate::validate::Validate for Format {
535 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
536 Ok(())
537 }
538}
539#[derive(Debug, Clone, PartialEq, Eq)]
540#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
541pub enum Location {
542 Cable,
543 EV,
544 Inlet,
545 Outlet,
546 Body,
547}
548#[cfg(feature = "validate")]
549impl crate::validate::Validate for Location {
550 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
551 Ok(())
552 }
553}
554#[derive(Debug, Clone, PartialEq, Eq)]
555#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
556pub enum Measurand {
557 #[cfg_attr(feature = "serde", serde(rename = "Energy.Active.Export.Register"))]
558 EnergyActiveExportRegister,
559 #[cfg_attr(feature = "serde", serde(rename = "Energy.Active.Import.Register"))]
560 EnergyActiveImportRegister,
561 #[cfg_attr(feature = "serde", serde(rename = "Energy.Reactive.Export.Register"))]
562 EnergyReactiveExportRegister,
563 #[cfg_attr(feature = "serde", serde(rename = "Energy.Reactive.Import.Register"))]
564 EnergyReactiveImportRegister,
565 #[cfg_attr(feature = "serde", serde(rename = "Energy.Active.Export.Interval"))]
566 EnergyActiveExportInterval,
567 #[cfg_attr(feature = "serde", serde(rename = "Energy.Active.Import.Interval"))]
568 EnergyActiveImportInterval,
569 #[cfg_attr(feature = "serde", serde(rename = "Energy.Reactive.Export.Interval"))]
570 EnergyReactiveExportInterval,
571 #[cfg_attr(feature = "serde", serde(rename = "Energy.Reactive.Import.Interval"))]
572 EnergyReactiveImportInterval,
573 #[cfg_attr(feature = "serde", serde(rename = "Power.Active.Export"))]
574 PowerActiveExport,
575 #[cfg_attr(feature = "serde", serde(rename = "Power.Active.Import"))]
576 PowerActiveImport,
577 #[cfg_attr(feature = "serde", serde(rename = "Power.Offered"))]
578 PowerOffered,
579 #[cfg_attr(feature = "serde", serde(rename = "Power.Reactive.Export"))]
580 PowerReactiveExport,
581 #[cfg_attr(feature = "serde", serde(rename = "Power.Reactive.Import"))]
582 PowerReactiveImport,
583 #[cfg_attr(feature = "serde", serde(rename = "Power.Factor"))]
584 PowerFactor,
585 #[cfg_attr(feature = "serde", serde(rename = "Current.Import"))]
586 CurrentImport,
587 #[cfg_attr(feature = "serde", serde(rename = "Current.Export"))]
588 CurrentExport,
589 #[cfg_attr(feature = "serde", serde(rename = "Current.Offered"))]
590 CurrentOffered,
591 Voltage,
592 Frequency,
593 Temperature,
594 SoC,
595 RPM,
596}
597#[cfg(feature = "validate")]
598impl crate::validate::Validate for Measurand {
599 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
600 Ok(())
601 }
602}
603#[derive(Debug, Clone, PartialEq, Eq)]
604#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
605pub enum Phase {
606 L1,
607 L2,
608 L3,
609 N,
610 #[cfg_attr(feature = "serde", serde(rename = "L1-N"))]
611 L1N,
612 #[cfg_attr(feature = "serde", serde(rename = "L2-N"))]
613 L2N,
614 #[cfg_attr(feature = "serde", serde(rename = "L3-N"))]
615 L3N,
616 #[cfg_attr(feature = "serde", serde(rename = "L1-L2"))]
617 L1L2,
618 #[cfg_attr(feature = "serde", serde(rename = "L2-L3"))]
619 L2L3,
620 #[cfg_attr(feature = "serde", serde(rename = "L3-L1"))]
621 L3L1,
622}
623#[cfg(feature = "validate")]
624impl crate::validate::Validate for Phase {
625 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
626 Ok(())
627 }
628}
629#[derive(Debug, Clone, PartialEq, Eq)]
630#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
631pub enum SampledValueItemUnit {
632 Wh,
633 #[cfg_attr(feature = "serde", serde(rename = "kWh"))]
634 KWh,
635 #[cfg_attr(feature = "serde", serde(rename = "varh"))]
636 Varh,
637 #[cfg_attr(feature = "serde", serde(rename = "kvarh"))]
638 Kvarh,
639 W,
640 #[cfg_attr(feature = "serde", serde(rename = "kW"))]
641 KW,
642 VA,
643 #[cfg_attr(feature = "serde", serde(rename = "kVA"))]
644 KVA,
645 #[cfg_attr(feature = "serde", serde(rename = "var"))]
646 Var,
647 #[cfg_attr(feature = "serde", serde(rename = "kvar"))]
648 Kvar,
649 A,
650 V,
651 K,
652 Celcius,
653 Celsius,
654 Fahrenheit,
655 Percent,
656}
657#[cfg(feature = "validate")]
658impl crate::validate::Validate for SampledValueItemUnit {
659 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
660 Ok(())
661 }
662}
663#[cfg(feature = "alloc")]
664#[derive(Debug, Clone, PartialEq, Eq)]
665#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
666pub struct SampledValueItem {
667 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
668 pub context: Option<Context>,
669 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
670 pub format: Option<Format>,
671 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
672 pub location: Option<Location>,
673 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
674 pub measurand: Option<Measurand>,
675 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
676 pub phase: Option<Phase>,
677 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
678 pub unit: Option<SampledValueItemUnit>,
679 pub value: alloc::string::String,
680}
681#[cfg(all(feature = "validate", feature = "alloc"))]
682impl crate::validate::Validate for SampledValueItem {
683 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
684 if let Some(value) = &self.context {
685 crate::validate::Validate::validate(value)
686 .map_err(|error| error.in_field("context"))?;
687 }
688 if let Some(value) = &self.format {
689 crate::validate::Validate::validate(value)
690 .map_err(|error| error.in_field("format"))?;
691 }
692 if let Some(value) = &self.location {
693 crate::validate::Validate::validate(value)
694 .map_err(|error| error.in_field("location"))?;
695 }
696 if let Some(value) = &self.measurand {
697 crate::validate::Validate::validate(value)
698 .map_err(|error| error.in_field("measurand"))?;
699 }
700 if let Some(value) = &self.phase {
701 crate::validate::Validate::validate(value)
702 .map_err(|error| error.in_field("phase"))?;
703 }
704 if let Some(value) = &self.unit {
705 crate::validate::Validate::validate(value)
706 .map_err(|error| error.in_field("unit"))?;
707 }
708 Ok(())
709 }
710}
711#[cfg(not(feature = "alloc"))]
712#[derive(Debug, Clone, PartialEq, Eq)]
713#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
714pub struct SampledValueItem<const SAMPLED_VALUE_ITEM_VALUE_CAP: usize = 1024usize> {
715 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
716 pub context: Option<Context>,
717 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
718 pub format: Option<Format>,
719 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
720 pub location: Option<Location>,
721 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
722 pub measurand: Option<Measurand>,
723 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
724 pub phase: Option<Phase>,
725 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
726 pub unit: Option<SampledValueItemUnit>,
727 pub value: heapless::String<SAMPLED_VALUE_ITEM_VALUE_CAP>,
728}
729#[cfg(all(feature = "validate", not(feature = "alloc")))]
730impl<const SAMPLED_VALUE_ITEM_VALUE_CAP: usize> crate::validate::Validate
731for SampledValueItem<SAMPLED_VALUE_ITEM_VALUE_CAP> {
732 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
733 if let Some(value) = &self.context {
734 crate::validate::Validate::validate(value)
735 .map_err(|error| error.in_field("context"))?;
736 }
737 if let Some(value) = &self.format {
738 crate::validate::Validate::validate(value)
739 .map_err(|error| error.in_field("format"))?;
740 }
741 if let Some(value) = &self.location {
742 crate::validate::Validate::validate(value)
743 .map_err(|error| error.in_field("location"))?;
744 }
745 if let Some(value) = &self.measurand {
746 crate::validate::Validate::validate(value)
747 .map_err(|error| error.in_field("measurand"))?;
748 }
749 if let Some(value) = &self.phase {
750 crate::validate::Validate::validate(value)
751 .map_err(|error| error.in_field("phase"))?;
752 }
753 if let Some(value) = &self.unit {
754 crate::validate::Validate::validate(value)
755 .map_err(|error| error.in_field("unit"))?;
756 }
757 Ok(())
758 }
759}
760#[cfg(feature = "alloc")]
761#[derive(Debug, Clone, PartialEq, Eq)]
762#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
763pub struct MeterValueItem {
764 #[cfg_attr(feature = "serde", serde(rename = "sampledValue"))]
765 pub sampled_value: alloc::vec::Vec<SampledValueItem>,
766 pub timestamp: crate::OcppTimestamp,
767}
768#[cfg(all(feature = "validate", feature = "alloc"))]
769impl crate::validate::Validate for MeterValueItem {
770 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
771 for (index, item) in self.sampled_value.iter().enumerate() {
772 crate::validate::Validate::validate(item)
773 .map_err(|error| error.in_index(index).in_field("sampledValue"))?;
774 }
775 Ok(())
776 }
777}
778#[cfg(not(feature = "alloc"))]
779#[derive(Debug, Clone, PartialEq, Eq)]
780#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
781pub struct MeterValueItem<
782 const METER_VALUE_ITEM_SAMPLED_VALUE_CAP: usize = 8usize,
783 const SAMPLED_VALUE_ITEM_VALUE_CAP: usize = 1024usize,
784> {
785 #[cfg_attr(feature = "serde", serde(rename = "sampledValue"))]
786 pub sampled_value: heapless::Vec<
787 SampledValueItem<SAMPLED_VALUE_ITEM_VALUE_CAP>,
788 METER_VALUE_ITEM_SAMPLED_VALUE_CAP,
789 >,
790 pub timestamp: crate::OcppTimestamp,
791}
792#[cfg(all(feature = "validate", not(feature = "alloc")))]
793impl<
794 const METER_VALUE_ITEM_SAMPLED_VALUE_CAP: usize,
795 const SAMPLED_VALUE_ITEM_VALUE_CAP: usize,
796> crate::validate::Validate
797for MeterValueItem<METER_VALUE_ITEM_SAMPLED_VALUE_CAP, SAMPLED_VALUE_ITEM_VALUE_CAP> {
798 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
799 for (index, item) in self.sampled_value.iter().enumerate() {
800 crate::validate::Validate::validate(item)
801 .map_err(|error| error.in_index(index).in_field("sampledValue"))?;
802 }
803 Ok(())
804 }
805}
806#[derive(Debug, Clone, PartialEq, Eq)]
807#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
808pub enum ChargingProfileKind {
809 Absolute,
810 Recurring,
811 Relative,
812}
813#[cfg(feature = "validate")]
814impl crate::validate::Validate for ChargingProfileKind {
815 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
816 Ok(())
817 }
818}
819#[derive(Debug, Clone, PartialEq, Eq)]
820#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
821pub enum RecurrencyKind {
822 Daily,
823 Weekly,
824}
825#[cfg(feature = "validate")]
826impl crate::validate::Validate for RecurrencyKind {
827 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
828 Ok(())
829 }
830}
831#[cfg(feature = "alloc")]
832#[derive(Debug, Clone, PartialEq)]
833#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
834pub struct ChargingProfile {
835 #[cfg_attr(feature = "serde", serde(rename = "chargingProfileId"))]
836 pub charging_profile_id: i64,
837 #[cfg_attr(feature = "serde", serde(rename = "chargingProfileKind"))]
838 pub charging_profile_kind: ChargingProfileKind,
839 #[cfg_attr(feature = "serde", serde(rename = "chargingProfilePurpose"))]
840 pub charging_profile_purpose: ChargingProfilePurpose,
841 #[cfg_attr(feature = "serde", serde(rename = "chargingSchedule"))]
842 pub charging_schedule: ChargingSchedule,
843 #[cfg_attr(feature = "serde", serde(rename = "recurrencyKind"))]
844 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
845 pub recurrency_kind: Option<RecurrencyKind>,
846 #[cfg_attr(feature = "serde", serde(rename = "stackLevel"))]
847 pub stack_level: i64,
848 #[cfg_attr(feature = "serde", serde(rename = "transactionId"))]
849 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
850 pub transaction_id: Option<i64>,
851 #[cfg_attr(feature = "serde", serde(rename = "validFrom"))]
852 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
853 pub valid_from: Option<crate::OcppTimestamp>,
854 #[cfg_attr(feature = "serde", serde(rename = "validTo"))]
855 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
856 pub valid_to: Option<crate::OcppTimestamp>,
857}
858#[cfg(all(feature = "validate", feature = "alloc"))]
859impl crate::validate::Validate for ChargingProfile {
860 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
861 crate::validate::Validate::validate(&self.charging_profile_kind)
862 .map_err(|error| error.in_field("chargingProfileKind"))?;
863 crate::validate::Validate::validate(&self.charging_profile_purpose)
864 .map_err(|error| error.in_field("chargingProfilePurpose"))?;
865 crate::validate::Validate::validate(&self.charging_schedule)
866 .map_err(|error| error.in_field("chargingSchedule"))?;
867 if let Some(value) = &self.recurrency_kind {
868 crate::validate::Validate::validate(value)
869 .map_err(|error| error.in_field("recurrencyKind"))?;
870 }
871 Ok(())
872 }
873}
874#[cfg(not(feature = "alloc"))]
875#[derive(Debug, Clone, PartialEq)]
876#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
877pub struct ChargingProfile<
878 const CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP: usize = 8usize,
879> {
880 #[cfg_attr(feature = "serde", serde(rename = "chargingProfileId"))]
881 pub charging_profile_id: i64,
882 #[cfg_attr(feature = "serde", serde(rename = "chargingProfileKind"))]
883 pub charging_profile_kind: ChargingProfileKind,
884 #[cfg_attr(feature = "serde", serde(rename = "chargingProfilePurpose"))]
885 pub charging_profile_purpose: ChargingProfilePurpose,
886 #[cfg_attr(feature = "serde", serde(rename = "chargingSchedule"))]
887 pub charging_schedule: ChargingSchedule<
888 CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP,
889 >,
890 #[cfg_attr(feature = "serde", serde(rename = "recurrencyKind"))]
891 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
892 pub recurrency_kind: Option<RecurrencyKind>,
893 #[cfg_attr(feature = "serde", serde(rename = "stackLevel"))]
894 pub stack_level: i64,
895 #[cfg_attr(feature = "serde", serde(rename = "transactionId"))]
896 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
897 pub transaction_id: Option<i64>,
898 #[cfg_attr(feature = "serde", serde(rename = "validFrom"))]
899 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
900 pub valid_from: Option<crate::OcppTimestamp>,
901 #[cfg_attr(feature = "serde", serde(rename = "validTo"))]
902 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
903 pub valid_to: Option<crate::OcppTimestamp>,
904}
905#[cfg(all(feature = "validate", not(feature = "alloc")))]
906impl<
907 const CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP: usize,
908> crate::validate::Validate
909for ChargingProfile<CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP> {
910 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
911 crate::validate::Validate::validate(&self.charging_profile_kind)
912 .map_err(|error| error.in_field("chargingProfileKind"))?;
913 crate::validate::Validate::validate(&self.charging_profile_purpose)
914 .map_err(|error| error.in_field("chargingProfilePurpose"))?;
915 crate::validate::Validate::validate(&self.charging_schedule)
916 .map_err(|error| error.in_field("chargingSchedule"))?;
917 if let Some(value) = &self.recurrency_kind {
918 crate::validate::Validate::validate(value)
919 .map_err(|error| error.in_field("recurrencyKind"))?;
920 }
921 Ok(())
922 }
923}
924#[derive(Debug, Clone, PartialEq, Eq)]
925#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
926pub enum RemoteStartTransactionResponseStatus {
927 Accepted,
928 Rejected,
929}
930#[cfg(feature = "validate")]
931impl crate::validate::Validate for RemoteStartTransactionResponseStatus {
932 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
933 Ok(())
934 }
935}
936#[derive(Debug, Clone, PartialEq, Eq)]
937#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
938pub enum RemoteStopTransactionResponseStatus {
939 Accepted,
940 Rejected,
941}
942#[cfg(feature = "validate")]
943impl crate::validate::Validate for RemoteStopTransactionResponseStatus {
944 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
945 Ok(())
946 }
947}
948#[derive(Debug, Clone, PartialEq, Eq)]
949#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
950pub enum ReserveNowResponseStatus {
951 Accepted,
952 Faulted,
953 Occupied,
954 Rejected,
955 Unavailable,
956}
957#[cfg(feature = "validate")]
958impl crate::validate::Validate for ReserveNowResponseStatus {
959 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
960 Ok(())
961 }
962}
963#[derive(Debug, Clone, PartialEq, Eq)]
964#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
965pub enum ResetRequestType {
966 Hard,
967 Soft,
968}
969#[cfg(feature = "validate")]
970impl crate::validate::Validate for ResetRequestType {
971 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
972 Ok(())
973 }
974}
975#[derive(Debug, Clone, PartialEq, Eq)]
976#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
977pub enum ResetResponseStatus {
978 Accepted,
979 Rejected,
980}
981#[cfg(feature = "validate")]
982impl crate::validate::Validate for ResetResponseStatus {
983 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
984 Ok(())
985 }
986}
987#[derive(Debug, Clone, PartialEq, Eq)]
988#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
989pub struct LocalAuthorizationListItem {
990 #[cfg_attr(feature = "serde", serde(rename = "idTag"))]
991 pub id_tag: super::IdTag,
992 #[cfg_attr(feature = "serde", serde(rename = "idTagInfo"))]
993 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
994 pub id_tag_info: Option<IdTagInfo>,
995}
996#[cfg(feature = "validate")]
997impl crate::validate::Validate for LocalAuthorizationListItem {
998 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
999 if let Some(value) = &self.id_tag_info {
1000 crate::validate::Validate::validate(value)
1001 .map_err(|error| error.in_field("idTagInfo"))?;
1002 }
1003 Ok(())
1004 }
1005}
1006#[derive(Debug, Clone, PartialEq, Eq)]
1007#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1008pub enum UpdateType {
1009 Differential,
1010 Full,
1011}
1012#[cfg(feature = "validate")]
1013impl crate::validate::Validate for UpdateType {
1014 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1015 Ok(())
1016 }
1017}
1018#[derive(Debug, Clone, PartialEq, Eq)]
1019#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1020pub enum SendLocalListResponseStatus {
1021 Accepted,
1022 Failed,
1023 NotSupported,
1024 VersionMismatch,
1025}
1026#[cfg(feature = "validate")]
1027impl crate::validate::Validate for SendLocalListResponseStatus {
1028 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1029 Ok(())
1030 }
1031}
1032#[cfg(feature = "alloc")]
1033#[derive(Debug, Clone, PartialEq)]
1034#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1035pub struct CsChargingProfiles {
1036 #[cfg_attr(feature = "serde", serde(rename = "chargingProfileId"))]
1037 pub charging_profile_id: i64,
1038 #[cfg_attr(feature = "serde", serde(rename = "chargingProfileKind"))]
1039 pub charging_profile_kind: ChargingProfileKind,
1040 #[cfg_attr(feature = "serde", serde(rename = "chargingProfilePurpose"))]
1041 pub charging_profile_purpose: ChargingProfilePurpose,
1042 #[cfg_attr(feature = "serde", serde(rename = "chargingSchedule"))]
1043 pub charging_schedule: ChargingSchedule,
1044 #[cfg_attr(feature = "serde", serde(rename = "recurrencyKind"))]
1045 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1046 pub recurrency_kind: Option<RecurrencyKind>,
1047 #[cfg_attr(feature = "serde", serde(rename = "stackLevel"))]
1048 pub stack_level: i64,
1049 #[cfg_attr(feature = "serde", serde(rename = "transactionId"))]
1050 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1051 pub transaction_id: Option<i64>,
1052 #[cfg_attr(feature = "serde", serde(rename = "validFrom"))]
1053 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1054 pub valid_from: Option<crate::OcppTimestamp>,
1055 #[cfg_attr(feature = "serde", serde(rename = "validTo"))]
1056 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1057 pub valid_to: Option<crate::OcppTimestamp>,
1058}
1059#[cfg(all(feature = "validate", feature = "alloc"))]
1060impl crate::validate::Validate for CsChargingProfiles {
1061 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1062 crate::validate::Validate::validate(&self.charging_profile_kind)
1063 .map_err(|error| error.in_field("chargingProfileKind"))?;
1064 crate::validate::Validate::validate(&self.charging_profile_purpose)
1065 .map_err(|error| error.in_field("chargingProfilePurpose"))?;
1066 crate::validate::Validate::validate(&self.charging_schedule)
1067 .map_err(|error| error.in_field("chargingSchedule"))?;
1068 if let Some(value) = &self.recurrency_kind {
1069 crate::validate::Validate::validate(value)
1070 .map_err(|error| error.in_field("recurrencyKind"))?;
1071 }
1072 Ok(())
1073 }
1074}
1075#[cfg(not(feature = "alloc"))]
1076#[derive(Debug, Clone, PartialEq)]
1077#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1078pub struct CsChargingProfiles<
1079 const CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP: usize = 8usize,
1080> {
1081 #[cfg_attr(feature = "serde", serde(rename = "chargingProfileId"))]
1082 pub charging_profile_id: i64,
1083 #[cfg_attr(feature = "serde", serde(rename = "chargingProfileKind"))]
1084 pub charging_profile_kind: ChargingProfileKind,
1085 #[cfg_attr(feature = "serde", serde(rename = "chargingProfilePurpose"))]
1086 pub charging_profile_purpose: ChargingProfilePurpose,
1087 #[cfg_attr(feature = "serde", serde(rename = "chargingSchedule"))]
1088 pub charging_schedule: ChargingSchedule<
1089 CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP,
1090 >,
1091 #[cfg_attr(feature = "serde", serde(rename = "recurrencyKind"))]
1092 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1093 pub recurrency_kind: Option<RecurrencyKind>,
1094 #[cfg_attr(feature = "serde", serde(rename = "stackLevel"))]
1095 pub stack_level: i64,
1096 #[cfg_attr(feature = "serde", serde(rename = "transactionId"))]
1097 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1098 pub transaction_id: Option<i64>,
1099 #[cfg_attr(feature = "serde", serde(rename = "validFrom"))]
1100 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1101 pub valid_from: Option<crate::OcppTimestamp>,
1102 #[cfg_attr(feature = "serde", serde(rename = "validTo"))]
1103 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1104 pub valid_to: Option<crate::OcppTimestamp>,
1105}
1106#[cfg(all(feature = "validate", not(feature = "alloc")))]
1107impl<
1108 const CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP: usize,
1109> crate::validate::Validate
1110for CsChargingProfiles<CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP> {
1111 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1112 crate::validate::Validate::validate(&self.charging_profile_kind)
1113 .map_err(|error| error.in_field("chargingProfileKind"))?;
1114 crate::validate::Validate::validate(&self.charging_profile_purpose)
1115 .map_err(|error| error.in_field("chargingProfilePurpose"))?;
1116 crate::validate::Validate::validate(&self.charging_schedule)
1117 .map_err(|error| error.in_field("chargingSchedule"))?;
1118 if let Some(value) = &self.recurrency_kind {
1119 crate::validate::Validate::validate(value)
1120 .map_err(|error| error.in_field("recurrencyKind"))?;
1121 }
1122 Ok(())
1123 }
1124}
1125#[derive(Debug, Clone, PartialEq, Eq)]
1126#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1127pub enum SetChargingProfileResponseStatus {
1128 Accepted,
1129 Rejected,
1130 NotSupported,
1131}
1132#[cfg(feature = "validate")]
1133impl crate::validate::Validate for SetChargingProfileResponseStatus {
1134 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1135 Ok(())
1136 }
1137}
1138#[derive(Debug, Clone, PartialEq, Eq)]
1139#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1140pub enum SignCertificateResponseStatus {
1141 Accepted,
1142 Rejected,
1143}
1144#[cfg(feature = "validate")]
1145impl crate::validate::Validate for SignCertificateResponseStatus {
1146 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1147 Ok(())
1148 }
1149}
1150#[derive(Debug, Clone, PartialEq, Eq)]
1151#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1152pub enum SignedFirmwareStatusNotificationRequestStatus {
1153 Downloaded,
1154 DownloadFailed,
1155 Downloading,
1156 DownloadScheduled,
1157 DownloadPaused,
1158 Idle,
1159 InstallationFailed,
1160 Installing,
1161 Installed,
1162 InstallRebooting,
1163 InstallScheduled,
1164 InstallVerificationFailed,
1165 InvalidSignature,
1166 SignatureVerified,
1167}
1168#[cfg(feature = "validate")]
1169impl crate::validate::Validate for SignedFirmwareStatusNotificationRequestStatus {
1170 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1171 Ok(())
1172 }
1173}
1174#[cfg(feature = "alloc")]
1175#[derive(Debug, Clone, PartialEq, Eq)]
1176#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1177pub struct Firmware {
1178 #[cfg_attr(feature = "serde", serde(rename = "installDateTime"))]
1179 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1180 pub install_date_time: Option<crate::OcppTimestamp>,
1181 pub location: heapless::String<512usize>,
1182 #[cfg_attr(feature = "serde", serde(rename = "retrieveDateTime"))]
1183 pub retrieve_date_time: crate::OcppTimestamp,
1184 pub signature: alloc::string::String,
1185 #[cfg_attr(feature = "serde", serde(rename = "signingCertificate"))]
1186 pub signing_certificate: alloc::string::String,
1187}
1188#[cfg(all(feature = "validate", feature = "alloc"))]
1189impl crate::validate::Validate for Firmware {
1190 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1191 crate::validate::check_max_length(&self.signature, 800usize)
1192 .map_err(|error| error.in_field("signature"))?;
1193 crate::validate::check_max_length(&self.signing_certificate, 5500usize)
1194 .map_err(|error| error.in_field("signingCertificate"))?;
1195 Ok(())
1196 }
1197}
1198#[cfg(not(feature = "alloc"))]
1199#[derive(Debug, Clone, PartialEq, Eq)]
1200#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1201pub struct Firmware<
1202 const FIRMWARE_SIGNATURE_CAP: usize = 800usize,
1203 const FIRMWARE_SIGNING_CERTIFICATE_CAP: usize = 1024usize,
1204> {
1205 #[cfg_attr(feature = "serde", serde(rename = "installDateTime"))]
1206 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1207 pub install_date_time: Option<crate::OcppTimestamp>,
1208 pub location: heapless::String<512usize>,
1209 #[cfg_attr(feature = "serde", serde(rename = "retrieveDateTime"))]
1210 pub retrieve_date_time: crate::OcppTimestamp,
1211 pub signature: heapless::String<FIRMWARE_SIGNATURE_CAP>,
1212 #[cfg_attr(feature = "serde", serde(rename = "signingCertificate"))]
1213 pub signing_certificate: heapless::String<FIRMWARE_SIGNING_CERTIFICATE_CAP>,
1214}
1215#[cfg(all(feature = "validate", not(feature = "alloc")))]
1216impl<
1217 const FIRMWARE_SIGNATURE_CAP: usize,
1218 const FIRMWARE_SIGNING_CERTIFICATE_CAP: usize,
1219> crate::validate::Validate
1220for Firmware<FIRMWARE_SIGNATURE_CAP, FIRMWARE_SIGNING_CERTIFICATE_CAP> {
1221 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1222 crate::validate::check_max_length(&self.signature, 800usize)
1223 .map_err(|error| error.in_field("signature"))?;
1224 crate::validate::check_max_length(&self.signing_certificate, 5500usize)
1225 .map_err(|error| error.in_field("signingCertificate"))?;
1226 Ok(())
1227 }
1228}
1229#[derive(Debug, Clone, PartialEq, Eq)]
1230#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1231pub enum SignedUpdateFirmwareResponseStatus {
1232 Accepted,
1233 Rejected,
1234 AcceptedCanceled,
1235 InvalidCertificate,
1236 RevokedCertificate,
1237}
1238#[cfg(feature = "validate")]
1239impl crate::validate::Validate for SignedUpdateFirmwareResponseStatus {
1240 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1241 Ok(())
1242 }
1243}
1244#[derive(Debug, Clone, PartialEq, Eq)]
1245#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1246pub enum ErrorCode {
1247 ConnectorLockFailure,
1248 EVCommunicationError,
1249 GroundFailure,
1250 HighTemperature,
1251 InternalError,
1252 LocalListConflict,
1253 NoError,
1254 OtherError,
1255 OverCurrentFailure,
1256 PowerMeterFailure,
1257 PowerSwitchFailure,
1258 ReaderFailure,
1259 ResetFailure,
1260 UnderVoltage,
1261 OverVoltage,
1262 WeakSignal,
1263}
1264#[cfg(feature = "validate")]
1265impl crate::validate::Validate for ErrorCode {
1266 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1267 Ok(())
1268 }
1269}
1270#[derive(Debug, Clone, PartialEq, Eq)]
1271#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1272pub enum StatusNotificationRequestStatus {
1273 Available,
1274 Preparing,
1275 Charging,
1276 SuspendedEVSE,
1277 SuspendedEV,
1278 Finishing,
1279 Reserved,
1280 Unavailable,
1281 Faulted,
1282}
1283#[cfg(feature = "validate")]
1284impl crate::validate::Validate for StatusNotificationRequestStatus {
1285 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1286 Ok(())
1287 }
1288}
1289#[derive(Debug, Clone, PartialEq, Eq)]
1290#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1291pub enum Reason {
1292 EmergencyStop,
1293 EVDisconnected,
1294 HardReset,
1295 Local,
1296 Other,
1297 PowerLoss,
1298 Reboot,
1299 Remote,
1300 SoftReset,
1301 UnlockCommand,
1302 DeAuthorized,
1303}
1304#[cfg(feature = "validate")]
1305impl crate::validate::Validate for Reason {
1306 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1307 Ok(())
1308 }
1309}
1310#[cfg(feature = "alloc")]
1311#[derive(Debug, Clone, PartialEq, Eq)]
1312#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1313pub struct TransactionDataItem {
1314 #[cfg_attr(feature = "serde", serde(rename = "sampledValue"))]
1315 pub sampled_value: alloc::vec::Vec<SampledValueItem>,
1316 pub timestamp: crate::OcppTimestamp,
1317}
1318#[cfg(all(feature = "validate", feature = "alloc"))]
1319impl crate::validate::Validate for TransactionDataItem {
1320 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1321 for (index, item) in self.sampled_value.iter().enumerate() {
1322 crate::validate::Validate::validate(item)
1323 .map_err(|error| error.in_index(index).in_field("sampledValue"))?;
1324 }
1325 Ok(())
1326 }
1327}
1328#[cfg(not(feature = "alloc"))]
1329#[derive(Debug, Clone, PartialEq, Eq)]
1330#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1331pub struct TransactionDataItem<
1332 const TRANSACTION_DATA_ITEM_SAMPLED_VALUE_CAP: usize = 8usize,
1333 const SAMPLED_VALUE_ITEM_VALUE_CAP: usize = 1024usize,
1334> {
1335 #[cfg_attr(feature = "serde", serde(rename = "sampledValue"))]
1336 pub sampled_value: heapless::Vec<
1337 SampledValueItem<SAMPLED_VALUE_ITEM_VALUE_CAP>,
1338 TRANSACTION_DATA_ITEM_SAMPLED_VALUE_CAP,
1339 >,
1340 pub timestamp: crate::OcppTimestamp,
1341}
1342#[cfg(all(feature = "validate", not(feature = "alloc")))]
1343impl<
1344 const TRANSACTION_DATA_ITEM_SAMPLED_VALUE_CAP: usize,
1345 const SAMPLED_VALUE_ITEM_VALUE_CAP: usize,
1346> crate::validate::Validate
1347for TransactionDataItem<
1348 TRANSACTION_DATA_ITEM_SAMPLED_VALUE_CAP,
1349 SAMPLED_VALUE_ITEM_VALUE_CAP,
1350> {
1351 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1352 for (index, item) in self.sampled_value.iter().enumerate() {
1353 crate::validate::Validate::validate(item)
1354 .map_err(|error| error.in_index(index).in_field("sampledValue"))?;
1355 }
1356 Ok(())
1357 }
1358}
1359#[derive(Debug, Clone, PartialEq, Eq)]
1360#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1361pub enum TriggerMessageRequestRequestedMessage {
1362 BootNotification,
1363 DiagnosticsStatusNotification,
1364 FirmwareStatusNotification,
1365 Heartbeat,
1366 MeterValues,
1367 StatusNotification,
1368}
1369#[cfg(feature = "validate")]
1370impl crate::validate::Validate for TriggerMessageRequestRequestedMessage {
1371 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1372 Ok(())
1373 }
1374}
1375#[derive(Debug, Clone, PartialEq, Eq)]
1376#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1377pub enum TriggerMessageResponseStatus {
1378 Accepted,
1379 Rejected,
1380 NotImplemented,
1381}
1382#[cfg(feature = "validate")]
1383impl crate::validate::Validate for TriggerMessageResponseStatus {
1384 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1385 Ok(())
1386 }
1387}
1388#[derive(Debug, Clone, PartialEq, Eq)]
1389#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1390pub enum UnlockConnectorResponseStatus {
1391 Unlocked,
1392 UnlockFailed,
1393 NotSupported,
1394}
1395#[cfg(feature = "validate")]
1396impl crate::validate::Validate for UnlockConnectorResponseStatus {
1397 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1398 Ok(())
1399 }
1400}