1#[derive(Debug, Clone, PartialEq, Eq)]
6#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7pub struct CustomData {
8 #[cfg_attr(feature = "serde", serde(rename = "vendorId"))]
9 pub vendor_id: heapless::String<255usize>,
10}
11#[cfg(feature = "validate")]
12impl crate::validate::Validate for CustomData {
13 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
14 Ok(())
15 }
16}
17#[derive(Debug, Clone, PartialEq, Eq)]
19#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
20pub struct AdditionalInfo<CustomDataType = crate::NoCustomData> {
21 #[cfg_attr(feature = "serde", serde(rename = "additionalIdToken"))]
23 pub additional_id_token: heapless::String<36usize>,
24 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
25 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
26 pub custom_data: Option<CustomDataType>,
27 pub r#type: heapless::String<50usize>,
29}
30#[cfg(feature = "validate")]
31impl<CustomDataType> crate::validate::Validate for AdditionalInfo<CustomDataType> {
32 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
33 Ok(())
34 }
35}
36#[derive(Debug, Clone, PartialEq, Eq)]
38#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
39pub enum IdTokenEnum {
40 Central,
41 #[cfg_attr(feature = "serde", serde(rename = "eMAID"))]
42 EMAID,
43 ISO14443,
44 ISO15693,
45 KeyCode,
46 Local,
47 MacAddress,
48 NoAuthorization,
49}
50#[cfg(feature = "validate")]
51impl crate::validate::Validate for IdTokenEnum {
52 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
53 Ok(())
54 }
55}
56#[cfg(feature = "alloc")]
57#[derive(Debug, Clone, PartialEq, Eq)]
59#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
60pub struct IdToken<CustomDataType = crate::NoCustomData> {
61 #[cfg_attr(feature = "serde", serde(rename = "additionalInfo"))]
62 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
63 pub additional_info: Option<alloc::vec::Vec<AdditionalInfo<CustomDataType>>>,
64 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
65 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
66 pub custom_data: Option<CustomDataType>,
67 #[cfg_attr(feature = "serde", serde(rename = "idToken"))]
69 pub id_token: heapless::String<36usize>,
70 pub r#type: IdTokenEnum,
71}
72#[cfg(all(feature = "validate", feature = "alloc"))]
73impl<CustomDataType> crate::validate::Validate for IdToken<CustomDataType> {
74 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
75 if let Some(value) = &self.additional_info {
76 crate::validate::check_min_items(value.len(), 1usize)
77 .map_err(|error| error.in_field("additionalInfo"))?;
78 for (index, item) in value.iter().enumerate() {
79 crate::validate::Validate::validate(item)
80 .map_err(|error| error.in_index(index).in_field("additionalInfo"))?;
81 }
82 }
83 crate::validate::Validate::validate(&self.r#type)
84 .map_err(|error| error.in_field("type"))?;
85 Ok(())
86 }
87}
88#[cfg(not(feature = "alloc"))]
89#[derive(Debug, Clone, PartialEq, Eq)]
91#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
92pub struct IdToken<
93 CustomDataType = crate::NoCustomData,
94 const ID_TOKEN_ADDITIONAL_INFO_CAP: usize = 8usize,
95> {
96 #[cfg_attr(feature = "serde", serde(rename = "additionalInfo"))]
97 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
98 pub additional_info: Option<
99 heapless::Vec<AdditionalInfo<CustomDataType>, ID_TOKEN_ADDITIONAL_INFO_CAP>,
100 >,
101 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
102 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
103 pub custom_data: Option<CustomDataType>,
104 #[cfg_attr(feature = "serde", serde(rename = "idToken"))]
106 pub id_token: heapless::String<36usize>,
107 pub r#type: IdTokenEnum,
108}
109#[cfg(all(feature = "validate", not(feature = "alloc")))]
110impl<CustomDataType, const ID_TOKEN_ADDITIONAL_INFO_CAP: usize> crate::validate::Validate
111for IdToken<CustomDataType, ID_TOKEN_ADDITIONAL_INFO_CAP> {
112 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
113 if let Some(value) = &self.additional_info {
114 crate::validate::check_min_items(value.len(), 1usize)
115 .map_err(|error| error.in_field("additionalInfo"))?;
116 for (index, item) in value.iter().enumerate() {
117 crate::validate::Validate::validate(item)
118 .map_err(|error| error.in_index(index).in_field("additionalInfo"))?;
119 }
120 }
121 crate::validate::Validate::validate(&self.r#type)
122 .map_err(|error| error.in_field("type"))?;
123 Ok(())
124 }
125}
126#[derive(Debug, Clone, PartialEq, Eq)]
128#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
129pub enum HashAlgorithmEnum {
130 SHA256,
131 SHA384,
132 SHA512,
133}
134#[cfg(feature = "validate")]
135impl crate::validate::Validate for HashAlgorithmEnum {
136 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
137 Ok(())
138 }
139}
140#[derive(Debug, Clone, PartialEq, Eq)]
141#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
142pub struct OCSPRequestData<CustomDataType = crate::NoCustomData> {
143 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
144 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
145 pub custom_data: Option<CustomDataType>,
146 #[cfg_attr(feature = "serde", serde(rename = "hashAlgorithm"))]
147 pub hash_algorithm: HashAlgorithmEnum,
148 #[cfg_attr(feature = "serde", serde(rename = "issuerKeyHash"))]
150 pub issuer_key_hash: heapless::String<128usize>,
151 #[cfg_attr(feature = "serde", serde(rename = "issuerNameHash"))]
153 pub issuer_name_hash: heapless::String<128usize>,
154 #[cfg_attr(feature = "serde", serde(rename = "responderURL"))]
156 pub responder_u_r_l: heapless::String<512usize>,
157 #[cfg_attr(feature = "serde", serde(rename = "serialNumber"))]
159 pub serial_number: heapless::String<40usize>,
160}
161#[cfg(feature = "validate")]
162impl<CustomDataType> crate::validate::Validate for OCSPRequestData<CustomDataType> {
163 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
164 crate::validate::Validate::validate(&self.hash_algorithm)
165 .map_err(|error| error.in_field("hashAlgorithm"))?;
166 Ok(())
167 }
168}
169#[derive(Debug, Clone, PartialEq, Eq)]
173#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
174pub enum AuthorizeCertificateStatusEnum {
175 Accepted,
176 SignatureError,
177 CertificateExpired,
178 CertificateRevoked,
179 NoCertificateAvailable,
180 CertChainError,
181 ContractCancelled,
182}
183#[cfg(feature = "validate")]
184impl crate::validate::Validate for AuthorizeCertificateStatusEnum {
185 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
186 Ok(())
187 }
188}
189#[derive(Debug, Clone, PartialEq, Eq)]
193#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
194pub enum MessageFormatEnum {
195 ASCII,
196 HTML,
197 URI,
198 UTF8,
199}
200#[cfg(feature = "validate")]
201impl crate::validate::Validate for MessageFormatEnum {
202 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
203 Ok(())
204 }
205}
206#[derive(Debug, Clone, PartialEq, Eq)]
210#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
211pub struct MessageContent<CustomDataType = crate::NoCustomData> {
212 pub content: heapless::String<512usize>,
216 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
217 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
218 pub custom_data: Option<CustomDataType>,
219 pub format: MessageFormatEnum,
220 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
224 pub language: Option<heapless::String<8usize>>,
225}
226#[cfg(feature = "validate")]
227impl<CustomDataType> crate::validate::Validate for MessageContent<CustomDataType> {
228 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
229 crate::validate::Validate::validate(&self.format)
230 .map_err(|error| error.in_field("format"))?;
231 Ok(())
232 }
233}
234#[derive(Debug, Clone, PartialEq, Eq)]
238#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
239pub enum AuthorizationStatusEnum {
240 Accepted,
241 Blocked,
242 ConcurrentTx,
243 Expired,
244 Invalid,
245 NoCredit,
246 NotAllowedTypeEVSE,
247 NotAtThisLocation,
248 NotAtThisTime,
249 Unknown,
250}
251#[cfg(feature = "validate")]
252impl crate::validate::Validate for AuthorizationStatusEnum {
253 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
254 Ok(())
255 }
256}
257#[cfg(feature = "alloc")]
258#[derive(Debug, Clone, PartialEq, Eq)]
263#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
264pub struct IdTokenInfo<CustomDataType = crate::NoCustomData> {
265 #[cfg_attr(feature = "serde", serde(rename = "cacheExpiryDateTime"))]
269 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
270 pub cache_expiry_date_time: Option<crate::OcppTimestamp>,
271 #[cfg_attr(feature = "serde", serde(rename = "chargingPriority"))]
273 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
274 pub charging_priority: Option<i64>,
275 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
276 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
277 pub custom_data: Option<CustomDataType>,
278 #[cfg_attr(feature = "serde", serde(rename = "evseId"))]
280 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
281 pub evse_id: Option<alloc::vec::Vec<i64>>,
282 #[cfg_attr(feature = "serde", serde(rename = "groupIdToken"))]
283 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
284 pub group_id_token: Option<IdToken<CustomDataType>>,
285 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
289 pub language1: Option<heapless::String<8usize>>,
290 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
294 pub language2: Option<heapless::String<8usize>>,
295 #[cfg_attr(feature = "serde", serde(rename = "personalMessage"))]
296 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
297 pub personal_message: Option<MessageContent<CustomDataType>>,
298 pub status: AuthorizationStatusEnum,
299}
300#[cfg(all(feature = "validate", feature = "alloc"))]
301impl<CustomDataType> crate::validate::Validate for IdTokenInfo<CustomDataType> {
302 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
303 if let Some(value) = &self.evse_id {
304 crate::validate::check_min_items(value.len(), 1usize)
305 .map_err(|error| error.in_field("evseId"))?;
306 }
307 if let Some(value) = &self.group_id_token {
308 crate::validate::Validate::validate(value)
309 .map_err(|error| error.in_field("groupIdToken"))?;
310 }
311 if let Some(value) = &self.personal_message {
312 crate::validate::Validate::validate(value)
313 .map_err(|error| error.in_field("personalMessage"))?;
314 }
315 crate::validate::Validate::validate(&self.status)
316 .map_err(|error| error.in_field("status"))?;
317 Ok(())
318 }
319}
320#[cfg(not(feature = "alloc"))]
321#[derive(Debug, Clone, PartialEq, Eq)]
326#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
327pub struct IdTokenInfo<
328 CustomDataType = crate::NoCustomData,
329 const ID_TOKEN_INFO_EVSE_ID_CAP: usize = 8usize,
330 const ID_TOKEN_ADDITIONAL_INFO_CAP: usize = 8usize,
331> {
332 #[cfg_attr(feature = "serde", serde(rename = "cacheExpiryDateTime"))]
336 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
337 pub cache_expiry_date_time: Option<crate::OcppTimestamp>,
338 #[cfg_attr(feature = "serde", serde(rename = "chargingPriority"))]
340 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
341 pub charging_priority: Option<i64>,
342 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
343 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
344 pub custom_data: Option<CustomDataType>,
345 #[cfg_attr(feature = "serde", serde(rename = "evseId"))]
347 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
348 pub evse_id: Option<heapless::Vec<i64, ID_TOKEN_INFO_EVSE_ID_CAP>>,
349 #[cfg_attr(feature = "serde", serde(rename = "groupIdToken"))]
350 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
351 pub group_id_token: Option<IdToken<CustomDataType, ID_TOKEN_ADDITIONAL_INFO_CAP>>,
352 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
356 pub language1: Option<heapless::String<8usize>>,
357 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
361 pub language2: Option<heapless::String<8usize>>,
362 #[cfg_attr(feature = "serde", serde(rename = "personalMessage"))]
363 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
364 pub personal_message: Option<MessageContent<CustomDataType>>,
365 pub status: AuthorizationStatusEnum,
366}
367#[cfg(all(feature = "validate", not(feature = "alloc")))]
368impl<
369 CustomDataType,
370 const ID_TOKEN_INFO_EVSE_ID_CAP: usize,
371 const ID_TOKEN_ADDITIONAL_INFO_CAP: usize,
372> crate::validate::Validate
373for IdTokenInfo<
374 CustomDataType,
375 ID_TOKEN_INFO_EVSE_ID_CAP,
376 ID_TOKEN_ADDITIONAL_INFO_CAP,
377> {
378 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
379 if let Some(value) = &self.evse_id {
380 crate::validate::check_min_items(value.len(), 1usize)
381 .map_err(|error| error.in_field("evseId"))?;
382 }
383 if let Some(value) = &self.group_id_token {
384 crate::validate::Validate::validate(value)
385 .map_err(|error| error.in_field("groupIdToken"))?;
386 }
387 if let Some(value) = &self.personal_message {
388 crate::validate::Validate::validate(value)
389 .map_err(|error| error.in_field("personalMessage"))?;
390 }
391 crate::validate::Validate::validate(&self.status)
392 .map_err(|error| error.in_field("status"))?;
393 Ok(())
394 }
395}
396#[derive(Debug, Clone, PartialEq, Eq)]
400#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
401pub struct Modem<CustomDataType = crate::NoCustomData> {
402 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
403 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
404 pub custom_data: Option<CustomDataType>,
405 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
409 pub iccid: Option<heapless::String<20usize>>,
410 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
414 pub imsi: Option<heapless::String<20usize>>,
415}
416#[cfg(feature = "validate")]
417impl<CustomDataType> crate::validate::Validate for Modem<CustomDataType> {
418 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
419 Ok(())
420 }
421}
422#[derive(Debug, Clone, PartialEq, Eq)]
426#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
427pub struct ChargingStation<CustomDataType = crate::NoCustomData> {
428 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
429 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
430 pub custom_data: Option<CustomDataType>,
431 #[cfg_attr(feature = "serde", serde(rename = "firmwareVersion"))]
433 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
434 pub firmware_version: Option<heapless::String<50usize>>,
435 pub model: heapless::String<20usize>,
439 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
440 pub modem: Option<Modem<CustomDataType>>,
441 #[cfg_attr(feature = "serde", serde(rename = "serialNumber"))]
445 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
446 pub serial_number: Option<heapless::String<25usize>>,
447 #[cfg_attr(feature = "serde", serde(rename = "vendorName"))]
449 pub vendor_name: heapless::String<50usize>,
450}
451#[cfg(feature = "validate")]
452impl<CustomDataType> crate::validate::Validate for ChargingStation<CustomDataType> {
453 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
454 if let Some(value) = &self.modem {
455 crate::validate::Validate::validate(value)
456 .map_err(|error| error.in_field("modem"))?;
457 }
458 Ok(())
459 }
460}
461#[derive(Debug, Clone, PartialEq, Eq)]
463#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
464pub enum BootReasonEnum {
465 ApplicationReset,
466 FirmwareUpdate,
467 LocalReset,
468 PowerUp,
469 RemoteReset,
470 ScheduledReset,
471 Triggered,
472 Unknown,
473 Watchdog,
474}
475#[cfg(feature = "validate")]
476impl crate::validate::Validate for BootReasonEnum {
477 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
478 Ok(())
479 }
480}
481#[derive(Debug, Clone, PartialEq, Eq)]
484#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
485pub enum RegistrationStatusEnum {
486 Accepted,
487 Pending,
488 Rejected,
489}
490#[cfg(feature = "validate")]
491impl crate::validate::Validate for RegistrationStatusEnum {
492 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
493 Ok(())
494 }
495}
496#[derive(Debug, Clone, PartialEq, Eq)]
498#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
499pub struct StatusInfo<CustomDataType = crate::NoCustomData> {
500 #[cfg_attr(feature = "serde", serde(rename = "additionalInfo"))]
502 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
503 pub additional_info: Option<heapless::String<512usize>>,
504 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
505 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
506 pub custom_data: Option<CustomDataType>,
507 #[cfg_attr(feature = "serde", serde(rename = "reasonCode"))]
509 pub reason_code: heapless::String<20usize>,
510}
511#[cfg(feature = "validate")]
512impl<CustomDataType> crate::validate::Validate for StatusInfo<CustomDataType> {
513 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
514 Ok(())
515 }
516}
517#[derive(Debug, Clone, PartialEq, Eq)]
519#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
520pub enum CancelReservationStatusEnum {
521 Accepted,
522 Rejected,
523}
524#[cfg(feature = "validate")]
525impl crate::validate::Validate for CancelReservationStatusEnum {
526 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
527 Ok(())
528 }
529}
530#[derive(Debug, Clone, PartialEq, Eq)]
532#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
533pub enum CertificateSigningUseEnum {
534 ChargingStationCertificate,
535 V2GCertificate,
536}
537#[cfg(feature = "validate")]
538impl crate::validate::Validate for CertificateSigningUseEnum {
539 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
540 Ok(())
541 }
542}
543#[derive(Debug, Clone, PartialEq, Eq)]
545#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
546pub enum CertificateSignedStatusEnum {
547 Accepted,
548 Rejected,
549}
550#[cfg(feature = "validate")]
551impl crate::validate::Validate for CertificateSignedStatusEnum {
552 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
553 Ok(())
554 }
555}
556#[derive(Debug, Clone, PartialEq, Eq)]
560#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
561pub struct EVSE<CustomDataType = crate::NoCustomData> {
562 #[cfg_attr(feature = "serde", serde(rename = "connectorId"))]
564 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
565 pub connector_id: Option<i64>,
566 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
567 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
568 pub custom_data: Option<CustomDataType>,
569 pub id: i64,
573}
574#[cfg(feature = "validate")]
575impl<CustomDataType> crate::validate::Validate for EVSE<CustomDataType> {
576 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
577 Ok(())
578 }
579}
580#[derive(Debug, Clone, PartialEq, Eq)]
582#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
583pub enum OperationalStatusEnum {
584 Inoperative,
585 Operative,
586}
587#[cfg(feature = "validate")]
588impl crate::validate::Validate for OperationalStatusEnum {
589 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
590 Ok(())
591 }
592}
593#[derive(Debug, Clone, PartialEq, Eq)]
595#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
596pub enum ChangeAvailabilityStatusEnum {
597 Accepted,
598 Rejected,
599 Scheduled,
600}
601#[cfg(feature = "validate")]
602impl crate::validate::Validate for ChangeAvailabilityStatusEnum {
603 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
604 Ok(())
605 }
606}
607#[derive(Debug, Clone, PartialEq, Eq)]
609#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
610pub enum ClearCacheStatusEnum {
611 Accepted,
612 Rejected,
613}
614#[cfg(feature = "validate")]
615impl crate::validate::Validate for ClearCacheStatusEnum {
616 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
617 Ok(())
618 }
619}
620#[derive(Debug, Clone, PartialEq, Eq)]
624#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
625pub enum ChargingProfilePurposeEnum {
626 ChargingStationExternalConstraints,
627 ChargingStationMaxProfile,
628 TxDefaultProfile,
629 TxProfile,
630}
631#[cfg(feature = "validate")]
632impl crate::validate::Validate for ChargingProfilePurposeEnum {
633 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
634 Ok(())
635 }
636}
637#[derive(Debug, Clone, PartialEq, Eq)]
641#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
642pub struct ClearChargingProfile<CustomDataType = crate::NoCustomData> {
643 #[cfg_attr(feature = "serde", serde(rename = "chargingProfilePurpose"))]
644 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
645 pub charging_profile_purpose: Option<ChargingProfilePurposeEnum>,
646 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
647 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
648 pub custom_data: Option<CustomDataType>,
649 #[cfg_attr(feature = "serde", serde(rename = "evseId"))]
653 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
654 pub evse_id: Option<i64>,
655 #[cfg_attr(feature = "serde", serde(rename = "stackLevel"))]
659 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
660 pub stack_level: Option<i64>,
661}
662#[cfg(feature = "validate")]
663impl<CustomDataType> crate::validate::Validate for ClearChargingProfile<CustomDataType> {
664 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
665 if let Some(value) = &self.charging_profile_purpose {
666 crate::validate::Validate::validate(value)
667 .map_err(|error| error.in_field("chargingProfilePurpose"))?;
668 }
669 Ok(())
670 }
671}
672#[derive(Debug, Clone, PartialEq, Eq)]
674#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
675pub enum ClearChargingProfileStatusEnum {
676 Accepted,
677 Unknown,
678}
679#[cfg(feature = "validate")]
680impl crate::validate::Validate for ClearChargingProfileStatusEnum {
681 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
682 Ok(())
683 }
684}
685#[derive(Debug, Clone, PartialEq, Eq)]
687#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
688pub enum ClearMessageStatusEnum {
689 Accepted,
690 Unknown,
691}
692#[cfg(feature = "validate")]
693impl crate::validate::Validate for ClearMessageStatusEnum {
694 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
695 Ok(())
696 }
697}
698#[derive(Debug, Clone, PartialEq, Eq)]
700#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
701pub enum ClearMonitoringStatusEnum {
702 Accepted,
703 Rejected,
704 NotFound,
705}
706#[cfg(feature = "validate")]
707impl crate::validate::Validate for ClearMonitoringStatusEnum {
708 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
709 Ok(())
710 }
711}
712#[derive(Debug, Clone, PartialEq, Eq)]
713#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
714pub struct ClearMonitoringResult<CustomDataType = crate::NoCustomData> {
715 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
716 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
717 pub custom_data: Option<CustomDataType>,
718 pub id: i64,
720 pub status: ClearMonitoringStatusEnum,
721 #[cfg_attr(feature = "serde", serde(rename = "statusInfo"))]
722 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
723 pub status_info: Option<StatusInfo<CustomDataType>>,
724}
725#[cfg(feature = "validate")]
726impl<CustomDataType> crate::validate::Validate
727for ClearMonitoringResult<CustomDataType> {
728 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
729 crate::validate::Validate::validate(&self.status)
730 .map_err(|error| error.in_field("status"))?;
731 if let Some(value) = &self.status_info {
732 crate::validate::Validate::validate(value)
733 .map_err(|error| error.in_field("statusInfo"))?;
734 }
735 Ok(())
736 }
737}
738#[derive(Debug, Clone, PartialEq, Eq)]
740#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
741pub enum ChargingLimitSourceEnum {
742 EMS,
743 Other,
744 SO,
745 CSO,
746}
747#[cfg(feature = "validate")]
748impl crate::validate::Validate for ChargingLimitSourceEnum {
749 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
750 Ok(())
751 }
752}
753#[derive(Debug, Clone, PartialEq, Eq)]
754#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
755pub struct CertificateHashData<CustomDataType = crate::NoCustomData> {
756 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
757 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
758 pub custom_data: Option<CustomDataType>,
759 #[cfg_attr(feature = "serde", serde(rename = "hashAlgorithm"))]
760 pub hash_algorithm: HashAlgorithmEnum,
761 #[cfg_attr(feature = "serde", serde(rename = "issuerKeyHash"))]
763 pub issuer_key_hash: heapless::String<128usize>,
764 #[cfg_attr(feature = "serde", serde(rename = "issuerNameHash"))]
766 pub issuer_name_hash: heapless::String<128usize>,
767 #[cfg_attr(feature = "serde", serde(rename = "serialNumber"))]
769 pub serial_number: heapless::String<40usize>,
770}
771#[cfg(feature = "validate")]
772impl<CustomDataType> crate::validate::Validate for CertificateHashData<CustomDataType> {
773 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
774 crate::validate::Validate::validate(&self.hash_algorithm)
775 .map_err(|error| error.in_field("hashAlgorithm"))?;
776 Ok(())
777 }
778}
779#[derive(Debug, Clone, PartialEq, Eq)]
781#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
782pub enum CustomerInformationStatusEnum {
783 Accepted,
784 Rejected,
785 Invalid,
786}
787#[cfg(feature = "validate")]
788impl crate::validate::Validate for CustomerInformationStatusEnum {
789 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
790 Ok(())
791 }
792}
793#[derive(Debug, Clone, PartialEq, Eq)]
795#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
796pub enum DataTransferStatusEnum {
797 Accepted,
798 Rejected,
799 UnknownMessageId,
800 UnknownVendorId,
801}
802#[cfg(feature = "validate")]
803impl crate::validate::Validate for DataTransferStatusEnum {
804 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
805 Ok(())
806 }
807}
808#[derive(Debug, Clone, PartialEq, Eq)]
810#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
811pub enum DeleteCertificateStatusEnum {
812 Accepted,
813 Failed,
814 NotFound,
815}
816#[cfg(feature = "validate")]
817impl crate::validate::Validate for DeleteCertificateStatusEnum {
818 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
819 Ok(())
820 }
821}
822#[derive(Debug, Clone, PartialEq, Eq)]
824#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
825pub enum FirmwareStatusEnum {
826 Downloaded,
827 DownloadFailed,
828 Downloading,
829 DownloadScheduled,
830 DownloadPaused,
831 Idle,
832 InstallationFailed,
833 Installing,
834 Installed,
835 InstallRebooting,
836 InstallScheduled,
837 InstallVerificationFailed,
838 InvalidSignature,
839 SignatureVerified,
840}
841#[cfg(feature = "validate")]
842impl crate::validate::Validate for FirmwareStatusEnum {
843 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
844 Ok(())
845 }
846}
847#[derive(Debug, Clone, PartialEq, Eq)]
849#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
850pub enum CertificateActionEnum {
851 Install,
852 Update,
853}
854#[cfg(feature = "validate")]
855impl crate::validate::Validate for CertificateActionEnum {
856 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
857 Ok(())
858 }
859}
860#[derive(Debug, Clone, PartialEq, Eq)]
862#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
863pub enum Iso15118EVCertificateStatusEnum {
864 Accepted,
865 Failed,
866}
867#[cfg(feature = "validate")]
868impl crate::validate::Validate for Iso15118EVCertificateStatusEnum {
869 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
870 Ok(())
871 }
872}
873#[derive(Debug, Clone, PartialEq, Eq)]
875#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
876pub enum ReportBaseEnum {
877 ConfigurationInventory,
878 FullInventory,
879 SummaryInventory,
880}
881#[cfg(feature = "validate")]
882impl crate::validate::Validate for ReportBaseEnum {
883 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
884 Ok(())
885 }
886}
887#[derive(Debug, Clone, PartialEq, Eq)]
889#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
890pub enum GenericDeviceModelStatusEnum {
891 Accepted,
892 Rejected,
893 NotSupported,
894 EmptyResultSet,
895}
896#[cfg(feature = "validate")]
897impl crate::validate::Validate for GenericDeviceModelStatusEnum {
898 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
899 Ok(())
900 }
901}
902#[derive(Debug, Clone, PartialEq, Eq)]
904#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
905pub enum GetCertificateStatusEnum {
906 Accepted,
907 Failed,
908}
909#[cfg(feature = "validate")]
910impl crate::validate::Validate for GetCertificateStatusEnum {
911 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
912 Ok(())
913 }
914}
915#[cfg(feature = "alloc")]
916#[derive(Debug, Clone, PartialEq, Eq)]
920#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
921pub struct ChargingProfileCriterion<CustomDataType = crate::NoCustomData> {
922 #[cfg_attr(feature = "serde", serde(rename = "chargingLimitSource"))]
924 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
925 pub charging_limit_source: Option<heapless::Vec<ChargingLimitSourceEnum, 4usize>>,
926 #[cfg_attr(feature = "serde", serde(rename = "chargingProfileId"))]
928 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
929 pub charging_profile_id: Option<alloc::vec::Vec<i64>>,
930 #[cfg_attr(feature = "serde", serde(rename = "chargingProfilePurpose"))]
931 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
932 pub charging_profile_purpose: Option<ChargingProfilePurposeEnum>,
933 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
934 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
935 pub custom_data: Option<CustomDataType>,
936 #[cfg_attr(feature = "serde", serde(rename = "stackLevel"))]
940 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
941 pub stack_level: Option<i64>,
942}
943#[cfg(all(feature = "validate", feature = "alloc"))]
944impl<CustomDataType> crate::validate::Validate
945for ChargingProfileCriterion<CustomDataType> {
946 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
947 if let Some(value) = &self.charging_limit_source {
948 crate::validate::check_min_items(value.len(), 1usize)
949 .map_err(|error| error.in_field("chargingLimitSource"))?;
950 for (index, item) in value.iter().enumerate() {
951 crate::validate::Validate::validate(item)
952 .map_err(|error| {
953 error.in_index(index).in_field("chargingLimitSource")
954 })?;
955 }
956 }
957 if let Some(value) = &self.charging_profile_id {
958 crate::validate::check_min_items(value.len(), 1usize)
959 .map_err(|error| error.in_field("chargingProfileId"))?;
960 }
961 if let Some(value) = &self.charging_profile_purpose {
962 crate::validate::Validate::validate(value)
963 .map_err(|error| error.in_field("chargingProfilePurpose"))?;
964 }
965 Ok(())
966 }
967}
968#[cfg(not(feature = "alloc"))]
969#[derive(Debug, Clone, PartialEq, Eq)]
973#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
974pub struct ChargingProfileCriterion<
975 CustomDataType = crate::NoCustomData,
976 const CHARGING_PROFILE_CRITERION_CHARGING_PROFILE_ID_CAP: usize = 8usize,
977> {
978 #[cfg_attr(feature = "serde", serde(rename = "chargingLimitSource"))]
980 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
981 pub charging_limit_source: Option<heapless::Vec<ChargingLimitSourceEnum, 4usize>>,
982 #[cfg_attr(feature = "serde", serde(rename = "chargingProfileId"))]
984 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
985 pub charging_profile_id: Option<
986 heapless::Vec<i64, CHARGING_PROFILE_CRITERION_CHARGING_PROFILE_ID_CAP>,
987 >,
988 #[cfg_attr(feature = "serde", serde(rename = "chargingProfilePurpose"))]
989 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
990 pub charging_profile_purpose: Option<ChargingProfilePurposeEnum>,
991 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
992 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
993 pub custom_data: Option<CustomDataType>,
994 #[cfg_attr(feature = "serde", serde(rename = "stackLevel"))]
998 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
999 pub stack_level: Option<i64>,
1000}
1001#[cfg(all(feature = "validate", not(feature = "alloc")))]
1002impl<
1003 CustomDataType,
1004 const CHARGING_PROFILE_CRITERION_CHARGING_PROFILE_ID_CAP: usize,
1005> crate::validate::Validate
1006for ChargingProfileCriterion<
1007 CustomDataType,
1008 CHARGING_PROFILE_CRITERION_CHARGING_PROFILE_ID_CAP,
1009> {
1010 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1011 if let Some(value) = &self.charging_limit_source {
1012 crate::validate::check_min_items(value.len(), 1usize)
1013 .map_err(|error| error.in_field("chargingLimitSource"))?;
1014 for (index, item) in value.iter().enumerate() {
1015 crate::validate::Validate::validate(item)
1016 .map_err(|error| {
1017 error.in_index(index).in_field("chargingLimitSource")
1018 })?;
1019 }
1020 }
1021 if let Some(value) = &self.charging_profile_id {
1022 crate::validate::check_min_items(value.len(), 1usize)
1023 .map_err(|error| error.in_field("chargingProfileId"))?;
1024 }
1025 if let Some(value) = &self.charging_profile_purpose {
1026 crate::validate::Validate::validate(value)
1027 .map_err(|error| error.in_field("chargingProfilePurpose"))?;
1028 }
1029 Ok(())
1030 }
1031}
1032#[derive(Debug, Clone, PartialEq, Eq)]
1034#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1035pub enum GetChargingProfileStatusEnum {
1036 Accepted,
1037 NoProfiles,
1038}
1039#[cfg(feature = "validate")]
1040impl crate::validate::Validate for GetChargingProfileStatusEnum {
1041 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1042 Ok(())
1043 }
1044}
1045#[derive(Debug, Clone, PartialEq, Eq)]
1047#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1048pub enum ChargingRateUnitEnum {
1049 W,
1050 A,
1051}
1052#[cfg(feature = "validate")]
1053impl crate::validate::Validate for ChargingRateUnitEnum {
1054 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1055 Ok(())
1056 }
1057}
1058#[derive(Debug, Clone, PartialEq)]
1062#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1063pub struct ChargingSchedulePeriod<CustomDataType = crate::NoCustomData> {
1064 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1065 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1066 pub custom_data: Option<CustomDataType>,
1067 pub limit: f64,
1071 #[cfg_attr(feature = "serde", serde(rename = "numberPhases"))]
1075 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1076 pub number_phases: Option<i64>,
1077 #[cfg_attr(feature = "serde", serde(rename = "phaseToUse"))]
1079 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1080 pub phase_to_use: Option<i64>,
1081 #[cfg_attr(feature = "serde", serde(rename = "startPeriod"))]
1085 pub start_period: i64,
1086}
1087#[cfg(feature = "validate")]
1088impl<CustomDataType> crate::validate::Validate
1089for ChargingSchedulePeriod<CustomDataType> {
1090 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1091 Ok(())
1092 }
1093}
1094#[cfg(feature = "alloc")]
1095#[derive(Debug, Clone, PartialEq)]
1098#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1099pub struct CompositeSchedule<CustomDataType = crate::NoCustomData> {
1100 #[cfg_attr(feature = "serde", serde(rename = "chargingRateUnit"))]
1101 pub charging_rate_unit: ChargingRateUnitEnum,
1102 #[cfg_attr(feature = "serde", serde(rename = "chargingSchedulePeriod"))]
1103 pub charging_schedule_period: alloc::vec::Vec<
1104 ChargingSchedulePeriod<CustomDataType>,
1105 >,
1106 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1107 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1108 pub custom_data: Option<CustomDataType>,
1109 pub duration: i64,
1111 #[cfg_attr(feature = "serde", serde(rename = "evseId"))]
1116 pub evse_id: i64,
1117 #[cfg_attr(feature = "serde", serde(rename = "scheduleStart"))]
1121 pub schedule_start: crate::OcppTimestamp,
1122}
1123#[cfg(all(feature = "validate", feature = "alloc"))]
1124impl<CustomDataType> crate::validate::Validate for CompositeSchedule<CustomDataType> {
1125 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1126 crate::validate::Validate::validate(&self.charging_rate_unit)
1127 .map_err(|error| error.in_field("chargingRateUnit"))?;
1128 crate::validate::check_min_items(self.charging_schedule_period.len(), 1usize)
1129 .map_err(|error| error.in_field("chargingSchedulePeriod"))?;
1130 for (index, item) in self.charging_schedule_period.iter().enumerate() {
1131 crate::validate::Validate::validate(item)
1132 .map_err(|error| {
1133 error.in_index(index).in_field("chargingSchedulePeriod")
1134 })?;
1135 }
1136 Ok(())
1137 }
1138}
1139#[cfg(not(feature = "alloc"))]
1140#[derive(Debug, Clone, PartialEq)]
1143#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1144pub struct CompositeSchedule<
1145 CustomDataType = crate::NoCustomData,
1146 const COMPOSITE_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP: usize = 8usize,
1147> {
1148 #[cfg_attr(feature = "serde", serde(rename = "chargingRateUnit"))]
1149 pub charging_rate_unit: ChargingRateUnitEnum,
1150 #[cfg_attr(feature = "serde", serde(rename = "chargingSchedulePeriod"))]
1151 pub charging_schedule_period: heapless::Vec<
1152 ChargingSchedulePeriod<CustomDataType>,
1153 COMPOSITE_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP,
1154 >,
1155 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1156 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1157 pub custom_data: Option<CustomDataType>,
1158 pub duration: i64,
1160 #[cfg_attr(feature = "serde", serde(rename = "evseId"))]
1165 pub evse_id: i64,
1166 #[cfg_attr(feature = "serde", serde(rename = "scheduleStart"))]
1170 pub schedule_start: crate::OcppTimestamp,
1171}
1172#[cfg(all(feature = "validate", not(feature = "alloc")))]
1173impl<
1174 CustomDataType,
1175 const COMPOSITE_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP: usize,
1176> crate::validate::Validate
1177for CompositeSchedule<CustomDataType, COMPOSITE_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP> {
1178 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1179 crate::validate::Validate::validate(&self.charging_rate_unit)
1180 .map_err(|error| error.in_field("chargingRateUnit"))?;
1181 crate::validate::check_min_items(self.charging_schedule_period.len(), 1usize)
1182 .map_err(|error| error.in_field("chargingSchedulePeriod"))?;
1183 for (index, item) in self.charging_schedule_period.iter().enumerate() {
1184 crate::validate::Validate::validate(item)
1185 .map_err(|error| {
1186 error.in_index(index).in_field("chargingSchedulePeriod")
1187 })?;
1188 }
1189 Ok(())
1190 }
1191}
1192#[derive(Debug, Clone, PartialEq, Eq)]
1195#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1196pub enum GenericStatusEnum {
1197 Accepted,
1198 Rejected,
1199}
1200#[cfg(feature = "validate")]
1201impl crate::validate::Validate for GenericStatusEnum {
1202 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1203 Ok(())
1204 }
1205}
1206#[derive(Debug, Clone, PartialEq, Eq)]
1208#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1209pub enum MessagePriorityEnum {
1210 AlwaysFront,
1211 InFront,
1212 NormalCycle,
1213}
1214#[cfg(feature = "validate")]
1215impl crate::validate::Validate for MessagePriorityEnum {
1216 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1217 Ok(())
1218 }
1219}
1220#[derive(Debug, Clone, PartialEq, Eq)]
1222#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1223pub enum MessageStateEnum {
1224 Charging,
1225 Faulted,
1226 Idle,
1227 Unavailable,
1228}
1229#[cfg(feature = "validate")]
1230impl crate::validate::Validate for MessageStateEnum {
1231 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1232 Ok(())
1233 }
1234}
1235#[derive(Debug, Clone, PartialEq, Eq)]
1237#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1238pub enum GetDisplayMessagesStatusEnum {
1239 Accepted,
1240 Unknown,
1241}
1242#[cfg(feature = "validate")]
1243impl crate::validate::Validate for GetDisplayMessagesStatusEnum {
1244 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1245 Ok(())
1246 }
1247}
1248#[derive(Debug, Clone, PartialEq, Eq)]
1249#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1250pub enum GetCertificateIdUseEnum {
1251 V2GRootCertificate,
1252 MORootCertificate,
1253 CSMSRootCertificate,
1254 V2GCertificateChain,
1255 ManufacturerRootCertificate,
1256}
1257#[cfg(feature = "validate")]
1258impl crate::validate::Validate for GetCertificateIdUseEnum {
1259 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1260 Ok(())
1261 }
1262}
1263#[derive(Debug, Clone, PartialEq, Eq)]
1264#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1265pub struct CertificateHashDataChain<CustomDataType = crate::NoCustomData> {
1266 #[cfg_attr(feature = "serde", serde(rename = "certificateHashData"))]
1267 pub certificate_hash_data: CertificateHashData<CustomDataType>,
1268 #[cfg_attr(feature = "serde", serde(rename = "certificateType"))]
1269 pub certificate_type: GetCertificateIdUseEnum,
1270 #[cfg_attr(feature = "serde", serde(rename = "childCertificateHashData"))]
1271 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1272 pub child_certificate_hash_data: Option<
1273 heapless::Vec<CertificateHashData<CustomDataType>, 4usize>,
1274 >,
1275 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1276 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1277 pub custom_data: Option<CustomDataType>,
1278}
1279#[cfg(feature = "validate")]
1280impl<CustomDataType> crate::validate::Validate
1281for CertificateHashDataChain<CustomDataType> {
1282 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1283 crate::validate::Validate::validate(&self.certificate_hash_data)
1284 .map_err(|error| error.in_field("certificateHashData"))?;
1285 crate::validate::Validate::validate(&self.certificate_type)
1286 .map_err(|error| error.in_field("certificateType"))?;
1287 if let Some(value) = &self.child_certificate_hash_data {
1288 crate::validate::check_min_items(value.len(), 1usize)
1289 .map_err(|error| error.in_field("childCertificateHashData"))?;
1290 for (index, item) in value.iter().enumerate() {
1291 crate::validate::Validate::validate(item)
1292 .map_err(|error| {
1293 error.in_index(index).in_field("childCertificateHashData")
1294 })?;
1295 }
1296 }
1297 Ok(())
1298 }
1299}
1300#[derive(Debug, Clone, PartialEq, Eq)]
1302#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1303pub enum GetInstalledCertificateStatusEnum {
1304 Accepted,
1305 NotFound,
1306}
1307#[cfg(feature = "validate")]
1308impl crate::validate::Validate for GetInstalledCertificateStatusEnum {
1309 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1310 Ok(())
1311 }
1312}
1313#[derive(Debug, Clone, PartialEq, Eq)]
1317#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1318pub struct LogParameters<CustomDataType = crate::NoCustomData> {
1319 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1320 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1321 pub custom_data: Option<CustomDataType>,
1322 #[cfg_attr(feature = "serde", serde(rename = "latestTimestamp"))]
1326 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1327 pub latest_timestamp: Option<crate::OcppTimestamp>,
1328 #[cfg_attr(feature = "serde", serde(rename = "oldestTimestamp"))]
1332 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1333 pub oldest_timestamp: Option<crate::OcppTimestamp>,
1334 #[cfg_attr(feature = "serde", serde(rename = "remoteLocation"))]
1338 pub remote_location: heapless::String<512usize>,
1339}
1340#[cfg(feature = "validate")]
1341impl<CustomDataType> crate::validate::Validate for LogParameters<CustomDataType> {
1342 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1343 Ok(())
1344 }
1345}
1346#[derive(Debug, Clone, PartialEq, Eq)]
1349#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1350pub enum LogEnum {
1351 DiagnosticsLog,
1352 SecurityLog,
1353}
1354#[cfg(feature = "validate")]
1355impl crate::validate::Validate for LogEnum {
1356 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1357 Ok(())
1358 }
1359}
1360#[derive(Debug, Clone, PartialEq, Eq)]
1362#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1363pub enum LogStatusEnum {
1364 Accepted,
1365 Rejected,
1366 AcceptedCanceled,
1367}
1368#[cfg(feature = "validate")]
1369impl crate::validate::Validate for LogStatusEnum {
1370 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1371 Ok(())
1372 }
1373}
1374#[derive(Debug, Clone, PartialEq, Eq)]
1376#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1377pub struct Component<CustomDataType = crate::NoCustomData> {
1378 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1379 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1380 pub custom_data: Option<CustomDataType>,
1381 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1382 pub evse: Option<EVSE<CustomDataType>>,
1383 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1385 pub instance: Option<heapless::String<50usize>>,
1386 pub name: heapless::String<50usize>,
1388}
1389#[cfg(feature = "validate")]
1390impl<CustomDataType> crate::validate::Validate for Component<CustomDataType> {
1391 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1392 if let Some(value) = &self.evse {
1393 crate::validate::Validate::validate(value)
1394 .map_err(|error| error.in_field("evse"))?;
1395 }
1396 Ok(())
1397 }
1398}
1399#[derive(Debug, Clone, PartialEq, Eq)]
1401#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1402pub struct Variable<CustomDataType = crate::NoCustomData> {
1403 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1404 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1405 pub custom_data: Option<CustomDataType>,
1406 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1408 pub instance: Option<heapless::String<50usize>>,
1409 pub name: heapless::String<50usize>,
1411}
1412#[cfg(feature = "validate")]
1413impl<CustomDataType> crate::validate::Validate for Variable<CustomDataType> {
1414 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1415 Ok(())
1416 }
1417}
1418#[derive(Debug, Clone, PartialEq, Eq)]
1420#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1421pub struct ComponentVariable<CustomDataType = crate::NoCustomData> {
1422 pub component: Component<CustomDataType>,
1423 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1424 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1425 pub custom_data: Option<CustomDataType>,
1426 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1427 pub variable: Option<Variable<CustomDataType>>,
1428}
1429#[cfg(feature = "validate")]
1430impl<CustomDataType> crate::validate::Validate for ComponentVariable<CustomDataType> {
1431 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1432 crate::validate::Validate::validate(&self.component)
1433 .map_err(|error| error.in_field("component"))?;
1434 if let Some(value) = &self.variable {
1435 crate::validate::Validate::validate(value)
1436 .map_err(|error| error.in_field("variable"))?;
1437 }
1438 Ok(())
1439 }
1440}
1441#[derive(Debug, Clone, PartialEq, Eq)]
1442#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1443pub enum MonitoringCriterionEnum {
1444 ThresholdMonitoring,
1445 DeltaMonitoring,
1446 PeriodicMonitoring,
1447}
1448#[cfg(feature = "validate")]
1449impl crate::validate::Validate for MonitoringCriterionEnum {
1450 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1451 Ok(())
1452 }
1453}
1454#[derive(Debug, Clone, PartialEq, Eq)]
1455#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1456pub enum ComponentCriterionEnum {
1457 Active,
1458 Available,
1459 Enabled,
1460 Problem,
1461}
1462#[cfg(feature = "validate")]
1463impl crate::validate::Validate for ComponentCriterionEnum {
1464 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1465 Ok(())
1466 }
1467}
1468#[derive(Debug, Clone, PartialEq, Eq)]
1470#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1471pub enum AttributeEnum {
1472 Actual,
1473 Target,
1474 MinSet,
1475 MaxSet,
1476}
1477#[cfg(feature = "validate")]
1478impl crate::validate::Validate for AttributeEnum {
1479 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1480 Ok(())
1481 }
1482}
1483#[derive(Debug, Clone, PartialEq, Eq)]
1485#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1486pub struct GetVariableData<CustomDataType = crate::NoCustomData> {
1487 #[cfg_attr(feature = "serde", serde(rename = "attributeType"))]
1488 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1489 pub attribute_type: Option<AttributeEnum>,
1490 pub component: Component<CustomDataType>,
1491 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1492 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1493 pub custom_data: Option<CustomDataType>,
1494 pub variable: Variable<CustomDataType>,
1495}
1496#[cfg(feature = "validate")]
1497impl<CustomDataType> crate::validate::Validate for GetVariableData<CustomDataType> {
1498 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1499 if let Some(value) = &self.attribute_type {
1500 crate::validate::Validate::validate(value)
1501 .map_err(|error| error.in_field("attributeType"))?;
1502 }
1503 crate::validate::Validate::validate(&self.component)
1504 .map_err(|error| error.in_field("component"))?;
1505 crate::validate::Validate::validate(&self.variable)
1506 .map_err(|error| error.in_field("variable"))?;
1507 Ok(())
1508 }
1509}
1510#[derive(Debug, Clone, PartialEq, Eq)]
1512#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1513pub enum GetVariableStatusEnum {
1514 Accepted,
1515 Rejected,
1516 UnknownComponent,
1517 UnknownVariable,
1518 NotSupportedAttributeType,
1519}
1520#[cfg(feature = "validate")]
1521impl crate::validate::Validate for GetVariableStatusEnum {
1522 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1523 Ok(())
1524 }
1525}
1526#[cfg(feature = "alloc")]
1527#[derive(Debug, Clone, PartialEq, Eq)]
1529#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1530pub struct GetVariableResult<CustomDataType = crate::NoCustomData> {
1531 #[cfg_attr(feature = "serde", serde(rename = "attributeStatus"))]
1532 pub attribute_status: GetVariableStatusEnum,
1533 #[cfg_attr(feature = "serde", serde(rename = "attributeStatusInfo"))]
1534 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1535 pub attribute_status_info: Option<StatusInfo<CustomDataType>>,
1536 #[cfg_attr(feature = "serde", serde(rename = "attributeType"))]
1537 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1538 pub attribute_type: Option<AttributeEnum>,
1539 #[cfg_attr(feature = "serde", serde(rename = "attributeValue"))]
1543 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1544 pub attribute_value: Option<alloc::string::String>,
1545 pub component: Component<CustomDataType>,
1546 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1547 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1548 pub custom_data: Option<CustomDataType>,
1549 pub variable: Variable<CustomDataType>,
1550}
1551#[cfg(all(feature = "validate", feature = "alloc"))]
1552impl<CustomDataType> crate::validate::Validate for GetVariableResult<CustomDataType> {
1553 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1554 crate::validate::Validate::validate(&self.attribute_status)
1555 .map_err(|error| error.in_field("attributeStatus"))?;
1556 if let Some(value) = &self.attribute_status_info {
1557 crate::validate::Validate::validate(value)
1558 .map_err(|error| error.in_field("attributeStatusInfo"))?;
1559 }
1560 if let Some(value) = &self.attribute_type {
1561 crate::validate::Validate::validate(value)
1562 .map_err(|error| error.in_field("attributeType"))?;
1563 }
1564 if let Some(value) = &self.attribute_value {
1565 crate::validate::check_max_length(value, 2500usize)
1566 .map_err(|error| error.in_field("attributeValue"))?;
1567 }
1568 crate::validate::Validate::validate(&self.component)
1569 .map_err(|error| error.in_field("component"))?;
1570 crate::validate::Validate::validate(&self.variable)
1571 .map_err(|error| error.in_field("variable"))?;
1572 Ok(())
1573 }
1574}
1575#[cfg(not(feature = "alloc"))]
1576#[derive(Debug, Clone, PartialEq, Eq)]
1578#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1579pub struct GetVariableResult<
1580 CustomDataType = crate::NoCustomData,
1581 const GET_VARIABLE_RESULT_ATTRIBUTE_VALUE_CAP: usize = 1024usize,
1582> {
1583 #[cfg_attr(feature = "serde", serde(rename = "attributeStatus"))]
1584 pub attribute_status: GetVariableStatusEnum,
1585 #[cfg_attr(feature = "serde", serde(rename = "attributeStatusInfo"))]
1586 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1587 pub attribute_status_info: Option<StatusInfo<CustomDataType>>,
1588 #[cfg_attr(feature = "serde", serde(rename = "attributeType"))]
1589 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1590 pub attribute_type: Option<AttributeEnum>,
1591 #[cfg_attr(feature = "serde", serde(rename = "attributeValue"))]
1595 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1596 pub attribute_value: Option<
1597 heapless::String<GET_VARIABLE_RESULT_ATTRIBUTE_VALUE_CAP>,
1598 >,
1599 pub component: Component<CustomDataType>,
1600 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1601 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1602 pub custom_data: Option<CustomDataType>,
1603 pub variable: Variable<CustomDataType>,
1604}
1605#[cfg(all(feature = "validate", not(feature = "alloc")))]
1606impl<
1607 CustomDataType,
1608 const GET_VARIABLE_RESULT_ATTRIBUTE_VALUE_CAP: usize,
1609> crate::validate::Validate
1610for GetVariableResult<CustomDataType, GET_VARIABLE_RESULT_ATTRIBUTE_VALUE_CAP> {
1611 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1612 crate::validate::Validate::validate(&self.attribute_status)
1613 .map_err(|error| error.in_field("attributeStatus"))?;
1614 if let Some(value) = &self.attribute_status_info {
1615 crate::validate::Validate::validate(value)
1616 .map_err(|error| error.in_field("attributeStatusInfo"))?;
1617 }
1618 if let Some(value) = &self.attribute_type {
1619 crate::validate::Validate::validate(value)
1620 .map_err(|error| error.in_field("attributeType"))?;
1621 }
1622 if let Some(value) = &self.attribute_value {
1623 crate::validate::check_max_length(value, 2500usize)
1624 .map_err(|error| error.in_field("attributeValue"))?;
1625 }
1626 crate::validate::Validate::validate(&self.component)
1627 .map_err(|error| error.in_field("component"))?;
1628 crate::validate::Validate::validate(&self.variable)
1629 .map_err(|error| error.in_field("variable"))?;
1630 Ok(())
1631 }
1632}
1633#[derive(Debug, Clone, PartialEq, Eq)]
1635#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1636pub enum InstallCertificateUseEnum {
1637 V2GRootCertificate,
1638 MORootCertificate,
1639 CSMSRootCertificate,
1640 ManufacturerRootCertificate,
1641}
1642#[cfg(feature = "validate")]
1643impl crate::validate::Validate for InstallCertificateUseEnum {
1644 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1645 Ok(())
1646 }
1647}
1648#[derive(Debug, Clone, PartialEq, Eq)]
1650#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1651pub enum InstallCertificateStatusEnum {
1652 Accepted,
1653 Rejected,
1654 Failed,
1655}
1656#[cfg(feature = "validate")]
1657impl crate::validate::Validate for InstallCertificateStatusEnum {
1658 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1659 Ok(())
1660 }
1661}
1662#[derive(Debug, Clone, PartialEq, Eq)]
1664#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1665pub enum UploadLogStatusEnum {
1666 BadMessage,
1667 Idle,
1668 NotSupportedOperation,
1669 PermissionDenied,
1670 Uploaded,
1671 UploadFailure,
1672 Uploading,
1673 AcceptedCanceled,
1674}
1675#[cfg(feature = "validate")]
1676impl crate::validate::Validate for UploadLogStatusEnum {
1677 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1678 Ok(())
1679 }
1680}
1681#[derive(Debug, Clone, PartialEq, Eq)]
1685#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1686pub enum ReadingContextEnum {
1687 #[cfg_attr(feature = "serde", serde(rename = "Interruption.Begin"))]
1688 InterruptionBegin,
1689 #[cfg_attr(feature = "serde", serde(rename = "Interruption.End"))]
1690 InterruptionEnd,
1691 Other,
1692 #[cfg_attr(feature = "serde", serde(rename = "Sample.Clock"))]
1693 SampleClock,
1694 #[cfg_attr(feature = "serde", serde(rename = "Sample.Periodic"))]
1695 SamplePeriodic,
1696 #[cfg_attr(feature = "serde", serde(rename = "Transaction.Begin"))]
1697 TransactionBegin,
1698 #[cfg_attr(feature = "serde", serde(rename = "Transaction.End"))]
1699 TransactionEnd,
1700 Trigger,
1701}
1702#[cfg(feature = "validate")]
1703impl crate::validate::Validate for ReadingContextEnum {
1704 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1705 Ok(())
1706 }
1707}
1708#[derive(Debug, Clone, PartialEq, Eq)]
1712#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1713pub enum LocationEnum {
1714 Body,
1715 Cable,
1716 EV,
1717 Inlet,
1718 Outlet,
1719}
1720#[cfg(feature = "validate")]
1721impl crate::validate::Validate for LocationEnum {
1722 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1723 Ok(())
1724 }
1725}
1726#[derive(Debug, Clone, PartialEq, Eq)]
1730#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1731pub enum MeasurandEnum {
1732 #[cfg_attr(feature = "serde", serde(rename = "Current.Export"))]
1733 CurrentExport,
1734 #[cfg_attr(feature = "serde", serde(rename = "Current.Import"))]
1735 CurrentImport,
1736 #[cfg_attr(feature = "serde", serde(rename = "Current.Offered"))]
1737 CurrentOffered,
1738 #[cfg_attr(feature = "serde", serde(rename = "Energy.Active.Export.Register"))]
1739 EnergyActiveExportRegister,
1740 #[cfg_attr(feature = "serde", serde(rename = "Energy.Active.Import.Register"))]
1741 EnergyActiveImportRegister,
1742 #[cfg_attr(feature = "serde", serde(rename = "Energy.Reactive.Export.Register"))]
1743 EnergyReactiveExportRegister,
1744 #[cfg_attr(feature = "serde", serde(rename = "Energy.Reactive.Import.Register"))]
1745 EnergyReactiveImportRegister,
1746 #[cfg_attr(feature = "serde", serde(rename = "Energy.Active.Export.Interval"))]
1747 EnergyActiveExportInterval,
1748 #[cfg_attr(feature = "serde", serde(rename = "Energy.Active.Import.Interval"))]
1749 EnergyActiveImportInterval,
1750 #[cfg_attr(feature = "serde", serde(rename = "Energy.Active.Net"))]
1751 EnergyActiveNet,
1752 #[cfg_attr(feature = "serde", serde(rename = "Energy.Reactive.Export.Interval"))]
1753 EnergyReactiveExportInterval,
1754 #[cfg_attr(feature = "serde", serde(rename = "Energy.Reactive.Import.Interval"))]
1755 EnergyReactiveImportInterval,
1756 #[cfg_attr(feature = "serde", serde(rename = "Energy.Reactive.Net"))]
1757 EnergyReactiveNet,
1758 #[cfg_attr(feature = "serde", serde(rename = "Energy.Apparent.Net"))]
1759 EnergyApparentNet,
1760 #[cfg_attr(feature = "serde", serde(rename = "Energy.Apparent.Import"))]
1761 EnergyApparentImport,
1762 #[cfg_attr(feature = "serde", serde(rename = "Energy.Apparent.Export"))]
1763 EnergyApparentExport,
1764 Frequency,
1765 #[cfg_attr(feature = "serde", serde(rename = "Power.Active.Export"))]
1766 PowerActiveExport,
1767 #[cfg_attr(feature = "serde", serde(rename = "Power.Active.Import"))]
1768 PowerActiveImport,
1769 #[cfg_attr(feature = "serde", serde(rename = "Power.Factor"))]
1770 PowerFactor,
1771 #[cfg_attr(feature = "serde", serde(rename = "Power.Offered"))]
1772 PowerOffered,
1773 #[cfg_attr(feature = "serde", serde(rename = "Power.Reactive.Export"))]
1774 PowerReactiveExport,
1775 #[cfg_attr(feature = "serde", serde(rename = "Power.Reactive.Import"))]
1776 PowerReactiveImport,
1777 SoC,
1778 Voltage,
1779}
1780#[cfg(feature = "validate")]
1781impl crate::validate::Validate for MeasurandEnum {
1782 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1783 Ok(())
1784 }
1785}
1786#[derive(Debug, Clone, PartialEq, Eq)]
1790#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1791pub enum PhaseEnum {
1792 L1,
1793 L2,
1794 L3,
1795 N,
1796 #[cfg_attr(feature = "serde", serde(rename = "L1-N"))]
1797 L1N,
1798 #[cfg_attr(feature = "serde", serde(rename = "L2-N"))]
1799 L2N,
1800 #[cfg_attr(feature = "serde", serde(rename = "L3-N"))]
1801 L3N,
1802 #[cfg_attr(feature = "serde", serde(rename = "L1-L2"))]
1803 L1L2,
1804 #[cfg_attr(feature = "serde", serde(rename = "L2-L3"))]
1805 L2L3,
1806 #[cfg_attr(feature = "serde", serde(rename = "L3-L1"))]
1807 L3L1,
1808}
1809#[cfg(feature = "validate")]
1810impl crate::validate::Validate for PhaseEnum {
1811 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1812 Ok(())
1813 }
1814}
1815#[cfg(feature = "alloc")]
1816#[derive(Debug, Clone, PartialEq, Eq)]
1818#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1819pub struct SignedMeterValue<CustomDataType = crate::NoCustomData> {
1820 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1821 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1822 pub custom_data: Option<CustomDataType>,
1823 #[cfg_attr(feature = "serde", serde(rename = "encodingMethod"))]
1825 pub encoding_method: heapless::String<50usize>,
1826 #[cfg_attr(feature = "serde", serde(rename = "publicKey"))]
1828 pub public_key: alloc::string::String,
1829 #[cfg_attr(feature = "serde", serde(rename = "signedMeterData"))]
1831 pub signed_meter_data: alloc::string::String,
1832 #[cfg_attr(feature = "serde", serde(rename = "signingMethod"))]
1834 pub signing_method: heapless::String<50usize>,
1835}
1836#[cfg(all(feature = "validate", feature = "alloc"))]
1837impl<CustomDataType> crate::validate::Validate for SignedMeterValue<CustomDataType> {
1838 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1839 crate::validate::check_max_length(&self.public_key, 2500usize)
1840 .map_err(|error| error.in_field("publicKey"))?;
1841 crate::validate::check_max_length(&self.signed_meter_data, 2500usize)
1842 .map_err(|error| error.in_field("signedMeterData"))?;
1843 Ok(())
1844 }
1845}
1846#[cfg(not(feature = "alloc"))]
1847#[derive(Debug, Clone, PartialEq, Eq)]
1849#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1850pub struct SignedMeterValue<
1851 CustomDataType = crate::NoCustomData,
1852 const SIGNED_METER_VALUE_PUBLIC_KEY_CAP: usize = 1024usize,
1853 const SIGNED_METER_VALUE_SIGNED_METER_DATA_CAP: usize = 1024usize,
1854> {
1855 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1856 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1857 pub custom_data: Option<CustomDataType>,
1858 #[cfg_attr(feature = "serde", serde(rename = "encodingMethod"))]
1860 pub encoding_method: heapless::String<50usize>,
1861 #[cfg_attr(feature = "serde", serde(rename = "publicKey"))]
1863 pub public_key: heapless::String<SIGNED_METER_VALUE_PUBLIC_KEY_CAP>,
1864 #[cfg_attr(feature = "serde", serde(rename = "signedMeterData"))]
1866 pub signed_meter_data: heapless::String<SIGNED_METER_VALUE_SIGNED_METER_DATA_CAP>,
1867 #[cfg_attr(feature = "serde", serde(rename = "signingMethod"))]
1869 pub signing_method: heapless::String<50usize>,
1870}
1871#[cfg(all(feature = "validate", not(feature = "alloc")))]
1872impl<
1873 CustomDataType,
1874 const SIGNED_METER_VALUE_PUBLIC_KEY_CAP: usize,
1875 const SIGNED_METER_VALUE_SIGNED_METER_DATA_CAP: usize,
1876> crate::validate::Validate
1877for SignedMeterValue<
1878 CustomDataType,
1879 SIGNED_METER_VALUE_PUBLIC_KEY_CAP,
1880 SIGNED_METER_VALUE_SIGNED_METER_DATA_CAP,
1881> {
1882 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1883 crate::validate::check_max_length(&self.public_key, 2500usize)
1884 .map_err(|error| error.in_field("publicKey"))?;
1885 crate::validate::check_max_length(&self.signed_meter_data, 2500usize)
1886 .map_err(|error| error.in_field("signedMeterData"))?;
1887 Ok(())
1888 }
1889}
1890#[derive(Debug, Clone, PartialEq, Eq)]
1892#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1893pub struct UnitOfMeasure<CustomDataType = crate::NoCustomData> {
1894 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1895 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1896 pub custom_data: Option<CustomDataType>,
1897 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1899 pub multiplier: Option<i64>,
1900 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1904 pub unit: Option<heapless::String<20usize>>,
1905}
1906#[cfg(feature = "validate")]
1907impl<CustomDataType> crate::validate::Validate for UnitOfMeasure<CustomDataType> {
1908 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1909 Ok(())
1910 }
1911}
1912#[cfg(feature = "alloc")]
1913#[derive(Debug, Clone, PartialEq)]
1919#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1920pub struct SampledValue<CustomDataType = crate::NoCustomData> {
1921 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1922 pub context: Option<ReadingContextEnum>,
1923 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1924 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1925 pub custom_data: Option<CustomDataType>,
1926 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1927 pub location: Option<LocationEnum>,
1928 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1929 pub measurand: Option<MeasurandEnum>,
1930 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1931 pub phase: Option<PhaseEnum>,
1932 #[cfg_attr(feature = "serde", serde(rename = "signedMeterValue"))]
1933 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1934 pub signed_meter_value: Option<SignedMeterValue<CustomDataType>>,
1935 #[cfg_attr(feature = "serde", serde(rename = "unitOfMeasure"))]
1936 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1937 pub unit_of_measure: Option<UnitOfMeasure<CustomDataType>>,
1938 pub value: f64,
1942}
1943#[cfg(all(feature = "validate", feature = "alloc"))]
1944impl<CustomDataType> crate::validate::Validate for SampledValue<CustomDataType> {
1945 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
1946 if let Some(value) = &self.context {
1947 crate::validate::Validate::validate(value)
1948 .map_err(|error| error.in_field("context"))?;
1949 }
1950 if let Some(value) = &self.location {
1951 crate::validate::Validate::validate(value)
1952 .map_err(|error| error.in_field("location"))?;
1953 }
1954 if let Some(value) = &self.measurand {
1955 crate::validate::Validate::validate(value)
1956 .map_err(|error| error.in_field("measurand"))?;
1957 }
1958 if let Some(value) = &self.phase {
1959 crate::validate::Validate::validate(value)
1960 .map_err(|error| error.in_field("phase"))?;
1961 }
1962 if let Some(value) = &self.signed_meter_value {
1963 crate::validate::Validate::validate(value)
1964 .map_err(|error| error.in_field("signedMeterValue"))?;
1965 }
1966 if let Some(value) = &self.unit_of_measure {
1967 crate::validate::Validate::validate(value)
1968 .map_err(|error| error.in_field("unitOfMeasure"))?;
1969 }
1970 Ok(())
1971 }
1972}
1973#[cfg(not(feature = "alloc"))]
1974#[derive(Debug, Clone, PartialEq)]
1980#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1981pub struct SampledValue<
1982 CustomDataType = crate::NoCustomData,
1983 const SIGNED_METER_VALUE_PUBLIC_KEY_CAP: usize = 1024usize,
1984 const SIGNED_METER_VALUE_SIGNED_METER_DATA_CAP: usize = 1024usize,
1985> {
1986 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1987 pub context: Option<ReadingContextEnum>,
1988 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
1989 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1990 pub custom_data: Option<CustomDataType>,
1991 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1992 pub location: Option<LocationEnum>,
1993 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1994 pub measurand: Option<MeasurandEnum>,
1995 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1996 pub phase: Option<PhaseEnum>,
1997 #[cfg_attr(feature = "serde", serde(rename = "signedMeterValue"))]
1998 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
1999 pub signed_meter_value: Option<
2000 SignedMeterValue<
2001 CustomDataType,
2002 SIGNED_METER_VALUE_PUBLIC_KEY_CAP,
2003 SIGNED_METER_VALUE_SIGNED_METER_DATA_CAP,
2004 >,
2005 >,
2006 #[cfg_attr(feature = "serde", serde(rename = "unitOfMeasure"))]
2007 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2008 pub unit_of_measure: Option<UnitOfMeasure<CustomDataType>>,
2009 pub value: f64,
2013}
2014#[cfg(all(feature = "validate", not(feature = "alloc")))]
2015impl<
2016 CustomDataType,
2017 const SIGNED_METER_VALUE_PUBLIC_KEY_CAP: usize,
2018 const SIGNED_METER_VALUE_SIGNED_METER_DATA_CAP: usize,
2019> crate::validate::Validate
2020for SampledValue<
2021 CustomDataType,
2022 SIGNED_METER_VALUE_PUBLIC_KEY_CAP,
2023 SIGNED_METER_VALUE_SIGNED_METER_DATA_CAP,
2024> {
2025 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2026 if let Some(value) = &self.context {
2027 crate::validate::Validate::validate(value)
2028 .map_err(|error| error.in_field("context"))?;
2029 }
2030 if let Some(value) = &self.location {
2031 crate::validate::Validate::validate(value)
2032 .map_err(|error| error.in_field("location"))?;
2033 }
2034 if let Some(value) = &self.measurand {
2035 crate::validate::Validate::validate(value)
2036 .map_err(|error| error.in_field("measurand"))?;
2037 }
2038 if let Some(value) = &self.phase {
2039 crate::validate::Validate::validate(value)
2040 .map_err(|error| error.in_field("phase"))?;
2041 }
2042 if let Some(value) = &self.signed_meter_value {
2043 crate::validate::Validate::validate(value)
2044 .map_err(|error| error.in_field("signedMeterValue"))?;
2045 }
2046 if let Some(value) = &self.unit_of_measure {
2047 crate::validate::Validate::validate(value)
2048 .map_err(|error| error.in_field("unitOfMeasure"))?;
2049 }
2050 Ok(())
2051 }
2052}
2053#[cfg(feature = "alloc")]
2054#[derive(Debug, Clone, PartialEq)]
2058#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2059pub struct MeterValue<CustomDataType = crate::NoCustomData> {
2060 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2061 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2062 pub custom_data: Option<CustomDataType>,
2063 #[cfg_attr(feature = "serde", serde(rename = "sampledValue"))]
2064 pub sampled_value: alloc::vec::Vec<SampledValue<CustomDataType>>,
2065 pub timestamp: crate::OcppTimestamp,
2069}
2070#[cfg(all(feature = "validate", feature = "alloc"))]
2071impl<CustomDataType> crate::validate::Validate for MeterValue<CustomDataType> {
2072 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2073 crate::validate::check_min_items(self.sampled_value.len(), 1usize)
2074 .map_err(|error| error.in_field("sampledValue"))?;
2075 for (index, item) in self.sampled_value.iter().enumerate() {
2076 crate::validate::Validate::validate(item)
2077 .map_err(|error| error.in_index(index).in_field("sampledValue"))?;
2078 }
2079 Ok(())
2080 }
2081}
2082#[cfg(not(feature = "alloc"))]
2083#[derive(Debug, Clone, PartialEq)]
2087#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2088pub struct MeterValue<
2089 CustomDataType = crate::NoCustomData,
2090 const METER_VALUE_SAMPLED_VALUE_CAP: usize = 8usize,
2091 const SIGNED_METER_VALUE_PUBLIC_KEY_CAP: usize = 1024usize,
2092 const SIGNED_METER_VALUE_SIGNED_METER_DATA_CAP: usize = 1024usize,
2093> {
2094 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2095 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2096 pub custom_data: Option<CustomDataType>,
2097 #[cfg_attr(feature = "serde", serde(rename = "sampledValue"))]
2098 pub sampled_value: heapless::Vec<
2099 SampledValue<
2100 CustomDataType,
2101 SIGNED_METER_VALUE_PUBLIC_KEY_CAP,
2102 SIGNED_METER_VALUE_SIGNED_METER_DATA_CAP,
2103 >,
2104 METER_VALUE_SAMPLED_VALUE_CAP,
2105 >,
2106 pub timestamp: crate::OcppTimestamp,
2110}
2111#[cfg(all(feature = "validate", not(feature = "alloc")))]
2112impl<
2113 CustomDataType,
2114 const METER_VALUE_SAMPLED_VALUE_CAP: usize,
2115 const SIGNED_METER_VALUE_PUBLIC_KEY_CAP: usize,
2116 const SIGNED_METER_VALUE_SIGNED_METER_DATA_CAP: usize,
2117> crate::validate::Validate
2118for MeterValue<
2119 CustomDataType,
2120 METER_VALUE_SAMPLED_VALUE_CAP,
2121 SIGNED_METER_VALUE_PUBLIC_KEY_CAP,
2122 SIGNED_METER_VALUE_SIGNED_METER_DATA_CAP,
2123> {
2124 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2125 crate::validate::check_min_items(self.sampled_value.len(), 1usize)
2126 .map_err(|error| error.in_field("sampledValue"))?;
2127 for (index, item) in self.sampled_value.iter().enumerate() {
2128 crate::validate::Validate::validate(item)
2129 .map_err(|error| error.in_index(index).in_field("sampledValue"))?;
2130 }
2131 Ok(())
2132 }
2133}
2134#[derive(Debug, Clone, PartialEq, Eq)]
2137#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2138pub struct ChargingLimit<CustomDataType = crate::NoCustomData> {
2139 #[cfg_attr(feature = "serde", serde(rename = "chargingLimitSource"))]
2140 pub charging_limit_source: ChargingLimitSourceEnum,
2141 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2142 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2143 pub custom_data: Option<CustomDataType>,
2144 #[cfg_attr(feature = "serde", serde(rename = "isGridCritical"))]
2148 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2149 pub is_grid_critical: Option<bool>,
2150}
2151#[cfg(feature = "validate")]
2152impl<CustomDataType> crate::validate::Validate for ChargingLimit<CustomDataType> {
2153 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2154 crate::validate::Validate::validate(&self.charging_limit_source)
2155 .map_err(|error| error.in_field("chargingLimitSource"))?;
2156 Ok(())
2157 }
2158}
2159#[derive(Debug, Clone, PartialEq, Eq)]
2163#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2164pub enum CostKindEnum {
2165 CarbonDioxideEmission,
2166 RelativePricePercentage,
2167 RenewableGenerationPercentage,
2168}
2169#[cfg(feature = "validate")]
2170impl crate::validate::Validate for CostKindEnum {
2171 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2172 Ok(())
2173 }
2174}
2175#[derive(Debug, Clone, PartialEq, Eq)]
2178#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2179pub struct Cost<CustomDataType = crate::NoCustomData> {
2180 pub amount: i64,
2184 #[cfg_attr(feature = "serde", serde(rename = "amountMultiplier"))]
2188 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2189 pub amount_multiplier: Option<i64>,
2190 #[cfg_attr(feature = "serde", serde(rename = "costKind"))]
2191 pub cost_kind: CostKindEnum,
2192 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2193 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2194 pub custom_data: Option<CustomDataType>,
2195}
2196#[cfg(feature = "validate")]
2197impl<CustomDataType> crate::validate::Validate for Cost<CustomDataType> {
2198 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2199 crate::validate::Validate::validate(&self.cost_kind)
2200 .map_err(|error| error.in_field("costKind"))?;
2201 Ok(())
2202 }
2203}
2204#[derive(Debug, Clone, PartialEq)]
2207#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2208pub struct ConsumptionCost<CustomDataType = crate::NoCustomData> {
2209 pub cost: heapless::Vec<Cost<CustomDataType>, 3usize>,
2210 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2211 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2212 pub custom_data: Option<CustomDataType>,
2213 #[cfg_attr(feature = "serde", serde(rename = "startValue"))]
2217 pub start_value: f64,
2218}
2219#[cfg(feature = "validate")]
2220impl<CustomDataType> crate::validate::Validate for ConsumptionCost<CustomDataType> {
2221 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2222 crate::validate::check_min_items(self.cost.len(), 1usize)
2223 .map_err(|error| error.in_field("cost"))?;
2224 for (index, item) in self.cost.iter().enumerate() {
2225 crate::validate::Validate::validate(item)
2226 .map_err(|error| error.in_index(index).in_field("cost"))?;
2227 }
2228 Ok(())
2229 }
2230}
2231#[derive(Debug, Clone, PartialEq, Eq)]
2234#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2235pub struct RelativeTimeInterval<CustomDataType = crate::NoCustomData> {
2236 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2237 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2238 pub custom_data: Option<CustomDataType>,
2239 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2243 pub duration: Option<i64>,
2244 pub start: i64,
2248}
2249#[cfg(feature = "validate")]
2250impl<CustomDataType> crate::validate::Validate for RelativeTimeInterval<CustomDataType> {
2251 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2252 Ok(())
2253 }
2254}
2255#[derive(Debug, Clone, PartialEq)]
2258#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2259pub struct SalesTariffEntry<CustomDataType = crate::NoCustomData> {
2260 #[cfg_attr(feature = "serde", serde(rename = "consumptionCost"))]
2261 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2262 pub consumption_cost: Option<heapless::Vec<ConsumptionCost<CustomDataType>, 3usize>>,
2263 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2264 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2265 pub custom_data: Option<CustomDataType>,
2266 #[cfg_attr(feature = "serde", serde(rename = "ePriceLevel"))]
2270 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2271 pub e_price_level: Option<i64>,
2272 #[cfg_attr(feature = "serde", serde(rename = "relativeTimeInterval"))]
2273 pub relative_time_interval: RelativeTimeInterval<CustomDataType>,
2274}
2275#[cfg(feature = "validate")]
2276impl<CustomDataType> crate::validate::Validate for SalesTariffEntry<CustomDataType> {
2277 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2278 if let Some(value) = &self.consumption_cost {
2279 crate::validate::check_min_items(value.len(), 1usize)
2280 .map_err(|error| error.in_field("consumptionCost"))?;
2281 for (index, item) in value.iter().enumerate() {
2282 crate::validate::Validate::validate(item)
2283 .map_err(|error| error.in_index(index).in_field("consumptionCost"))?;
2284 }
2285 }
2286 if let Some(value) = self.e_price_level {
2287 crate::validate::check_min_i64(value, 0i64)
2288 .map_err(|error| error.in_field("ePriceLevel"))?;
2289 }
2290 crate::validate::Validate::validate(&self.relative_time_interval)
2291 .map_err(|error| error.in_field("relativeTimeInterval"))?;
2292 Ok(())
2293 }
2294}
2295#[cfg(feature = "alloc")]
2296#[derive(Debug, Clone, PartialEq)]
2300#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2301pub struct SalesTariff<CustomDataType = crate::NoCustomData> {
2302 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2303 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2304 pub custom_data: Option<CustomDataType>,
2305 pub id: i64,
2309 #[cfg_attr(feature = "serde", serde(rename = "numEPriceLevels"))]
2313 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2314 pub num_e_price_levels: Option<i64>,
2315 #[cfg_attr(feature = "serde", serde(rename = "salesTariffDescription"))]
2319 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2320 pub sales_tariff_description: Option<heapless::String<32usize>>,
2321 #[cfg_attr(feature = "serde", serde(rename = "salesTariffEntry"))]
2322 pub sales_tariff_entry: alloc::vec::Vec<SalesTariffEntry<CustomDataType>>,
2323}
2324#[cfg(all(feature = "validate", feature = "alloc"))]
2325impl<CustomDataType> crate::validate::Validate for SalesTariff<CustomDataType> {
2326 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2327 crate::validate::check_min_items(self.sales_tariff_entry.len(), 1usize)
2328 .map_err(|error| error.in_field("salesTariffEntry"))?;
2329 crate::validate::check_max_items(self.sales_tariff_entry.len(), 1024usize)
2330 .map_err(|error| error.in_field("salesTariffEntry"))?;
2331 for (index, item) in self.sales_tariff_entry.iter().enumerate() {
2332 crate::validate::Validate::validate(item)
2333 .map_err(|error| error.in_index(index).in_field("salesTariffEntry"))?;
2334 }
2335 Ok(())
2336 }
2337}
2338#[cfg(not(feature = "alloc"))]
2339#[derive(Debug, Clone, PartialEq)]
2343#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2344pub struct SalesTariff<
2345 CustomDataType = crate::NoCustomData,
2346 const SALES_TARIFF_SALES_TARIFF_ENTRY_CAP: usize = 8usize,
2347> {
2348 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2349 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2350 pub custom_data: Option<CustomDataType>,
2351 pub id: i64,
2355 #[cfg_attr(feature = "serde", serde(rename = "numEPriceLevels"))]
2359 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2360 pub num_e_price_levels: Option<i64>,
2361 #[cfg_attr(feature = "serde", serde(rename = "salesTariffDescription"))]
2365 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2366 pub sales_tariff_description: Option<heapless::String<32usize>>,
2367 #[cfg_attr(feature = "serde", serde(rename = "salesTariffEntry"))]
2368 pub sales_tariff_entry: heapless::Vec<
2369 SalesTariffEntry<CustomDataType>,
2370 SALES_TARIFF_SALES_TARIFF_ENTRY_CAP,
2371 >,
2372}
2373#[cfg(all(feature = "validate", not(feature = "alloc")))]
2374impl<
2375 CustomDataType,
2376 const SALES_TARIFF_SALES_TARIFF_ENTRY_CAP: usize,
2377> crate::validate::Validate
2378for SalesTariff<CustomDataType, SALES_TARIFF_SALES_TARIFF_ENTRY_CAP> {
2379 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2380 crate::validate::check_min_items(self.sales_tariff_entry.len(), 1usize)
2381 .map_err(|error| error.in_field("salesTariffEntry"))?;
2382 crate::validate::check_max_items(self.sales_tariff_entry.len(), 1024usize)
2383 .map_err(|error| error.in_field("salesTariffEntry"))?;
2384 for (index, item) in self.sales_tariff_entry.iter().enumerate() {
2385 crate::validate::Validate::validate(item)
2386 .map_err(|error| error.in_index(index).in_field("salesTariffEntry"))?;
2387 }
2388 Ok(())
2389 }
2390}
2391#[cfg(feature = "alloc")]
2392#[derive(Debug, Clone, PartialEq)]
2396#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2397pub struct ChargingSchedule<CustomDataType = crate::NoCustomData> {
2398 #[cfg_attr(feature = "serde", serde(rename = "chargingRateUnit"))]
2399 pub charging_rate_unit: ChargingRateUnitEnum,
2400 #[cfg_attr(feature = "serde", serde(rename = "chargingSchedulePeriod"))]
2401 pub charging_schedule_period: alloc::vec::Vec<
2402 ChargingSchedulePeriod<CustomDataType>,
2403 >,
2404 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2405 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2406 pub custom_data: Option<CustomDataType>,
2407 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2411 pub duration: Option<i64>,
2412 pub id: i64,
2414 #[cfg_attr(feature = "serde", serde(rename = "minChargingRate"))]
2418 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2419 pub min_charging_rate: Option<f64>,
2420 #[cfg_attr(feature = "serde", serde(rename = "salesTariff"))]
2421 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2422 pub sales_tariff: Option<SalesTariff<CustomDataType>>,
2423 #[cfg_attr(feature = "serde", serde(rename = "startSchedule"))]
2427 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2428 pub start_schedule: Option<crate::OcppTimestamp>,
2429}
2430#[cfg(all(feature = "validate", feature = "alloc"))]
2431impl<CustomDataType> crate::validate::Validate for ChargingSchedule<CustomDataType> {
2432 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2433 crate::validate::Validate::validate(&self.charging_rate_unit)
2434 .map_err(|error| error.in_field("chargingRateUnit"))?;
2435 crate::validate::check_min_items(self.charging_schedule_period.len(), 1usize)
2436 .map_err(|error| error.in_field("chargingSchedulePeriod"))?;
2437 crate::validate::check_max_items(self.charging_schedule_period.len(), 1024usize)
2438 .map_err(|error| error.in_field("chargingSchedulePeriod"))?;
2439 for (index, item) in self.charging_schedule_period.iter().enumerate() {
2440 crate::validate::Validate::validate(item)
2441 .map_err(|error| {
2442 error.in_index(index).in_field("chargingSchedulePeriod")
2443 })?;
2444 }
2445 if let Some(value) = &self.sales_tariff {
2446 crate::validate::Validate::validate(value)
2447 .map_err(|error| error.in_field("salesTariff"))?;
2448 }
2449 Ok(())
2450 }
2451}
2452#[cfg(not(feature = "alloc"))]
2453#[derive(Debug, Clone, PartialEq)]
2457#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2458pub struct ChargingSchedule<
2459 CustomDataType = crate::NoCustomData,
2460 const CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP: usize = 8usize,
2461 const SALES_TARIFF_SALES_TARIFF_ENTRY_CAP: usize = 8usize,
2462> {
2463 #[cfg_attr(feature = "serde", serde(rename = "chargingRateUnit"))]
2464 pub charging_rate_unit: ChargingRateUnitEnum,
2465 #[cfg_attr(feature = "serde", serde(rename = "chargingSchedulePeriod"))]
2466 pub charging_schedule_period: heapless::Vec<
2467 ChargingSchedulePeriod<CustomDataType>,
2468 CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP,
2469 >,
2470 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2471 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2472 pub custom_data: Option<CustomDataType>,
2473 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2477 pub duration: Option<i64>,
2478 pub id: i64,
2480 #[cfg_attr(feature = "serde", serde(rename = "minChargingRate"))]
2484 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2485 pub min_charging_rate: Option<f64>,
2486 #[cfg_attr(feature = "serde", serde(rename = "salesTariff"))]
2487 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2488 pub sales_tariff: Option<
2489 SalesTariff<CustomDataType, SALES_TARIFF_SALES_TARIFF_ENTRY_CAP>,
2490 >,
2491 #[cfg_attr(feature = "serde", serde(rename = "startSchedule"))]
2495 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2496 pub start_schedule: Option<crate::OcppTimestamp>,
2497}
2498#[cfg(all(feature = "validate", not(feature = "alloc")))]
2499impl<
2500 CustomDataType,
2501 const CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP: usize,
2502 const SALES_TARIFF_SALES_TARIFF_ENTRY_CAP: usize,
2503> crate::validate::Validate
2504for ChargingSchedule<
2505 CustomDataType,
2506 CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP,
2507 SALES_TARIFF_SALES_TARIFF_ENTRY_CAP,
2508> {
2509 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2510 crate::validate::Validate::validate(&self.charging_rate_unit)
2511 .map_err(|error| error.in_field("chargingRateUnit"))?;
2512 crate::validate::check_min_items(self.charging_schedule_period.len(), 1usize)
2513 .map_err(|error| error.in_field("chargingSchedulePeriod"))?;
2514 crate::validate::check_max_items(self.charging_schedule_period.len(), 1024usize)
2515 .map_err(|error| error.in_field("chargingSchedulePeriod"))?;
2516 for (index, item) in self.charging_schedule_period.iter().enumerate() {
2517 crate::validate::Validate::validate(item)
2518 .map_err(|error| {
2519 error.in_index(index).in_field("chargingSchedulePeriod")
2520 })?;
2521 }
2522 if let Some(value) = &self.sales_tariff {
2523 crate::validate::Validate::validate(value)
2524 .map_err(|error| error.in_field("salesTariff"))?;
2525 }
2526 Ok(())
2527 }
2528}
2529#[derive(Debug, Clone, PartialEq, Eq)]
2533#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2534pub struct MessageInfo<CustomDataType = crate::NoCustomData> {
2535 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2536 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2537 pub custom_data: Option<CustomDataType>,
2538 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2539 pub display: Option<Component<CustomDataType>>,
2540 #[cfg_attr(feature = "serde", serde(rename = "endDateTime"))]
2544 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2545 pub end_date_time: Option<crate::OcppTimestamp>,
2546 pub id: i64,
2550 pub message: MessageContent<CustomDataType>,
2551 pub priority: MessagePriorityEnum,
2552 #[cfg_attr(feature = "serde", serde(rename = "startDateTime"))]
2556 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2557 pub start_date_time: Option<crate::OcppTimestamp>,
2558 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2559 pub state: Option<MessageStateEnum>,
2560 #[cfg_attr(feature = "serde", serde(rename = "transactionId"))]
2564 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2565 pub transaction_id: Option<heapless::String<36usize>>,
2566}
2567#[cfg(feature = "validate")]
2568impl<CustomDataType> crate::validate::Validate for MessageInfo<CustomDataType> {
2569 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2570 if let Some(value) = &self.display {
2571 crate::validate::Validate::validate(value)
2572 .map_err(|error| error.in_field("display"))?;
2573 }
2574 crate::validate::Validate::validate(&self.message)
2575 .map_err(|error| error.in_field("message"))?;
2576 crate::validate::Validate::validate(&self.priority)
2577 .map_err(|error| error.in_field("priority"))?;
2578 if let Some(value) = &self.state {
2579 crate::validate::Validate::validate(value)
2580 .map_err(|error| error.in_field("state"))?;
2581 }
2582 Ok(())
2583 }
2584}
2585#[derive(Debug, Clone, PartialEq, Eq)]
2589#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2590pub struct ACChargingParameters<CustomDataType = crate::NoCustomData> {
2591 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2592 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2593 pub custom_data: Option<CustomDataType>,
2594 #[cfg_attr(feature = "serde", serde(rename = "energyAmount"))]
2598 pub energy_amount: i64,
2599 #[cfg_attr(feature = "serde", serde(rename = "evMaxCurrent"))]
2603 pub ev_max_current: i64,
2604 #[cfg_attr(feature = "serde", serde(rename = "evMaxVoltage"))]
2608 pub ev_max_voltage: i64,
2609 #[cfg_attr(feature = "serde", serde(rename = "evMinCurrent"))]
2613 pub ev_min_current: i64,
2614}
2615#[cfg(feature = "validate")]
2616impl<CustomDataType> crate::validate::Validate for ACChargingParameters<CustomDataType> {
2617 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2618 Ok(())
2619 }
2620}
2621#[derive(Debug, Clone, PartialEq, Eq)]
2625#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2626pub struct DCChargingParameters<CustomDataType = crate::NoCustomData> {
2627 #[cfg_attr(feature = "serde", serde(rename = "bulkSoC"))]
2631 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2632 pub bulk_so_c: Option<i64>,
2633 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2634 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2635 pub custom_data: Option<CustomDataType>,
2636 #[cfg_attr(feature = "serde", serde(rename = "energyAmount"))]
2640 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2641 pub energy_amount: Option<i64>,
2642 #[cfg_attr(feature = "serde", serde(rename = "evEnergyCapacity"))]
2646 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2647 pub ev_energy_capacity: Option<i64>,
2648 #[cfg_attr(feature = "serde", serde(rename = "evMaxCurrent"))]
2652 pub ev_max_current: i64,
2653 #[cfg_attr(feature = "serde", serde(rename = "evMaxPower"))]
2657 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2658 pub ev_max_power: Option<i64>,
2659 #[cfg_attr(feature = "serde", serde(rename = "evMaxVoltage"))]
2663 pub ev_max_voltage: i64,
2664 #[cfg_attr(feature = "serde", serde(rename = "fullSoC"))]
2668 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2669 pub full_so_c: Option<i64>,
2670 #[cfg_attr(feature = "serde", serde(rename = "stateOfCharge"))]
2674 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2675 pub state_of_charge: Option<i64>,
2676}
2677#[cfg(feature = "validate")]
2678impl<CustomDataType> crate::validate::Validate for DCChargingParameters<CustomDataType> {
2679 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2680 if let Some(value) = self.bulk_so_c {
2681 crate::validate::check_min_i64(value, 0i64)
2682 .map_err(|error| error.in_field("bulkSoC"))?;
2683 crate::validate::check_max_i64(value, 100i64)
2684 .map_err(|error| error.in_field("bulkSoC"))?;
2685 }
2686 if let Some(value) = self.full_so_c {
2687 crate::validate::check_min_i64(value, 0i64)
2688 .map_err(|error| error.in_field("fullSoC"))?;
2689 crate::validate::check_max_i64(value, 100i64)
2690 .map_err(|error| error.in_field("fullSoC"))?;
2691 }
2692 if let Some(value) = self.state_of_charge {
2693 crate::validate::check_min_i64(value, 0i64)
2694 .map_err(|error| error.in_field("stateOfCharge"))?;
2695 crate::validate::check_max_i64(value, 100i64)
2696 .map_err(|error| error.in_field("stateOfCharge"))?;
2697 }
2698 Ok(())
2699 }
2700}
2701#[derive(Debug, Clone, PartialEq, Eq)]
2705#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2706pub enum EnergyTransferModeEnum {
2707 DC,
2708 #[cfg_attr(feature = "serde", serde(rename = "AC_single_phase"))]
2709 ACsinglephase,
2710 #[cfg_attr(feature = "serde", serde(rename = "AC_two_phase"))]
2711 ACtwophase,
2712 #[cfg_attr(feature = "serde", serde(rename = "AC_three_phase"))]
2713 ACthreephase,
2714}
2715#[cfg(feature = "validate")]
2716impl crate::validate::Validate for EnergyTransferModeEnum {
2717 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2718 Ok(())
2719 }
2720}
2721#[derive(Debug, Clone, PartialEq, Eq)]
2724#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2725pub struct ChargingNeeds<CustomDataType = crate::NoCustomData> {
2726 #[cfg_attr(feature = "serde", serde(rename = "acChargingParameters"))]
2727 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2728 pub ac_charging_parameters: Option<ACChargingParameters<CustomDataType>>,
2729 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2730 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2731 pub custom_data: Option<CustomDataType>,
2732 #[cfg_attr(feature = "serde", serde(rename = "dcChargingParameters"))]
2733 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2734 pub dc_charging_parameters: Option<DCChargingParameters<CustomDataType>>,
2735 #[cfg_attr(feature = "serde", serde(rename = "departureTime"))]
2739 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2740 pub departure_time: Option<crate::OcppTimestamp>,
2741 #[cfg_attr(feature = "serde", serde(rename = "requestedEnergyTransfer"))]
2742 pub requested_energy_transfer: EnergyTransferModeEnum,
2743}
2744#[cfg(feature = "validate")]
2745impl<CustomDataType> crate::validate::Validate for ChargingNeeds<CustomDataType> {
2746 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2747 if let Some(value) = &self.ac_charging_parameters {
2748 crate::validate::Validate::validate(value)
2749 .map_err(|error| error.in_field("acChargingParameters"))?;
2750 }
2751 if let Some(value) = &self.dc_charging_parameters {
2752 crate::validate::Validate::validate(value)
2753 .map_err(|error| error.in_field("dcChargingParameters"))?;
2754 }
2755 crate::validate::Validate::validate(&self.requested_energy_transfer)
2756 .map_err(|error| error.in_field("requestedEnergyTransfer"))?;
2757 Ok(())
2758 }
2759}
2760#[derive(Debug, Clone, PartialEq, Eq)]
2762#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2763pub enum NotifyEVChargingNeedsStatusEnum {
2764 Accepted,
2765 Rejected,
2766 Processing,
2767}
2768#[cfg(feature = "validate")]
2769impl crate::validate::Validate for NotifyEVChargingNeedsStatusEnum {
2770 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2771 Ok(())
2772 }
2773}
2774#[derive(Debug, Clone, PartialEq, Eq)]
2776#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2777pub enum EventNotificationEnum {
2778 HardWiredNotification,
2779 HardWiredMonitor,
2780 PreconfiguredMonitor,
2781 CustomMonitor,
2782}
2783#[cfg(feature = "validate")]
2784impl crate::validate::Validate for EventNotificationEnum {
2785 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2786 Ok(())
2787 }
2788}
2789#[derive(Debug, Clone, PartialEq, Eq)]
2791#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2792pub enum EventTriggerEnum {
2793 Alerting,
2794 Delta,
2795 Periodic,
2796}
2797#[cfg(feature = "validate")]
2798impl crate::validate::Validate for EventTriggerEnum {
2799 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2800 Ok(())
2801 }
2802}
2803#[cfg(feature = "alloc")]
2804#[derive(Debug, Clone, PartialEq, Eq)]
2806#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2807pub struct EventData<CustomDataType = crate::NoCustomData> {
2808 #[cfg_attr(feature = "serde", serde(rename = "actualValue"))]
2812 pub actual_value: alloc::string::String,
2813 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2815 pub cause: Option<i64>,
2816 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2818 pub cleared: Option<bool>,
2819 pub component: Component<CustomDataType>,
2820 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2821 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2822 pub custom_data: Option<CustomDataType>,
2823 #[cfg_attr(feature = "serde", serde(rename = "eventId"))]
2825 pub event_id: i64,
2826 #[cfg_attr(feature = "serde", serde(rename = "eventNotificationType"))]
2827 pub event_notification_type: EventNotificationEnum,
2828 #[cfg_attr(feature = "serde", serde(rename = "techCode"))]
2830 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2831 pub tech_code: Option<heapless::String<50usize>>,
2832 #[cfg_attr(feature = "serde", serde(rename = "techInfo"))]
2834 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2835 pub tech_info: Option<heapless::String<500usize>>,
2836 pub timestamp: crate::OcppTimestamp,
2838 #[cfg_attr(feature = "serde", serde(rename = "transactionId"))]
2840 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2841 pub transaction_id: Option<heapless::String<36usize>>,
2842 pub trigger: EventTriggerEnum,
2843 pub variable: Variable<CustomDataType>,
2844 #[cfg_attr(feature = "serde", serde(rename = "variableMonitoringId"))]
2846 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2847 pub variable_monitoring_id: Option<i64>,
2848}
2849#[cfg(all(feature = "validate", feature = "alloc"))]
2850impl<CustomDataType> crate::validate::Validate for EventData<CustomDataType> {
2851 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2852 crate::validate::check_max_length(&self.actual_value, 2500usize)
2853 .map_err(|error| error.in_field("actualValue"))?;
2854 crate::validate::Validate::validate(&self.component)
2855 .map_err(|error| error.in_field("component"))?;
2856 crate::validate::Validate::validate(&self.event_notification_type)
2857 .map_err(|error| error.in_field("eventNotificationType"))?;
2858 crate::validate::Validate::validate(&self.trigger)
2859 .map_err(|error| error.in_field("trigger"))?;
2860 crate::validate::Validate::validate(&self.variable)
2861 .map_err(|error| error.in_field("variable"))?;
2862 Ok(())
2863 }
2864}
2865#[cfg(not(feature = "alloc"))]
2866#[derive(Debug, Clone, PartialEq, Eq)]
2868#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2869pub struct EventData<
2870 CustomDataType = crate::NoCustomData,
2871 const EVENT_DATA_ACTUAL_VALUE_CAP: usize = 1024usize,
2872> {
2873 #[cfg_attr(feature = "serde", serde(rename = "actualValue"))]
2877 pub actual_value: heapless::String<EVENT_DATA_ACTUAL_VALUE_CAP>,
2878 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2880 pub cause: Option<i64>,
2881 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2883 pub cleared: Option<bool>,
2884 pub component: Component<CustomDataType>,
2885 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2886 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2887 pub custom_data: Option<CustomDataType>,
2888 #[cfg_attr(feature = "serde", serde(rename = "eventId"))]
2890 pub event_id: i64,
2891 #[cfg_attr(feature = "serde", serde(rename = "eventNotificationType"))]
2892 pub event_notification_type: EventNotificationEnum,
2893 #[cfg_attr(feature = "serde", serde(rename = "techCode"))]
2895 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2896 pub tech_code: Option<heapless::String<50usize>>,
2897 #[cfg_attr(feature = "serde", serde(rename = "techInfo"))]
2899 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2900 pub tech_info: Option<heapless::String<500usize>>,
2901 pub timestamp: crate::OcppTimestamp,
2903 #[cfg_attr(feature = "serde", serde(rename = "transactionId"))]
2905 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2906 pub transaction_id: Option<heapless::String<36usize>>,
2907 pub trigger: EventTriggerEnum,
2908 pub variable: Variable<CustomDataType>,
2909 #[cfg_attr(feature = "serde", serde(rename = "variableMonitoringId"))]
2911 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2912 pub variable_monitoring_id: Option<i64>,
2913}
2914#[cfg(all(feature = "validate", not(feature = "alloc")))]
2915impl<CustomDataType, const EVENT_DATA_ACTUAL_VALUE_CAP: usize> crate::validate::Validate
2916for EventData<CustomDataType, EVENT_DATA_ACTUAL_VALUE_CAP> {
2917 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2918 crate::validate::check_max_length(&self.actual_value, 2500usize)
2919 .map_err(|error| error.in_field("actualValue"))?;
2920 crate::validate::Validate::validate(&self.component)
2921 .map_err(|error| error.in_field("component"))?;
2922 crate::validate::Validate::validate(&self.event_notification_type)
2923 .map_err(|error| error.in_field("eventNotificationType"))?;
2924 crate::validate::Validate::validate(&self.trigger)
2925 .map_err(|error| error.in_field("trigger"))?;
2926 crate::validate::Validate::validate(&self.variable)
2927 .map_err(|error| error.in_field("variable"))?;
2928 Ok(())
2929 }
2930}
2931#[derive(Debug, Clone, PartialEq, Eq)]
2933#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2934pub enum MonitorEnum {
2935 UpperThreshold,
2936 LowerThreshold,
2937 Delta,
2938 Periodic,
2939 PeriodicClockAligned,
2940}
2941#[cfg(feature = "validate")]
2942impl crate::validate::Validate for MonitorEnum {
2943 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2944 Ok(())
2945 }
2946}
2947#[derive(Debug, Clone, PartialEq)]
2949#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2950pub struct VariableMonitoring<CustomDataType = crate::NoCustomData> {
2951 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
2952 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
2953 pub custom_data: Option<CustomDataType>,
2954 pub id: i64,
2956 pub severity: i64,
2980 pub transaction: bool,
2982 pub r#type: MonitorEnum,
2983 pub value: f64,
2986}
2987#[cfg(feature = "validate")]
2988impl<CustomDataType> crate::validate::Validate for VariableMonitoring<CustomDataType> {
2989 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
2990 crate::validate::Validate::validate(&self.r#type)
2991 .map_err(|error| error.in_field("type"))?;
2992 Ok(())
2993 }
2994}
2995#[cfg(feature = "alloc")]
2996#[derive(Debug, Clone, PartialEq)]
2998#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2999pub struct MonitoringData<CustomDataType = crate::NoCustomData> {
3000 pub component: Component<CustomDataType>,
3001 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3002 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3003 pub custom_data: Option<CustomDataType>,
3004 pub variable: Variable<CustomDataType>,
3005 #[cfg_attr(feature = "serde", serde(rename = "variableMonitoring"))]
3006 pub variable_monitoring: alloc::vec::Vec<VariableMonitoring<CustomDataType>>,
3007}
3008#[cfg(all(feature = "validate", feature = "alloc"))]
3009impl<CustomDataType> crate::validate::Validate for MonitoringData<CustomDataType> {
3010 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3011 crate::validate::Validate::validate(&self.component)
3012 .map_err(|error| error.in_field("component"))?;
3013 crate::validate::Validate::validate(&self.variable)
3014 .map_err(|error| error.in_field("variable"))?;
3015 crate::validate::check_min_items(self.variable_monitoring.len(), 1usize)
3016 .map_err(|error| error.in_field("variableMonitoring"))?;
3017 for (index, item) in self.variable_monitoring.iter().enumerate() {
3018 crate::validate::Validate::validate(item)
3019 .map_err(|error| error.in_index(index).in_field("variableMonitoring"))?;
3020 }
3021 Ok(())
3022 }
3023}
3024#[cfg(not(feature = "alloc"))]
3025#[derive(Debug, Clone, PartialEq)]
3027#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3028pub struct MonitoringData<
3029 CustomDataType = crate::NoCustomData,
3030 const MONITORING_DATA_VARIABLE_MONITORING_CAP: usize = 8usize,
3031> {
3032 pub component: Component<CustomDataType>,
3033 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3034 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3035 pub custom_data: Option<CustomDataType>,
3036 pub variable: Variable<CustomDataType>,
3037 #[cfg_attr(feature = "serde", serde(rename = "variableMonitoring"))]
3038 pub variable_monitoring: heapless::Vec<
3039 VariableMonitoring<CustomDataType>,
3040 MONITORING_DATA_VARIABLE_MONITORING_CAP,
3041 >,
3042}
3043#[cfg(all(feature = "validate", not(feature = "alloc")))]
3044impl<
3045 CustomDataType,
3046 const MONITORING_DATA_VARIABLE_MONITORING_CAP: usize,
3047> crate::validate::Validate
3048for MonitoringData<CustomDataType, MONITORING_DATA_VARIABLE_MONITORING_CAP> {
3049 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3050 crate::validate::Validate::validate(&self.component)
3051 .map_err(|error| error.in_field("component"))?;
3052 crate::validate::Validate::validate(&self.variable)
3053 .map_err(|error| error.in_field("variable"))?;
3054 crate::validate::check_min_items(self.variable_monitoring.len(), 1usize)
3055 .map_err(|error| error.in_field("variableMonitoring"))?;
3056 for (index, item) in self.variable_monitoring.iter().enumerate() {
3057 crate::validate::Validate::validate(item)
3058 .map_err(|error| error.in_index(index).in_field("variableMonitoring"))?;
3059 }
3060 Ok(())
3061 }
3062}
3063#[derive(Debug, Clone, PartialEq, Eq)]
3065#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3066pub enum MutabilityEnum {
3067 ReadOnly,
3068 WriteOnly,
3069 ReadWrite,
3070}
3071#[cfg(feature = "validate")]
3072impl crate::validate::Validate for MutabilityEnum {
3073 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3074 Ok(())
3075 }
3076}
3077#[cfg(feature = "alloc")]
3078#[derive(Debug, Clone, PartialEq, Eq)]
3080#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3081pub struct VariableAttribute<CustomDataType = crate::NoCustomData> {
3082 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3084 pub constant: Option<bool>,
3085 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3086 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3087 pub custom_data: Option<CustomDataType>,
3088 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3089 pub mutability: Option<MutabilityEnum>,
3090 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3092 pub persistent: Option<bool>,
3093 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3094 pub r#type: Option<AttributeEnum>,
3095 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3099 pub value: Option<alloc::string::String>,
3100}
3101#[cfg(all(feature = "validate", feature = "alloc"))]
3102impl<CustomDataType> crate::validate::Validate for VariableAttribute<CustomDataType> {
3103 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3104 if let Some(value) = &self.mutability {
3105 crate::validate::Validate::validate(value)
3106 .map_err(|error| error.in_field("mutability"))?;
3107 }
3108 if let Some(value) = &self.r#type {
3109 crate::validate::Validate::validate(value)
3110 .map_err(|error| error.in_field("type"))?;
3111 }
3112 if let Some(value) = &self.value {
3113 crate::validate::check_max_length(value, 2500usize)
3114 .map_err(|error| error.in_field("value"))?;
3115 }
3116 Ok(())
3117 }
3118}
3119#[cfg(not(feature = "alloc"))]
3120#[derive(Debug, Clone, PartialEq, Eq)]
3122#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3123pub struct VariableAttribute<
3124 CustomDataType = crate::NoCustomData,
3125 const VARIABLE_ATTRIBUTE_VALUE_CAP: usize = 1024usize,
3126> {
3127 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3129 pub constant: Option<bool>,
3130 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3131 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3132 pub custom_data: Option<CustomDataType>,
3133 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3134 pub mutability: Option<MutabilityEnum>,
3135 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3137 pub persistent: Option<bool>,
3138 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3139 pub r#type: Option<AttributeEnum>,
3140 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3144 pub value: Option<heapless::String<VARIABLE_ATTRIBUTE_VALUE_CAP>>,
3145}
3146#[cfg(all(feature = "validate", not(feature = "alloc")))]
3147impl<CustomDataType, const VARIABLE_ATTRIBUTE_VALUE_CAP: usize> crate::validate::Validate
3148for VariableAttribute<CustomDataType, VARIABLE_ATTRIBUTE_VALUE_CAP> {
3149 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3150 if let Some(value) = &self.mutability {
3151 crate::validate::Validate::validate(value)
3152 .map_err(|error| error.in_field("mutability"))?;
3153 }
3154 if let Some(value) = &self.r#type {
3155 crate::validate::Validate::validate(value)
3156 .map_err(|error| error.in_field("type"))?;
3157 }
3158 if let Some(value) = &self.value {
3159 crate::validate::check_max_length(value, 2500usize)
3160 .map_err(|error| error.in_field("value"))?;
3161 }
3162 Ok(())
3163 }
3164}
3165#[derive(Debug, Clone, PartialEq, Eq)]
3167#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3168pub enum DataEnum {
3169 #[cfg_attr(feature = "serde", serde(rename = "string"))]
3170 String,
3171 #[cfg_attr(feature = "serde", serde(rename = "decimal"))]
3172 Decimal,
3173 #[cfg_attr(feature = "serde", serde(rename = "integer"))]
3174 Integer,
3175 #[cfg_attr(feature = "serde", serde(rename = "dateTime"))]
3176 DateTime,
3177 #[cfg_attr(feature = "serde", serde(rename = "boolean"))]
3178 Boolean,
3179 OptionList,
3180 SequenceList,
3181 MemberList,
3182}
3183#[cfg(feature = "validate")]
3184impl crate::validate::Validate for DataEnum {
3185 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3186 Ok(())
3187 }
3188}
3189#[cfg(feature = "alloc")]
3190#[derive(Debug, Clone, PartialEq)]
3192#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3193pub struct VariableCharacteristics<CustomDataType = crate::NoCustomData> {
3194 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3195 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3196 pub custom_data: Option<CustomDataType>,
3197 #[cfg_attr(feature = "serde", serde(rename = "dataType"))]
3198 pub data_type: DataEnum,
3199 #[cfg_attr(feature = "serde", serde(rename = "maxLimit"))]
3201 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3202 pub max_limit: Option<f64>,
3203 #[cfg_attr(feature = "serde", serde(rename = "minLimit"))]
3205 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3206 pub min_limit: Option<f64>,
3207 #[cfg_attr(feature = "serde", serde(rename = "supportsMonitoring"))]
3209 pub supports_monitoring: bool,
3210 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3212 pub unit: Option<heapless::String<16usize>>,
3213 #[cfg_attr(feature = "serde", serde(rename = "valuesList"))]
3225 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3226 pub values_list: Option<alloc::string::String>,
3227}
3228#[cfg(all(feature = "validate", feature = "alloc"))]
3229impl<CustomDataType> crate::validate::Validate
3230for VariableCharacteristics<CustomDataType> {
3231 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3232 crate::validate::Validate::validate(&self.data_type)
3233 .map_err(|error| error.in_field("dataType"))?;
3234 if let Some(value) = &self.values_list {
3235 crate::validate::check_max_length(value, 1000usize)
3236 .map_err(|error| error.in_field("valuesList"))?;
3237 }
3238 Ok(())
3239 }
3240}
3241#[cfg(not(feature = "alloc"))]
3242#[derive(Debug, Clone, PartialEq)]
3244#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3245pub struct VariableCharacteristics<
3246 CustomDataType = crate::NoCustomData,
3247 const VARIABLE_CHARACTERISTICS_VALUES_LIST_CAP: usize = 1000usize,
3248> {
3249 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3250 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3251 pub custom_data: Option<CustomDataType>,
3252 #[cfg_attr(feature = "serde", serde(rename = "dataType"))]
3253 pub data_type: DataEnum,
3254 #[cfg_attr(feature = "serde", serde(rename = "maxLimit"))]
3256 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3257 pub max_limit: Option<f64>,
3258 #[cfg_attr(feature = "serde", serde(rename = "minLimit"))]
3260 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3261 pub min_limit: Option<f64>,
3262 #[cfg_attr(feature = "serde", serde(rename = "supportsMonitoring"))]
3264 pub supports_monitoring: bool,
3265 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3267 pub unit: Option<heapless::String<16usize>>,
3268 #[cfg_attr(feature = "serde", serde(rename = "valuesList"))]
3280 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3281 pub values_list: Option<heapless::String<VARIABLE_CHARACTERISTICS_VALUES_LIST_CAP>>,
3282}
3283#[cfg(all(feature = "validate", not(feature = "alloc")))]
3284impl<
3285 CustomDataType,
3286 const VARIABLE_CHARACTERISTICS_VALUES_LIST_CAP: usize,
3287> crate::validate::Validate
3288for VariableCharacteristics<CustomDataType, VARIABLE_CHARACTERISTICS_VALUES_LIST_CAP> {
3289 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3290 crate::validate::Validate::validate(&self.data_type)
3291 .map_err(|error| error.in_field("dataType"))?;
3292 if let Some(value) = &self.values_list {
3293 crate::validate::check_max_length(value, 1000usize)
3294 .map_err(|error| error.in_field("valuesList"))?;
3295 }
3296 Ok(())
3297 }
3298}
3299#[cfg(feature = "alloc")]
3300#[derive(Debug, Clone, PartialEq)]
3302#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3303pub struct ReportData<CustomDataType = crate::NoCustomData> {
3304 pub component: Component<CustomDataType>,
3305 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3306 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3307 pub custom_data: Option<CustomDataType>,
3308 pub variable: Variable<CustomDataType>,
3309 #[cfg_attr(feature = "serde", serde(rename = "variableAttribute"))]
3310 pub variable_attribute: heapless::Vec<VariableAttribute<CustomDataType>, 4usize>,
3311 #[cfg_attr(feature = "serde", serde(rename = "variableCharacteristics"))]
3312 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3313 pub variable_characteristics: Option<VariableCharacteristics<CustomDataType>>,
3314}
3315#[cfg(all(feature = "validate", feature = "alloc"))]
3316impl<CustomDataType> crate::validate::Validate for ReportData<CustomDataType> {
3317 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3318 crate::validate::Validate::validate(&self.component)
3319 .map_err(|error| error.in_field("component"))?;
3320 crate::validate::Validate::validate(&self.variable)
3321 .map_err(|error| error.in_field("variable"))?;
3322 crate::validate::check_min_items(self.variable_attribute.len(), 1usize)
3323 .map_err(|error| error.in_field("variableAttribute"))?;
3324 for (index, item) in self.variable_attribute.iter().enumerate() {
3325 crate::validate::Validate::validate(item)
3326 .map_err(|error| error.in_index(index).in_field("variableAttribute"))?;
3327 }
3328 if let Some(value) = &self.variable_characteristics {
3329 crate::validate::Validate::validate(value)
3330 .map_err(|error| error.in_field("variableCharacteristics"))?;
3331 }
3332 Ok(())
3333 }
3334}
3335#[cfg(not(feature = "alloc"))]
3336#[derive(Debug, Clone, PartialEq)]
3338#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3339pub struct ReportData<
3340 CustomDataType = crate::NoCustomData,
3341 const VARIABLE_ATTRIBUTE_VALUE_CAP: usize = 1024usize,
3342 const VARIABLE_CHARACTERISTICS_VALUES_LIST_CAP: usize = 1000usize,
3343> {
3344 pub component: Component<CustomDataType>,
3345 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3346 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3347 pub custom_data: Option<CustomDataType>,
3348 pub variable: Variable<CustomDataType>,
3349 #[cfg_attr(feature = "serde", serde(rename = "variableAttribute"))]
3350 pub variable_attribute: heapless::Vec<
3351 VariableAttribute<CustomDataType, VARIABLE_ATTRIBUTE_VALUE_CAP>,
3352 4usize,
3353 >,
3354 #[cfg_attr(feature = "serde", serde(rename = "variableCharacteristics"))]
3355 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3356 pub variable_characteristics: Option<
3357 VariableCharacteristics<CustomDataType, VARIABLE_CHARACTERISTICS_VALUES_LIST_CAP>,
3358 >,
3359}
3360#[cfg(all(feature = "validate", not(feature = "alloc")))]
3361impl<
3362 CustomDataType,
3363 const VARIABLE_ATTRIBUTE_VALUE_CAP: usize,
3364 const VARIABLE_CHARACTERISTICS_VALUES_LIST_CAP: usize,
3365> crate::validate::Validate
3366for ReportData<
3367 CustomDataType,
3368 VARIABLE_ATTRIBUTE_VALUE_CAP,
3369 VARIABLE_CHARACTERISTICS_VALUES_LIST_CAP,
3370> {
3371 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3372 crate::validate::Validate::validate(&self.component)
3373 .map_err(|error| error.in_field("component"))?;
3374 crate::validate::Validate::validate(&self.variable)
3375 .map_err(|error| error.in_field("variable"))?;
3376 crate::validate::check_min_items(self.variable_attribute.len(), 1usize)
3377 .map_err(|error| error.in_field("variableAttribute"))?;
3378 for (index, item) in self.variable_attribute.iter().enumerate() {
3379 crate::validate::Validate::validate(item)
3380 .map_err(|error| error.in_index(index).in_field("variableAttribute"))?;
3381 }
3382 if let Some(value) = &self.variable_characteristics {
3383 crate::validate::Validate::validate(value)
3384 .map_err(|error| error.in_field("variableCharacteristics"))?;
3385 }
3386 Ok(())
3387 }
3388}
3389#[derive(Debug, Clone, PartialEq, Eq)]
3392#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3393pub enum PublishFirmwareStatusEnum {
3394 Idle,
3395 DownloadScheduled,
3396 Downloading,
3397 Downloaded,
3398 Published,
3399 DownloadFailed,
3400 DownloadPaused,
3401 InvalidChecksum,
3402 ChecksumVerified,
3403 PublishFailed,
3404}
3405#[cfg(feature = "validate")]
3406impl crate::validate::Validate for PublishFirmwareStatusEnum {
3407 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3408 Ok(())
3409 }
3410}
3411#[derive(Debug, Clone, PartialEq, Eq)]
3415#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3416pub enum ChargingProfileKindEnum {
3417 Absolute,
3418 Recurring,
3419 Relative,
3420}
3421#[cfg(feature = "validate")]
3422impl crate::validate::Validate for ChargingProfileKindEnum {
3423 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3424 Ok(())
3425 }
3426}
3427#[derive(Debug, Clone, PartialEq, Eq)]
3431#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3432pub enum RecurrencyKindEnum {
3433 Daily,
3434 Weekly,
3435}
3436#[cfg(feature = "validate")]
3437impl crate::validate::Validate for RecurrencyKindEnum {
3438 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3439 Ok(())
3440 }
3441}
3442#[cfg(feature = "alloc")]
3443#[derive(Debug, Clone, PartialEq)]
3447#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3448pub struct ChargingProfile<CustomDataType = crate::NoCustomData> {
3449 #[cfg_attr(feature = "serde", serde(rename = "chargingProfileKind"))]
3450 pub charging_profile_kind: ChargingProfileKindEnum,
3451 #[cfg_attr(feature = "serde", serde(rename = "chargingProfilePurpose"))]
3452 pub charging_profile_purpose: ChargingProfilePurposeEnum,
3453 #[cfg_attr(feature = "serde", serde(rename = "chargingSchedule"))]
3454 pub charging_schedule: heapless::Vec<ChargingSchedule<CustomDataType>, 3usize>,
3455 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3456 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3457 pub custom_data: Option<CustomDataType>,
3458 pub id: i64,
3462 #[cfg_attr(feature = "serde", serde(rename = "recurrencyKind"))]
3463 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3464 pub recurrency_kind: Option<RecurrencyKindEnum>,
3465 #[cfg_attr(feature = "serde", serde(rename = "stackLevel"))]
3469 pub stack_level: i64,
3470 #[cfg_attr(feature = "serde", serde(rename = "transactionId"))]
3472 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3473 pub transaction_id: Option<heapless::String<36usize>>,
3474 #[cfg_attr(feature = "serde", serde(rename = "validFrom"))]
3478 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3479 pub valid_from: Option<crate::OcppTimestamp>,
3480 #[cfg_attr(feature = "serde", serde(rename = "validTo"))]
3484 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3485 pub valid_to: Option<crate::OcppTimestamp>,
3486}
3487#[cfg(all(feature = "validate", feature = "alloc"))]
3488impl<CustomDataType> crate::validate::Validate for ChargingProfile<CustomDataType> {
3489 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3490 crate::validate::Validate::validate(&self.charging_profile_kind)
3491 .map_err(|error| error.in_field("chargingProfileKind"))?;
3492 crate::validate::Validate::validate(&self.charging_profile_purpose)
3493 .map_err(|error| error.in_field("chargingProfilePurpose"))?;
3494 crate::validate::check_min_items(self.charging_schedule.len(), 1usize)
3495 .map_err(|error| error.in_field("chargingSchedule"))?;
3496 for (index, item) in self.charging_schedule.iter().enumerate() {
3497 crate::validate::Validate::validate(item)
3498 .map_err(|error| error.in_index(index).in_field("chargingSchedule"))?;
3499 }
3500 if let Some(value) = &self.recurrency_kind {
3501 crate::validate::Validate::validate(value)
3502 .map_err(|error| error.in_field("recurrencyKind"))?;
3503 }
3504 Ok(())
3505 }
3506}
3507#[cfg(not(feature = "alloc"))]
3508#[derive(Debug, Clone, PartialEq)]
3512#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3513pub struct ChargingProfile<
3514 CustomDataType = crate::NoCustomData,
3515 const CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP: usize = 8usize,
3516 const SALES_TARIFF_SALES_TARIFF_ENTRY_CAP: usize = 8usize,
3517> {
3518 #[cfg_attr(feature = "serde", serde(rename = "chargingProfileKind"))]
3519 pub charging_profile_kind: ChargingProfileKindEnum,
3520 #[cfg_attr(feature = "serde", serde(rename = "chargingProfilePurpose"))]
3521 pub charging_profile_purpose: ChargingProfilePurposeEnum,
3522 #[cfg_attr(feature = "serde", serde(rename = "chargingSchedule"))]
3523 pub charging_schedule: heapless::Vec<
3524 ChargingSchedule<
3525 CustomDataType,
3526 CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP,
3527 SALES_TARIFF_SALES_TARIFF_ENTRY_CAP,
3528 >,
3529 3usize,
3530 >,
3531 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3532 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3533 pub custom_data: Option<CustomDataType>,
3534 pub id: i64,
3538 #[cfg_attr(feature = "serde", serde(rename = "recurrencyKind"))]
3539 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3540 pub recurrency_kind: Option<RecurrencyKindEnum>,
3541 #[cfg_attr(feature = "serde", serde(rename = "stackLevel"))]
3545 pub stack_level: i64,
3546 #[cfg_attr(feature = "serde", serde(rename = "transactionId"))]
3548 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3549 pub transaction_id: Option<heapless::String<36usize>>,
3550 #[cfg_attr(feature = "serde", serde(rename = "validFrom"))]
3554 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3555 pub valid_from: Option<crate::OcppTimestamp>,
3556 #[cfg_attr(feature = "serde", serde(rename = "validTo"))]
3560 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3561 pub valid_to: Option<crate::OcppTimestamp>,
3562}
3563#[cfg(all(feature = "validate", not(feature = "alloc")))]
3564impl<
3565 CustomDataType,
3566 const CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP: usize,
3567 const SALES_TARIFF_SALES_TARIFF_ENTRY_CAP: usize,
3568> crate::validate::Validate
3569for ChargingProfile<
3570 CustomDataType,
3571 CHARGING_SCHEDULE_CHARGING_SCHEDULE_PERIOD_CAP,
3572 SALES_TARIFF_SALES_TARIFF_ENTRY_CAP,
3573> {
3574 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3575 crate::validate::Validate::validate(&self.charging_profile_kind)
3576 .map_err(|error| error.in_field("chargingProfileKind"))?;
3577 crate::validate::Validate::validate(&self.charging_profile_purpose)
3578 .map_err(|error| error.in_field("chargingProfilePurpose"))?;
3579 crate::validate::check_min_items(self.charging_schedule.len(), 1usize)
3580 .map_err(|error| error.in_field("chargingSchedule"))?;
3581 for (index, item) in self.charging_schedule.iter().enumerate() {
3582 crate::validate::Validate::validate(item)
3583 .map_err(|error| error.in_index(index).in_field("chargingSchedule"))?;
3584 }
3585 if let Some(value) = &self.recurrency_kind {
3586 crate::validate::Validate::validate(value)
3587 .map_err(|error| error.in_field("recurrencyKind"))?;
3588 }
3589 Ok(())
3590 }
3591}
3592#[derive(Debug, Clone, PartialEq, Eq)]
3594#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3595pub enum RequestStartStopStatusEnum {
3596 Accepted,
3597 Rejected,
3598}
3599#[cfg(feature = "validate")]
3600impl crate::validate::Validate for RequestStartStopStatusEnum {
3601 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3602 Ok(())
3603 }
3604}
3605#[derive(Debug, Clone, PartialEq, Eq)]
3607#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3608pub enum ReservationUpdateStatusEnum {
3609 Expired,
3610 Removed,
3611}
3612#[cfg(feature = "validate")]
3613impl crate::validate::Validate for ReservationUpdateStatusEnum {
3614 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3615 Ok(())
3616 }
3617}
3618#[derive(Debug, Clone, PartialEq, Eq)]
3620#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3621pub enum ConnectorEnum {
3622 #[cfg_attr(feature = "serde", serde(rename = "cCCS1"))]
3623 CCCS1,
3624 #[cfg_attr(feature = "serde", serde(rename = "cCCS2"))]
3625 CCCS2,
3626 #[cfg_attr(feature = "serde", serde(rename = "cG105"))]
3627 CG105,
3628 #[cfg_attr(feature = "serde", serde(rename = "cTesla"))]
3629 CTesla,
3630 #[cfg_attr(feature = "serde", serde(rename = "cType1"))]
3631 CType1,
3632 #[cfg_attr(feature = "serde", serde(rename = "cType2"))]
3633 CType2,
3634 #[cfg_attr(feature = "serde", serde(rename = "s309-1P-16A"))]
3635 S3091P16A,
3636 #[cfg_attr(feature = "serde", serde(rename = "s309-1P-32A"))]
3637 S3091P32A,
3638 #[cfg_attr(feature = "serde", serde(rename = "s309-3P-16A"))]
3639 S3093P16A,
3640 #[cfg_attr(feature = "serde", serde(rename = "s309-3P-32A"))]
3641 S3093P32A,
3642 #[cfg_attr(feature = "serde", serde(rename = "sBS1361"))]
3643 SBS1361,
3644 #[cfg_attr(feature = "serde", serde(rename = "sCEE-7-7"))]
3645 SCEE77,
3646 #[cfg_attr(feature = "serde", serde(rename = "sType2"))]
3647 SType2,
3648 #[cfg_attr(feature = "serde", serde(rename = "sType3"))]
3649 SType3,
3650 Other1PhMax16A,
3651 Other1PhOver16A,
3652 Other3Ph,
3653 Pan,
3654 #[cfg_attr(feature = "serde", serde(rename = "wInductive"))]
3655 WInductive,
3656 #[cfg_attr(feature = "serde", serde(rename = "wResonant"))]
3657 WResonant,
3658 Undetermined,
3659 Unknown,
3660}
3661#[cfg(feature = "validate")]
3662impl crate::validate::Validate for ConnectorEnum {
3663 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3664 Ok(())
3665 }
3666}
3667#[derive(Debug, Clone, PartialEq, Eq)]
3669#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3670pub enum ReserveNowStatusEnum {
3671 Accepted,
3672 Faulted,
3673 Occupied,
3674 Rejected,
3675 Unavailable,
3676}
3677#[cfg(feature = "validate")]
3678impl crate::validate::Validate for ReserveNowStatusEnum {
3679 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3680 Ok(())
3681 }
3682}
3683#[derive(Debug, Clone, PartialEq, Eq)]
3685#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3686pub enum ResetEnum {
3687 Immediate,
3688 OnIdle,
3689}
3690#[cfg(feature = "validate")]
3691impl crate::validate::Validate for ResetEnum {
3692 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3693 Ok(())
3694 }
3695}
3696#[derive(Debug, Clone, PartialEq, Eq)]
3698#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3699pub enum ResetStatusEnum {
3700 Accepted,
3701 Rejected,
3702 Scheduled,
3703}
3704#[cfg(feature = "validate")]
3705impl crate::validate::Validate for ResetStatusEnum {
3706 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3707 Ok(())
3708 }
3709}
3710#[cfg(feature = "alloc")]
3711#[derive(Debug, Clone, PartialEq, Eq)]
3713#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3714pub struct AuthorizationData<CustomDataType = crate::NoCustomData> {
3715 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3716 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3717 pub custom_data: Option<CustomDataType>,
3718 #[cfg_attr(feature = "serde", serde(rename = "idToken"))]
3719 pub id_token: IdToken<CustomDataType>,
3720 #[cfg_attr(feature = "serde", serde(rename = "idTokenInfo"))]
3721 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3722 pub id_token_info: Option<IdTokenInfo<CustomDataType>>,
3723}
3724#[cfg(all(feature = "validate", feature = "alloc"))]
3725impl<CustomDataType> crate::validate::Validate for AuthorizationData<CustomDataType> {
3726 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3727 crate::validate::Validate::validate(&self.id_token)
3728 .map_err(|error| error.in_field("idToken"))?;
3729 if let Some(value) = &self.id_token_info {
3730 crate::validate::Validate::validate(value)
3731 .map_err(|error| error.in_field("idTokenInfo"))?;
3732 }
3733 Ok(())
3734 }
3735}
3736#[cfg(not(feature = "alloc"))]
3737#[derive(Debug, Clone, PartialEq, Eq)]
3739#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3740pub struct AuthorizationData<
3741 CustomDataType = crate::NoCustomData,
3742 const ID_TOKEN_ADDITIONAL_INFO_CAP: usize = 8usize,
3743 const ID_TOKEN_INFO_EVSE_ID_CAP: usize = 8usize,
3744> {
3745 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3746 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3747 pub custom_data: Option<CustomDataType>,
3748 #[cfg_attr(feature = "serde", serde(rename = "idToken"))]
3749 pub id_token: IdToken<CustomDataType, ID_TOKEN_ADDITIONAL_INFO_CAP>,
3750 #[cfg_attr(feature = "serde", serde(rename = "idTokenInfo"))]
3751 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3752 pub id_token_info: Option<
3753 IdTokenInfo<
3754 CustomDataType,
3755 ID_TOKEN_INFO_EVSE_ID_CAP,
3756 ID_TOKEN_ADDITIONAL_INFO_CAP,
3757 >,
3758 >,
3759}
3760#[cfg(all(feature = "validate", not(feature = "alloc")))]
3761impl<
3762 CustomDataType,
3763 const ID_TOKEN_ADDITIONAL_INFO_CAP: usize,
3764 const ID_TOKEN_INFO_EVSE_ID_CAP: usize,
3765> crate::validate::Validate
3766for AuthorizationData<
3767 CustomDataType,
3768 ID_TOKEN_ADDITIONAL_INFO_CAP,
3769 ID_TOKEN_INFO_EVSE_ID_CAP,
3770> {
3771 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3772 crate::validate::Validate::validate(&self.id_token)
3773 .map_err(|error| error.in_field("idToken"))?;
3774 if let Some(value) = &self.id_token_info {
3775 crate::validate::Validate::validate(value)
3776 .map_err(|error| error.in_field("idTokenInfo"))?;
3777 }
3778 Ok(())
3779 }
3780}
3781#[derive(Debug, Clone, PartialEq, Eq)]
3783#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3784pub enum UpdateEnum {
3785 Differential,
3786 Full,
3787}
3788#[cfg(feature = "validate")]
3789impl crate::validate::Validate for UpdateEnum {
3790 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3791 Ok(())
3792 }
3793}
3794#[derive(Debug, Clone, PartialEq, Eq)]
3796#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3797pub enum SendLocalListStatusEnum {
3798 Accepted,
3799 Failed,
3800 VersionMismatch,
3801}
3802#[cfg(feature = "validate")]
3803impl crate::validate::Validate for SendLocalListStatusEnum {
3804 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3805 Ok(())
3806 }
3807}
3808#[derive(Debug, Clone, PartialEq, Eq)]
3810#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3811pub enum ChargingProfileStatusEnum {
3812 Accepted,
3813 Rejected,
3814}
3815#[cfg(feature = "validate")]
3816impl crate::validate::Validate for ChargingProfileStatusEnum {
3817 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3818 Ok(())
3819 }
3820}
3821#[derive(Debug, Clone, PartialEq, Eq)]
3823#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3824pub enum DisplayMessageStatusEnum {
3825 Accepted,
3826 NotSupportedMessageFormat,
3827 Rejected,
3828 NotSupportedPriority,
3829 NotSupportedState,
3830 UnknownTransaction,
3831}
3832#[cfg(feature = "validate")]
3833impl crate::validate::Validate for DisplayMessageStatusEnum {
3834 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3835 Ok(())
3836 }
3837}
3838#[derive(Debug, Clone, PartialEq, Eq)]
3840#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3841pub enum MonitoringBaseEnum {
3842 All,
3843 FactoryDefault,
3844 HardWiredOnly,
3845}
3846#[cfg(feature = "validate")]
3847impl crate::validate::Validate for MonitoringBaseEnum {
3848 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3849 Ok(())
3850 }
3851}
3852#[derive(Debug, Clone, PartialEq, Eq)]
3856#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3857pub enum APNAuthenticationEnum {
3858 CHAP,
3859 NONE,
3860 PAP,
3861 AUTO,
3862}
3863#[cfg(feature = "validate")]
3864impl crate::validate::Validate for APNAuthenticationEnum {
3865 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3866 Ok(())
3867 }
3868}
3869#[derive(Debug, Clone, PartialEq, Eq)]
3875#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3876pub struct APN<CustomDataType = crate::NoCustomData> {
3877 pub apn: heapless::String<512usize>,
3881 #[cfg_attr(feature = "serde", serde(rename = "apnAuthentication"))]
3882 pub apn_authentication: APNAuthenticationEnum,
3883 #[cfg_attr(feature = "serde", serde(rename = "apnPassword"))]
3887 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3888 pub apn_password: Option<heapless::String<20usize>>,
3889 #[cfg_attr(feature = "serde", serde(rename = "apnUserName"))]
3893 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3894 pub apn_user_name: Option<heapless::String<20usize>>,
3895 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
3896 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3897 pub custom_data: Option<CustomDataType>,
3898 #[cfg_attr(feature = "serde", serde(rename = "preferredNetwork"))]
3902 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3903 pub preferred_network: Option<heapless::String<6usize>>,
3904 #[cfg_attr(feature = "serde", serde(rename = "simPin"))]
3908 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3909 pub sim_pin: Option<i64>,
3910 #[cfg_attr(feature = "serde", serde(rename = "useOnlyPreferredNetwork"))]
3915 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
3916 pub use_only_preferred_network: Option<bool>,
3917}
3918#[cfg(feature = "validate")]
3919impl<CustomDataType> crate::validate::Validate for APN<CustomDataType> {
3920 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3921 crate::validate::Validate::validate(&self.apn_authentication)
3922 .map_err(|error| error.in_field("apnAuthentication"))?;
3923 Ok(())
3924 }
3925}
3926#[derive(Debug, Clone, PartialEq, Eq)]
3928#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3929pub enum OCPPInterfaceEnum {
3930 Wired0,
3931 Wired1,
3932 Wired2,
3933 Wired3,
3934 Wireless0,
3935 Wireless1,
3936 Wireless2,
3937 Wireless3,
3938}
3939#[cfg(feature = "validate")]
3940impl crate::validate::Validate for OCPPInterfaceEnum {
3941 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3942 Ok(())
3943 }
3944}
3945#[derive(Debug, Clone, PartialEq, Eq)]
3949#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3950pub enum OCPPTransportEnum {
3951 JSON,
3952 SOAP,
3953}
3954#[cfg(feature = "validate")]
3955impl crate::validate::Validate for OCPPTransportEnum {
3956 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3957 Ok(())
3958 }
3959}
3960#[derive(Debug, Clone, PartialEq, Eq)]
3964#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3965pub enum OCPPVersionEnum {
3966 OCPP12,
3967 OCPP15,
3968 OCPP16,
3969 OCPP20,
3970}
3971#[cfg(feature = "validate")]
3972impl crate::validate::Validate for OCPPVersionEnum {
3973 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3974 Ok(())
3975 }
3976}
3977#[derive(Debug, Clone, PartialEq, Eq)]
3981#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3982pub enum VPNEnum {
3983 IKEv2,
3984 IPSec,
3985 L2TP,
3986 PPTP,
3987}
3988#[cfg(feature = "validate")]
3989impl crate::validate::Validate for VPNEnum {
3990 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
3991 Ok(())
3992 }
3993}
3994#[derive(Debug, Clone, PartialEq, Eq)]
3998#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3999pub struct VPN<CustomDataType = crate::NoCustomData> {
4000 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
4001 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4002 pub custom_data: Option<CustomDataType>,
4003 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4007 pub group: Option<heapless::String<20usize>>,
4008 pub key: heapless::String<255usize>,
4012 pub password: heapless::String<20usize>,
4016 pub server: heapless::String<512usize>,
4020 pub r#type: VPNEnum,
4021 pub user: heapless::String<20usize>,
4025}
4026#[cfg(feature = "validate")]
4027impl<CustomDataType> crate::validate::Validate for VPN<CustomDataType> {
4028 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4029 crate::validate::Validate::validate(&self.r#type)
4030 .map_err(|error| error.in_field("type"))?;
4031 Ok(())
4032 }
4033}
4034#[derive(Debug, Clone, PartialEq, Eq)]
4038#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4039pub struct NetworkConnectionProfile<CustomDataType = crate::NoCustomData> {
4040 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4041 pub apn: Option<APN<CustomDataType>>,
4042 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
4043 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4044 pub custom_data: Option<CustomDataType>,
4045 #[cfg_attr(feature = "serde", serde(rename = "messageTimeout"))]
4049 pub message_timeout: i64,
4050 #[cfg_attr(feature = "serde", serde(rename = "ocppCsmsUrl"))]
4054 pub ocpp_csms_url: heapless::String<512usize>,
4055 #[cfg_attr(feature = "serde", serde(rename = "ocppInterface"))]
4056 pub ocpp_interface: OCPPInterfaceEnum,
4057 #[cfg_attr(feature = "serde", serde(rename = "ocppTransport"))]
4058 pub ocpp_transport: OCPPTransportEnum,
4059 #[cfg_attr(feature = "serde", serde(rename = "ocppVersion"))]
4060 pub ocpp_version: OCPPVersionEnum,
4061 #[cfg_attr(feature = "serde", serde(rename = "securityProfile"))]
4063 pub security_profile: i64,
4064 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4065 pub vpn: Option<VPN<CustomDataType>>,
4066}
4067#[cfg(feature = "validate")]
4068impl<CustomDataType> crate::validate::Validate
4069for NetworkConnectionProfile<CustomDataType> {
4070 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4071 if let Some(value) = &self.apn {
4072 crate::validate::Validate::validate(value)
4073 .map_err(|error| error.in_field("apn"))?;
4074 }
4075 crate::validate::Validate::validate(&self.ocpp_interface)
4076 .map_err(|error| error.in_field("ocppInterface"))?;
4077 crate::validate::Validate::validate(&self.ocpp_transport)
4078 .map_err(|error| error.in_field("ocppTransport"))?;
4079 crate::validate::Validate::validate(&self.ocpp_version)
4080 .map_err(|error| error.in_field("ocppVersion"))?;
4081 if let Some(value) = &self.vpn {
4082 crate::validate::Validate::validate(value)
4083 .map_err(|error| error.in_field("vpn"))?;
4084 }
4085 Ok(())
4086 }
4087}
4088#[derive(Debug, Clone, PartialEq, Eq)]
4090#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4091pub enum SetNetworkProfileStatusEnum {
4092 Accepted,
4093 Rejected,
4094 Failed,
4095}
4096#[cfg(feature = "validate")]
4097impl crate::validate::Validate for SetNetworkProfileStatusEnum {
4098 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4099 Ok(())
4100 }
4101}
4102#[derive(Debug, Clone, PartialEq)]
4104#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4105pub struct SetMonitoringData<CustomDataType = crate::NoCustomData> {
4106 pub component: Component<CustomDataType>,
4107 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
4108 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4109 pub custom_data: Option<CustomDataType>,
4110 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4112 pub id: Option<i64>,
4113 pub severity: i64,
4137 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4139 pub transaction: Option<bool>,
4140 pub r#type: MonitorEnum,
4141 pub value: f64,
4144 pub variable: Variable<CustomDataType>,
4145}
4146#[cfg(feature = "validate")]
4147impl<CustomDataType> crate::validate::Validate for SetMonitoringData<CustomDataType> {
4148 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4149 crate::validate::Validate::validate(&self.component)
4150 .map_err(|error| error.in_field("component"))?;
4151 crate::validate::Validate::validate(&self.r#type)
4152 .map_err(|error| error.in_field("type"))?;
4153 crate::validate::Validate::validate(&self.variable)
4154 .map_err(|error| error.in_field("variable"))?;
4155 Ok(())
4156 }
4157}
4158#[derive(Debug, Clone, PartialEq, Eq)]
4160#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4161pub enum SetMonitoringStatusEnum {
4162 Accepted,
4163 UnknownComponent,
4164 UnknownVariable,
4165 UnsupportedMonitorType,
4166 Rejected,
4167 Duplicate,
4168}
4169#[cfg(feature = "validate")]
4170impl crate::validate::Validate for SetMonitoringStatusEnum {
4171 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4172 Ok(())
4173 }
4174}
4175#[derive(Debug, Clone, PartialEq, Eq)]
4177#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4178pub struct SetMonitoringResult<CustomDataType = crate::NoCustomData> {
4179 pub component: Component<CustomDataType>,
4180 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
4181 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4182 pub custom_data: Option<CustomDataType>,
4183 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4185 pub id: Option<i64>,
4186 pub severity: i64,
4210 pub status: SetMonitoringStatusEnum,
4211 #[cfg_attr(feature = "serde", serde(rename = "statusInfo"))]
4212 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4213 pub status_info: Option<StatusInfo<CustomDataType>>,
4214 pub r#type: MonitorEnum,
4215 pub variable: Variable<CustomDataType>,
4216}
4217#[cfg(feature = "validate")]
4218impl<CustomDataType> crate::validate::Validate for SetMonitoringResult<CustomDataType> {
4219 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4220 crate::validate::Validate::validate(&self.component)
4221 .map_err(|error| error.in_field("component"))?;
4222 crate::validate::Validate::validate(&self.status)
4223 .map_err(|error| error.in_field("status"))?;
4224 if let Some(value) = &self.status_info {
4225 crate::validate::Validate::validate(value)
4226 .map_err(|error| error.in_field("statusInfo"))?;
4227 }
4228 crate::validate::Validate::validate(&self.r#type)
4229 .map_err(|error| error.in_field("type"))?;
4230 crate::validate::Validate::validate(&self.variable)
4231 .map_err(|error| error.in_field("variable"))?;
4232 Ok(())
4233 }
4234}
4235#[cfg(feature = "alloc")]
4236#[derive(Debug, Clone, PartialEq, Eq)]
4237#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4238pub struct SetVariableData<CustomDataType = crate::NoCustomData> {
4239 #[cfg_attr(feature = "serde", serde(rename = "attributeType"))]
4240 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4241 pub attribute_type: Option<AttributeEnum>,
4242 #[cfg_attr(feature = "serde", serde(rename = "attributeValue"))]
4246 pub attribute_value: alloc::string::String,
4247 pub component: Component<CustomDataType>,
4248 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
4249 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4250 pub custom_data: Option<CustomDataType>,
4251 pub variable: Variable<CustomDataType>,
4252}
4253#[cfg(all(feature = "validate", feature = "alloc"))]
4254impl<CustomDataType> crate::validate::Validate for SetVariableData<CustomDataType> {
4255 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4256 if let Some(value) = &self.attribute_type {
4257 crate::validate::Validate::validate(value)
4258 .map_err(|error| error.in_field("attributeType"))?;
4259 }
4260 crate::validate::check_max_length(&self.attribute_value, 1000usize)
4261 .map_err(|error| error.in_field("attributeValue"))?;
4262 crate::validate::Validate::validate(&self.component)
4263 .map_err(|error| error.in_field("component"))?;
4264 crate::validate::Validate::validate(&self.variable)
4265 .map_err(|error| error.in_field("variable"))?;
4266 Ok(())
4267 }
4268}
4269#[cfg(not(feature = "alloc"))]
4270#[derive(Debug, Clone, PartialEq, Eq)]
4271#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4272pub struct SetVariableData<
4273 CustomDataType = crate::NoCustomData,
4274 const SET_VARIABLE_DATA_ATTRIBUTE_VALUE_CAP: usize = 1000usize,
4275> {
4276 #[cfg_attr(feature = "serde", serde(rename = "attributeType"))]
4277 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4278 pub attribute_type: Option<AttributeEnum>,
4279 #[cfg_attr(feature = "serde", serde(rename = "attributeValue"))]
4283 pub attribute_value: heapless::String<SET_VARIABLE_DATA_ATTRIBUTE_VALUE_CAP>,
4284 pub component: Component<CustomDataType>,
4285 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
4286 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4287 pub custom_data: Option<CustomDataType>,
4288 pub variable: Variable<CustomDataType>,
4289}
4290#[cfg(all(feature = "validate", not(feature = "alloc")))]
4291impl<
4292 CustomDataType,
4293 const SET_VARIABLE_DATA_ATTRIBUTE_VALUE_CAP: usize,
4294> crate::validate::Validate
4295for SetVariableData<CustomDataType, SET_VARIABLE_DATA_ATTRIBUTE_VALUE_CAP> {
4296 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4297 if let Some(value) = &self.attribute_type {
4298 crate::validate::Validate::validate(value)
4299 .map_err(|error| error.in_field("attributeType"))?;
4300 }
4301 crate::validate::check_max_length(&self.attribute_value, 1000usize)
4302 .map_err(|error| error.in_field("attributeValue"))?;
4303 crate::validate::Validate::validate(&self.component)
4304 .map_err(|error| error.in_field("component"))?;
4305 crate::validate::Validate::validate(&self.variable)
4306 .map_err(|error| error.in_field("variable"))?;
4307 Ok(())
4308 }
4309}
4310#[derive(Debug, Clone, PartialEq, Eq)]
4312#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4313pub enum SetVariableStatusEnum {
4314 Accepted,
4315 Rejected,
4316 UnknownComponent,
4317 UnknownVariable,
4318 NotSupportedAttributeType,
4319 RebootRequired,
4320}
4321#[cfg(feature = "validate")]
4322impl crate::validate::Validate for SetVariableStatusEnum {
4323 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4324 Ok(())
4325 }
4326}
4327#[derive(Debug, Clone, PartialEq, Eq)]
4328#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4329pub struct SetVariableResult<CustomDataType = crate::NoCustomData> {
4330 #[cfg_attr(feature = "serde", serde(rename = "attributeStatus"))]
4331 pub attribute_status: SetVariableStatusEnum,
4332 #[cfg_attr(feature = "serde", serde(rename = "attributeStatusInfo"))]
4333 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4334 pub attribute_status_info: Option<StatusInfo<CustomDataType>>,
4335 #[cfg_attr(feature = "serde", serde(rename = "attributeType"))]
4336 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4337 pub attribute_type: Option<AttributeEnum>,
4338 pub component: Component<CustomDataType>,
4339 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
4340 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4341 pub custom_data: Option<CustomDataType>,
4342 pub variable: Variable<CustomDataType>,
4343}
4344#[cfg(feature = "validate")]
4345impl<CustomDataType> crate::validate::Validate for SetVariableResult<CustomDataType> {
4346 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4347 crate::validate::Validate::validate(&self.attribute_status)
4348 .map_err(|error| error.in_field("attributeStatus"))?;
4349 if let Some(value) = &self.attribute_status_info {
4350 crate::validate::Validate::validate(value)
4351 .map_err(|error| error.in_field("attributeStatusInfo"))?;
4352 }
4353 if let Some(value) = &self.attribute_type {
4354 crate::validate::Validate::validate(value)
4355 .map_err(|error| error.in_field("attributeType"))?;
4356 }
4357 crate::validate::Validate::validate(&self.component)
4358 .map_err(|error| error.in_field("component"))?;
4359 crate::validate::Validate::validate(&self.variable)
4360 .map_err(|error| error.in_field("variable"))?;
4361 Ok(())
4362 }
4363}
4364#[derive(Debug, Clone, PartialEq, Eq)]
4366#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4367pub enum ConnectorStatusEnum {
4368 Available,
4369 Occupied,
4370 Reserved,
4371 Unavailable,
4372 Faulted,
4373}
4374#[cfg(feature = "validate")]
4375impl crate::validate::Validate for ConnectorStatusEnum {
4376 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4377 Ok(())
4378 }
4379}
4380#[derive(Debug, Clone, PartialEq, Eq)]
4383#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4384pub enum TransactionEventEnum {
4385 Ended,
4386 Started,
4387 Updated,
4388}
4389#[cfg(feature = "validate")]
4390impl crate::validate::Validate for TransactionEventEnum {
4391 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4392 Ok(())
4393 }
4394}
4395#[derive(Debug, Clone, PartialEq, Eq)]
4400#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4401pub enum ChargingStateEnum {
4402 Charging,
4403 EVConnected,
4404 SuspendedEV,
4405 SuspendedEVSE,
4406 Idle,
4407}
4408#[cfg(feature = "validate")]
4409impl crate::validate::Validate for ChargingStateEnum {
4410 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4411 Ok(())
4412 }
4413}
4414#[derive(Debug, Clone, PartialEq, Eq)]
4418#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4419pub enum ReasonEnum {
4420 DeAuthorized,
4421 EmergencyStop,
4422 EnergyLimitReached,
4423 EVDisconnected,
4424 GroundFault,
4425 ImmediateReset,
4426 Local,
4427 LocalOutOfCredit,
4428 MasterPass,
4429 Other,
4430 OvercurrentFault,
4431 PowerLoss,
4432 PowerQuality,
4433 Reboot,
4434 Remote,
4435 SOCLimitReached,
4436 StoppedByEV,
4437 TimeLimitReached,
4438 Timeout,
4439}
4440#[cfg(feature = "validate")]
4441impl crate::validate::Validate for ReasonEnum {
4442 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4443 Ok(())
4444 }
4445}
4446#[derive(Debug, Clone, PartialEq, Eq)]
4449#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4450pub struct Transaction<CustomDataType = crate::NoCustomData> {
4451 #[cfg_attr(feature = "serde", serde(rename = "chargingState"))]
4452 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4453 pub charging_state: Option<ChargingStateEnum>,
4454 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
4455 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4456 pub custom_data: Option<CustomDataType>,
4457 #[cfg_attr(feature = "serde", serde(rename = "remoteStartId"))]
4459 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4460 pub remote_start_id: Option<i64>,
4461 #[cfg_attr(feature = "serde", serde(rename = "stoppedReason"))]
4462 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4463 pub stopped_reason: Option<ReasonEnum>,
4464 #[cfg_attr(feature = "serde", serde(rename = "timeSpentCharging"))]
4468 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4469 pub time_spent_charging: Option<i64>,
4470 #[cfg_attr(feature = "serde", serde(rename = "transactionId"))]
4472 pub transaction_id: heapless::String<36usize>,
4473}
4474#[cfg(feature = "validate")]
4475impl<CustomDataType> crate::validate::Validate for Transaction<CustomDataType> {
4476 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4477 if let Some(value) = &self.charging_state {
4478 crate::validate::Validate::validate(value)
4479 .map_err(|error| error.in_field("chargingState"))?;
4480 }
4481 if let Some(value) = &self.stopped_reason {
4482 crate::validate::Validate::validate(value)
4483 .map_err(|error| error.in_field("stoppedReason"))?;
4484 }
4485 Ok(())
4486 }
4487}
4488#[derive(Debug, Clone, PartialEq, Eq)]
4490#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4491pub enum TriggerReasonEnum {
4492 Authorized,
4493 CablePluggedIn,
4494 ChargingRateChanged,
4495 ChargingStateChanged,
4496 Deauthorized,
4497 EnergyLimitReached,
4498 EVCommunicationLost,
4499 EVConnectTimeout,
4500 MeterValueClock,
4501 MeterValuePeriodic,
4502 TimeLimitReached,
4503 Trigger,
4504 UnlockCommand,
4505 StopAuthorized,
4506 EVDeparted,
4507 EVDetected,
4508 RemoteStop,
4509 RemoteStart,
4510 AbnormalCondition,
4511 SignedDataReceived,
4512 ResetCommand,
4513}
4514#[cfg(feature = "validate")]
4515impl crate::validate::Validate for TriggerReasonEnum {
4516 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4517 Ok(())
4518 }
4519}
4520#[derive(Debug, Clone, PartialEq, Eq)]
4522#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4523pub enum MessageTriggerEnum {
4524 BootNotification,
4525 LogStatusNotification,
4526 FirmwareStatusNotification,
4527 Heartbeat,
4528 MeterValues,
4529 SignChargingStationCertificate,
4530 SignV2GCertificate,
4531 StatusNotification,
4532 TransactionEvent,
4533 SignCombinedCertificate,
4534 PublishFirmwareStatusNotification,
4535}
4536#[cfg(feature = "validate")]
4537impl crate::validate::Validate for MessageTriggerEnum {
4538 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4539 Ok(())
4540 }
4541}
4542#[derive(Debug, Clone, PartialEq, Eq)]
4544#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4545pub enum TriggerMessageStatusEnum {
4546 Accepted,
4547 Rejected,
4548 NotImplemented,
4549}
4550#[cfg(feature = "validate")]
4551impl crate::validate::Validate for TriggerMessageStatusEnum {
4552 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4553 Ok(())
4554 }
4555}
4556#[derive(Debug, Clone, PartialEq, Eq)]
4558#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4559pub enum UnlockStatusEnum {
4560 Unlocked,
4561 UnlockFailed,
4562 OngoingAuthorizedTransaction,
4563 UnknownConnector,
4564}
4565#[cfg(feature = "validate")]
4566impl crate::validate::Validate for UnlockStatusEnum {
4567 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4568 Ok(())
4569 }
4570}
4571#[derive(Debug, Clone, PartialEq, Eq)]
4573#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4574pub enum UnpublishFirmwareStatusEnum {
4575 DownloadOngoing,
4576 NoFirmware,
4577 Unpublished,
4578}
4579#[cfg(feature = "validate")]
4580impl crate::validate::Validate for UnpublishFirmwareStatusEnum {
4581 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4582 Ok(())
4583 }
4584}
4585#[cfg(feature = "alloc")]
4586#[derive(Debug, Clone, PartialEq, Eq)]
4590#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4591pub struct Firmware<CustomDataType = crate::NoCustomData> {
4592 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
4593 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4594 pub custom_data: Option<CustomDataType>,
4595 #[cfg_attr(feature = "serde", serde(rename = "installDateTime"))]
4599 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4600 pub install_date_time: Option<crate::OcppTimestamp>,
4601 pub location: heapless::String<512usize>,
4605 #[cfg_attr(feature = "serde", serde(rename = "retrieveDateTime"))]
4609 pub retrieve_date_time: crate::OcppTimestamp,
4610 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4614 pub signature: Option<alloc::string::String>,
4615 #[cfg_attr(feature = "serde", serde(rename = "signingCertificate"))]
4618 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4619 pub signing_certificate: Option<alloc::string::String>,
4620}
4621#[cfg(all(feature = "validate", feature = "alloc"))]
4622impl<CustomDataType> crate::validate::Validate for Firmware<CustomDataType> {
4623 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4624 if let Some(value) = &self.signature {
4625 crate::validate::check_max_length(value, 800usize)
4626 .map_err(|error| error.in_field("signature"))?;
4627 }
4628 if let Some(value) = &self.signing_certificate {
4629 crate::validate::check_max_length(value, 5500usize)
4630 .map_err(|error| error.in_field("signingCertificate"))?;
4631 }
4632 Ok(())
4633 }
4634}
4635#[cfg(not(feature = "alloc"))]
4636#[derive(Debug, Clone, PartialEq, Eq)]
4640#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4641pub struct Firmware<
4642 CustomDataType = crate::NoCustomData,
4643 const FIRMWARE_SIGNATURE_CAP: usize = 800usize,
4644 const FIRMWARE_SIGNING_CERTIFICATE_CAP: usize = 1024usize,
4645> {
4646 #[cfg_attr(feature = "serde", serde(rename = "customData"))]
4647 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4648 pub custom_data: Option<CustomDataType>,
4649 #[cfg_attr(feature = "serde", serde(rename = "installDateTime"))]
4653 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4654 pub install_date_time: Option<crate::OcppTimestamp>,
4655 pub location: heapless::String<512usize>,
4659 #[cfg_attr(feature = "serde", serde(rename = "retrieveDateTime"))]
4663 pub retrieve_date_time: crate::OcppTimestamp,
4664 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4668 pub signature: Option<heapless::String<FIRMWARE_SIGNATURE_CAP>>,
4669 #[cfg_attr(feature = "serde", serde(rename = "signingCertificate"))]
4672 #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
4673 pub signing_certificate: Option<heapless::String<FIRMWARE_SIGNING_CERTIFICATE_CAP>>,
4674}
4675#[cfg(all(feature = "validate", not(feature = "alloc")))]
4676impl<
4677 CustomDataType,
4678 const FIRMWARE_SIGNATURE_CAP: usize,
4679 const FIRMWARE_SIGNING_CERTIFICATE_CAP: usize,
4680> crate::validate::Validate
4681for Firmware<CustomDataType, FIRMWARE_SIGNATURE_CAP, FIRMWARE_SIGNING_CERTIFICATE_CAP> {
4682 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4683 if let Some(value) = &self.signature {
4684 crate::validate::check_max_length(value, 800usize)
4685 .map_err(|error| error.in_field("signature"))?;
4686 }
4687 if let Some(value) = &self.signing_certificate {
4688 crate::validate::check_max_length(value, 5500usize)
4689 .map_err(|error| error.in_field("signingCertificate"))?;
4690 }
4691 Ok(())
4692 }
4693}
4694#[derive(Debug, Clone, PartialEq, Eq)]
4696#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4697pub enum UpdateFirmwareStatusEnum {
4698 Accepted,
4699 Rejected,
4700 AcceptedCanceled,
4701 InvalidCertificate,
4702 RevokedCertificate,
4703}
4704#[cfg(feature = "validate")]
4705impl crate::validate::Validate for UpdateFirmwareStatusEnum {
4706 fn validate(&self) -> Result<(), crate::validate::ValidationError> {
4707 Ok(())
4708 }
4709}