Skip to main content

codetics_ocpp21/
messages.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Kevin Vavelin, Codetics (https://codetics.fr)
3
4//! OCPP 2.1 request / response payloads.
5
6use ocpp_core::DateTime;
7use ocpp_core::validate::{self as v, Path, Validate, Violation};
8use serde::{Deserialize, Serialize};
9
10use crate::datatypes::*;
11use crate::enums::*;
12
13#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
14#[serde(deny_unknown_fields)]
15pub struct AFRRSignalRequest {
16    /// Time when signal becomes active.
17    #[serde(rename = "timestamp")]
18    pub timestamp: DateTime,
19    /// Value of signal in _v2xSignalWattCurve_.
20    #[serde(rename = "signal")]
21    pub signal: i64,
22    #[serde(
23        rename = "customData",
24        default,
25        skip_serializing_if = "Option::is_none"
26    )]
27    pub custom_data: Option<CustomData>,
28}
29
30impl Validate for AFRRSignalRequest {
31    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
32        if let Some(x) = &self.custom_data {
33            let p = path.field("customData");
34            x.validate(&p)?;
35        }
36        Ok(())
37    }
38}
39
40#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
41#[serde(deny_unknown_fields)]
42pub struct AFRRSignalResponse {
43    #[serde(rename = "status")]
44    pub status: GenericStatusEnum,
45    #[serde(
46        rename = "statusInfo",
47        default,
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub status_info: Option<StatusInfo>,
51    #[serde(
52        rename = "customData",
53        default,
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub custom_data: Option<CustomData>,
57}
58
59impl Validate for AFRRSignalResponse {
60    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
61        if let Some(x) = &self.status_info {
62            let p = path.field("statusInfo");
63            x.validate(&p)?;
64        }
65        if let Some(x) = &self.custom_data {
66            let p = path.field("customData");
67            x.validate(&p)?;
68        }
69        Ok(())
70    }
71}
72
73#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
74#[serde(deny_unknown_fields)]
75pub struct AdjustPeriodicEventStreamRequest {
76    #[serde(rename = "id")]
77    pub id: i64,
78    #[serde(rename = "params")]
79    pub params: PeriodicEventStreamParams,
80    #[serde(
81        rename = "customData",
82        default,
83        skip_serializing_if = "Option::is_none"
84    )]
85    pub custom_data: Option<CustomData>,
86}
87
88impl Validate for AdjustPeriodicEventStreamRequest {
89    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
90        {
91            let x = &self.id;
92            let p = path.field("id");
93            v::minimum(*x, 0i64, &p)?;
94        }
95        {
96            let x = &self.params;
97            let p = path.field("params");
98            x.validate(&p)?;
99        }
100        if let Some(x) = &self.custom_data {
101            let p = path.field("customData");
102            x.validate(&p)?;
103        }
104        Ok(())
105    }
106}
107
108#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
109#[serde(deny_unknown_fields)]
110pub struct AdjustPeriodicEventStreamResponse {
111    #[serde(rename = "status")]
112    pub status: GenericStatusEnum,
113    #[serde(
114        rename = "statusInfo",
115        default,
116        skip_serializing_if = "Option::is_none"
117    )]
118    pub status_info: Option<StatusInfo>,
119    #[serde(
120        rename = "customData",
121        default,
122        skip_serializing_if = "Option::is_none"
123    )]
124    pub custom_data: Option<CustomData>,
125}
126
127impl Validate for AdjustPeriodicEventStreamResponse {
128    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
129        if let Some(x) = &self.status_info {
130            let p = path.field("statusInfo");
131            x.validate(&p)?;
132        }
133        if let Some(x) = &self.custom_data {
134            let p = path.field("customData");
135            x.validate(&p)?;
136        }
137        Ok(())
138    }
139}
140
141#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
142#[serde(deny_unknown_fields)]
143pub struct AuthorizeRequest {
144    #[serde(rename = "idToken")]
145    pub id_token: IdToken,
146    /// *(2.1)* The X.509 certificate chain presented by EV and encoded in PEM format. Order of certificates in chain is from leaf up to (but excluding) root certificate. +
147    /// Only needed in case of central contract validation when Charging Station cannot validate the contract certificate.
148    #[serde(
149        rename = "certificate",
150        default,
151        skip_serializing_if = "Option::is_none"
152    )]
153    pub certificate: Option<String>,
154    #[serde(
155        rename = "iso15118CertificateHashData",
156        default,
157        skip_serializing_if = "Option::is_none"
158    )]
159    pub iso15118_certificate_hash_data: Option<Vec<OCSPRequestData>>,
160    #[serde(
161        rename = "customData",
162        default,
163        skip_serializing_if = "Option::is_none"
164    )]
165    pub custom_data: Option<CustomData>,
166}
167
168impl Validate for AuthorizeRequest {
169    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
170        {
171            let x = &self.id_token;
172            let p = path.field("idToken");
173            x.validate(&p)?;
174        }
175        if let Some(x) = &self.certificate {
176            let p = path.field("certificate");
177            v::max_length(x, 10000, &p)?;
178        }
179        if let Some(x) = &self.iso15118_certificate_hash_data {
180            let p = path.field("iso15118CertificateHashData");
181            v::items(x, Some(1), Some(4), &p)?;
182            for (i0, it0) in x.iter().enumerate() {
183                let p0 = p.index(i0);
184                it0.validate(&p0)?;
185            }
186        }
187        if let Some(x) = &self.custom_data {
188            let p = path.field("customData");
189            x.validate(&p)?;
190        }
191        Ok(())
192    }
193}
194
195#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
196#[serde(deny_unknown_fields)]
197pub struct AuthorizeResponse {
198    #[serde(rename = "idTokenInfo")]
199    pub id_token_info: IdTokenInfo,
200    #[serde(
201        rename = "certificateStatus",
202        default,
203        skip_serializing_if = "Option::is_none"
204    )]
205    pub certificate_status: Option<AuthorizeCertificateStatusEnum>,
206    /// *(2.1)* List of allowed energy transfer modes the EV can choose from. If omitted this defaults to charging only.
207    #[serde(
208        rename = "allowedEnergyTransfer",
209        default,
210        skip_serializing_if = "Option::is_none"
211    )]
212    pub allowed_energy_transfer: Option<Vec<EnergyTransferModeEnum>>,
213    #[serde(rename = "tariff", default, skip_serializing_if = "Option::is_none")]
214    pub tariff: Option<Tariff>,
215    #[serde(
216        rename = "customData",
217        default,
218        skip_serializing_if = "Option::is_none"
219    )]
220    pub custom_data: Option<CustomData>,
221}
222
223impl Validate for AuthorizeResponse {
224    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
225        {
226            let x = &self.id_token_info;
227            let p = path.field("idTokenInfo");
228            x.validate(&p)?;
229        }
230        if let Some(x) = &self.allowed_energy_transfer {
231            let p = path.field("allowedEnergyTransfer");
232            v::items(x, Some(1), None, &p)?;
233        }
234        if let Some(x) = &self.tariff {
235            let p = path.field("tariff");
236            x.validate(&p)?;
237        }
238        if let Some(x) = &self.custom_data {
239            let p = path.field("customData");
240            x.validate(&p)?;
241        }
242        Ok(())
243    }
244}
245
246#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
247#[serde(deny_unknown_fields)]
248pub struct BatterySwapRequest {
249    #[serde(rename = "batteryData")]
250    pub battery_data: Vec<BatteryData>,
251    #[serde(rename = "eventType")]
252    pub event_type: BatterySwapEventEnum,
253    #[serde(rename = "idToken")]
254    pub id_token: IdToken,
255    /// RequestId to correlate BatteryIn/Out events and optional RequestBatterySwapRequest.
256    #[serde(rename = "requestId")]
257    pub request_id: i64,
258    #[serde(
259        rename = "customData",
260        default,
261        skip_serializing_if = "Option::is_none"
262    )]
263    pub custom_data: Option<CustomData>,
264}
265
266impl Validate for BatterySwapRequest {
267    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
268        {
269            let x = &self.battery_data;
270            let p = path.field("batteryData");
271            v::items(x, Some(1), None, &p)?;
272            for (i0, it0) in x.iter().enumerate() {
273                let p0 = p.index(i0);
274                it0.validate(&p0)?;
275            }
276        }
277        {
278            let x = &self.id_token;
279            let p = path.field("idToken");
280            x.validate(&p)?;
281        }
282        if let Some(x) = &self.custom_data {
283            let p = path.field("customData");
284            x.validate(&p)?;
285        }
286        Ok(())
287    }
288}
289
290/// This is an empty response that just acknowledges receipt of the request. (The request cannot be rejected).
291#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
292#[serde(deny_unknown_fields)]
293pub struct BatterySwapResponse {
294    #[serde(
295        rename = "customData",
296        default,
297        skip_serializing_if = "Option::is_none"
298    )]
299    pub custom_data: Option<CustomData>,
300}
301
302impl Validate for BatterySwapResponse {
303    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
304        if let Some(x) = &self.custom_data {
305            let p = path.field("customData");
306            x.validate(&p)?;
307        }
308        Ok(())
309    }
310}
311
312#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
313#[serde(deny_unknown_fields)]
314pub struct BootNotificationRequest {
315    #[serde(rename = "chargingStation")]
316    pub charging_station: ChargingStation,
317    #[serde(rename = "reason")]
318    pub reason: BootReasonEnum,
319    #[serde(
320        rename = "customData",
321        default,
322        skip_serializing_if = "Option::is_none"
323    )]
324    pub custom_data: Option<CustomData>,
325}
326
327impl Validate for BootNotificationRequest {
328    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
329        {
330            let x = &self.charging_station;
331            let p = path.field("chargingStation");
332            x.validate(&p)?;
333        }
334        if let Some(x) = &self.custom_data {
335            let p = path.field("customData");
336            x.validate(&p)?;
337        }
338        Ok(())
339    }
340}
341
342#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
343#[serde(deny_unknown_fields)]
344pub struct BootNotificationResponse {
345    /// This contains the CSMS’s current time.
346    #[serde(rename = "currentTime")]
347    pub current_time: DateTime,
348    /// When &lt;&lt;cmn_registrationstatusenumtype,Status&gt;&gt; is Accepted, this contains the heartbeat interval in seconds. If the CSMS returns something other than Accepted, the value of the interval field indicates the minimum wait time before sending a next BootNotification request.
349    #[serde(rename = "interval")]
350    pub interval: i64,
351    #[serde(rename = "status")]
352    pub status: RegistrationStatusEnum,
353    #[serde(
354        rename = "statusInfo",
355        default,
356        skip_serializing_if = "Option::is_none"
357    )]
358    pub status_info: Option<StatusInfo>,
359    #[serde(
360        rename = "customData",
361        default,
362        skip_serializing_if = "Option::is_none"
363    )]
364    pub custom_data: Option<CustomData>,
365}
366
367impl Validate for BootNotificationResponse {
368    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
369        if let Some(x) = &self.status_info {
370            let p = path.field("statusInfo");
371            x.validate(&p)?;
372        }
373        if let Some(x) = &self.custom_data {
374            let p = path.field("customData");
375            x.validate(&p)?;
376        }
377        Ok(())
378    }
379}
380
381#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
382#[serde(deny_unknown_fields)]
383pub struct CancelReservationRequest {
384    /// Id of the reservation to cancel.
385    #[serde(rename = "reservationId")]
386    pub reservation_id: i64,
387    #[serde(
388        rename = "customData",
389        default,
390        skip_serializing_if = "Option::is_none"
391    )]
392    pub custom_data: Option<CustomData>,
393}
394
395impl Validate for CancelReservationRequest {
396    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
397        {
398            let x = &self.reservation_id;
399            let p = path.field("reservationId");
400            v::minimum(*x, 0i64, &p)?;
401        }
402        if let Some(x) = &self.custom_data {
403            let p = path.field("customData");
404            x.validate(&p)?;
405        }
406        Ok(())
407    }
408}
409
410#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
411#[serde(deny_unknown_fields)]
412pub struct CancelReservationResponse {
413    #[serde(rename = "status")]
414    pub status: CancelReservationStatusEnum,
415    #[serde(
416        rename = "statusInfo",
417        default,
418        skip_serializing_if = "Option::is_none"
419    )]
420    pub status_info: Option<StatusInfo>,
421    #[serde(
422        rename = "customData",
423        default,
424        skip_serializing_if = "Option::is_none"
425    )]
426    pub custom_data: Option<CustomData>,
427}
428
429impl Validate for CancelReservationResponse {
430    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
431        if let Some(x) = &self.status_info {
432            let p = path.field("statusInfo");
433            x.validate(&p)?;
434        }
435        if let Some(x) = &self.custom_data {
436            let p = path.field("customData");
437            x.validate(&p)?;
438        }
439        Ok(())
440    }
441}
442
443#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
444#[serde(deny_unknown_fields)]
445pub struct CertificateSignedRequest {
446    /// The signed PEM encoded X.509 certificate. This SHALL also contain the necessary sub CA certificates, when applicable. The order of the bundle follows the certificate chain, starting from the leaf certificate.
447    /// The Configuration Variable &lt;&lt;configkey-max-certificate-chain-size,MaxCertificateChainSize&gt;&gt; can be used to limit the maximum size of this field.
448    #[serde(rename = "certificateChain")]
449    pub certificate_chain: String,
450    #[serde(
451        rename = "certificateType",
452        default,
453        skip_serializing_if = "Option::is_none"
454    )]
455    pub certificate_type: Option<CertificateSigningUseEnum>,
456    /// *(2.1)* RequestId to correlate this message with the SignCertificateRequest.
457    #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")]
458    pub request_id: Option<i64>,
459    #[serde(
460        rename = "customData",
461        default,
462        skip_serializing_if = "Option::is_none"
463    )]
464    pub custom_data: Option<CustomData>,
465}
466
467impl Validate for CertificateSignedRequest {
468    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
469        {
470            let x = &self.certificate_chain;
471            let p = path.field("certificateChain");
472            v::max_length(x, 10000, &p)?;
473        }
474        if let Some(x) = &self.custom_data {
475            let p = path.field("customData");
476            x.validate(&p)?;
477        }
478        Ok(())
479    }
480}
481
482#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
483#[serde(deny_unknown_fields)]
484pub struct CertificateSignedResponse {
485    #[serde(rename = "status")]
486    pub status: CertificateSignedStatusEnum,
487    #[serde(
488        rename = "statusInfo",
489        default,
490        skip_serializing_if = "Option::is_none"
491    )]
492    pub status_info: Option<StatusInfo>,
493    #[serde(
494        rename = "customData",
495        default,
496        skip_serializing_if = "Option::is_none"
497    )]
498    pub custom_data: Option<CustomData>,
499}
500
501impl Validate for CertificateSignedResponse {
502    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
503        if let Some(x) = &self.status_info {
504            let p = path.field("statusInfo");
505            x.validate(&p)?;
506        }
507        if let Some(x) = &self.custom_data {
508            let p = path.field("customData");
509            x.validate(&p)?;
510        }
511        Ok(())
512    }
513}
514
515#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
516#[serde(deny_unknown_fields)]
517pub struct ChangeAvailabilityRequest {
518    #[serde(rename = "evse", default, skip_serializing_if = "Option::is_none")]
519    pub evse: Option<EVSE>,
520    #[serde(rename = "operationalStatus")]
521    pub operational_status: OperationalStatusEnum,
522    #[serde(
523        rename = "customData",
524        default,
525        skip_serializing_if = "Option::is_none"
526    )]
527    pub custom_data: Option<CustomData>,
528}
529
530impl Validate for ChangeAvailabilityRequest {
531    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
532        if let Some(x) = &self.evse {
533            let p = path.field("evse");
534            x.validate(&p)?;
535        }
536        if let Some(x) = &self.custom_data {
537            let p = path.field("customData");
538            x.validate(&p)?;
539        }
540        Ok(())
541    }
542}
543
544#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
545#[serde(deny_unknown_fields)]
546pub struct ChangeAvailabilityResponse {
547    #[serde(rename = "status")]
548    pub status: ChangeAvailabilityStatusEnum,
549    #[serde(
550        rename = "statusInfo",
551        default,
552        skip_serializing_if = "Option::is_none"
553    )]
554    pub status_info: Option<StatusInfo>,
555    #[serde(
556        rename = "customData",
557        default,
558        skip_serializing_if = "Option::is_none"
559    )]
560    pub custom_data: Option<CustomData>,
561}
562
563impl Validate for ChangeAvailabilityResponse {
564    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
565        if let Some(x) = &self.status_info {
566            let p = path.field("statusInfo");
567            x.validate(&p)?;
568        }
569        if let Some(x) = &self.custom_data {
570            let p = path.field("customData");
571            x.validate(&p)?;
572        }
573        Ok(())
574    }
575}
576
577#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
578#[serde(deny_unknown_fields)]
579pub struct ChangeTransactionTariffRequest {
580    #[serde(rename = "tariff")]
581    pub tariff: Tariff,
582    /// Transaction id for new tariff.
583    #[serde(rename = "transactionId")]
584    pub transaction_id: String,
585    #[serde(
586        rename = "customData",
587        default,
588        skip_serializing_if = "Option::is_none"
589    )]
590    pub custom_data: Option<CustomData>,
591}
592
593impl Validate for ChangeTransactionTariffRequest {
594    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
595        {
596            let x = &self.tariff;
597            let p = path.field("tariff");
598            x.validate(&p)?;
599        }
600        {
601            let x = &self.transaction_id;
602            let p = path.field("transactionId");
603            v::max_length(x, 36, &p)?;
604        }
605        if let Some(x) = &self.custom_data {
606            let p = path.field("customData");
607            x.validate(&p)?;
608        }
609        Ok(())
610    }
611}
612
613#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
614#[serde(deny_unknown_fields)]
615pub struct ChangeTransactionTariffResponse {
616    #[serde(rename = "status")]
617    pub status: TariffChangeStatusEnum,
618    #[serde(
619        rename = "statusInfo",
620        default,
621        skip_serializing_if = "Option::is_none"
622    )]
623    pub status_info: Option<StatusInfo>,
624    #[serde(
625        rename = "customData",
626        default,
627        skip_serializing_if = "Option::is_none"
628    )]
629    pub custom_data: Option<CustomData>,
630}
631
632impl Validate for ChangeTransactionTariffResponse {
633    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
634        if let Some(x) = &self.status_info {
635            let p = path.field("statusInfo");
636            x.validate(&p)?;
637        }
638        if let Some(x) = &self.custom_data {
639            let p = path.field("customData");
640            x.validate(&p)?;
641        }
642        Ok(())
643    }
644}
645
646#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
647#[serde(deny_unknown_fields)]
648pub struct ClearCacheRequest {
649    #[serde(
650        rename = "customData",
651        default,
652        skip_serializing_if = "Option::is_none"
653    )]
654    pub custom_data: Option<CustomData>,
655}
656
657impl Validate for ClearCacheRequest {
658    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
659        if let Some(x) = &self.custom_data {
660            let p = path.field("customData");
661            x.validate(&p)?;
662        }
663        Ok(())
664    }
665}
666
667#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
668#[serde(deny_unknown_fields)]
669pub struct ClearCacheResponse {
670    #[serde(rename = "status")]
671    pub status: ClearCacheStatusEnum,
672    #[serde(
673        rename = "statusInfo",
674        default,
675        skip_serializing_if = "Option::is_none"
676    )]
677    pub status_info: Option<StatusInfo>,
678    #[serde(
679        rename = "customData",
680        default,
681        skip_serializing_if = "Option::is_none"
682    )]
683    pub custom_data: Option<CustomData>,
684}
685
686impl Validate for ClearCacheResponse {
687    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
688        if let Some(x) = &self.status_info {
689            let p = path.field("statusInfo");
690            x.validate(&p)?;
691        }
692        if let Some(x) = &self.custom_data {
693            let p = path.field("customData");
694            x.validate(&p)?;
695        }
696        Ok(())
697    }
698}
699
700#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
701#[serde(deny_unknown_fields)]
702pub struct ClearChargingProfileRequest {
703    /// The Id of the charging profile to clear.
704    #[serde(
705        rename = "chargingProfileId",
706        default,
707        skip_serializing_if = "Option::is_none"
708    )]
709    pub charging_profile_id: Option<i64>,
710    #[serde(
711        rename = "chargingProfileCriteria",
712        default,
713        skip_serializing_if = "Option::is_none"
714    )]
715    pub charging_profile_criteria: Option<ClearChargingProfile>,
716    #[serde(
717        rename = "customData",
718        default,
719        skip_serializing_if = "Option::is_none"
720    )]
721    pub custom_data: Option<CustomData>,
722}
723
724impl Validate for ClearChargingProfileRequest {
725    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
726        if let Some(x) = &self.charging_profile_criteria {
727            let p = path.field("chargingProfileCriteria");
728            x.validate(&p)?;
729        }
730        if let Some(x) = &self.custom_data {
731            let p = path.field("customData");
732            x.validate(&p)?;
733        }
734        Ok(())
735    }
736}
737
738#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
739#[serde(deny_unknown_fields)]
740pub struct ClearChargingProfileResponse {
741    #[serde(rename = "status")]
742    pub status: ClearChargingProfileStatusEnum,
743    #[serde(
744        rename = "statusInfo",
745        default,
746        skip_serializing_if = "Option::is_none"
747    )]
748    pub status_info: Option<StatusInfo>,
749    #[serde(
750        rename = "customData",
751        default,
752        skip_serializing_if = "Option::is_none"
753    )]
754    pub custom_data: Option<CustomData>,
755}
756
757impl Validate for ClearChargingProfileResponse {
758    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
759        if let Some(x) = &self.status_info {
760            let p = path.field("statusInfo");
761            x.validate(&p)?;
762        }
763        if let Some(x) = &self.custom_data {
764            let p = path.field("customData");
765            x.validate(&p)?;
766        }
767        Ok(())
768    }
769}
770
771#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
772#[serde(deny_unknown_fields)]
773pub struct ClearDERControlRequest {
774    /// True: clearing default DER controls. False: clearing scheduled controls.
775    #[serde(rename = "isDefault")]
776    pub is_default: bool,
777    #[serde(
778        rename = "controlType",
779        default,
780        skip_serializing_if = "Option::is_none"
781    )]
782    pub control_type: Option<DERControlEnum>,
783    /// Id of control setting to clear. When omitted all settings for _controlType_ are cleared.
784    #[serde(rename = "controlId", default, skip_serializing_if = "Option::is_none")]
785    pub control_id: Option<String>,
786    #[serde(
787        rename = "customData",
788        default,
789        skip_serializing_if = "Option::is_none"
790    )]
791    pub custom_data: Option<CustomData>,
792}
793
794impl Validate for ClearDERControlRequest {
795    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
796        if let Some(x) = &self.control_id {
797            let p = path.field("controlId");
798            v::max_length(x, 36, &p)?;
799        }
800        if let Some(x) = &self.custom_data {
801            let p = path.field("customData");
802            x.validate(&p)?;
803        }
804        Ok(())
805    }
806}
807
808#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
809#[serde(deny_unknown_fields)]
810pub struct ClearDERControlResponse {
811    #[serde(rename = "status")]
812    pub status: DERControlStatusEnum,
813    #[serde(
814        rename = "statusInfo",
815        default,
816        skip_serializing_if = "Option::is_none"
817    )]
818    pub status_info: Option<StatusInfo>,
819    #[serde(
820        rename = "customData",
821        default,
822        skip_serializing_if = "Option::is_none"
823    )]
824    pub custom_data: Option<CustomData>,
825}
826
827impl Validate for ClearDERControlResponse {
828    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
829        if let Some(x) = &self.status_info {
830            let p = path.field("statusInfo");
831            x.validate(&p)?;
832        }
833        if let Some(x) = &self.custom_data {
834            let p = path.field("customData");
835            x.validate(&p)?;
836        }
837        Ok(())
838    }
839}
840
841#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
842#[serde(deny_unknown_fields)]
843pub struct ClearDisplayMessageRequest {
844    /// Id of the message that SHALL be removed from the Charging Station.
845    #[serde(rename = "id")]
846    pub id: i64,
847    #[serde(
848        rename = "customData",
849        default,
850        skip_serializing_if = "Option::is_none"
851    )]
852    pub custom_data: Option<CustomData>,
853}
854
855impl Validate for ClearDisplayMessageRequest {
856    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
857        {
858            let x = &self.id;
859            let p = path.field("id");
860            v::minimum(*x, 0i64, &p)?;
861        }
862        if let Some(x) = &self.custom_data {
863            let p = path.field("customData");
864            x.validate(&p)?;
865        }
866        Ok(())
867    }
868}
869
870#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
871#[serde(deny_unknown_fields)]
872pub struct ClearDisplayMessageResponse {
873    #[serde(rename = "status")]
874    pub status: ClearMessageStatusEnum,
875    #[serde(
876        rename = "statusInfo",
877        default,
878        skip_serializing_if = "Option::is_none"
879    )]
880    pub status_info: Option<StatusInfo>,
881    #[serde(
882        rename = "customData",
883        default,
884        skip_serializing_if = "Option::is_none"
885    )]
886    pub custom_data: Option<CustomData>,
887}
888
889impl Validate for ClearDisplayMessageResponse {
890    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
891        if let Some(x) = &self.status_info {
892            let p = path.field("statusInfo");
893            x.validate(&p)?;
894        }
895        if let Some(x) = &self.custom_data {
896            let p = path.field("customData");
897            x.validate(&p)?;
898        }
899        Ok(())
900    }
901}
902
903#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
904#[serde(deny_unknown_fields)]
905pub struct ClearTariffsRequest {
906    /// List of tariff Ids to clear. When absent clears all tariffs at _evseId_.
907    #[serde(rename = "tariffIds", default, skip_serializing_if = "Option::is_none")]
908    pub tariff_ids: Option<Vec<String>>,
909    /// When present only clear tariffs matching _tariffIds_ at EVSE _evseId_.
910    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
911    pub evse_id: Option<i64>,
912    #[serde(
913        rename = "customData",
914        default,
915        skip_serializing_if = "Option::is_none"
916    )]
917    pub custom_data: Option<CustomData>,
918}
919
920impl Validate for ClearTariffsRequest {
921    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
922        if let Some(x) = &self.tariff_ids {
923            let p = path.field("tariffIds");
924            v::items(x, Some(1), None, &p)?;
925            for (i0, it0) in x.iter().enumerate() {
926                let p0 = p.index(i0);
927                v::max_length(it0, 60, &p0)?;
928            }
929        }
930        if let Some(x) = &self.evse_id {
931            let p = path.field("evseId");
932            v::minimum(*x, 0i64, &p)?;
933        }
934        if let Some(x) = &self.custom_data {
935            let p = path.field("customData");
936            x.validate(&p)?;
937        }
938        Ok(())
939    }
940}
941
942#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
943#[serde(deny_unknown_fields)]
944pub struct ClearTariffsResponse {
945    #[serde(rename = "clearTariffsResult")]
946    pub clear_tariffs_result: Vec<ClearTariffsResult>,
947    #[serde(
948        rename = "customData",
949        default,
950        skip_serializing_if = "Option::is_none"
951    )]
952    pub custom_data: Option<CustomData>,
953}
954
955impl Validate for ClearTariffsResponse {
956    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
957        {
958            let x = &self.clear_tariffs_result;
959            let p = path.field("clearTariffsResult");
960            v::items(x, Some(1), None, &p)?;
961            for (i0, it0) in x.iter().enumerate() {
962                let p0 = p.index(i0);
963                it0.validate(&p0)?;
964            }
965        }
966        if let Some(x) = &self.custom_data {
967            let p = path.field("customData");
968            x.validate(&p)?;
969        }
970        Ok(())
971    }
972}
973
974#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
975#[serde(deny_unknown_fields)]
976pub struct ClearVariableMonitoringRequest {
977    /// List of the monitors to be cleared, identified by there Id.
978    #[serde(rename = "id")]
979    pub id: Vec<i64>,
980    #[serde(
981        rename = "customData",
982        default,
983        skip_serializing_if = "Option::is_none"
984    )]
985    pub custom_data: Option<CustomData>,
986}
987
988impl Validate for ClearVariableMonitoringRequest {
989    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
990        {
991            let x = &self.id;
992            let p = path.field("id");
993            v::items(x, Some(1), None, &p)?;
994            for (i0, it0) in x.iter().enumerate() {
995                let p0 = p.index(i0);
996                v::minimum(*it0, 0i64, &p0)?;
997            }
998        }
999        if let Some(x) = &self.custom_data {
1000            let p = path.field("customData");
1001            x.validate(&p)?;
1002        }
1003        Ok(())
1004    }
1005}
1006
1007#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1008#[serde(deny_unknown_fields)]
1009pub struct ClearVariableMonitoringResponse {
1010    #[serde(rename = "clearMonitoringResult")]
1011    pub clear_monitoring_result: Vec<ClearMonitoringResult>,
1012    #[serde(
1013        rename = "customData",
1014        default,
1015        skip_serializing_if = "Option::is_none"
1016    )]
1017    pub custom_data: Option<CustomData>,
1018}
1019
1020impl Validate for ClearVariableMonitoringResponse {
1021    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1022        {
1023            let x = &self.clear_monitoring_result;
1024            let p = path.field("clearMonitoringResult");
1025            v::items(x, Some(1), None, &p)?;
1026            for (i0, it0) in x.iter().enumerate() {
1027                let p0 = p.index(i0);
1028                it0.validate(&p0)?;
1029            }
1030        }
1031        if let Some(x) = &self.custom_data {
1032            let p = path.field("customData");
1033            x.validate(&p)?;
1034        }
1035        Ok(())
1036    }
1037}
1038
1039#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1040#[serde(deny_unknown_fields)]
1041pub struct ClearedChargingLimitRequest {
1042    /// Source of the charging limit. Allowed values defined in Appendix as ChargingLimitSourceEnumStringType.
1043    #[serde(rename = "chargingLimitSource")]
1044    pub charging_limit_source: String,
1045    /// EVSE Identifier.
1046    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
1047    pub evse_id: Option<i64>,
1048    #[serde(
1049        rename = "customData",
1050        default,
1051        skip_serializing_if = "Option::is_none"
1052    )]
1053    pub custom_data: Option<CustomData>,
1054}
1055
1056impl Validate for ClearedChargingLimitRequest {
1057    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1058        {
1059            let x = &self.charging_limit_source;
1060            let p = path.field("chargingLimitSource");
1061            v::max_length(x, 20, &p)?;
1062        }
1063        if let Some(x) = &self.evse_id {
1064            let p = path.field("evseId");
1065            v::minimum(*x, 0i64, &p)?;
1066        }
1067        if let Some(x) = &self.custom_data {
1068            let p = path.field("customData");
1069            x.validate(&p)?;
1070        }
1071        Ok(())
1072    }
1073}
1074
1075#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1076#[serde(deny_unknown_fields)]
1077pub struct ClearedChargingLimitResponse {
1078    #[serde(
1079        rename = "customData",
1080        default,
1081        skip_serializing_if = "Option::is_none"
1082    )]
1083    pub custom_data: Option<CustomData>,
1084}
1085
1086impl Validate for ClearedChargingLimitResponse {
1087    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1088        if let Some(x) = &self.custom_data {
1089            let p = path.field("customData");
1090            x.validate(&p)?;
1091        }
1092        Ok(())
1093    }
1094}
1095
1096#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1097#[serde(deny_unknown_fields)]
1098pub struct ClosePeriodicEventStreamRequest {
1099    /// Id of stream to close.
1100    #[serde(rename = "id")]
1101    pub id: i64,
1102    #[serde(
1103        rename = "customData",
1104        default,
1105        skip_serializing_if = "Option::is_none"
1106    )]
1107    pub custom_data: Option<CustomData>,
1108}
1109
1110impl Validate for ClosePeriodicEventStreamRequest {
1111    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1112        {
1113            let x = &self.id;
1114            let p = path.field("id");
1115            v::minimum(*x, 0i64, &p)?;
1116        }
1117        if let Some(x) = &self.custom_data {
1118            let p = path.field("customData");
1119            x.validate(&p)?;
1120        }
1121        Ok(())
1122    }
1123}
1124
1125#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1126#[serde(deny_unknown_fields)]
1127pub struct ClosePeriodicEventStreamResponse {
1128    #[serde(
1129        rename = "customData",
1130        default,
1131        skip_serializing_if = "Option::is_none"
1132    )]
1133    pub custom_data: Option<CustomData>,
1134}
1135
1136impl Validate for ClosePeriodicEventStreamResponse {
1137    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1138        if let Some(x) = &self.custom_data {
1139            let p = path.field("customData");
1140            x.validate(&p)?;
1141        }
1142        Ok(())
1143    }
1144}
1145
1146#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1147#[serde(deny_unknown_fields)]
1148pub struct CostUpdatedRequest {
1149    /// Current total cost, based on the information known by the CSMS, of the transaction including taxes. In the currency configured with the configuration Variable: \[&lt;&lt;configkey-currency, Currency&gt;&gt;\]
1150    #[serde(rename = "totalCost")]
1151    pub total_cost: f64,
1152    /// Transaction Id of the transaction the current cost are asked for.
1153    #[serde(rename = "transactionId")]
1154    pub transaction_id: String,
1155    #[serde(
1156        rename = "customData",
1157        default,
1158        skip_serializing_if = "Option::is_none"
1159    )]
1160    pub custom_data: Option<CustomData>,
1161}
1162
1163impl Validate for CostUpdatedRequest {
1164    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1165        {
1166            let x = &self.transaction_id;
1167            let p = path.field("transactionId");
1168            v::max_length(x, 36, &p)?;
1169        }
1170        if let Some(x) = &self.custom_data {
1171            let p = path.field("customData");
1172            x.validate(&p)?;
1173        }
1174        Ok(())
1175    }
1176}
1177
1178#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1179#[serde(deny_unknown_fields)]
1180pub struct CostUpdatedResponse {
1181    #[serde(
1182        rename = "customData",
1183        default,
1184        skip_serializing_if = "Option::is_none"
1185    )]
1186    pub custom_data: Option<CustomData>,
1187}
1188
1189impl Validate for CostUpdatedResponse {
1190    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1191        if let Some(x) = &self.custom_data {
1192            let p = path.field("customData");
1193            x.validate(&p)?;
1194        }
1195        Ok(())
1196    }
1197}
1198
1199#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1200#[serde(deny_unknown_fields)]
1201pub struct CustomerInformationRequest {
1202    #[serde(
1203        rename = "customerCertificate",
1204        default,
1205        skip_serializing_if = "Option::is_none"
1206    )]
1207    pub customer_certificate: Option<CertificateHashData>,
1208    #[serde(rename = "idToken", default, skip_serializing_if = "Option::is_none")]
1209    pub id_token: Option<IdToken>,
1210    /// The Id of the request.
1211    #[serde(rename = "requestId")]
1212    pub request_id: i64,
1213    /// Flag indicating whether the Charging Station should return NotifyCustomerInformationRequest messages containing information about the customer referred to.
1214    #[serde(rename = "report")]
1215    pub report: bool,
1216    /// Flag indicating whether the Charging Station should clear all information about the customer referred to.
1217    #[serde(rename = "clear")]
1218    pub clear: bool,
1219    /// A (e.g. vendor specific) identifier of the customer this request refers to. This field contains a custom identifier other than IdToken and Certificate.
1220    /// One of the possible identifiers (customerIdentifier, customerIdToken or customerCertificate) should be in the request message.
1221    #[serde(
1222        rename = "customerIdentifier",
1223        default,
1224        skip_serializing_if = "Option::is_none"
1225    )]
1226    pub customer_identifier: Option<String>,
1227    #[serde(
1228        rename = "customData",
1229        default,
1230        skip_serializing_if = "Option::is_none"
1231    )]
1232    pub custom_data: Option<CustomData>,
1233}
1234
1235impl Validate for CustomerInformationRequest {
1236    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1237        if let Some(x) = &self.customer_certificate {
1238            let p = path.field("customerCertificate");
1239            x.validate(&p)?;
1240        }
1241        if let Some(x) = &self.id_token {
1242            let p = path.field("idToken");
1243            x.validate(&p)?;
1244        }
1245        {
1246            let x = &self.request_id;
1247            let p = path.field("requestId");
1248            v::minimum(*x, 0i64, &p)?;
1249        }
1250        if let Some(x) = &self.customer_identifier {
1251            let p = path.field("customerIdentifier");
1252            v::max_length(x, 64, &p)?;
1253        }
1254        if let Some(x) = &self.custom_data {
1255            let p = path.field("customData");
1256            x.validate(&p)?;
1257        }
1258        Ok(())
1259    }
1260}
1261
1262#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1263#[serde(deny_unknown_fields)]
1264pub struct CustomerInformationResponse {
1265    #[serde(rename = "status")]
1266    pub status: CustomerInformationStatusEnum,
1267    #[serde(
1268        rename = "statusInfo",
1269        default,
1270        skip_serializing_if = "Option::is_none"
1271    )]
1272    pub status_info: Option<StatusInfo>,
1273    #[serde(
1274        rename = "customData",
1275        default,
1276        skip_serializing_if = "Option::is_none"
1277    )]
1278    pub custom_data: Option<CustomData>,
1279}
1280
1281impl Validate for CustomerInformationResponse {
1282    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1283        if let Some(x) = &self.status_info {
1284            let p = path.field("statusInfo");
1285            x.validate(&p)?;
1286        }
1287        if let Some(x) = &self.custom_data {
1288            let p = path.field("customData");
1289            x.validate(&p)?;
1290        }
1291        Ok(())
1292    }
1293}
1294
1295#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1296#[serde(deny_unknown_fields)]
1297pub struct DataTransferRequest {
1298    /// May be used to indicate a specific message or implementation.
1299    #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")]
1300    pub message_id: Option<String>,
1301    /// Data without specified length or format. This needs to be decided by both parties (Open to implementation).
1302    #[serde(rename = "data", default, skip_serializing_if = "Option::is_none")]
1303    pub data: Option<serde_json::Value>,
1304    /// This identifies the Vendor specific implementation
1305    #[serde(rename = "vendorId")]
1306    pub vendor_id: String,
1307    #[serde(
1308        rename = "customData",
1309        default,
1310        skip_serializing_if = "Option::is_none"
1311    )]
1312    pub custom_data: Option<CustomData>,
1313}
1314
1315impl Validate for DataTransferRequest {
1316    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1317        if let Some(x) = &self.message_id {
1318            let p = path.field("messageId");
1319            v::max_length(x, 50, &p)?;
1320        }
1321        {
1322            let x = &self.vendor_id;
1323            let p = path.field("vendorId");
1324            v::max_length(x, 255, &p)?;
1325        }
1326        if let Some(x) = &self.custom_data {
1327            let p = path.field("customData");
1328            x.validate(&p)?;
1329        }
1330        Ok(())
1331    }
1332}
1333
1334#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1335#[serde(deny_unknown_fields)]
1336pub struct DataTransferResponse {
1337    #[serde(rename = "status")]
1338    pub status: DataTransferStatusEnum,
1339    #[serde(
1340        rename = "statusInfo",
1341        default,
1342        skip_serializing_if = "Option::is_none"
1343    )]
1344    pub status_info: Option<StatusInfo>,
1345    /// Data without specified length or format, in response to request.
1346    #[serde(rename = "data", default, skip_serializing_if = "Option::is_none")]
1347    pub data: Option<serde_json::Value>,
1348    #[serde(
1349        rename = "customData",
1350        default,
1351        skip_serializing_if = "Option::is_none"
1352    )]
1353    pub custom_data: Option<CustomData>,
1354}
1355
1356impl Validate for DataTransferResponse {
1357    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1358        if let Some(x) = &self.status_info {
1359            let p = path.field("statusInfo");
1360            x.validate(&p)?;
1361        }
1362        if let Some(x) = &self.custom_data {
1363            let p = path.field("customData");
1364            x.validate(&p)?;
1365        }
1366        Ok(())
1367    }
1368}
1369
1370#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1371#[serde(deny_unknown_fields)]
1372pub struct DeleteCertificateRequest {
1373    #[serde(rename = "certificateHashData")]
1374    pub certificate_hash_data: CertificateHashData,
1375    #[serde(
1376        rename = "customData",
1377        default,
1378        skip_serializing_if = "Option::is_none"
1379    )]
1380    pub custom_data: Option<CustomData>,
1381}
1382
1383impl Validate for DeleteCertificateRequest {
1384    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1385        {
1386            let x = &self.certificate_hash_data;
1387            let p = path.field("certificateHashData");
1388            x.validate(&p)?;
1389        }
1390        if let Some(x) = &self.custom_data {
1391            let p = path.field("customData");
1392            x.validate(&p)?;
1393        }
1394        Ok(())
1395    }
1396}
1397
1398#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1399#[serde(deny_unknown_fields)]
1400pub struct DeleteCertificateResponse {
1401    #[serde(rename = "status")]
1402    pub status: DeleteCertificateStatusEnum,
1403    #[serde(
1404        rename = "statusInfo",
1405        default,
1406        skip_serializing_if = "Option::is_none"
1407    )]
1408    pub status_info: Option<StatusInfo>,
1409    #[serde(
1410        rename = "customData",
1411        default,
1412        skip_serializing_if = "Option::is_none"
1413    )]
1414    pub custom_data: Option<CustomData>,
1415}
1416
1417impl Validate for DeleteCertificateResponse {
1418    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1419        if let Some(x) = &self.status_info {
1420            let p = path.field("statusInfo");
1421            x.validate(&p)?;
1422        }
1423        if let Some(x) = &self.custom_data {
1424            let p = path.field("customData");
1425            x.validate(&p)?;
1426        }
1427        Ok(())
1428    }
1429}
1430
1431#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1432#[serde(deny_unknown_fields)]
1433pub struct FirmwareStatusNotificationRequest {
1434    #[serde(rename = "status")]
1435    pub status: FirmwareStatusEnum,
1436    /// The request id that was provided in the
1437    /// UpdateFirmwareRequest that started this firmware update.
1438    /// This field is mandatory, unless the message was triggered by a TriggerMessageRequest AND there is no firmware update ongoing.
1439    #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")]
1440    pub request_id: Option<i64>,
1441    #[serde(
1442        rename = "statusInfo",
1443        default,
1444        skip_serializing_if = "Option::is_none"
1445    )]
1446    pub status_info: Option<StatusInfo>,
1447    #[serde(
1448        rename = "customData",
1449        default,
1450        skip_serializing_if = "Option::is_none"
1451    )]
1452    pub custom_data: Option<CustomData>,
1453}
1454
1455impl Validate for FirmwareStatusNotificationRequest {
1456    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1457        if let Some(x) = &self.status_info {
1458            let p = path.field("statusInfo");
1459            x.validate(&p)?;
1460        }
1461        if let Some(x) = &self.custom_data {
1462            let p = path.field("customData");
1463            x.validate(&p)?;
1464        }
1465        Ok(())
1466    }
1467}
1468
1469#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1470#[serde(deny_unknown_fields)]
1471pub struct FirmwareStatusNotificationResponse {
1472    #[serde(
1473        rename = "customData",
1474        default,
1475        skip_serializing_if = "Option::is_none"
1476    )]
1477    pub custom_data: Option<CustomData>,
1478}
1479
1480impl Validate for FirmwareStatusNotificationResponse {
1481    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1482        if let Some(x) = &self.custom_data {
1483            let p = path.field("customData");
1484            x.validate(&p)?;
1485        }
1486        Ok(())
1487    }
1488}
1489
1490#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1491#[serde(deny_unknown_fields)]
1492pub struct Get15118EVCertificateRequest {
1493    /// Schema version currently used for the 15118 session between EV and Charging Station. Needed for parsing of the EXI stream by the CSMS.
1494    #[serde(rename = "iso15118SchemaVersion")]
1495    pub iso15118_schema_version: String,
1496    #[serde(rename = "action")]
1497    pub action: CertificateActionEnum,
1498    /// *(2.1)* Raw CertificateInstallationReq request from EV, Base64 encoded. +
1499    /// Extended to support ISO 15118-20 certificates. The minimum supported length is 11000. If a longer _exiRequest_ is supported, then the supported length must be communicated in variable OCPPCommCtrlr.FieldLength\[ "Get15118EVCertificateRequest.exiRequest" \].
1500    #[serde(rename = "exiRequest")]
1501    pub exi_request: String,
1502    /// *(2.1)* Absent during ISO 15118-2 session. Required during ISO 15118-20 session. +
1503    /// Maximum number of contracts that EV wants to install.
1504    #[serde(
1505        rename = "maximumContractCertificateChains",
1506        default,
1507        skip_serializing_if = "Option::is_none"
1508    )]
1509    pub maximum_contract_certificate_chains: Option<i64>,
1510    /// *(2.1)*  Absent during ISO 15118-2 session. Optional during ISO 15118-20 session. List of EMAIDs for which contract certificates must be requested first, in case there are more certificates than allowed by _maximumContractCertificateChains_.
1511    #[serde(
1512        rename = "prioritizedEMAIDs",
1513        default,
1514        skip_serializing_if = "Option::is_none"
1515    )]
1516    pub prioritized_emai_ds: Option<Vec<String>>,
1517    #[serde(
1518        rename = "customData",
1519        default,
1520        skip_serializing_if = "Option::is_none"
1521    )]
1522    pub custom_data: Option<CustomData>,
1523}
1524
1525impl Validate for Get15118EVCertificateRequest {
1526    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1527        {
1528            let x = &self.iso15118_schema_version;
1529            let p = path.field("iso15118SchemaVersion");
1530            v::max_length(x, 50, &p)?;
1531        }
1532        {
1533            let x = &self.exi_request;
1534            let p = path.field("exiRequest");
1535            v::max_length(x, 11000, &p)?;
1536        }
1537        if let Some(x) = &self.maximum_contract_certificate_chains {
1538            let p = path.field("maximumContractCertificateChains");
1539            v::minimum(*x, 0i64, &p)?;
1540        }
1541        if let Some(x) = &self.prioritized_emai_ds {
1542            let p = path.field("prioritizedEMAIDs");
1543            v::items(x, Some(1), Some(8), &p)?;
1544            for (i0, it0) in x.iter().enumerate() {
1545                let p0 = p.index(i0);
1546                v::max_length(it0, 255, &p0)?;
1547            }
1548        }
1549        if let Some(x) = &self.custom_data {
1550            let p = path.field("customData");
1551            x.validate(&p)?;
1552        }
1553        Ok(())
1554    }
1555}
1556
1557#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1558#[serde(deny_unknown_fields)]
1559pub struct Get15118EVCertificateResponse {
1560    #[serde(rename = "status")]
1561    pub status: Iso15118EVCertificateStatusEnum,
1562    #[serde(
1563        rename = "statusInfo",
1564        default,
1565        skip_serializing_if = "Option::is_none"
1566    )]
1567    pub status_info: Option<StatusInfo>,
1568    /// *(2/1)* Raw CertificateInstallationRes response for the EV, Base64 encoded. +
1569    /// Extended to support ISO 15118-20 certificates. The minimum supported length is 17000. If a longer _exiResponse_ is supported, then the supported length must be communicated in variable OCPPCommCtrlr.FieldLength\[ "Get15118EVCertificateResponse.exiResponse" \].
1570    #[serde(rename = "exiResponse")]
1571    pub exi_response: String,
1572    /// *(2.1)* Number of contracts that can be retrieved with additional requests.
1573    #[serde(
1574        rename = "remainingContracts",
1575        default,
1576        skip_serializing_if = "Option::is_none"
1577    )]
1578    pub remaining_contracts: Option<i64>,
1579    #[serde(
1580        rename = "customData",
1581        default,
1582        skip_serializing_if = "Option::is_none"
1583    )]
1584    pub custom_data: Option<CustomData>,
1585}
1586
1587impl Validate for Get15118EVCertificateResponse {
1588    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1589        if let Some(x) = &self.status_info {
1590            let p = path.field("statusInfo");
1591            x.validate(&p)?;
1592        }
1593        {
1594            let x = &self.exi_response;
1595            let p = path.field("exiResponse");
1596            v::max_length(x, 17000, &p)?;
1597        }
1598        if let Some(x) = &self.remaining_contracts {
1599            let p = path.field("remainingContracts");
1600            v::minimum(*x, 0i64, &p)?;
1601        }
1602        if let Some(x) = &self.custom_data {
1603            let p = path.field("customData");
1604            x.validate(&p)?;
1605        }
1606        Ok(())
1607    }
1608}
1609
1610#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1611#[serde(deny_unknown_fields)]
1612pub struct GetBaseReportRequest {
1613    /// The Id of the request.
1614    #[serde(rename = "requestId")]
1615    pub request_id: i64,
1616    #[serde(rename = "reportBase")]
1617    pub report_base: ReportBaseEnum,
1618    #[serde(
1619        rename = "customData",
1620        default,
1621        skip_serializing_if = "Option::is_none"
1622    )]
1623    pub custom_data: Option<CustomData>,
1624}
1625
1626impl Validate for GetBaseReportRequest {
1627    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1628        if let Some(x) = &self.custom_data {
1629            let p = path.field("customData");
1630            x.validate(&p)?;
1631        }
1632        Ok(())
1633    }
1634}
1635
1636#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1637#[serde(deny_unknown_fields)]
1638pub struct GetBaseReportResponse {
1639    #[serde(rename = "status")]
1640    pub status: GenericDeviceModelStatusEnum,
1641    #[serde(
1642        rename = "statusInfo",
1643        default,
1644        skip_serializing_if = "Option::is_none"
1645    )]
1646    pub status_info: Option<StatusInfo>,
1647    #[serde(
1648        rename = "customData",
1649        default,
1650        skip_serializing_if = "Option::is_none"
1651    )]
1652    pub custom_data: Option<CustomData>,
1653}
1654
1655impl Validate for GetBaseReportResponse {
1656    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1657        if let Some(x) = &self.status_info {
1658            let p = path.field("statusInfo");
1659            x.validate(&p)?;
1660        }
1661        if let Some(x) = &self.custom_data {
1662            let p = path.field("customData");
1663            x.validate(&p)?;
1664        }
1665        Ok(())
1666    }
1667}
1668
1669#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1670#[serde(deny_unknown_fields)]
1671pub struct GetCertificateChainStatusRequest {
1672    #[serde(rename = "certificateStatusRequests")]
1673    pub certificate_status_requests: Vec<CertificateStatusRequestInfo>,
1674    #[serde(
1675        rename = "customData",
1676        default,
1677        skip_serializing_if = "Option::is_none"
1678    )]
1679    pub custom_data: Option<CustomData>,
1680}
1681
1682impl Validate for GetCertificateChainStatusRequest {
1683    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1684        {
1685            let x = &self.certificate_status_requests;
1686            let p = path.field("certificateStatusRequests");
1687            v::items(x, Some(1), Some(4), &p)?;
1688            for (i0, it0) in x.iter().enumerate() {
1689                let p0 = p.index(i0);
1690                it0.validate(&p0)?;
1691            }
1692        }
1693        if let Some(x) = &self.custom_data {
1694            let p = path.field("customData");
1695            x.validate(&p)?;
1696        }
1697        Ok(())
1698    }
1699}
1700
1701#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1702#[serde(deny_unknown_fields)]
1703pub struct GetCertificateChainStatusResponse {
1704    #[serde(rename = "certificateStatus")]
1705    pub certificate_status: Vec<CertificateStatus>,
1706    #[serde(
1707        rename = "customData",
1708        default,
1709        skip_serializing_if = "Option::is_none"
1710    )]
1711    pub custom_data: Option<CustomData>,
1712}
1713
1714impl Validate for GetCertificateChainStatusResponse {
1715    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1716        {
1717            let x = &self.certificate_status;
1718            let p = path.field("certificateStatus");
1719            v::items(x, Some(1), Some(4), &p)?;
1720            for (i0, it0) in x.iter().enumerate() {
1721                let p0 = p.index(i0);
1722                it0.validate(&p0)?;
1723            }
1724        }
1725        if let Some(x) = &self.custom_data {
1726            let p = path.field("customData");
1727            x.validate(&p)?;
1728        }
1729        Ok(())
1730    }
1731}
1732
1733#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1734#[serde(deny_unknown_fields)]
1735pub struct GetCertificateStatusRequest {
1736    #[serde(rename = "ocspRequestData")]
1737    pub ocsp_request_data: OCSPRequestData,
1738    #[serde(
1739        rename = "customData",
1740        default,
1741        skip_serializing_if = "Option::is_none"
1742    )]
1743    pub custom_data: Option<CustomData>,
1744}
1745
1746impl Validate for GetCertificateStatusRequest {
1747    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1748        {
1749            let x = &self.ocsp_request_data;
1750            let p = path.field("ocspRequestData");
1751            x.validate(&p)?;
1752        }
1753        if let Some(x) = &self.custom_data {
1754            let p = path.field("customData");
1755            x.validate(&p)?;
1756        }
1757        Ok(())
1758    }
1759}
1760
1761#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1762#[serde(deny_unknown_fields)]
1763pub struct GetCertificateStatusResponse {
1764    #[serde(rename = "status")]
1765    pub status: GetCertificateStatusEnum,
1766    #[serde(
1767        rename = "statusInfo",
1768        default,
1769        skip_serializing_if = "Option::is_none"
1770    )]
1771    pub status_info: Option<StatusInfo>,
1772    /// *(2.1)* OCSPResponse class as defined in &lt;&lt;ref-ocpp_security_24, IETF RFC 6960&gt;&gt;. DER encoded (as defined in &lt;&lt;ref-ocpp_security_24, IETF RFC 6960&gt;&gt;), and then base64 encoded. MAY only be omitted when status is not Accepted. +
1773    /// The minimum supported length is 18000. If a longer _ocspResult_ is supported, then the supported length must be communicated in variable OCPPCommCtrlr.FieldLength\[ "GetCertificateStatusResponse.ocspResult" \].
1774    #[serde(
1775        rename = "ocspResult",
1776        default,
1777        skip_serializing_if = "Option::is_none"
1778    )]
1779    pub ocsp_result: Option<String>,
1780    #[serde(
1781        rename = "customData",
1782        default,
1783        skip_serializing_if = "Option::is_none"
1784    )]
1785    pub custom_data: Option<CustomData>,
1786}
1787
1788impl Validate for GetCertificateStatusResponse {
1789    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1790        if let Some(x) = &self.status_info {
1791            let p = path.field("statusInfo");
1792            x.validate(&p)?;
1793        }
1794        if let Some(x) = &self.ocsp_result {
1795            let p = path.field("ocspResult");
1796            v::max_length(x, 18000, &p)?;
1797        }
1798        if let Some(x) = &self.custom_data {
1799            let p = path.field("customData");
1800            x.validate(&p)?;
1801        }
1802        Ok(())
1803    }
1804}
1805
1806#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1807#[serde(deny_unknown_fields)]
1808pub struct GetChargingProfilesRequest {
1809    /// Reference identification that is to be used by the Charging Station in the &lt;&lt;reportchargingprofilesrequest, ReportChargingProfilesRequest&gt;&gt; when provided.
1810    #[serde(rename = "requestId")]
1811    pub request_id: i64,
1812    /// For which EVSE installed charging profiles SHALL be reported. If 0, only charging profiles installed on the Charging Station itself (the grid connection) SHALL be reported. If omitted, all installed charging profiles SHALL be reported. +
1813    /// Reported charging profiles SHALL match the criteria in field _chargingProfile_.
1814    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
1815    pub evse_id: Option<i64>,
1816    #[serde(rename = "chargingProfile")]
1817    pub charging_profile: ChargingProfileCriterion,
1818    #[serde(
1819        rename = "customData",
1820        default,
1821        skip_serializing_if = "Option::is_none"
1822    )]
1823    pub custom_data: Option<CustomData>,
1824}
1825
1826impl Validate for GetChargingProfilesRequest {
1827    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1828        if let Some(x) = &self.evse_id {
1829            let p = path.field("evseId");
1830            v::minimum(*x, 0i64, &p)?;
1831        }
1832        {
1833            let x = &self.charging_profile;
1834            let p = path.field("chargingProfile");
1835            x.validate(&p)?;
1836        }
1837        if let Some(x) = &self.custom_data {
1838            let p = path.field("customData");
1839            x.validate(&p)?;
1840        }
1841        Ok(())
1842    }
1843}
1844
1845#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1846#[serde(deny_unknown_fields)]
1847pub struct GetChargingProfilesResponse {
1848    #[serde(rename = "status")]
1849    pub status: GetChargingProfileStatusEnum,
1850    #[serde(
1851        rename = "statusInfo",
1852        default,
1853        skip_serializing_if = "Option::is_none"
1854    )]
1855    pub status_info: Option<StatusInfo>,
1856    #[serde(
1857        rename = "customData",
1858        default,
1859        skip_serializing_if = "Option::is_none"
1860    )]
1861    pub custom_data: Option<CustomData>,
1862}
1863
1864impl Validate for GetChargingProfilesResponse {
1865    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1866        if let Some(x) = &self.status_info {
1867            let p = path.field("statusInfo");
1868            x.validate(&p)?;
1869        }
1870        if let Some(x) = &self.custom_data {
1871            let p = path.field("customData");
1872            x.validate(&p)?;
1873        }
1874        Ok(())
1875    }
1876}
1877
1878#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1879#[serde(deny_unknown_fields)]
1880pub struct GetCompositeScheduleRequest {
1881    /// Length of the requested schedule in seconds.
1882    #[serde(rename = "duration")]
1883    pub duration: i64,
1884    #[serde(
1885        rename = "chargingRateUnit",
1886        default,
1887        skip_serializing_if = "Option::is_none"
1888    )]
1889    pub charging_rate_unit: Option<ChargingRateUnitEnum>,
1890    /// The ID of the EVSE for which the schedule is requested. When evseid=0, the Charging Station will calculate the expected consumption for the grid connection.
1891    #[serde(rename = "evseId")]
1892    pub evse_id: i64,
1893    #[serde(
1894        rename = "customData",
1895        default,
1896        skip_serializing_if = "Option::is_none"
1897    )]
1898    pub custom_data: Option<CustomData>,
1899}
1900
1901impl Validate for GetCompositeScheduleRequest {
1902    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1903        {
1904            let x = &self.evse_id;
1905            let p = path.field("evseId");
1906            v::minimum(*x, 0i64, &p)?;
1907        }
1908        if let Some(x) = &self.custom_data {
1909            let p = path.field("customData");
1910            x.validate(&p)?;
1911        }
1912        Ok(())
1913    }
1914}
1915
1916#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1917#[serde(deny_unknown_fields)]
1918pub struct GetCompositeScheduleResponse {
1919    #[serde(rename = "status")]
1920    pub status: GenericStatusEnum,
1921    #[serde(
1922        rename = "statusInfo",
1923        default,
1924        skip_serializing_if = "Option::is_none"
1925    )]
1926    pub status_info: Option<StatusInfo>,
1927    #[serde(rename = "schedule", default, skip_serializing_if = "Option::is_none")]
1928    pub schedule: Option<CompositeSchedule>,
1929    #[serde(
1930        rename = "customData",
1931        default,
1932        skip_serializing_if = "Option::is_none"
1933    )]
1934    pub custom_data: Option<CustomData>,
1935}
1936
1937impl Validate for GetCompositeScheduleResponse {
1938    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1939        if let Some(x) = &self.status_info {
1940            let p = path.field("statusInfo");
1941            x.validate(&p)?;
1942        }
1943        if let Some(x) = &self.schedule {
1944            let p = path.field("schedule");
1945            x.validate(&p)?;
1946        }
1947        if let Some(x) = &self.custom_data {
1948            let p = path.field("customData");
1949            x.validate(&p)?;
1950        }
1951        Ok(())
1952    }
1953}
1954
1955#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1956#[serde(deny_unknown_fields)]
1957pub struct GetDERControlRequest {
1958    /// RequestId to be used in ReportDERControlRequest.
1959    #[serde(rename = "requestId")]
1960    pub request_id: i64,
1961    /// True: get a default DER control. False: get a scheduled control.
1962    #[serde(rename = "isDefault", default, skip_serializing_if = "Option::is_none")]
1963    pub is_default: Option<bool>,
1964    #[serde(
1965        rename = "controlType",
1966        default,
1967        skip_serializing_if = "Option::is_none"
1968    )]
1969    pub control_type: Option<DERControlEnum>,
1970    /// Id of setting to get. When omitted all settings for _controlType_ are retrieved.
1971    #[serde(rename = "controlId", default, skip_serializing_if = "Option::is_none")]
1972    pub control_id: Option<String>,
1973    #[serde(
1974        rename = "customData",
1975        default,
1976        skip_serializing_if = "Option::is_none"
1977    )]
1978    pub custom_data: Option<CustomData>,
1979}
1980
1981impl Validate for GetDERControlRequest {
1982    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1983        if let Some(x) = &self.control_id {
1984            let p = path.field("controlId");
1985            v::max_length(x, 36, &p)?;
1986        }
1987        if let Some(x) = &self.custom_data {
1988            let p = path.field("customData");
1989            x.validate(&p)?;
1990        }
1991        Ok(())
1992    }
1993}
1994
1995#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1996#[serde(deny_unknown_fields)]
1997pub struct GetDERControlResponse {
1998    #[serde(rename = "status")]
1999    pub status: DERControlStatusEnum,
2000    #[serde(
2001        rename = "statusInfo",
2002        default,
2003        skip_serializing_if = "Option::is_none"
2004    )]
2005    pub status_info: Option<StatusInfo>,
2006    #[serde(
2007        rename = "customData",
2008        default,
2009        skip_serializing_if = "Option::is_none"
2010    )]
2011    pub custom_data: Option<CustomData>,
2012}
2013
2014impl Validate for GetDERControlResponse {
2015    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2016        if let Some(x) = &self.status_info {
2017            let p = path.field("statusInfo");
2018            x.validate(&p)?;
2019        }
2020        if let Some(x) = &self.custom_data {
2021            let p = path.field("customData");
2022            x.validate(&p)?;
2023        }
2024        Ok(())
2025    }
2026}
2027
2028#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2029#[serde(deny_unknown_fields)]
2030pub struct GetDisplayMessagesRequest {
2031    /// If provided the Charging Station shall return Display Messages of the given ids. This field SHALL NOT contain more ids than set in &lt;&lt;configkey-number-of-display-messages,NumberOfDisplayMessages.maxLimit&gt;&gt;
2032    #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2033    pub id: Option<Vec<i64>>,
2034    /// The Id of this request.
2035    #[serde(rename = "requestId")]
2036    pub request_id: i64,
2037    #[serde(rename = "priority", default, skip_serializing_if = "Option::is_none")]
2038    pub priority: Option<MessagePriorityEnum>,
2039    #[serde(rename = "state", default, skip_serializing_if = "Option::is_none")]
2040    pub state: Option<MessageStateEnum>,
2041    #[serde(
2042        rename = "customData",
2043        default,
2044        skip_serializing_if = "Option::is_none"
2045    )]
2046    pub custom_data: Option<CustomData>,
2047}
2048
2049impl Validate for GetDisplayMessagesRequest {
2050    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2051        if let Some(x) = &self.id {
2052            let p = path.field("id");
2053            v::items(x, Some(1), None, &p)?;
2054            for (i0, it0) in x.iter().enumerate() {
2055                let p0 = p.index(i0);
2056                v::minimum(*it0, 0i64, &p0)?;
2057            }
2058        }
2059        if let Some(x) = &self.custom_data {
2060            let p = path.field("customData");
2061            x.validate(&p)?;
2062        }
2063        Ok(())
2064    }
2065}
2066
2067#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2068#[serde(deny_unknown_fields)]
2069pub struct GetDisplayMessagesResponse {
2070    #[serde(rename = "status")]
2071    pub status: GetDisplayMessagesStatusEnum,
2072    #[serde(
2073        rename = "statusInfo",
2074        default,
2075        skip_serializing_if = "Option::is_none"
2076    )]
2077    pub status_info: Option<StatusInfo>,
2078    #[serde(
2079        rename = "customData",
2080        default,
2081        skip_serializing_if = "Option::is_none"
2082    )]
2083    pub custom_data: Option<CustomData>,
2084}
2085
2086impl Validate for GetDisplayMessagesResponse {
2087    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2088        if let Some(x) = &self.status_info {
2089            let p = path.field("statusInfo");
2090            x.validate(&p)?;
2091        }
2092        if let Some(x) = &self.custom_data {
2093            let p = path.field("customData");
2094            x.validate(&p)?;
2095        }
2096        Ok(())
2097    }
2098}
2099
2100#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2101#[serde(deny_unknown_fields)]
2102pub struct GetInstalledCertificateIdsRequest {
2103    /// Indicates the type of certificates requested. When omitted, all certificate types are requested.
2104    #[serde(
2105        rename = "certificateType",
2106        default,
2107        skip_serializing_if = "Option::is_none"
2108    )]
2109    pub certificate_type: Option<Vec<GetCertificateIdUseEnum>>,
2110    #[serde(
2111        rename = "customData",
2112        default,
2113        skip_serializing_if = "Option::is_none"
2114    )]
2115    pub custom_data: Option<CustomData>,
2116}
2117
2118impl Validate for GetInstalledCertificateIdsRequest {
2119    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2120        if let Some(x) = &self.certificate_type {
2121            let p = path.field("certificateType");
2122            v::items(x, Some(1), None, &p)?;
2123        }
2124        if let Some(x) = &self.custom_data {
2125            let p = path.field("customData");
2126            x.validate(&p)?;
2127        }
2128        Ok(())
2129    }
2130}
2131
2132#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2133#[serde(deny_unknown_fields)]
2134pub struct GetInstalledCertificateIdsResponse {
2135    #[serde(rename = "status")]
2136    pub status: GetInstalledCertificateStatusEnum,
2137    #[serde(
2138        rename = "statusInfo",
2139        default,
2140        skip_serializing_if = "Option::is_none"
2141    )]
2142    pub status_info: Option<StatusInfo>,
2143    #[serde(
2144        rename = "certificateHashDataChain",
2145        default,
2146        skip_serializing_if = "Option::is_none"
2147    )]
2148    pub certificate_hash_data_chain: Option<Vec<CertificateHashDataChain>>,
2149    #[serde(
2150        rename = "customData",
2151        default,
2152        skip_serializing_if = "Option::is_none"
2153    )]
2154    pub custom_data: Option<CustomData>,
2155}
2156
2157impl Validate for GetInstalledCertificateIdsResponse {
2158    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2159        if let Some(x) = &self.status_info {
2160            let p = path.field("statusInfo");
2161            x.validate(&p)?;
2162        }
2163        if let Some(x) = &self.certificate_hash_data_chain {
2164            let p = path.field("certificateHashDataChain");
2165            v::items(x, Some(1), None, &p)?;
2166            for (i0, it0) in x.iter().enumerate() {
2167                let p0 = p.index(i0);
2168                it0.validate(&p0)?;
2169            }
2170        }
2171        if let Some(x) = &self.custom_data {
2172            let p = path.field("customData");
2173            x.validate(&p)?;
2174        }
2175        Ok(())
2176    }
2177}
2178
2179#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2180#[serde(deny_unknown_fields)]
2181pub struct GetLocalListVersionRequest {
2182    #[serde(
2183        rename = "customData",
2184        default,
2185        skip_serializing_if = "Option::is_none"
2186    )]
2187    pub custom_data: Option<CustomData>,
2188}
2189
2190impl Validate for GetLocalListVersionRequest {
2191    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2192        if let Some(x) = &self.custom_data {
2193            let p = path.field("customData");
2194            x.validate(&p)?;
2195        }
2196        Ok(())
2197    }
2198}
2199
2200#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2201#[serde(deny_unknown_fields)]
2202pub struct GetLocalListVersionResponse {
2203    /// This contains the current version number of the local authorization list in the Charging Station.
2204    #[serde(rename = "versionNumber")]
2205    pub version_number: i64,
2206    #[serde(
2207        rename = "customData",
2208        default,
2209        skip_serializing_if = "Option::is_none"
2210    )]
2211    pub custom_data: Option<CustomData>,
2212}
2213
2214impl Validate for GetLocalListVersionResponse {
2215    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2216        if let Some(x) = &self.custom_data {
2217            let p = path.field("customData");
2218            x.validate(&p)?;
2219        }
2220        Ok(())
2221    }
2222}
2223
2224#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2225#[serde(deny_unknown_fields)]
2226pub struct GetLogRequest {
2227    #[serde(rename = "log")]
2228    pub log: LogParameters,
2229    #[serde(rename = "logType")]
2230    pub log_type: LogEnum,
2231    /// The Id of this request
2232    #[serde(rename = "requestId")]
2233    pub request_id: i64,
2234    /// This specifies how many times the Charging Station must retry to upload the log before giving up. If this field is not present, it is left to Charging Station to decide how many times it wants to retry. If the value is 0, it means: no retries.
2235    #[serde(rename = "retries", default, skip_serializing_if = "Option::is_none")]
2236    pub retries: Option<i64>,
2237    /// The interval in seconds after which a retry may be attempted. If this field is not present, it is left to Charging Station to decide how long to wait between attempts.
2238    #[serde(
2239        rename = "retryInterval",
2240        default,
2241        skip_serializing_if = "Option::is_none"
2242    )]
2243    pub retry_interval: Option<i64>,
2244    #[serde(
2245        rename = "customData",
2246        default,
2247        skip_serializing_if = "Option::is_none"
2248    )]
2249    pub custom_data: Option<CustomData>,
2250}
2251
2252impl Validate for GetLogRequest {
2253    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2254        {
2255            let x = &self.log;
2256            let p = path.field("log");
2257            x.validate(&p)?;
2258        }
2259        if let Some(x) = &self.retries {
2260            let p = path.field("retries");
2261            v::minimum(*x, 0i64, &p)?;
2262        }
2263        if let Some(x) = &self.custom_data {
2264            let p = path.field("customData");
2265            x.validate(&p)?;
2266        }
2267        Ok(())
2268    }
2269}
2270
2271#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2272#[serde(deny_unknown_fields)]
2273pub struct GetLogResponse {
2274    #[serde(rename = "status")]
2275    pub status: LogStatusEnum,
2276    #[serde(
2277        rename = "statusInfo",
2278        default,
2279        skip_serializing_if = "Option::is_none"
2280    )]
2281    pub status_info: Option<StatusInfo>,
2282    /// This contains the name of the log file that will be uploaded. This field is not present when no logging information is available.
2283    #[serde(rename = "filename", default, skip_serializing_if = "Option::is_none")]
2284    pub filename: Option<String>,
2285    #[serde(
2286        rename = "customData",
2287        default,
2288        skip_serializing_if = "Option::is_none"
2289    )]
2290    pub custom_data: Option<CustomData>,
2291}
2292
2293impl Validate for GetLogResponse {
2294    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2295        if let Some(x) = &self.status_info {
2296            let p = path.field("statusInfo");
2297            x.validate(&p)?;
2298        }
2299        if let Some(x) = &self.filename {
2300            let p = path.field("filename");
2301            v::max_length(x, 255, &p)?;
2302        }
2303        if let Some(x) = &self.custom_data {
2304            let p = path.field("customData");
2305            x.validate(&p)?;
2306        }
2307        Ok(())
2308    }
2309}
2310
2311#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2312#[serde(deny_unknown_fields)]
2313pub struct GetMonitoringReportRequest {
2314    #[serde(
2315        rename = "componentVariable",
2316        default,
2317        skip_serializing_if = "Option::is_none"
2318    )]
2319    pub component_variable: Option<Vec<ComponentVariable>>,
2320    /// The Id of the request.
2321    #[serde(rename = "requestId")]
2322    pub request_id: i64,
2323    /// This field contains criteria for components for which a monitoring report is requested
2324    #[serde(
2325        rename = "monitoringCriteria",
2326        default,
2327        skip_serializing_if = "Option::is_none"
2328    )]
2329    pub monitoring_criteria: Option<Vec<MonitoringCriterionEnum>>,
2330    #[serde(
2331        rename = "customData",
2332        default,
2333        skip_serializing_if = "Option::is_none"
2334    )]
2335    pub custom_data: Option<CustomData>,
2336}
2337
2338impl Validate for GetMonitoringReportRequest {
2339    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2340        if let Some(x) = &self.component_variable {
2341            let p = path.field("componentVariable");
2342            v::items(x, Some(1), None, &p)?;
2343            for (i0, it0) in x.iter().enumerate() {
2344                let p0 = p.index(i0);
2345                it0.validate(&p0)?;
2346            }
2347        }
2348        if let Some(x) = &self.monitoring_criteria {
2349            let p = path.field("monitoringCriteria");
2350            v::items(x, Some(1), Some(3), &p)?;
2351        }
2352        if let Some(x) = &self.custom_data {
2353            let p = path.field("customData");
2354            x.validate(&p)?;
2355        }
2356        Ok(())
2357    }
2358}
2359
2360#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2361#[serde(deny_unknown_fields)]
2362pub struct GetMonitoringReportResponse {
2363    #[serde(rename = "status")]
2364    pub status: GenericDeviceModelStatusEnum,
2365    #[serde(
2366        rename = "statusInfo",
2367        default,
2368        skip_serializing_if = "Option::is_none"
2369    )]
2370    pub status_info: Option<StatusInfo>,
2371    #[serde(
2372        rename = "customData",
2373        default,
2374        skip_serializing_if = "Option::is_none"
2375    )]
2376    pub custom_data: Option<CustomData>,
2377}
2378
2379impl Validate for GetMonitoringReportResponse {
2380    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2381        if let Some(x) = &self.status_info {
2382            let p = path.field("statusInfo");
2383            x.validate(&p)?;
2384        }
2385        if let Some(x) = &self.custom_data {
2386            let p = path.field("customData");
2387            x.validate(&p)?;
2388        }
2389        Ok(())
2390    }
2391}
2392
2393/// This message is empty. It has no fields.
2394#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2395#[serde(deny_unknown_fields)]
2396pub struct GetPeriodicEventStreamRequest {
2397    #[serde(
2398        rename = "customData",
2399        default,
2400        skip_serializing_if = "Option::is_none"
2401    )]
2402    pub custom_data: Option<CustomData>,
2403}
2404
2405impl Validate for GetPeriodicEventStreamRequest {
2406    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2407        if let Some(x) = &self.custom_data {
2408            let p = path.field("customData");
2409            x.validate(&p)?;
2410        }
2411        Ok(())
2412    }
2413}
2414
2415#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2416#[serde(deny_unknown_fields)]
2417pub struct GetPeriodicEventStreamResponse {
2418    #[serde(
2419        rename = "constantStreamData",
2420        default,
2421        skip_serializing_if = "Option::is_none"
2422    )]
2423    pub constant_stream_data: Option<Vec<ConstantStreamData>>,
2424    #[serde(
2425        rename = "customData",
2426        default,
2427        skip_serializing_if = "Option::is_none"
2428    )]
2429    pub custom_data: Option<CustomData>,
2430}
2431
2432impl Validate for GetPeriodicEventStreamResponse {
2433    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2434        if let Some(x) = &self.constant_stream_data {
2435            let p = path.field("constantStreamData");
2436            v::items(x, Some(1), None, &p)?;
2437            for (i0, it0) in x.iter().enumerate() {
2438                let p0 = p.index(i0);
2439                it0.validate(&p0)?;
2440            }
2441        }
2442        if let Some(x) = &self.custom_data {
2443            let p = path.field("customData");
2444            x.validate(&p)?;
2445        }
2446        Ok(())
2447    }
2448}
2449
2450#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2451#[serde(deny_unknown_fields)]
2452pub struct GetReportRequest {
2453    #[serde(
2454        rename = "componentVariable",
2455        default,
2456        skip_serializing_if = "Option::is_none"
2457    )]
2458    pub component_variable: Option<Vec<ComponentVariable>>,
2459    /// The Id of the request.
2460    #[serde(rename = "requestId")]
2461    pub request_id: i64,
2462    /// This field contains criteria for components for which a report is requested
2463    #[serde(
2464        rename = "componentCriteria",
2465        default,
2466        skip_serializing_if = "Option::is_none"
2467    )]
2468    pub component_criteria: Option<Vec<ComponentCriterionEnum>>,
2469    #[serde(
2470        rename = "customData",
2471        default,
2472        skip_serializing_if = "Option::is_none"
2473    )]
2474    pub custom_data: Option<CustomData>,
2475}
2476
2477impl Validate for GetReportRequest {
2478    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2479        if let Some(x) = &self.component_variable {
2480            let p = path.field("componentVariable");
2481            v::items(x, Some(1), None, &p)?;
2482            for (i0, it0) in x.iter().enumerate() {
2483                let p0 = p.index(i0);
2484                it0.validate(&p0)?;
2485            }
2486        }
2487        if let Some(x) = &self.component_criteria {
2488            let p = path.field("componentCriteria");
2489            v::items(x, Some(1), Some(4), &p)?;
2490        }
2491        if let Some(x) = &self.custom_data {
2492            let p = path.field("customData");
2493            x.validate(&p)?;
2494        }
2495        Ok(())
2496    }
2497}
2498
2499#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2500#[serde(deny_unknown_fields)]
2501pub struct GetReportResponse {
2502    #[serde(rename = "status")]
2503    pub status: GenericDeviceModelStatusEnum,
2504    #[serde(
2505        rename = "statusInfo",
2506        default,
2507        skip_serializing_if = "Option::is_none"
2508    )]
2509    pub status_info: Option<StatusInfo>,
2510    #[serde(
2511        rename = "customData",
2512        default,
2513        skip_serializing_if = "Option::is_none"
2514    )]
2515    pub custom_data: Option<CustomData>,
2516}
2517
2518impl Validate for GetReportResponse {
2519    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2520        if let Some(x) = &self.status_info {
2521            let p = path.field("statusInfo");
2522            x.validate(&p)?;
2523        }
2524        if let Some(x) = &self.custom_data {
2525            let p = path.field("customData");
2526            x.validate(&p)?;
2527        }
2528        Ok(())
2529    }
2530}
2531
2532#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2533#[serde(deny_unknown_fields)]
2534pub struct GetTariffsRequest {
2535    /// EVSE id to get tariff from. When _evseId_ = 0, this gets tariffs from all EVSEs.
2536    #[serde(rename = "evseId")]
2537    pub evse_id: i64,
2538    #[serde(
2539        rename = "customData",
2540        default,
2541        skip_serializing_if = "Option::is_none"
2542    )]
2543    pub custom_data: Option<CustomData>,
2544}
2545
2546impl Validate for GetTariffsRequest {
2547    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2548        {
2549            let x = &self.evse_id;
2550            let p = path.field("evseId");
2551            v::minimum(*x, 0i64, &p)?;
2552        }
2553        if let Some(x) = &self.custom_data {
2554            let p = path.field("customData");
2555            x.validate(&p)?;
2556        }
2557        Ok(())
2558    }
2559}
2560
2561#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2562#[serde(deny_unknown_fields)]
2563pub struct GetTariffsResponse {
2564    #[serde(rename = "status")]
2565    pub status: TariffGetStatusEnum,
2566    #[serde(
2567        rename = "statusInfo",
2568        default,
2569        skip_serializing_if = "Option::is_none"
2570    )]
2571    pub status_info: Option<StatusInfo>,
2572    #[serde(
2573        rename = "tariffAssignments",
2574        default,
2575        skip_serializing_if = "Option::is_none"
2576    )]
2577    pub tariff_assignments: Option<Vec<TariffAssignment>>,
2578    #[serde(
2579        rename = "customData",
2580        default,
2581        skip_serializing_if = "Option::is_none"
2582    )]
2583    pub custom_data: Option<CustomData>,
2584}
2585
2586impl Validate for GetTariffsResponse {
2587    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2588        if let Some(x) = &self.status_info {
2589            let p = path.field("statusInfo");
2590            x.validate(&p)?;
2591        }
2592        if let Some(x) = &self.tariff_assignments {
2593            let p = path.field("tariffAssignments");
2594            v::items(x, Some(1), None, &p)?;
2595            for (i0, it0) in x.iter().enumerate() {
2596                let p0 = p.index(i0);
2597                it0.validate(&p0)?;
2598            }
2599        }
2600        if let Some(x) = &self.custom_data {
2601            let p = path.field("customData");
2602            x.validate(&p)?;
2603        }
2604        Ok(())
2605    }
2606}
2607
2608#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2609#[serde(deny_unknown_fields)]
2610pub struct GetTransactionStatusRequest {
2611    /// The Id of the transaction for which the status is requested.
2612    #[serde(
2613        rename = "transactionId",
2614        default,
2615        skip_serializing_if = "Option::is_none"
2616    )]
2617    pub transaction_id: Option<String>,
2618    #[serde(
2619        rename = "customData",
2620        default,
2621        skip_serializing_if = "Option::is_none"
2622    )]
2623    pub custom_data: Option<CustomData>,
2624}
2625
2626impl Validate for GetTransactionStatusRequest {
2627    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2628        if let Some(x) = &self.transaction_id {
2629            let p = path.field("transactionId");
2630            v::max_length(x, 36, &p)?;
2631        }
2632        if let Some(x) = &self.custom_data {
2633            let p = path.field("customData");
2634            x.validate(&p)?;
2635        }
2636        Ok(())
2637    }
2638}
2639
2640#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2641#[serde(deny_unknown_fields)]
2642pub struct GetTransactionStatusResponse {
2643    /// Whether the transaction is still ongoing.
2644    #[serde(
2645        rename = "ongoingIndicator",
2646        default,
2647        skip_serializing_if = "Option::is_none"
2648    )]
2649    pub ongoing_indicator: Option<bool>,
2650    /// Whether there are still message to be delivered.
2651    #[serde(rename = "messagesInQueue")]
2652    pub messages_in_queue: bool,
2653    #[serde(
2654        rename = "customData",
2655        default,
2656        skip_serializing_if = "Option::is_none"
2657    )]
2658    pub custom_data: Option<CustomData>,
2659}
2660
2661impl Validate for GetTransactionStatusResponse {
2662    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2663        if let Some(x) = &self.custom_data {
2664            let p = path.field("customData");
2665            x.validate(&p)?;
2666        }
2667        Ok(())
2668    }
2669}
2670
2671#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2672#[serde(deny_unknown_fields)]
2673pub struct GetVariablesRequest {
2674    #[serde(rename = "getVariableData")]
2675    pub get_variable_data: Vec<GetVariableData>,
2676    #[serde(
2677        rename = "customData",
2678        default,
2679        skip_serializing_if = "Option::is_none"
2680    )]
2681    pub custom_data: Option<CustomData>,
2682}
2683
2684impl Validate for GetVariablesRequest {
2685    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2686        {
2687            let x = &self.get_variable_data;
2688            let p = path.field("getVariableData");
2689            v::items(x, Some(1), None, &p)?;
2690            for (i0, it0) in x.iter().enumerate() {
2691                let p0 = p.index(i0);
2692                it0.validate(&p0)?;
2693            }
2694        }
2695        if let Some(x) = &self.custom_data {
2696            let p = path.field("customData");
2697            x.validate(&p)?;
2698        }
2699        Ok(())
2700    }
2701}
2702
2703#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2704#[serde(deny_unknown_fields)]
2705pub struct GetVariablesResponse {
2706    #[serde(rename = "getVariableResult")]
2707    pub get_variable_result: Vec<GetVariableResult>,
2708    #[serde(
2709        rename = "customData",
2710        default,
2711        skip_serializing_if = "Option::is_none"
2712    )]
2713    pub custom_data: Option<CustomData>,
2714}
2715
2716impl Validate for GetVariablesResponse {
2717    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2718        {
2719            let x = &self.get_variable_result;
2720            let p = path.field("getVariableResult");
2721            v::items(x, Some(1), None, &p)?;
2722            for (i0, it0) in x.iter().enumerate() {
2723                let p0 = p.index(i0);
2724                it0.validate(&p0)?;
2725            }
2726        }
2727        if let Some(x) = &self.custom_data {
2728            let p = path.field("customData");
2729            x.validate(&p)?;
2730        }
2731        Ok(())
2732    }
2733}
2734
2735#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2736#[serde(deny_unknown_fields)]
2737pub struct HeartbeatRequest {
2738    #[serde(
2739        rename = "customData",
2740        default,
2741        skip_serializing_if = "Option::is_none"
2742    )]
2743    pub custom_data: Option<CustomData>,
2744}
2745
2746impl Validate for HeartbeatRequest {
2747    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2748        if let Some(x) = &self.custom_data {
2749            let p = path.field("customData");
2750            x.validate(&p)?;
2751        }
2752        Ok(())
2753    }
2754}
2755
2756#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2757#[serde(deny_unknown_fields)]
2758pub struct HeartbeatResponse {
2759    /// Contains the current time of the CSMS.
2760    #[serde(rename = "currentTime")]
2761    pub current_time: DateTime,
2762    #[serde(
2763        rename = "customData",
2764        default,
2765        skip_serializing_if = "Option::is_none"
2766    )]
2767    pub custom_data: Option<CustomData>,
2768}
2769
2770impl Validate for HeartbeatResponse {
2771    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2772        if let Some(x) = &self.custom_data {
2773            let p = path.field("customData");
2774            x.validate(&p)?;
2775        }
2776        Ok(())
2777    }
2778}
2779
2780#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2781#[serde(deny_unknown_fields)]
2782pub struct InstallCertificateRequest {
2783    #[serde(rename = "certificateType")]
2784    pub certificate_type: InstallCertificateUseEnum,
2785    /// A PEM encoded X.509 certificate.
2786    #[serde(rename = "certificate")]
2787    pub certificate: String,
2788    #[serde(
2789        rename = "customData",
2790        default,
2791        skip_serializing_if = "Option::is_none"
2792    )]
2793    pub custom_data: Option<CustomData>,
2794}
2795
2796impl Validate for InstallCertificateRequest {
2797    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2798        {
2799            let x = &self.certificate;
2800            let p = path.field("certificate");
2801            v::max_length(x, 10000, &p)?;
2802        }
2803        if let Some(x) = &self.custom_data {
2804            let p = path.field("customData");
2805            x.validate(&p)?;
2806        }
2807        Ok(())
2808    }
2809}
2810
2811#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2812#[serde(deny_unknown_fields)]
2813pub struct InstallCertificateResponse {
2814    #[serde(rename = "status")]
2815    pub status: InstallCertificateStatusEnum,
2816    #[serde(
2817        rename = "statusInfo",
2818        default,
2819        skip_serializing_if = "Option::is_none"
2820    )]
2821    pub status_info: Option<StatusInfo>,
2822    #[serde(
2823        rename = "customData",
2824        default,
2825        skip_serializing_if = "Option::is_none"
2826    )]
2827    pub custom_data: Option<CustomData>,
2828}
2829
2830impl Validate for InstallCertificateResponse {
2831    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2832        if let Some(x) = &self.status_info {
2833            let p = path.field("statusInfo");
2834            x.validate(&p)?;
2835        }
2836        if let Some(x) = &self.custom_data {
2837            let p = path.field("customData");
2838            x.validate(&p)?;
2839        }
2840        Ok(())
2841    }
2842}
2843
2844#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2845#[serde(deny_unknown_fields)]
2846pub struct LogStatusNotificationRequest {
2847    #[serde(rename = "status")]
2848    pub status: UploadLogStatusEnum,
2849    /// The request id that was provided in GetLogRequest that started this log upload. This field is mandatory,
2850    /// unless the message was triggered by a TriggerMessageRequest AND there is no log upload ongoing.
2851    #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")]
2852    pub request_id: Option<i64>,
2853    #[serde(
2854        rename = "statusInfo",
2855        default,
2856        skip_serializing_if = "Option::is_none"
2857    )]
2858    pub status_info: Option<StatusInfo>,
2859    #[serde(
2860        rename = "customData",
2861        default,
2862        skip_serializing_if = "Option::is_none"
2863    )]
2864    pub custom_data: Option<CustomData>,
2865}
2866
2867impl Validate for LogStatusNotificationRequest {
2868    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2869        if let Some(x) = &self.status_info {
2870            let p = path.field("statusInfo");
2871            x.validate(&p)?;
2872        }
2873        if let Some(x) = &self.custom_data {
2874            let p = path.field("customData");
2875            x.validate(&p)?;
2876        }
2877        Ok(())
2878    }
2879}
2880
2881#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2882#[serde(deny_unknown_fields)]
2883pub struct LogStatusNotificationResponse {
2884    #[serde(
2885        rename = "customData",
2886        default,
2887        skip_serializing_if = "Option::is_none"
2888    )]
2889    pub custom_data: Option<CustomData>,
2890}
2891
2892impl Validate for LogStatusNotificationResponse {
2893    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2894        if let Some(x) = &self.custom_data {
2895            let p = path.field("customData");
2896            x.validate(&p)?;
2897        }
2898        Ok(())
2899    }
2900}
2901
2902#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2903#[serde(deny_unknown_fields)]
2904pub struct MeterValuesRequest {
2905    /// This contains a number (&gt;0) designating an EVSE of the Charging Station. ‘0’ (zero) is used to designate the main power meter.
2906    #[serde(rename = "evseId")]
2907    pub evse_id: i64,
2908    #[serde(rename = "meterValue")]
2909    pub meter_value: Vec<MeterValue>,
2910    #[serde(
2911        rename = "customData",
2912        default,
2913        skip_serializing_if = "Option::is_none"
2914    )]
2915    pub custom_data: Option<CustomData>,
2916}
2917
2918impl Validate for MeterValuesRequest {
2919    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2920        {
2921            let x = &self.evse_id;
2922            let p = path.field("evseId");
2923            v::minimum(*x, 0i64, &p)?;
2924        }
2925        {
2926            let x = &self.meter_value;
2927            let p = path.field("meterValue");
2928            v::items(x, Some(1), None, &p)?;
2929            for (i0, it0) in x.iter().enumerate() {
2930                let p0 = p.index(i0);
2931                it0.validate(&p0)?;
2932            }
2933        }
2934        if let Some(x) = &self.custom_data {
2935            let p = path.field("customData");
2936            x.validate(&p)?;
2937        }
2938        Ok(())
2939    }
2940}
2941
2942#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2943#[serde(deny_unknown_fields)]
2944pub struct MeterValuesResponse {
2945    #[serde(
2946        rename = "customData",
2947        default,
2948        skip_serializing_if = "Option::is_none"
2949    )]
2950    pub custom_data: Option<CustomData>,
2951}
2952
2953impl Validate for MeterValuesResponse {
2954    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2955        if let Some(x) = &self.custom_data {
2956            let p = path.field("customData");
2957            x.validate(&p)?;
2958        }
2959        Ok(())
2960    }
2961}
2962
2963#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2964#[serde(deny_unknown_fields)]
2965pub struct NotifyAllowedEnergyTransferRequest {
2966    /// The transaction for which the allowed energy transfer is allowed.
2967    #[serde(rename = "transactionId")]
2968    pub transaction_id: String,
2969    /// Modes of energy transfer that are accepted by CSMS.
2970    #[serde(rename = "allowedEnergyTransfer")]
2971    pub allowed_energy_transfer: Vec<EnergyTransferModeEnum>,
2972    #[serde(
2973        rename = "customData",
2974        default,
2975        skip_serializing_if = "Option::is_none"
2976    )]
2977    pub custom_data: Option<CustomData>,
2978}
2979
2980impl Validate for NotifyAllowedEnergyTransferRequest {
2981    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2982        {
2983            let x = &self.transaction_id;
2984            let p = path.field("transactionId");
2985            v::max_length(x, 36, &p)?;
2986        }
2987        {
2988            let x = &self.allowed_energy_transfer;
2989            let p = path.field("allowedEnergyTransfer");
2990            v::items(x, Some(1), None, &p)?;
2991        }
2992        if let Some(x) = &self.custom_data {
2993            let p = path.field("customData");
2994            x.validate(&p)?;
2995        }
2996        Ok(())
2997    }
2998}
2999
3000#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3001#[serde(deny_unknown_fields)]
3002pub struct NotifyAllowedEnergyTransferResponse {
3003    #[serde(rename = "status")]
3004    pub status: NotifyAllowedEnergyTransferStatusEnum,
3005    #[serde(
3006        rename = "statusInfo",
3007        default,
3008        skip_serializing_if = "Option::is_none"
3009    )]
3010    pub status_info: Option<StatusInfo>,
3011    #[serde(
3012        rename = "customData",
3013        default,
3014        skip_serializing_if = "Option::is_none"
3015    )]
3016    pub custom_data: Option<CustomData>,
3017}
3018
3019impl Validate for NotifyAllowedEnergyTransferResponse {
3020    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3021        if let Some(x) = &self.status_info {
3022            let p = path.field("statusInfo");
3023            x.validate(&p)?;
3024        }
3025        if let Some(x) = &self.custom_data {
3026            let p = path.field("customData");
3027            x.validate(&p)?;
3028        }
3029        Ok(())
3030    }
3031}
3032
3033#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3034#[serde(deny_unknown_fields)]
3035pub struct NotifyChargingLimitRequest {
3036    #[serde(
3037        rename = "chargingSchedule",
3038        default,
3039        skip_serializing_if = "Option::is_none"
3040    )]
3041    pub charging_schedule: Option<Vec<ChargingSchedule>>,
3042    /// The EVSE to which the charging limit is set. If absent or when zero, it applies to the entire Charging Station.
3043    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
3044    pub evse_id: Option<i64>,
3045    #[serde(rename = "chargingLimit")]
3046    pub charging_limit: ChargingLimit,
3047    #[serde(
3048        rename = "customData",
3049        default,
3050        skip_serializing_if = "Option::is_none"
3051    )]
3052    pub custom_data: Option<CustomData>,
3053}
3054
3055impl Validate for NotifyChargingLimitRequest {
3056    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3057        if let Some(x) = &self.charging_schedule {
3058            let p = path.field("chargingSchedule");
3059            v::items(x, Some(1), None, &p)?;
3060            for (i0, it0) in x.iter().enumerate() {
3061                let p0 = p.index(i0);
3062                it0.validate(&p0)?;
3063            }
3064        }
3065        if let Some(x) = &self.evse_id {
3066            let p = path.field("evseId");
3067            v::minimum(*x, 0i64, &p)?;
3068        }
3069        {
3070            let x = &self.charging_limit;
3071            let p = path.field("chargingLimit");
3072            x.validate(&p)?;
3073        }
3074        if let Some(x) = &self.custom_data {
3075            let p = path.field("customData");
3076            x.validate(&p)?;
3077        }
3078        Ok(())
3079    }
3080}
3081
3082#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3083#[serde(deny_unknown_fields)]
3084pub struct NotifyChargingLimitResponse {
3085    #[serde(
3086        rename = "customData",
3087        default,
3088        skip_serializing_if = "Option::is_none"
3089    )]
3090    pub custom_data: Option<CustomData>,
3091}
3092
3093impl Validate for NotifyChargingLimitResponse {
3094    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3095        if let Some(x) = &self.custom_data {
3096            let p = path.field("customData");
3097            x.validate(&p)?;
3098        }
3099        Ok(())
3100    }
3101}
3102
3103#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3104#[serde(deny_unknown_fields)]
3105pub struct NotifyCustomerInformationRequest {
3106    /// (Part of) the requested data. No format specified in which the data is returned. Should be human readable.
3107    #[serde(rename = "data")]
3108    pub data: String,
3109    /// “to be continued” indicator. Indicates whether another part of the monitoringData follows in an upcoming notifyMonitoringReportRequest message. Default value when omitted is false.
3110    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
3111    pub tbc: Option<bool>,
3112    /// Sequence number of this message. First message starts at 0.
3113    #[serde(rename = "seqNo")]
3114    pub seq_no: i64,
3115    /// Timestamp of the moment this message was generated at the Charging Station.
3116    #[serde(rename = "generatedAt")]
3117    pub generated_at: DateTime,
3118    /// The Id of the request.
3119    #[serde(rename = "requestId")]
3120    pub request_id: i64,
3121    #[serde(
3122        rename = "customData",
3123        default,
3124        skip_serializing_if = "Option::is_none"
3125    )]
3126    pub custom_data: Option<CustomData>,
3127}
3128
3129impl Validate for NotifyCustomerInformationRequest {
3130    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3131        {
3132            let x = &self.data;
3133            let p = path.field("data");
3134            v::max_length(x, 512, &p)?;
3135        }
3136        {
3137            let x = &self.seq_no;
3138            let p = path.field("seqNo");
3139            v::minimum(*x, 0i64, &p)?;
3140        }
3141        {
3142            let x = &self.request_id;
3143            let p = path.field("requestId");
3144            v::minimum(*x, 0i64, &p)?;
3145        }
3146        if let Some(x) = &self.custom_data {
3147            let p = path.field("customData");
3148            x.validate(&p)?;
3149        }
3150        Ok(())
3151    }
3152}
3153
3154#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3155#[serde(deny_unknown_fields)]
3156pub struct NotifyCustomerInformationResponse {
3157    #[serde(
3158        rename = "customData",
3159        default,
3160        skip_serializing_if = "Option::is_none"
3161    )]
3162    pub custom_data: Option<CustomData>,
3163}
3164
3165impl Validate for NotifyCustomerInformationResponse {
3166    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3167        if let Some(x) = &self.custom_data {
3168            let p = path.field("customData");
3169            x.validate(&p)?;
3170        }
3171        Ok(())
3172    }
3173}
3174
3175#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3176#[serde(deny_unknown_fields)]
3177pub struct NotifyDERAlarmRequest {
3178    #[serde(rename = "controlType")]
3179    pub control_type: DERControlEnum,
3180    #[serde(
3181        rename = "gridEventFault",
3182        default,
3183        skip_serializing_if = "Option::is_none"
3184    )]
3185    pub grid_event_fault: Option<GridEventFaultEnum>,
3186    /// True when error condition has ended.
3187    /// Absent or false when alarm has started.
3188    #[serde(
3189        rename = "alarmEnded",
3190        default,
3191        skip_serializing_if = "Option::is_none"
3192    )]
3193    pub alarm_ended: Option<bool>,
3194    /// Time of start or end of alarm.
3195    #[serde(rename = "timestamp")]
3196    pub timestamp: DateTime,
3197    /// Optional info provided by EV.
3198    #[serde(rename = "extraInfo", default, skip_serializing_if = "Option::is_none")]
3199    pub extra_info: Option<String>,
3200    #[serde(
3201        rename = "customData",
3202        default,
3203        skip_serializing_if = "Option::is_none"
3204    )]
3205    pub custom_data: Option<CustomData>,
3206}
3207
3208impl Validate for NotifyDERAlarmRequest {
3209    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3210        if let Some(x) = &self.extra_info {
3211            let p = path.field("extraInfo");
3212            v::max_length(x, 200, &p)?;
3213        }
3214        if let Some(x) = &self.custom_data {
3215            let p = path.field("customData");
3216            x.validate(&p)?;
3217        }
3218        Ok(())
3219    }
3220}
3221
3222#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3223#[serde(deny_unknown_fields)]
3224pub struct NotifyDERAlarmResponse {
3225    #[serde(
3226        rename = "customData",
3227        default,
3228        skip_serializing_if = "Option::is_none"
3229    )]
3230    pub custom_data: Option<CustomData>,
3231}
3232
3233impl Validate for NotifyDERAlarmResponse {
3234    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3235        if let Some(x) = &self.custom_data {
3236            let p = path.field("customData");
3237            x.validate(&p)?;
3238        }
3239        Ok(())
3240    }
3241}
3242
3243#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3244#[serde(deny_unknown_fields)]
3245pub struct NotifyDERStartStopRequest {
3246    /// Id of the started or stopped DER control.
3247    /// Corresponds to the _controlId_ of the SetDERControlRequest.
3248    #[serde(rename = "controlId")]
3249    pub control_id: String,
3250    /// True if DER control has started. False if it has ended.
3251    #[serde(rename = "started")]
3252    pub started: bool,
3253    /// Time of start or end of event.
3254    #[serde(rename = "timestamp")]
3255    pub timestamp: DateTime,
3256    /// List of controlIds that are superseded as a result of this control starting.
3257    #[serde(
3258        rename = "supersededIds",
3259        default,
3260        skip_serializing_if = "Option::is_none"
3261    )]
3262    pub superseded_ids: Option<Vec<String>>,
3263    #[serde(
3264        rename = "customData",
3265        default,
3266        skip_serializing_if = "Option::is_none"
3267    )]
3268    pub custom_data: Option<CustomData>,
3269}
3270
3271impl Validate for NotifyDERStartStopRequest {
3272    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3273        {
3274            let x = &self.control_id;
3275            let p = path.field("controlId");
3276            v::max_length(x, 36, &p)?;
3277        }
3278        if let Some(x) = &self.superseded_ids {
3279            let p = path.field("supersededIds");
3280            v::items(x, Some(1), Some(24), &p)?;
3281            for (i0, it0) in x.iter().enumerate() {
3282                let p0 = p.index(i0);
3283                v::max_length(it0, 36, &p0)?;
3284            }
3285        }
3286        if let Some(x) = &self.custom_data {
3287            let p = path.field("customData");
3288            x.validate(&p)?;
3289        }
3290        Ok(())
3291    }
3292}
3293
3294#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3295#[serde(deny_unknown_fields)]
3296pub struct NotifyDERStartStopResponse {
3297    #[serde(
3298        rename = "customData",
3299        default,
3300        skip_serializing_if = "Option::is_none"
3301    )]
3302    pub custom_data: Option<CustomData>,
3303}
3304
3305impl Validate for NotifyDERStartStopResponse {
3306    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3307        if let Some(x) = &self.custom_data {
3308            let p = path.field("customData");
3309            x.validate(&p)?;
3310        }
3311        Ok(())
3312    }
3313}
3314
3315#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3316#[serde(deny_unknown_fields)]
3317pub struct NotifyDisplayMessagesRequest {
3318    #[serde(
3319        rename = "messageInfo",
3320        default,
3321        skip_serializing_if = "Option::is_none"
3322    )]
3323    pub message_info: Option<Vec<MessageInfo>>,
3324    /// The id of the &lt;&lt;getdisplaymessagesrequest,GetDisplayMessagesRequest&gt;&gt; that requested this message.
3325    #[serde(rename = "requestId")]
3326    pub request_id: i64,
3327    /// "to be continued" indicator. Indicates whether another part of the report follows in an upcoming NotifyDisplayMessagesRequest message. Default value when omitted is false.
3328    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
3329    pub tbc: Option<bool>,
3330    #[serde(
3331        rename = "customData",
3332        default,
3333        skip_serializing_if = "Option::is_none"
3334    )]
3335    pub custom_data: Option<CustomData>,
3336}
3337
3338impl Validate for NotifyDisplayMessagesRequest {
3339    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3340        if let Some(x) = &self.message_info {
3341            let p = path.field("messageInfo");
3342            v::items(x, Some(1), None, &p)?;
3343            for (i0, it0) in x.iter().enumerate() {
3344                let p0 = p.index(i0);
3345                it0.validate(&p0)?;
3346            }
3347        }
3348        if let Some(x) = &self.custom_data {
3349            let p = path.field("customData");
3350            x.validate(&p)?;
3351        }
3352        Ok(())
3353    }
3354}
3355
3356#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3357#[serde(deny_unknown_fields)]
3358pub struct NotifyDisplayMessagesResponse {
3359    #[serde(
3360        rename = "customData",
3361        default,
3362        skip_serializing_if = "Option::is_none"
3363    )]
3364    pub custom_data: Option<CustomData>,
3365}
3366
3367impl Validate for NotifyDisplayMessagesResponse {
3368    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3369        if let Some(x) = &self.custom_data {
3370            let p = path.field("customData");
3371            x.validate(&p)?;
3372        }
3373        Ok(())
3374    }
3375}
3376
3377#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3378#[serde(deny_unknown_fields)]
3379pub struct NotifyEVChargingNeedsRequest {
3380    /// Defines the EVSE and connector to which the EV is connected. EvseId may not be 0.
3381    #[serde(rename = "evseId")]
3382    pub evse_id: i64,
3383    /// Contains the maximum elements the EV supports for: +
3384    /// - ISO 15118-2: schedule tuples in SASchedule (both Pmax and Tariff). +
3385    /// - ISO 15118-20: PowerScheduleEntry, PriceRule and PriceLevelScheduleEntries.
3386    #[serde(
3387        rename = "maxScheduleTuples",
3388        default,
3389        skip_serializing_if = "Option::is_none"
3390    )]
3391    pub max_schedule_tuples: Option<i64>,
3392    #[serde(rename = "chargingNeeds")]
3393    pub charging_needs: ChargingNeeds,
3394    /// *(2.1)* Time when EV charging needs were received. +
3395    /// Field can be added when charging station was offline when charging needs were received.
3396    #[serde(rename = "timestamp", default, skip_serializing_if = "Option::is_none")]
3397    pub timestamp: Option<DateTime>,
3398    #[serde(
3399        rename = "customData",
3400        default,
3401        skip_serializing_if = "Option::is_none"
3402    )]
3403    pub custom_data: Option<CustomData>,
3404}
3405
3406impl Validate for NotifyEVChargingNeedsRequest {
3407    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3408        {
3409            let x = &self.evse_id;
3410            let p = path.field("evseId");
3411            v::minimum(*x, 1i64, &p)?;
3412        }
3413        if let Some(x) = &self.max_schedule_tuples {
3414            let p = path.field("maxScheduleTuples");
3415            v::minimum(*x, 0i64, &p)?;
3416        }
3417        {
3418            let x = &self.charging_needs;
3419            let p = path.field("chargingNeeds");
3420            x.validate(&p)?;
3421        }
3422        if let Some(x) = &self.custom_data {
3423            let p = path.field("customData");
3424            x.validate(&p)?;
3425        }
3426        Ok(())
3427    }
3428}
3429
3430#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3431#[serde(deny_unknown_fields)]
3432pub struct NotifyEVChargingNeedsResponse {
3433    #[serde(rename = "status")]
3434    pub status: NotifyEVChargingNeedsStatusEnum,
3435    #[serde(
3436        rename = "statusInfo",
3437        default,
3438        skip_serializing_if = "Option::is_none"
3439    )]
3440    pub status_info: Option<StatusInfo>,
3441    #[serde(
3442        rename = "customData",
3443        default,
3444        skip_serializing_if = "Option::is_none"
3445    )]
3446    pub custom_data: Option<CustomData>,
3447}
3448
3449impl Validate for NotifyEVChargingNeedsResponse {
3450    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3451        if let Some(x) = &self.status_info {
3452            let p = path.field("statusInfo");
3453            x.validate(&p)?;
3454        }
3455        if let Some(x) = &self.custom_data {
3456            let p = path.field("customData");
3457            x.validate(&p)?;
3458        }
3459        Ok(())
3460    }
3461}
3462
3463#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3464#[serde(deny_unknown_fields)]
3465pub struct NotifyEVChargingScheduleRequest {
3466    /// Periods contained in the charging profile are relative to this point in time.
3467    #[serde(rename = "timeBase")]
3468    pub time_base: DateTime,
3469    #[serde(rename = "chargingSchedule")]
3470    pub charging_schedule: ChargingSchedule,
3471    /// The charging schedule contained in this notification applies to an EVSE. EvseId must be &gt; 0.
3472    #[serde(rename = "evseId")]
3473    pub evse_id: i64,
3474    /// *(2.1)* Id  of the _chargingSchedule_ that EV selected from the provided ChargingProfile.
3475    #[serde(
3476        rename = "selectedChargingScheduleId",
3477        default,
3478        skip_serializing_if = "Option::is_none"
3479    )]
3480    pub selected_charging_schedule_id: Option<i64>,
3481    /// *(2.1)* True when power tolerance is accepted by EV.
3482    /// This value is taken from EVPowerProfile.PowerToleranceAcceptance in the ISO 15118-20 PowerDeliverReq message..
3483    #[serde(
3484        rename = "powerToleranceAcceptance",
3485        default,
3486        skip_serializing_if = "Option::is_none"
3487    )]
3488    pub power_tolerance_acceptance: Option<bool>,
3489    #[serde(
3490        rename = "customData",
3491        default,
3492        skip_serializing_if = "Option::is_none"
3493    )]
3494    pub custom_data: Option<CustomData>,
3495}
3496
3497impl Validate for NotifyEVChargingScheduleRequest {
3498    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3499        {
3500            let x = &self.charging_schedule;
3501            let p = path.field("chargingSchedule");
3502            x.validate(&p)?;
3503        }
3504        {
3505            let x = &self.evse_id;
3506            let p = path.field("evseId");
3507            v::minimum(*x, 1i64, &p)?;
3508        }
3509        if let Some(x) = &self.selected_charging_schedule_id {
3510            let p = path.field("selectedChargingScheduleId");
3511            v::minimum(*x, 0i64, &p)?;
3512        }
3513        if let Some(x) = &self.custom_data {
3514            let p = path.field("customData");
3515            x.validate(&p)?;
3516        }
3517        Ok(())
3518    }
3519}
3520
3521#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3522#[serde(deny_unknown_fields)]
3523pub struct NotifyEVChargingScheduleResponse {
3524    #[serde(rename = "status")]
3525    pub status: GenericStatusEnum,
3526    #[serde(
3527        rename = "statusInfo",
3528        default,
3529        skip_serializing_if = "Option::is_none"
3530    )]
3531    pub status_info: Option<StatusInfo>,
3532    #[serde(
3533        rename = "customData",
3534        default,
3535        skip_serializing_if = "Option::is_none"
3536    )]
3537    pub custom_data: Option<CustomData>,
3538}
3539
3540impl Validate for NotifyEVChargingScheduleResponse {
3541    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3542        if let Some(x) = &self.status_info {
3543            let p = path.field("statusInfo");
3544            x.validate(&p)?;
3545        }
3546        if let Some(x) = &self.custom_data {
3547            let p = path.field("customData");
3548            x.validate(&p)?;
3549        }
3550        Ok(())
3551    }
3552}
3553
3554#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3555#[serde(deny_unknown_fields)]
3556pub struct NotifyEventRequest {
3557    /// Timestamp of the moment this message was generated at the Charging Station.
3558    #[serde(rename = "generatedAt")]
3559    pub generated_at: DateTime,
3560    /// “to be continued” indicator. Indicates whether another part of the report follows in an upcoming notifyEventRequest message. Default value when omitted is false.
3561    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
3562    pub tbc: Option<bool>,
3563    /// Sequence number of this message. First message starts at 0.
3564    #[serde(rename = "seqNo")]
3565    pub seq_no: i64,
3566    #[serde(rename = "eventData")]
3567    pub event_data: Vec<EventData>,
3568    #[serde(
3569        rename = "customData",
3570        default,
3571        skip_serializing_if = "Option::is_none"
3572    )]
3573    pub custom_data: Option<CustomData>,
3574}
3575
3576impl Validate for NotifyEventRequest {
3577    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3578        {
3579            let x = &self.seq_no;
3580            let p = path.field("seqNo");
3581            v::minimum(*x, 0i64, &p)?;
3582        }
3583        {
3584            let x = &self.event_data;
3585            let p = path.field("eventData");
3586            v::items(x, Some(1), None, &p)?;
3587            for (i0, it0) in x.iter().enumerate() {
3588                let p0 = p.index(i0);
3589                it0.validate(&p0)?;
3590            }
3591        }
3592        if let Some(x) = &self.custom_data {
3593            let p = path.field("customData");
3594            x.validate(&p)?;
3595        }
3596        Ok(())
3597    }
3598}
3599
3600#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3601#[serde(deny_unknown_fields)]
3602pub struct NotifyEventResponse {
3603    #[serde(
3604        rename = "customData",
3605        default,
3606        skip_serializing_if = "Option::is_none"
3607    )]
3608    pub custom_data: Option<CustomData>,
3609}
3610
3611impl Validate for NotifyEventResponse {
3612    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3613        if let Some(x) = &self.custom_data {
3614            let p = path.field("customData");
3615            x.validate(&p)?;
3616        }
3617        Ok(())
3618    }
3619}
3620
3621#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3622#[serde(deny_unknown_fields)]
3623pub struct NotifyMonitoringReportRequest {
3624    #[serde(rename = "monitor", default, skip_serializing_if = "Option::is_none")]
3625    pub monitor: Option<Vec<MonitoringData>>,
3626    /// The id of the GetMonitoringRequest that requested this report.
3627    #[serde(rename = "requestId")]
3628    pub request_id: i64,
3629    /// “to be continued” indicator. Indicates whether another part of the monitoringData follows in an upcoming notifyMonitoringReportRequest message. Default value when omitted is false.
3630    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
3631    pub tbc: Option<bool>,
3632    /// Sequence number of this message. First message starts at 0.
3633    #[serde(rename = "seqNo")]
3634    pub seq_no: i64,
3635    /// Timestamp of the moment this message was generated at the Charging Station.
3636    #[serde(rename = "generatedAt")]
3637    pub generated_at: DateTime,
3638    #[serde(
3639        rename = "customData",
3640        default,
3641        skip_serializing_if = "Option::is_none"
3642    )]
3643    pub custom_data: Option<CustomData>,
3644}
3645
3646impl Validate for NotifyMonitoringReportRequest {
3647    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3648        if let Some(x) = &self.monitor {
3649            let p = path.field("monitor");
3650            v::items(x, Some(1), None, &p)?;
3651            for (i0, it0) in x.iter().enumerate() {
3652                let p0 = p.index(i0);
3653                it0.validate(&p0)?;
3654            }
3655        }
3656        {
3657            let x = &self.seq_no;
3658            let p = path.field("seqNo");
3659            v::minimum(*x, 0i64, &p)?;
3660        }
3661        if let Some(x) = &self.custom_data {
3662            let p = path.field("customData");
3663            x.validate(&p)?;
3664        }
3665        Ok(())
3666    }
3667}
3668
3669#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3670#[serde(deny_unknown_fields)]
3671pub struct NotifyMonitoringReportResponse {
3672    #[serde(
3673        rename = "customData",
3674        default,
3675        skip_serializing_if = "Option::is_none"
3676    )]
3677    pub custom_data: Option<CustomData>,
3678}
3679
3680impl Validate for NotifyMonitoringReportResponse {
3681    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3682        if let Some(x) = &self.custom_data {
3683            let p = path.field("customData");
3684            x.validate(&p)?;
3685        }
3686        Ok(())
3687    }
3688}
3689
3690#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3691#[serde(deny_unknown_fields)]
3692pub struct NotifyPeriodicEventStream {
3693    #[serde(rename = "data")]
3694    pub data: Vec<StreamDataElement>,
3695    /// Id of stream.
3696    #[serde(rename = "id")]
3697    pub id: i64,
3698    /// Number of data elements still pending to be sent.
3699    #[serde(rename = "pending")]
3700    pub pending: i64,
3701    /// Base timestamp to add to time offset of values.
3702    #[serde(rename = "basetime")]
3703    pub basetime: DateTime,
3704    #[serde(
3705        rename = "customData",
3706        default,
3707        skip_serializing_if = "Option::is_none"
3708    )]
3709    pub custom_data: Option<CustomData>,
3710}
3711
3712impl Validate for NotifyPeriodicEventStream {
3713    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3714        {
3715            let x = &self.data;
3716            let p = path.field("data");
3717            v::items(x, Some(1), None, &p)?;
3718            for (i0, it0) in x.iter().enumerate() {
3719                let p0 = p.index(i0);
3720                it0.validate(&p0)?;
3721            }
3722        }
3723        {
3724            let x = &self.id;
3725            let p = path.field("id");
3726            v::minimum(*x, 0i64, &p)?;
3727        }
3728        {
3729            let x = &self.pending;
3730            let p = path.field("pending");
3731            v::minimum(*x, 0i64, &p)?;
3732        }
3733        if let Some(x) = &self.custom_data {
3734            let p = path.field("customData");
3735            x.validate(&p)?;
3736        }
3737        Ok(())
3738    }
3739}
3740
3741#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3742#[serde(deny_unknown_fields)]
3743pub struct NotifyPriorityChargingRequest {
3744    /// The transaction for which priority charging is requested.
3745    #[serde(rename = "transactionId")]
3746    pub transaction_id: String,
3747    /// True if priority charging was activated. False if it has stopped using the priority charging profile.
3748    #[serde(rename = "activated")]
3749    pub activated: bool,
3750    #[serde(
3751        rename = "customData",
3752        default,
3753        skip_serializing_if = "Option::is_none"
3754    )]
3755    pub custom_data: Option<CustomData>,
3756}
3757
3758impl Validate for NotifyPriorityChargingRequest {
3759    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3760        {
3761            let x = &self.transaction_id;
3762            let p = path.field("transactionId");
3763            v::max_length(x, 36, &p)?;
3764        }
3765        if let Some(x) = &self.custom_data {
3766            let p = path.field("customData");
3767            x.validate(&p)?;
3768        }
3769        Ok(())
3770    }
3771}
3772
3773/// This response message has an empty body.
3774#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3775#[serde(deny_unknown_fields)]
3776pub struct NotifyPriorityChargingResponse {
3777    #[serde(
3778        rename = "customData",
3779        default,
3780        skip_serializing_if = "Option::is_none"
3781    )]
3782    pub custom_data: Option<CustomData>,
3783}
3784
3785impl Validate for NotifyPriorityChargingResponse {
3786    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3787        if let Some(x) = &self.custom_data {
3788            let p = path.field("customData");
3789            x.validate(&p)?;
3790        }
3791        Ok(())
3792    }
3793}
3794
3795#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3796#[serde(deny_unknown_fields)]
3797pub struct NotifyReportRequest {
3798    /// The id of the GetReportRequest  or GetBaseReportRequest that requested this report
3799    #[serde(rename = "requestId")]
3800    pub request_id: i64,
3801    /// Timestamp of the moment this message was generated at the Charging Station.
3802    #[serde(rename = "generatedAt")]
3803    pub generated_at: DateTime,
3804    #[serde(
3805        rename = "reportData",
3806        default,
3807        skip_serializing_if = "Option::is_none"
3808    )]
3809    pub report_data: Option<Vec<ReportData>>,
3810    /// “to be continued” indicator. Indicates whether another part of the report follows in an upcoming notifyReportRequest message. Default value when omitted is false.
3811    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
3812    pub tbc: Option<bool>,
3813    /// Sequence number of this message. First message starts at 0.
3814    #[serde(rename = "seqNo")]
3815    pub seq_no: i64,
3816    #[serde(
3817        rename = "customData",
3818        default,
3819        skip_serializing_if = "Option::is_none"
3820    )]
3821    pub custom_data: Option<CustomData>,
3822}
3823
3824impl Validate for NotifyReportRequest {
3825    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3826        if let Some(x) = &self.report_data {
3827            let p = path.field("reportData");
3828            v::items(x, Some(1), None, &p)?;
3829            for (i0, it0) in x.iter().enumerate() {
3830                let p0 = p.index(i0);
3831                it0.validate(&p0)?;
3832            }
3833        }
3834        {
3835            let x = &self.seq_no;
3836            let p = path.field("seqNo");
3837            v::minimum(*x, 0i64, &p)?;
3838        }
3839        if let Some(x) = &self.custom_data {
3840            let p = path.field("customData");
3841            x.validate(&p)?;
3842        }
3843        Ok(())
3844    }
3845}
3846
3847#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3848#[serde(deny_unknown_fields)]
3849pub struct NotifyReportResponse {
3850    #[serde(
3851        rename = "customData",
3852        default,
3853        skip_serializing_if = "Option::is_none"
3854    )]
3855    pub custom_data: Option<CustomData>,
3856}
3857
3858impl Validate for NotifyReportResponse {
3859    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3860        if let Some(x) = &self.custom_data {
3861            let p = path.field("customData");
3862            x.validate(&p)?;
3863        }
3864        Ok(())
3865    }
3866}
3867
3868#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3869#[serde(deny_unknown_fields)]
3870pub struct NotifySettlementRequest {
3871    /// The _transactionId_ that the settlement belongs to. Can be empty if the payment transaction is canceled prior to the start of the OCPP transaction.
3872    #[serde(
3873        rename = "transactionId",
3874        default,
3875        skip_serializing_if = "Option::is_none"
3876    )]
3877    pub transaction_id: Option<String>,
3878    /// The payment reference received from the payment terminal and is used as the value for _idToken_.
3879    #[serde(rename = "pspRef")]
3880    pub psp_ref: String,
3881    #[serde(rename = "status")]
3882    pub status: PaymentStatusEnum,
3883    /// Additional information from payment terminal/payment process.
3884    #[serde(
3885        rename = "statusInfo",
3886        default,
3887        skip_serializing_if = "Option::is_none"
3888    )]
3889    pub status_info: Option<String>,
3890    /// The amount that was settled, or attempted to be settled (in case of failure).
3891    #[serde(rename = "settlementAmount")]
3892    pub settlement_amount: f64,
3893    /// The time when the settlement was done.
3894    #[serde(rename = "settlementTime")]
3895    pub settlement_time: DateTime,
3896    #[serde(rename = "receiptId", default, skip_serializing_if = "Option::is_none")]
3897    pub receipt_id: Option<String>,
3898    /// The receipt URL, to be used if the receipt is generated by the payment terminal or the CS.
3899    #[serde(
3900        rename = "receiptUrl",
3901        default,
3902        skip_serializing_if = "Option::is_none"
3903    )]
3904    pub receipt_url: Option<String>,
3905    #[serde(
3906        rename = "vatCompany",
3907        default,
3908        skip_serializing_if = "Option::is_none"
3909    )]
3910    pub vat_company: Option<Address>,
3911    /// VAT number for a company receipt.
3912    #[serde(rename = "vatNumber", default, skip_serializing_if = "Option::is_none")]
3913    pub vat_number: Option<String>,
3914    #[serde(
3915        rename = "customData",
3916        default,
3917        skip_serializing_if = "Option::is_none"
3918    )]
3919    pub custom_data: Option<CustomData>,
3920}
3921
3922impl Validate for NotifySettlementRequest {
3923    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3924        if let Some(x) = &self.transaction_id {
3925            let p = path.field("transactionId");
3926            v::max_length(x, 36, &p)?;
3927        }
3928        {
3929            let x = &self.psp_ref;
3930            let p = path.field("pspRef");
3931            v::max_length(x, 255, &p)?;
3932        }
3933        if let Some(x) = &self.status_info {
3934            let p = path.field("statusInfo");
3935            v::max_length(x, 500, &p)?;
3936        }
3937        if let Some(x) = &self.receipt_id {
3938            let p = path.field("receiptId");
3939            v::max_length(x, 50, &p)?;
3940        }
3941        if let Some(x) = &self.receipt_url {
3942            let p = path.field("receiptUrl");
3943            v::max_length(x, 2000, &p)?;
3944        }
3945        if let Some(x) = &self.vat_company {
3946            let p = path.field("vatCompany");
3947            x.validate(&p)?;
3948        }
3949        if let Some(x) = &self.vat_number {
3950            let p = path.field("vatNumber");
3951            v::max_length(x, 20, &p)?;
3952        }
3953        if let Some(x) = &self.custom_data {
3954            let p = path.field("customData");
3955            x.validate(&p)?;
3956        }
3957        Ok(())
3958    }
3959}
3960
3961#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3962#[serde(deny_unknown_fields)]
3963pub struct NotifySettlementResponse {
3964    /// The receipt URL if receipt generated by CSMS. The Charging Station can QR encode it and show it to the EV Driver.
3965    #[serde(
3966        rename = "receiptUrl",
3967        default,
3968        skip_serializing_if = "Option::is_none"
3969    )]
3970    pub receipt_url: Option<String>,
3971    /// The receipt id if the receipt is generated by CSMS.
3972    #[serde(rename = "receiptId", default, skip_serializing_if = "Option::is_none")]
3973    pub receipt_id: Option<String>,
3974    #[serde(
3975        rename = "customData",
3976        default,
3977        skip_serializing_if = "Option::is_none"
3978    )]
3979    pub custom_data: Option<CustomData>,
3980}
3981
3982impl Validate for NotifySettlementResponse {
3983    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3984        if let Some(x) = &self.receipt_url {
3985            let p = path.field("receiptUrl");
3986            v::max_length(x, 2000, &p)?;
3987        }
3988        if let Some(x) = &self.receipt_id {
3989            let p = path.field("receiptId");
3990            v::max_length(x, 50, &p)?;
3991        }
3992        if let Some(x) = &self.custom_data {
3993            let p = path.field("customData");
3994            x.validate(&p)?;
3995        }
3996        Ok(())
3997    }
3998}
3999
4000#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4001#[serde(deny_unknown_fields)]
4002pub struct NotifyWebPaymentStartedRequest {
4003    /// EVSE id for which transaction is requested.
4004    #[serde(rename = "evseId")]
4005    pub evse_id: i64,
4006    /// Timeout value in seconds after which no result of web payment process (e.g. QR code scanning) is to be expected anymore.
4007    #[serde(rename = "timeout")]
4008    pub timeout: i64,
4009    #[serde(
4010        rename = "customData",
4011        default,
4012        skip_serializing_if = "Option::is_none"
4013    )]
4014    pub custom_data: Option<CustomData>,
4015}
4016
4017impl Validate for NotifyWebPaymentStartedRequest {
4018    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4019        {
4020            let x = &self.evse_id;
4021            let p = path.field("evseId");
4022            v::minimum(*x, 0i64, &p)?;
4023        }
4024        if let Some(x) = &self.custom_data {
4025            let p = path.field("customData");
4026            x.validate(&p)?;
4027        }
4028        Ok(())
4029    }
4030}
4031
4032#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
4033#[serde(deny_unknown_fields)]
4034pub struct NotifyWebPaymentStartedResponse {
4035    #[serde(
4036        rename = "customData",
4037        default,
4038        skip_serializing_if = "Option::is_none"
4039    )]
4040    pub custom_data: Option<CustomData>,
4041}
4042
4043impl Validate for NotifyWebPaymentStartedResponse {
4044    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4045        if let Some(x) = &self.custom_data {
4046            let p = path.field("customData");
4047            x.validate(&p)?;
4048        }
4049        Ok(())
4050    }
4051}
4052
4053#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4054#[serde(deny_unknown_fields)]
4055pub struct OpenPeriodicEventStreamRequest {
4056    #[serde(rename = "constantStreamData")]
4057    pub constant_stream_data: ConstantStreamData,
4058    #[serde(
4059        rename = "customData",
4060        default,
4061        skip_serializing_if = "Option::is_none"
4062    )]
4063    pub custom_data: Option<CustomData>,
4064}
4065
4066impl Validate for OpenPeriodicEventStreamRequest {
4067    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4068        {
4069            let x = &self.constant_stream_data;
4070            let p = path.field("constantStreamData");
4071            x.validate(&p)?;
4072        }
4073        if let Some(x) = &self.custom_data {
4074            let p = path.field("customData");
4075            x.validate(&p)?;
4076        }
4077        Ok(())
4078    }
4079}
4080
4081#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4082#[serde(deny_unknown_fields)]
4083pub struct OpenPeriodicEventStreamResponse {
4084    #[serde(rename = "status")]
4085    pub status: GenericStatusEnum,
4086    #[serde(
4087        rename = "statusInfo",
4088        default,
4089        skip_serializing_if = "Option::is_none"
4090    )]
4091    pub status_info: Option<StatusInfo>,
4092    #[serde(
4093        rename = "customData",
4094        default,
4095        skip_serializing_if = "Option::is_none"
4096    )]
4097    pub custom_data: Option<CustomData>,
4098}
4099
4100impl Validate for OpenPeriodicEventStreamResponse {
4101    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4102        if let Some(x) = &self.status_info {
4103            let p = path.field("statusInfo");
4104            x.validate(&p)?;
4105        }
4106        if let Some(x) = &self.custom_data {
4107            let p = path.field("customData");
4108            x.validate(&p)?;
4109        }
4110        Ok(())
4111    }
4112}
4113
4114#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4115#[serde(deny_unknown_fields)]
4116pub struct PublishFirmwareRequest {
4117    /// This contains a string containing a URI pointing to a
4118    /// location from which to retrieve the firmware.
4119    #[serde(rename = "location")]
4120    pub location: String,
4121    /// This specifies how many times Charging Station must retry
4122    /// to download the firmware before giving up. If this field is not
4123    /// present, it is left to Charging Station to decide how many times it wants to retry.
4124    /// If the value is 0, it means: no retries.
4125    #[serde(rename = "retries", default, skip_serializing_if = "Option::is_none")]
4126    pub retries: Option<i64>,
4127    /// The MD5 checksum over the entire firmware file as a hexadecimal string of length 32.
4128    #[serde(rename = "checksum")]
4129    pub checksum: String,
4130    /// The Id of the request.
4131    #[serde(rename = "requestId")]
4132    pub request_id: i64,
4133    /// The interval in seconds
4134    /// after which a retry may be
4135    /// attempted. If this field is not
4136    /// present, it is left to Charging
4137    /// Station to decide how long to wait
4138    /// between attempts.
4139    #[serde(
4140        rename = "retryInterval",
4141        default,
4142        skip_serializing_if = "Option::is_none"
4143    )]
4144    pub retry_interval: Option<i64>,
4145    #[serde(
4146        rename = "customData",
4147        default,
4148        skip_serializing_if = "Option::is_none"
4149    )]
4150    pub custom_data: Option<CustomData>,
4151}
4152
4153impl Validate for PublishFirmwareRequest {
4154    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4155        {
4156            let x = &self.location;
4157            let p = path.field("location");
4158            v::max_length(x, 2000, &p)?;
4159        }
4160        if let Some(x) = &self.retries {
4161            let p = path.field("retries");
4162            v::minimum(*x, 0i64, &p)?;
4163        }
4164        {
4165            let x = &self.checksum;
4166            let p = path.field("checksum");
4167            v::max_length(x, 32, &p)?;
4168        }
4169        {
4170            let x = &self.request_id;
4171            let p = path.field("requestId");
4172            v::minimum(*x, 0i64, &p)?;
4173        }
4174        if let Some(x) = &self.retry_interval {
4175            let p = path.field("retryInterval");
4176            v::minimum(*x, 0i64, &p)?;
4177        }
4178        if let Some(x) = &self.custom_data {
4179            let p = path.field("customData");
4180            x.validate(&p)?;
4181        }
4182        Ok(())
4183    }
4184}
4185
4186#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4187#[serde(deny_unknown_fields)]
4188pub struct PublishFirmwareResponse {
4189    #[serde(rename = "status")]
4190    pub status: GenericStatusEnum,
4191    #[serde(
4192        rename = "statusInfo",
4193        default,
4194        skip_serializing_if = "Option::is_none"
4195    )]
4196    pub status_info: Option<StatusInfo>,
4197    #[serde(
4198        rename = "customData",
4199        default,
4200        skip_serializing_if = "Option::is_none"
4201    )]
4202    pub custom_data: Option<CustomData>,
4203}
4204
4205impl Validate for PublishFirmwareResponse {
4206    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4207        if let Some(x) = &self.status_info {
4208            let p = path.field("statusInfo");
4209            x.validate(&p)?;
4210        }
4211        if let Some(x) = &self.custom_data {
4212            let p = path.field("customData");
4213            x.validate(&p)?;
4214        }
4215        Ok(())
4216    }
4217}
4218
4219#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4220#[serde(deny_unknown_fields)]
4221pub struct PublishFirmwareStatusNotificationRequest {
4222    #[serde(rename = "status")]
4223    pub status: PublishFirmwareStatusEnum,
4224    /// Required if status is Published. Can be multiple URI’s, if the Local Controller supports e.g. HTTP, HTTPS, and FTP.
4225    #[serde(rename = "location", default, skip_serializing_if = "Option::is_none")]
4226    pub location: Option<Vec<String>>,
4227    /// The request id that was
4228    /// provided in the
4229    /// PublishFirmwareRequest which
4230    /// triggered this action.
4231    #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")]
4232    pub request_id: Option<i64>,
4233    #[serde(
4234        rename = "statusInfo",
4235        default,
4236        skip_serializing_if = "Option::is_none"
4237    )]
4238    pub status_info: Option<StatusInfo>,
4239    #[serde(
4240        rename = "customData",
4241        default,
4242        skip_serializing_if = "Option::is_none"
4243    )]
4244    pub custom_data: Option<CustomData>,
4245}
4246
4247impl Validate for PublishFirmwareStatusNotificationRequest {
4248    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4249        if let Some(x) = &self.location {
4250            let p = path.field("location");
4251            v::items(x, Some(1), None, &p)?;
4252            for (i0, it0) in x.iter().enumerate() {
4253                let p0 = p.index(i0);
4254                v::max_length(it0, 2000, &p0)?;
4255            }
4256        }
4257        if let Some(x) = &self.request_id {
4258            let p = path.field("requestId");
4259            v::minimum(*x, 0i64, &p)?;
4260        }
4261        if let Some(x) = &self.status_info {
4262            let p = path.field("statusInfo");
4263            x.validate(&p)?;
4264        }
4265        if let Some(x) = &self.custom_data {
4266            let p = path.field("customData");
4267            x.validate(&p)?;
4268        }
4269        Ok(())
4270    }
4271}
4272
4273#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
4274#[serde(deny_unknown_fields)]
4275pub struct PublishFirmwareStatusNotificationResponse {
4276    #[serde(
4277        rename = "customData",
4278        default,
4279        skip_serializing_if = "Option::is_none"
4280    )]
4281    pub custom_data: Option<CustomData>,
4282}
4283
4284impl Validate for PublishFirmwareStatusNotificationResponse {
4285    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4286        if let Some(x) = &self.custom_data {
4287            let p = path.field("customData");
4288            x.validate(&p)?;
4289        }
4290        Ok(())
4291    }
4292}
4293
4294#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4295#[serde(deny_unknown_fields)]
4296pub struct PullDynamicScheduleUpdateRequest {
4297    /// Id of charging profile to update.
4298    #[serde(rename = "chargingProfileId")]
4299    pub charging_profile_id: i64,
4300    #[serde(
4301        rename = "customData",
4302        default,
4303        skip_serializing_if = "Option::is_none"
4304    )]
4305    pub custom_data: Option<CustomData>,
4306}
4307
4308impl Validate for PullDynamicScheduleUpdateRequest {
4309    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4310        if let Some(x) = &self.custom_data {
4311            let p = path.field("customData");
4312            x.validate(&p)?;
4313        }
4314        Ok(())
4315    }
4316}
4317
4318#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4319#[serde(deny_unknown_fields)]
4320pub struct PullDynamicScheduleUpdateResponse {
4321    #[serde(
4322        rename = "scheduleUpdate",
4323        default,
4324        skip_serializing_if = "Option::is_none"
4325    )]
4326    pub schedule_update: Option<ChargingScheduleUpdate>,
4327    #[serde(rename = "status")]
4328    pub status: ChargingProfileStatusEnum,
4329    #[serde(
4330        rename = "statusInfo",
4331        default,
4332        skip_serializing_if = "Option::is_none"
4333    )]
4334    pub status_info: Option<StatusInfo>,
4335    #[serde(
4336        rename = "customData",
4337        default,
4338        skip_serializing_if = "Option::is_none"
4339    )]
4340    pub custom_data: Option<CustomData>,
4341}
4342
4343impl Validate for PullDynamicScheduleUpdateResponse {
4344    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4345        if let Some(x) = &self.schedule_update {
4346            let p = path.field("scheduleUpdate");
4347            x.validate(&p)?;
4348        }
4349        if let Some(x) = &self.status_info {
4350            let p = path.field("statusInfo");
4351            x.validate(&p)?;
4352        }
4353        if let Some(x) = &self.custom_data {
4354            let p = path.field("customData");
4355            x.validate(&p)?;
4356        }
4357        Ok(())
4358    }
4359}
4360
4361#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4362#[serde(deny_unknown_fields)]
4363pub struct ReportChargingProfilesRequest {
4364    /// Id used to match the &lt;&lt;getchargingprofilesrequest, GetChargingProfilesRequest&gt;&gt; message with the resulting ReportChargingProfilesRequest messages. When the CSMS provided a requestId in the &lt;&lt;getchargingprofilesrequest, GetChargingProfilesRequest&gt;&gt;, this field SHALL contain the same value.
4365    #[serde(rename = "requestId")]
4366    pub request_id: i64,
4367    /// Source that has installed this charging profile. Values defined in Appendix as ChargingLimitSourceEnumStringType.
4368    #[serde(rename = "chargingLimitSource")]
4369    pub charging_limit_source: String,
4370    #[serde(rename = "chargingProfile")]
4371    pub charging_profile: Vec<ChargingProfile>,
4372    /// To Be Continued. Default value when omitted: false. false indicates that there are no further messages as part of this report.
4373    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
4374    pub tbc: Option<bool>,
4375    /// The evse to which the charging profile applies. If evseId = 0, the message contains an overall limit for the Charging Station.
4376    #[serde(rename = "evseId")]
4377    pub evse_id: i64,
4378    #[serde(
4379        rename = "customData",
4380        default,
4381        skip_serializing_if = "Option::is_none"
4382    )]
4383    pub custom_data: Option<CustomData>,
4384}
4385
4386impl Validate for ReportChargingProfilesRequest {
4387    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4388        {
4389            let x = &self.charging_limit_source;
4390            let p = path.field("chargingLimitSource");
4391            v::max_length(x, 20, &p)?;
4392        }
4393        {
4394            let x = &self.charging_profile;
4395            let p = path.field("chargingProfile");
4396            v::items(x, Some(1), None, &p)?;
4397            for (i0, it0) in x.iter().enumerate() {
4398                let p0 = p.index(i0);
4399                it0.validate(&p0)?;
4400            }
4401        }
4402        {
4403            let x = &self.evse_id;
4404            let p = path.field("evseId");
4405            v::minimum(*x, 0i64, &p)?;
4406        }
4407        if let Some(x) = &self.custom_data {
4408            let p = path.field("customData");
4409            x.validate(&p)?;
4410        }
4411        Ok(())
4412    }
4413}
4414
4415#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
4416#[serde(deny_unknown_fields)]
4417pub struct ReportChargingProfilesResponse {
4418    #[serde(
4419        rename = "customData",
4420        default,
4421        skip_serializing_if = "Option::is_none"
4422    )]
4423    pub custom_data: Option<CustomData>,
4424}
4425
4426impl Validate for ReportChargingProfilesResponse {
4427    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4428        if let Some(x) = &self.custom_data {
4429            let p = path.field("customData");
4430            x.validate(&p)?;
4431        }
4432        Ok(())
4433    }
4434}
4435
4436#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4437#[serde(deny_unknown_fields)]
4438pub struct ReportDERControlRequest {
4439    #[serde(rename = "curve", default, skip_serializing_if = "Option::is_none")]
4440    pub curve: Option<Vec<DERCurveGet>>,
4441    #[serde(
4442        rename = "enterService",
4443        default,
4444        skip_serializing_if = "Option::is_none"
4445    )]
4446    pub enter_service: Option<Vec<EnterServiceGet>>,
4447    #[serde(
4448        rename = "fixedPFAbsorb",
4449        default,
4450        skip_serializing_if = "Option::is_none"
4451    )]
4452    pub fixed_pf_absorb: Option<Vec<FixedPFGet>>,
4453    #[serde(
4454        rename = "fixedPFInject",
4455        default,
4456        skip_serializing_if = "Option::is_none"
4457    )]
4458    pub fixed_pf_inject: Option<Vec<FixedPFGet>>,
4459    #[serde(rename = "fixedVar", default, skip_serializing_if = "Option::is_none")]
4460    pub fixed_var: Option<Vec<FixedVarGet>>,
4461    #[serde(rename = "freqDroop", default, skip_serializing_if = "Option::is_none")]
4462    pub freq_droop: Option<Vec<FreqDroopGet>>,
4463    #[serde(rename = "gradient", default, skip_serializing_if = "Option::is_none")]
4464    pub gradient: Option<Vec<GradientGet>>,
4465    #[serde(
4466        rename = "limitMaxDischarge",
4467        default,
4468        skip_serializing_if = "Option::is_none"
4469    )]
4470    pub limit_max_discharge: Option<Vec<LimitMaxDischargeGet>>,
4471    /// RequestId from GetDERControlRequest.
4472    #[serde(rename = "requestId")]
4473    pub request_id: i64,
4474    /// To Be Continued. Default value when omitted: false. +
4475    /// False indicates that there are no further messages as part of this report.
4476    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
4477    pub tbc: Option<bool>,
4478    #[serde(
4479        rename = "customData",
4480        default,
4481        skip_serializing_if = "Option::is_none"
4482    )]
4483    pub custom_data: Option<CustomData>,
4484}
4485
4486impl Validate for ReportDERControlRequest {
4487    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4488        if let Some(x) = &self.curve {
4489            let p = path.field("curve");
4490            v::items(x, Some(1), Some(24), &p)?;
4491            for (i0, it0) in x.iter().enumerate() {
4492                let p0 = p.index(i0);
4493                it0.validate(&p0)?;
4494            }
4495        }
4496        if let Some(x) = &self.enter_service {
4497            let p = path.field("enterService");
4498            v::items(x, Some(1), Some(24), &p)?;
4499            for (i0, it0) in x.iter().enumerate() {
4500                let p0 = p.index(i0);
4501                it0.validate(&p0)?;
4502            }
4503        }
4504        if let Some(x) = &self.fixed_pf_absorb {
4505            let p = path.field("fixedPFAbsorb");
4506            v::items(x, Some(1), Some(24), &p)?;
4507            for (i0, it0) in x.iter().enumerate() {
4508                let p0 = p.index(i0);
4509                it0.validate(&p0)?;
4510            }
4511        }
4512        if let Some(x) = &self.fixed_pf_inject {
4513            let p = path.field("fixedPFInject");
4514            v::items(x, Some(1), Some(24), &p)?;
4515            for (i0, it0) in x.iter().enumerate() {
4516                let p0 = p.index(i0);
4517                it0.validate(&p0)?;
4518            }
4519        }
4520        if let Some(x) = &self.fixed_var {
4521            let p = path.field("fixedVar");
4522            v::items(x, Some(1), Some(24), &p)?;
4523            for (i0, it0) in x.iter().enumerate() {
4524                let p0 = p.index(i0);
4525                it0.validate(&p0)?;
4526            }
4527        }
4528        if let Some(x) = &self.freq_droop {
4529            let p = path.field("freqDroop");
4530            v::items(x, Some(1), Some(24), &p)?;
4531            for (i0, it0) in x.iter().enumerate() {
4532                let p0 = p.index(i0);
4533                it0.validate(&p0)?;
4534            }
4535        }
4536        if let Some(x) = &self.gradient {
4537            let p = path.field("gradient");
4538            v::items(x, Some(1), Some(24), &p)?;
4539            for (i0, it0) in x.iter().enumerate() {
4540                let p0 = p.index(i0);
4541                it0.validate(&p0)?;
4542            }
4543        }
4544        if let Some(x) = &self.limit_max_discharge {
4545            let p = path.field("limitMaxDischarge");
4546            v::items(x, Some(1), Some(24), &p)?;
4547            for (i0, it0) in x.iter().enumerate() {
4548                let p0 = p.index(i0);
4549                it0.validate(&p0)?;
4550            }
4551        }
4552        if let Some(x) = &self.custom_data {
4553            let p = path.field("customData");
4554            x.validate(&p)?;
4555        }
4556        Ok(())
4557    }
4558}
4559
4560/// This message has no parameters.
4561#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
4562#[serde(deny_unknown_fields)]
4563pub struct ReportDERControlResponse {
4564    #[serde(
4565        rename = "customData",
4566        default,
4567        skip_serializing_if = "Option::is_none"
4568    )]
4569    pub custom_data: Option<CustomData>,
4570}
4571
4572impl Validate for ReportDERControlResponse {
4573    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4574        if let Some(x) = &self.custom_data {
4575            let p = path.field("customData");
4576            x.validate(&p)?;
4577        }
4578        Ok(())
4579    }
4580}
4581
4582#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4583#[serde(deny_unknown_fields)]
4584pub struct RequestBatterySwapRequest {
4585    #[serde(rename = "idToken")]
4586    pub id_token: IdToken,
4587    /// Request id to match with BatterySwapRequest.
4588    #[serde(rename = "requestId")]
4589    pub request_id: i64,
4590    #[serde(
4591        rename = "customData",
4592        default,
4593        skip_serializing_if = "Option::is_none"
4594    )]
4595    pub custom_data: Option<CustomData>,
4596}
4597
4598impl Validate for RequestBatterySwapRequest {
4599    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4600        {
4601            let x = &self.id_token;
4602            let p = path.field("idToken");
4603            x.validate(&p)?;
4604        }
4605        if let Some(x) = &self.custom_data {
4606            let p = path.field("customData");
4607            x.validate(&p)?;
4608        }
4609        Ok(())
4610    }
4611}
4612
4613#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4614#[serde(deny_unknown_fields)]
4615pub struct RequestBatterySwapResponse {
4616    #[serde(rename = "status")]
4617    pub status: GenericStatusEnum,
4618    #[serde(
4619        rename = "statusInfo",
4620        default,
4621        skip_serializing_if = "Option::is_none"
4622    )]
4623    pub status_info: Option<StatusInfo>,
4624    #[serde(
4625        rename = "customData",
4626        default,
4627        skip_serializing_if = "Option::is_none"
4628    )]
4629    pub custom_data: Option<CustomData>,
4630}
4631
4632impl Validate for RequestBatterySwapResponse {
4633    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4634        if let Some(x) = &self.status_info {
4635            let p = path.field("statusInfo");
4636            x.validate(&p)?;
4637        }
4638        if let Some(x) = &self.custom_data {
4639            let p = path.field("customData");
4640            x.validate(&p)?;
4641        }
4642        Ok(())
4643    }
4644}
4645
4646#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4647#[serde(deny_unknown_fields)]
4648pub struct RequestStartTransactionRequest {
4649    /// Number of the EVSE on which to start the transaction. EvseId SHALL be &gt; 0
4650    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
4651    pub evse_id: Option<i64>,
4652    #[serde(
4653        rename = "groupIdToken",
4654        default,
4655        skip_serializing_if = "Option::is_none"
4656    )]
4657    pub group_id_token: Option<IdToken>,
4658    #[serde(rename = "idToken")]
4659    pub id_token: IdToken,
4660    /// Id given by the server to this start request. The Charging Station will return this in the &lt;&lt;transactioneventrequest, TransactionEventRequest&gt;&gt;, letting the server know which transaction was started for this request. Use to start a transaction.
4661    #[serde(rename = "remoteStartId")]
4662    pub remote_start_id: i64,
4663    #[serde(
4664        rename = "chargingProfile",
4665        default,
4666        skip_serializing_if = "Option::is_none"
4667    )]
4668    pub charging_profile: Option<ChargingProfile>,
4669    #[serde(
4670        rename = "customData",
4671        default,
4672        skip_serializing_if = "Option::is_none"
4673    )]
4674    pub custom_data: Option<CustomData>,
4675}
4676
4677impl Validate for RequestStartTransactionRequest {
4678    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4679        if let Some(x) = &self.evse_id {
4680            let p = path.field("evseId");
4681            v::minimum(*x, 1i64, &p)?;
4682        }
4683        if let Some(x) = &self.group_id_token {
4684            let p = path.field("groupIdToken");
4685            x.validate(&p)?;
4686        }
4687        {
4688            let x = &self.id_token;
4689            let p = path.field("idToken");
4690            x.validate(&p)?;
4691        }
4692        if let Some(x) = &self.charging_profile {
4693            let p = path.field("chargingProfile");
4694            x.validate(&p)?;
4695        }
4696        if let Some(x) = &self.custom_data {
4697            let p = path.field("customData");
4698            x.validate(&p)?;
4699        }
4700        Ok(())
4701    }
4702}
4703
4704#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4705#[serde(deny_unknown_fields)]
4706pub struct RequestStartTransactionResponse {
4707    #[serde(rename = "status")]
4708    pub status: RequestStartStopStatusEnum,
4709    #[serde(
4710        rename = "statusInfo",
4711        default,
4712        skip_serializing_if = "Option::is_none"
4713    )]
4714    pub status_info: Option<StatusInfo>,
4715    /// When the transaction was already started by the Charging Station before the RequestStartTransactionRequest was received, for example: cable plugged in first. This contains the transactionId of the already started transaction.
4716    #[serde(
4717        rename = "transactionId",
4718        default,
4719        skip_serializing_if = "Option::is_none"
4720    )]
4721    pub transaction_id: Option<String>,
4722    #[serde(
4723        rename = "customData",
4724        default,
4725        skip_serializing_if = "Option::is_none"
4726    )]
4727    pub custom_data: Option<CustomData>,
4728}
4729
4730impl Validate for RequestStartTransactionResponse {
4731    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4732        if let Some(x) = &self.status_info {
4733            let p = path.field("statusInfo");
4734            x.validate(&p)?;
4735        }
4736        if let Some(x) = &self.transaction_id {
4737            let p = path.field("transactionId");
4738            v::max_length(x, 36, &p)?;
4739        }
4740        if let Some(x) = &self.custom_data {
4741            let p = path.field("customData");
4742            x.validate(&p)?;
4743        }
4744        Ok(())
4745    }
4746}
4747
4748#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4749#[serde(deny_unknown_fields)]
4750pub struct RequestStopTransactionRequest {
4751    /// The identifier of the transaction which the Charging Station is requested to stop.
4752    #[serde(rename = "transactionId")]
4753    pub transaction_id: String,
4754    #[serde(
4755        rename = "customData",
4756        default,
4757        skip_serializing_if = "Option::is_none"
4758    )]
4759    pub custom_data: Option<CustomData>,
4760}
4761
4762impl Validate for RequestStopTransactionRequest {
4763    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4764        {
4765            let x = &self.transaction_id;
4766            let p = path.field("transactionId");
4767            v::max_length(x, 36, &p)?;
4768        }
4769        if let Some(x) = &self.custom_data {
4770            let p = path.field("customData");
4771            x.validate(&p)?;
4772        }
4773        Ok(())
4774    }
4775}
4776
4777#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4778#[serde(deny_unknown_fields)]
4779pub struct RequestStopTransactionResponse {
4780    #[serde(rename = "status")]
4781    pub status: RequestStartStopStatusEnum,
4782    #[serde(
4783        rename = "statusInfo",
4784        default,
4785        skip_serializing_if = "Option::is_none"
4786    )]
4787    pub status_info: Option<StatusInfo>,
4788    #[serde(
4789        rename = "customData",
4790        default,
4791        skip_serializing_if = "Option::is_none"
4792    )]
4793    pub custom_data: Option<CustomData>,
4794}
4795
4796impl Validate for RequestStopTransactionResponse {
4797    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4798        if let Some(x) = &self.status_info {
4799            let p = path.field("statusInfo");
4800            x.validate(&p)?;
4801        }
4802        if let Some(x) = &self.custom_data {
4803            let p = path.field("customData");
4804            x.validate(&p)?;
4805        }
4806        Ok(())
4807    }
4808}
4809
4810#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4811#[serde(deny_unknown_fields)]
4812pub struct ReservationStatusUpdateRequest {
4813    /// The ID of the reservation.
4814    #[serde(rename = "reservationId")]
4815    pub reservation_id: i64,
4816    #[serde(rename = "reservationUpdateStatus")]
4817    pub reservation_update_status: ReservationUpdateStatusEnum,
4818    #[serde(
4819        rename = "customData",
4820        default,
4821        skip_serializing_if = "Option::is_none"
4822    )]
4823    pub custom_data: Option<CustomData>,
4824}
4825
4826impl Validate for ReservationStatusUpdateRequest {
4827    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4828        {
4829            let x = &self.reservation_id;
4830            let p = path.field("reservationId");
4831            v::minimum(*x, 0i64, &p)?;
4832        }
4833        if let Some(x) = &self.custom_data {
4834            let p = path.field("customData");
4835            x.validate(&p)?;
4836        }
4837        Ok(())
4838    }
4839}
4840
4841#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
4842#[serde(deny_unknown_fields)]
4843pub struct ReservationStatusUpdateResponse {
4844    #[serde(
4845        rename = "customData",
4846        default,
4847        skip_serializing_if = "Option::is_none"
4848    )]
4849    pub custom_data: Option<CustomData>,
4850}
4851
4852impl Validate for ReservationStatusUpdateResponse {
4853    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4854        if let Some(x) = &self.custom_data {
4855            let p = path.field("customData");
4856            x.validate(&p)?;
4857        }
4858        Ok(())
4859    }
4860}
4861
4862#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4863#[serde(deny_unknown_fields)]
4864pub struct ReserveNowRequest {
4865    /// Id of reservation.
4866    #[serde(rename = "id")]
4867    pub id: i64,
4868    /// Date and time at which the reservation expires.
4869    #[serde(rename = "expiryDateTime")]
4870    pub expiry_date_time: DateTime,
4871    /// This field specifies the connector type. Values defined in Appendix as ConnectorEnumStringType.
4872    #[serde(
4873        rename = "connectorType",
4874        default,
4875        skip_serializing_if = "Option::is_none"
4876    )]
4877    pub connector_type: Option<String>,
4878    #[serde(rename = "idToken")]
4879    pub id_token: IdToken,
4880    /// This contains ID of the evse to be reserved.
4881    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
4882    pub evse_id: Option<i64>,
4883    #[serde(
4884        rename = "groupIdToken",
4885        default,
4886        skip_serializing_if = "Option::is_none"
4887    )]
4888    pub group_id_token: Option<IdToken>,
4889    #[serde(
4890        rename = "customData",
4891        default,
4892        skip_serializing_if = "Option::is_none"
4893    )]
4894    pub custom_data: Option<CustomData>,
4895}
4896
4897impl Validate for ReserveNowRequest {
4898    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4899        {
4900            let x = &self.id;
4901            let p = path.field("id");
4902            v::minimum(*x, 0i64, &p)?;
4903        }
4904        if let Some(x) = &self.connector_type {
4905            let p = path.field("connectorType");
4906            v::max_length(x, 20, &p)?;
4907        }
4908        {
4909            let x = &self.id_token;
4910            let p = path.field("idToken");
4911            x.validate(&p)?;
4912        }
4913        if let Some(x) = &self.evse_id {
4914            let p = path.field("evseId");
4915            v::minimum(*x, 0i64, &p)?;
4916        }
4917        if let Some(x) = &self.group_id_token {
4918            let p = path.field("groupIdToken");
4919            x.validate(&p)?;
4920        }
4921        if let Some(x) = &self.custom_data {
4922            let p = path.field("customData");
4923            x.validate(&p)?;
4924        }
4925        Ok(())
4926    }
4927}
4928
4929#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4930#[serde(deny_unknown_fields)]
4931pub struct ReserveNowResponse {
4932    #[serde(rename = "status")]
4933    pub status: ReserveNowStatusEnum,
4934    #[serde(
4935        rename = "statusInfo",
4936        default,
4937        skip_serializing_if = "Option::is_none"
4938    )]
4939    pub status_info: Option<StatusInfo>,
4940    #[serde(
4941        rename = "customData",
4942        default,
4943        skip_serializing_if = "Option::is_none"
4944    )]
4945    pub custom_data: Option<CustomData>,
4946}
4947
4948impl Validate for ReserveNowResponse {
4949    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4950        if let Some(x) = &self.status_info {
4951            let p = path.field("statusInfo");
4952            x.validate(&p)?;
4953        }
4954        if let Some(x) = &self.custom_data {
4955            let p = path.field("customData");
4956            x.validate(&p)?;
4957        }
4958        Ok(())
4959    }
4960}
4961
4962#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4963#[serde(deny_unknown_fields)]
4964pub struct ResetRequest {
4965    #[serde(rename = "type")]
4966    pub r#type: ResetEnum,
4967    /// This contains the ID of a specific EVSE that needs to be reset, instead of the entire Charging Station.
4968    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
4969    pub evse_id: Option<i64>,
4970    #[serde(
4971        rename = "customData",
4972        default,
4973        skip_serializing_if = "Option::is_none"
4974    )]
4975    pub custom_data: Option<CustomData>,
4976}
4977
4978impl Validate for ResetRequest {
4979    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4980        if let Some(x) = &self.evse_id {
4981            let p = path.field("evseId");
4982            v::minimum(*x, 0i64, &p)?;
4983        }
4984        if let Some(x) = &self.custom_data {
4985            let p = path.field("customData");
4986            x.validate(&p)?;
4987        }
4988        Ok(())
4989    }
4990}
4991
4992#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4993#[serde(deny_unknown_fields)]
4994pub struct ResetResponse {
4995    #[serde(rename = "status")]
4996    pub status: ResetStatusEnum,
4997    #[serde(
4998        rename = "statusInfo",
4999        default,
5000        skip_serializing_if = "Option::is_none"
5001    )]
5002    pub status_info: Option<StatusInfo>,
5003    #[serde(
5004        rename = "customData",
5005        default,
5006        skip_serializing_if = "Option::is_none"
5007    )]
5008    pub custom_data: Option<CustomData>,
5009}
5010
5011impl Validate for ResetResponse {
5012    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5013        if let Some(x) = &self.status_info {
5014            let p = path.field("statusInfo");
5015            x.validate(&p)?;
5016        }
5017        if let Some(x) = &self.custom_data {
5018            let p = path.field("customData");
5019            x.validate(&p)?;
5020        }
5021        Ok(())
5022    }
5023}
5024
5025#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5026#[serde(deny_unknown_fields)]
5027pub struct SecurityEventNotificationRequest {
5028    /// Type of the security event. This value should be taken from the Security events list.
5029    #[serde(rename = "type")]
5030    pub r#type: String,
5031    /// Date and time at which the event occurred.
5032    #[serde(rename = "timestamp")]
5033    pub timestamp: DateTime,
5034    /// Additional information about the occurred security event.
5035    #[serde(rename = "techInfo", default, skip_serializing_if = "Option::is_none")]
5036    pub tech_info: Option<String>,
5037    #[serde(
5038        rename = "customData",
5039        default,
5040        skip_serializing_if = "Option::is_none"
5041    )]
5042    pub custom_data: Option<CustomData>,
5043}
5044
5045impl Validate for SecurityEventNotificationRequest {
5046    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5047        {
5048            let x = &self.r#type;
5049            let p = path.field("type");
5050            v::max_length(x, 50, &p)?;
5051        }
5052        if let Some(x) = &self.tech_info {
5053            let p = path.field("techInfo");
5054            v::max_length(x, 255, &p)?;
5055        }
5056        if let Some(x) = &self.custom_data {
5057            let p = path.field("customData");
5058            x.validate(&p)?;
5059        }
5060        Ok(())
5061    }
5062}
5063
5064#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
5065#[serde(deny_unknown_fields)]
5066pub struct SecurityEventNotificationResponse {
5067    #[serde(
5068        rename = "customData",
5069        default,
5070        skip_serializing_if = "Option::is_none"
5071    )]
5072    pub custom_data: Option<CustomData>,
5073}
5074
5075impl Validate for SecurityEventNotificationResponse {
5076    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5077        if let Some(x) = &self.custom_data {
5078            let p = path.field("customData");
5079            x.validate(&p)?;
5080        }
5081        Ok(())
5082    }
5083}
5084
5085#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5086#[serde(deny_unknown_fields)]
5087pub struct SendLocalListRequest {
5088    #[serde(
5089        rename = "localAuthorizationList",
5090        default,
5091        skip_serializing_if = "Option::is_none"
5092    )]
5093    pub local_authorization_list: Option<Vec<AuthorizationData>>,
5094    /// In case of a full update this is the version number of the full list. In case of a differential update it is the version number of the list after the update has been applied.
5095    #[serde(rename = "versionNumber")]
5096    pub version_number: i64,
5097    #[serde(rename = "updateType")]
5098    pub update_type: UpdateEnum,
5099    #[serde(
5100        rename = "customData",
5101        default,
5102        skip_serializing_if = "Option::is_none"
5103    )]
5104    pub custom_data: Option<CustomData>,
5105}
5106
5107impl Validate for SendLocalListRequest {
5108    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5109        if let Some(x) = &self.local_authorization_list {
5110            let p = path.field("localAuthorizationList");
5111            v::items(x, Some(1), None, &p)?;
5112            for (i0, it0) in x.iter().enumerate() {
5113                let p0 = p.index(i0);
5114                it0.validate(&p0)?;
5115            }
5116        }
5117        if let Some(x) = &self.custom_data {
5118            let p = path.field("customData");
5119            x.validate(&p)?;
5120        }
5121        Ok(())
5122    }
5123}
5124
5125#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5126#[serde(deny_unknown_fields)]
5127pub struct SendLocalListResponse {
5128    #[serde(rename = "status")]
5129    pub status: SendLocalListStatusEnum,
5130    #[serde(
5131        rename = "statusInfo",
5132        default,
5133        skip_serializing_if = "Option::is_none"
5134    )]
5135    pub status_info: Option<StatusInfo>,
5136    #[serde(
5137        rename = "customData",
5138        default,
5139        skip_serializing_if = "Option::is_none"
5140    )]
5141    pub custom_data: Option<CustomData>,
5142}
5143
5144impl Validate for SendLocalListResponse {
5145    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5146        if let Some(x) = &self.status_info {
5147            let p = path.field("statusInfo");
5148            x.validate(&p)?;
5149        }
5150        if let Some(x) = &self.custom_data {
5151            let p = path.field("customData");
5152            x.validate(&p)?;
5153        }
5154        Ok(())
5155    }
5156}
5157
5158#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5159#[serde(deny_unknown_fields)]
5160pub struct SetChargingProfileRequest {
5161    /// For TxDefaultProfile an evseId=0 applies the profile to each individual evse. For ChargingStationMaxProfile and ChargingStationExternalConstraints an evseId=0 contains an overal limit for the whole Charging Station.
5162    #[serde(rename = "evseId")]
5163    pub evse_id: i64,
5164    #[serde(rename = "chargingProfile")]
5165    pub charging_profile: ChargingProfile,
5166    #[serde(
5167        rename = "customData",
5168        default,
5169        skip_serializing_if = "Option::is_none"
5170    )]
5171    pub custom_data: Option<CustomData>,
5172}
5173
5174impl Validate for SetChargingProfileRequest {
5175    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5176        {
5177            let x = &self.evse_id;
5178            let p = path.field("evseId");
5179            v::minimum(*x, 0i64, &p)?;
5180        }
5181        {
5182            let x = &self.charging_profile;
5183            let p = path.field("chargingProfile");
5184            x.validate(&p)?;
5185        }
5186        if let Some(x) = &self.custom_data {
5187            let p = path.field("customData");
5188            x.validate(&p)?;
5189        }
5190        Ok(())
5191    }
5192}
5193
5194#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5195#[serde(deny_unknown_fields)]
5196pub struct SetChargingProfileResponse {
5197    #[serde(rename = "status")]
5198    pub status: ChargingProfileStatusEnum,
5199    #[serde(
5200        rename = "statusInfo",
5201        default,
5202        skip_serializing_if = "Option::is_none"
5203    )]
5204    pub status_info: Option<StatusInfo>,
5205    #[serde(
5206        rename = "customData",
5207        default,
5208        skip_serializing_if = "Option::is_none"
5209    )]
5210    pub custom_data: Option<CustomData>,
5211}
5212
5213impl Validate for SetChargingProfileResponse {
5214    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5215        if let Some(x) = &self.status_info {
5216            let p = path.field("statusInfo");
5217            x.validate(&p)?;
5218        }
5219        if let Some(x) = &self.custom_data {
5220            let p = path.field("customData");
5221            x.validate(&p)?;
5222        }
5223        Ok(())
5224    }
5225}
5226
5227#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5228#[serde(deny_unknown_fields)]
5229pub struct SetDERControlRequest {
5230    /// True if this is a default DER control
5231    #[serde(rename = "isDefault")]
5232    pub is_default: bool,
5233    /// Unique id of this control, e.g. UUID
5234    #[serde(rename = "controlId")]
5235    pub control_id: String,
5236    #[serde(rename = "controlType")]
5237    pub control_type: DERControlEnum,
5238    #[serde(rename = "curve", default, skip_serializing_if = "Option::is_none")]
5239    pub curve: Option<DERCurve>,
5240    #[serde(
5241        rename = "enterService",
5242        default,
5243        skip_serializing_if = "Option::is_none"
5244    )]
5245    pub enter_service: Option<EnterService>,
5246    #[serde(
5247        rename = "fixedPFAbsorb",
5248        default,
5249        skip_serializing_if = "Option::is_none"
5250    )]
5251    pub fixed_pf_absorb: Option<FixedPF>,
5252    #[serde(
5253        rename = "fixedPFInject",
5254        default,
5255        skip_serializing_if = "Option::is_none"
5256    )]
5257    pub fixed_pf_inject: Option<FixedPF>,
5258    #[serde(rename = "fixedVar", default, skip_serializing_if = "Option::is_none")]
5259    pub fixed_var: Option<FixedVar>,
5260    #[serde(rename = "freqDroop", default, skip_serializing_if = "Option::is_none")]
5261    pub freq_droop: Option<FreqDroop>,
5262    #[serde(rename = "gradient", default, skip_serializing_if = "Option::is_none")]
5263    pub gradient: Option<Gradient>,
5264    #[serde(
5265        rename = "limitMaxDischarge",
5266        default,
5267        skip_serializing_if = "Option::is_none"
5268    )]
5269    pub limit_max_discharge: Option<LimitMaxDischarge>,
5270    #[serde(
5271        rename = "customData",
5272        default,
5273        skip_serializing_if = "Option::is_none"
5274    )]
5275    pub custom_data: Option<CustomData>,
5276}
5277
5278impl Validate for SetDERControlRequest {
5279    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5280        {
5281            let x = &self.control_id;
5282            let p = path.field("controlId");
5283            v::max_length(x, 36, &p)?;
5284        }
5285        if let Some(x) = &self.curve {
5286            let p = path.field("curve");
5287            x.validate(&p)?;
5288        }
5289        if let Some(x) = &self.enter_service {
5290            let p = path.field("enterService");
5291            x.validate(&p)?;
5292        }
5293        if let Some(x) = &self.fixed_pf_absorb {
5294            let p = path.field("fixedPFAbsorb");
5295            x.validate(&p)?;
5296        }
5297        if let Some(x) = &self.fixed_pf_inject {
5298            let p = path.field("fixedPFInject");
5299            x.validate(&p)?;
5300        }
5301        if let Some(x) = &self.fixed_var {
5302            let p = path.field("fixedVar");
5303            x.validate(&p)?;
5304        }
5305        if let Some(x) = &self.freq_droop {
5306            let p = path.field("freqDroop");
5307            x.validate(&p)?;
5308        }
5309        if let Some(x) = &self.gradient {
5310            let p = path.field("gradient");
5311            x.validate(&p)?;
5312        }
5313        if let Some(x) = &self.limit_max_discharge {
5314            let p = path.field("limitMaxDischarge");
5315            x.validate(&p)?;
5316        }
5317        if let Some(x) = &self.custom_data {
5318            let p = path.field("customData");
5319            x.validate(&p)?;
5320        }
5321        Ok(())
5322    }
5323}
5324
5325#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5326#[serde(deny_unknown_fields)]
5327pub struct SetDERControlResponse {
5328    #[serde(rename = "status")]
5329    pub status: DERControlStatusEnum,
5330    #[serde(
5331        rename = "statusInfo",
5332        default,
5333        skip_serializing_if = "Option::is_none"
5334    )]
5335    pub status_info: Option<StatusInfo>,
5336    /// List of controlIds that are superseded as a result of setting this control.
5337    #[serde(
5338        rename = "supersededIds",
5339        default,
5340        skip_serializing_if = "Option::is_none"
5341    )]
5342    pub superseded_ids: Option<Vec<String>>,
5343    #[serde(
5344        rename = "customData",
5345        default,
5346        skip_serializing_if = "Option::is_none"
5347    )]
5348    pub custom_data: Option<CustomData>,
5349}
5350
5351impl Validate for SetDERControlResponse {
5352    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5353        if let Some(x) = &self.status_info {
5354            let p = path.field("statusInfo");
5355            x.validate(&p)?;
5356        }
5357        if let Some(x) = &self.superseded_ids {
5358            let p = path.field("supersededIds");
5359            v::items(x, Some(1), Some(24), &p)?;
5360            for (i0, it0) in x.iter().enumerate() {
5361                let p0 = p.index(i0);
5362                v::max_length(it0, 36, &p0)?;
5363            }
5364        }
5365        if let Some(x) = &self.custom_data {
5366            let p = path.field("customData");
5367            x.validate(&p)?;
5368        }
5369        Ok(())
5370    }
5371}
5372
5373#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5374#[serde(deny_unknown_fields)]
5375pub struct SetDefaultTariffRequest {
5376    /// EVSE that tariff applies to. When _evseId_ = 0, then tarriff applies to all EVSEs.
5377    #[serde(rename = "evseId")]
5378    pub evse_id: i64,
5379    #[serde(rename = "tariff")]
5380    pub tariff: Tariff,
5381    #[serde(
5382        rename = "customData",
5383        default,
5384        skip_serializing_if = "Option::is_none"
5385    )]
5386    pub custom_data: Option<CustomData>,
5387}
5388
5389impl Validate for SetDefaultTariffRequest {
5390    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5391        {
5392            let x = &self.evse_id;
5393            let p = path.field("evseId");
5394            v::minimum(*x, 0i64, &p)?;
5395        }
5396        {
5397            let x = &self.tariff;
5398            let p = path.field("tariff");
5399            x.validate(&p)?;
5400        }
5401        if let Some(x) = &self.custom_data {
5402            let p = path.field("customData");
5403            x.validate(&p)?;
5404        }
5405        Ok(())
5406    }
5407}
5408
5409#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5410#[serde(deny_unknown_fields)]
5411pub struct SetDefaultTariffResponse {
5412    #[serde(rename = "status")]
5413    pub status: TariffSetStatusEnum,
5414    #[serde(
5415        rename = "statusInfo",
5416        default,
5417        skip_serializing_if = "Option::is_none"
5418    )]
5419    pub status_info: Option<StatusInfo>,
5420    #[serde(
5421        rename = "customData",
5422        default,
5423        skip_serializing_if = "Option::is_none"
5424    )]
5425    pub custom_data: Option<CustomData>,
5426}
5427
5428impl Validate for SetDefaultTariffResponse {
5429    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5430        if let Some(x) = &self.status_info {
5431            let p = path.field("statusInfo");
5432            x.validate(&p)?;
5433        }
5434        if let Some(x) = &self.custom_data {
5435            let p = path.field("customData");
5436            x.validate(&p)?;
5437        }
5438        Ok(())
5439    }
5440}
5441
5442#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5443#[serde(deny_unknown_fields)]
5444pub struct SetDisplayMessageRequest {
5445    #[serde(rename = "message")]
5446    pub message: MessageInfo,
5447    #[serde(
5448        rename = "customData",
5449        default,
5450        skip_serializing_if = "Option::is_none"
5451    )]
5452    pub custom_data: Option<CustomData>,
5453}
5454
5455impl Validate for SetDisplayMessageRequest {
5456    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5457        {
5458            let x = &self.message;
5459            let p = path.field("message");
5460            x.validate(&p)?;
5461        }
5462        if let Some(x) = &self.custom_data {
5463            let p = path.field("customData");
5464            x.validate(&p)?;
5465        }
5466        Ok(())
5467    }
5468}
5469
5470#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5471#[serde(deny_unknown_fields)]
5472pub struct SetDisplayMessageResponse {
5473    #[serde(rename = "status")]
5474    pub status: DisplayMessageStatusEnum,
5475    #[serde(
5476        rename = "statusInfo",
5477        default,
5478        skip_serializing_if = "Option::is_none"
5479    )]
5480    pub status_info: Option<StatusInfo>,
5481    #[serde(
5482        rename = "customData",
5483        default,
5484        skip_serializing_if = "Option::is_none"
5485    )]
5486    pub custom_data: Option<CustomData>,
5487}
5488
5489impl Validate for SetDisplayMessageResponse {
5490    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5491        if let Some(x) = &self.status_info {
5492            let p = path.field("statusInfo");
5493            x.validate(&p)?;
5494        }
5495        if let Some(x) = &self.custom_data {
5496            let p = path.field("customData");
5497            x.validate(&p)?;
5498        }
5499        Ok(())
5500    }
5501}
5502
5503#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5504#[serde(deny_unknown_fields)]
5505pub struct SetMonitoringBaseRequest {
5506    #[serde(rename = "monitoringBase")]
5507    pub monitoring_base: MonitoringBaseEnum,
5508    #[serde(
5509        rename = "customData",
5510        default,
5511        skip_serializing_if = "Option::is_none"
5512    )]
5513    pub custom_data: Option<CustomData>,
5514}
5515
5516impl Validate for SetMonitoringBaseRequest {
5517    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5518        if let Some(x) = &self.custom_data {
5519            let p = path.field("customData");
5520            x.validate(&p)?;
5521        }
5522        Ok(())
5523    }
5524}
5525
5526#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5527#[serde(deny_unknown_fields)]
5528pub struct SetMonitoringBaseResponse {
5529    #[serde(rename = "status")]
5530    pub status: GenericDeviceModelStatusEnum,
5531    #[serde(
5532        rename = "statusInfo",
5533        default,
5534        skip_serializing_if = "Option::is_none"
5535    )]
5536    pub status_info: Option<StatusInfo>,
5537    #[serde(
5538        rename = "customData",
5539        default,
5540        skip_serializing_if = "Option::is_none"
5541    )]
5542    pub custom_data: Option<CustomData>,
5543}
5544
5545impl Validate for SetMonitoringBaseResponse {
5546    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5547        if let Some(x) = &self.status_info {
5548            let p = path.field("statusInfo");
5549            x.validate(&p)?;
5550        }
5551        if let Some(x) = &self.custom_data {
5552            let p = path.field("customData");
5553            x.validate(&p)?;
5554        }
5555        Ok(())
5556    }
5557}
5558
5559#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5560#[serde(deny_unknown_fields)]
5561pub struct SetMonitoringLevelRequest {
5562    /// The Charging Station SHALL only report events with a severity number lower than or equal to this severity.
5563    /// The severity range is 0-9, with 0 as the highest and 9 as the lowest severity level.
5564    /// The severity levels have the following meaning: +
5565    /// *0-Danger* +
5566    /// Indicates lives are potentially in danger. Urgent attention is needed and action should be taken immediately. +
5567    /// *1-Hardware Failure* +
5568    /// Indicates that the Charging Station is unable to continue regular operations due to Hardware issues. Action is required. +
5569    /// *2-System Failure* +
5570    /// Indicates that the Charging Station is unable to continue regular operations due to software or minor hardware issues. Action is required. +
5571    /// *3-Critical* +
5572    /// Indicates a critical error. Action is required. +
5573    /// *4-Error* +
5574    /// Indicates a non-urgent error. Action is required. +
5575    /// *5-Alert* +
5576    /// Indicates an alert event. Default severity for any type of monitoring event.  +
5577    /// *6-Warning* +
5578    /// Indicates a warning event. Action may be required. +
5579    /// *7-Notice* +
5580    /// Indicates an unusual event. No immediate action is required. +
5581    /// *8-Informational* +
5582    /// Indicates a regular operational event. May be used for reporting, measuring throughput, etc. No action is required. +
5583    /// *9-Debug* +
5584    /// Indicates information useful to developers for debugging, not useful during operations.
5585    #[serde(rename = "severity")]
5586    pub severity: i64,
5587    #[serde(
5588        rename = "customData",
5589        default,
5590        skip_serializing_if = "Option::is_none"
5591    )]
5592    pub custom_data: Option<CustomData>,
5593}
5594
5595impl Validate for SetMonitoringLevelRequest {
5596    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5597        {
5598            let x = &self.severity;
5599            let p = path.field("severity");
5600            v::minimum(*x, 0i64, &p)?;
5601        }
5602        if let Some(x) = &self.custom_data {
5603            let p = path.field("customData");
5604            x.validate(&p)?;
5605        }
5606        Ok(())
5607    }
5608}
5609
5610#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5611#[serde(deny_unknown_fields)]
5612pub struct SetMonitoringLevelResponse {
5613    #[serde(rename = "status")]
5614    pub status: GenericStatusEnum,
5615    #[serde(
5616        rename = "statusInfo",
5617        default,
5618        skip_serializing_if = "Option::is_none"
5619    )]
5620    pub status_info: Option<StatusInfo>,
5621    #[serde(
5622        rename = "customData",
5623        default,
5624        skip_serializing_if = "Option::is_none"
5625    )]
5626    pub custom_data: Option<CustomData>,
5627}
5628
5629impl Validate for SetMonitoringLevelResponse {
5630    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5631        if let Some(x) = &self.status_info {
5632            let p = path.field("statusInfo");
5633            x.validate(&p)?;
5634        }
5635        if let Some(x) = &self.custom_data {
5636            let p = path.field("customData");
5637            x.validate(&p)?;
5638        }
5639        Ok(())
5640    }
5641}
5642
5643#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5644#[serde(deny_unknown_fields)]
5645pub struct SetNetworkProfileRequest {
5646    /// Slot in which the configuration should be stored.
5647    #[serde(rename = "configurationSlot")]
5648    pub configuration_slot: i64,
5649    #[serde(rename = "connectionData")]
5650    pub connection_data: NetworkConnectionProfile,
5651    #[serde(
5652        rename = "customData",
5653        default,
5654        skip_serializing_if = "Option::is_none"
5655    )]
5656    pub custom_data: Option<CustomData>,
5657}
5658
5659impl Validate for SetNetworkProfileRequest {
5660    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5661        {
5662            let x = &self.connection_data;
5663            let p = path.field("connectionData");
5664            x.validate(&p)?;
5665        }
5666        if let Some(x) = &self.custom_data {
5667            let p = path.field("customData");
5668            x.validate(&p)?;
5669        }
5670        Ok(())
5671    }
5672}
5673
5674#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5675#[serde(deny_unknown_fields)]
5676pub struct SetNetworkProfileResponse {
5677    #[serde(rename = "status")]
5678    pub status: SetNetworkProfileStatusEnum,
5679    #[serde(
5680        rename = "statusInfo",
5681        default,
5682        skip_serializing_if = "Option::is_none"
5683    )]
5684    pub status_info: Option<StatusInfo>,
5685    #[serde(
5686        rename = "customData",
5687        default,
5688        skip_serializing_if = "Option::is_none"
5689    )]
5690    pub custom_data: Option<CustomData>,
5691}
5692
5693impl Validate for SetNetworkProfileResponse {
5694    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5695        if let Some(x) = &self.status_info {
5696            let p = path.field("statusInfo");
5697            x.validate(&p)?;
5698        }
5699        if let Some(x) = &self.custom_data {
5700            let p = path.field("customData");
5701            x.validate(&p)?;
5702        }
5703        Ok(())
5704    }
5705}
5706
5707#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5708#[serde(deny_unknown_fields)]
5709pub struct SetVariableMonitoringRequest {
5710    #[serde(rename = "setMonitoringData")]
5711    pub set_monitoring_data: Vec<SetMonitoringData>,
5712    #[serde(
5713        rename = "customData",
5714        default,
5715        skip_serializing_if = "Option::is_none"
5716    )]
5717    pub custom_data: Option<CustomData>,
5718}
5719
5720impl Validate for SetVariableMonitoringRequest {
5721    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5722        {
5723            let x = &self.set_monitoring_data;
5724            let p = path.field("setMonitoringData");
5725            v::items(x, Some(1), None, &p)?;
5726            for (i0, it0) in x.iter().enumerate() {
5727                let p0 = p.index(i0);
5728                it0.validate(&p0)?;
5729            }
5730        }
5731        if let Some(x) = &self.custom_data {
5732            let p = path.field("customData");
5733            x.validate(&p)?;
5734        }
5735        Ok(())
5736    }
5737}
5738
5739#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5740#[serde(deny_unknown_fields)]
5741pub struct SetVariableMonitoringResponse {
5742    #[serde(rename = "setMonitoringResult")]
5743    pub set_monitoring_result: Vec<SetMonitoringResult>,
5744    #[serde(
5745        rename = "customData",
5746        default,
5747        skip_serializing_if = "Option::is_none"
5748    )]
5749    pub custom_data: Option<CustomData>,
5750}
5751
5752impl Validate for SetVariableMonitoringResponse {
5753    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5754        {
5755            let x = &self.set_monitoring_result;
5756            let p = path.field("setMonitoringResult");
5757            v::items(x, Some(1), None, &p)?;
5758            for (i0, it0) in x.iter().enumerate() {
5759                let p0 = p.index(i0);
5760                it0.validate(&p0)?;
5761            }
5762        }
5763        if let Some(x) = &self.custom_data {
5764            let p = path.field("customData");
5765            x.validate(&p)?;
5766        }
5767        Ok(())
5768    }
5769}
5770
5771#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5772#[serde(deny_unknown_fields)]
5773pub struct SetVariablesRequest {
5774    #[serde(rename = "setVariableData")]
5775    pub set_variable_data: Vec<SetVariableData>,
5776    #[serde(
5777        rename = "customData",
5778        default,
5779        skip_serializing_if = "Option::is_none"
5780    )]
5781    pub custom_data: Option<CustomData>,
5782}
5783
5784impl Validate for SetVariablesRequest {
5785    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5786        {
5787            let x = &self.set_variable_data;
5788            let p = path.field("setVariableData");
5789            v::items(x, Some(1), None, &p)?;
5790            for (i0, it0) in x.iter().enumerate() {
5791                let p0 = p.index(i0);
5792                it0.validate(&p0)?;
5793            }
5794        }
5795        if let Some(x) = &self.custom_data {
5796            let p = path.field("customData");
5797            x.validate(&p)?;
5798        }
5799        Ok(())
5800    }
5801}
5802
5803#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5804#[serde(deny_unknown_fields)]
5805pub struct SetVariablesResponse {
5806    #[serde(rename = "setVariableResult")]
5807    pub set_variable_result: Vec<SetVariableResult>,
5808    #[serde(
5809        rename = "customData",
5810        default,
5811        skip_serializing_if = "Option::is_none"
5812    )]
5813    pub custom_data: Option<CustomData>,
5814}
5815
5816impl Validate for SetVariablesResponse {
5817    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5818        {
5819            let x = &self.set_variable_result;
5820            let p = path.field("setVariableResult");
5821            v::items(x, Some(1), None, &p)?;
5822            for (i0, it0) in x.iter().enumerate() {
5823                let p0 = p.index(i0);
5824                it0.validate(&p0)?;
5825            }
5826        }
5827        if let Some(x) = &self.custom_data {
5828            let p = path.field("customData");
5829            x.validate(&p)?;
5830        }
5831        Ok(())
5832    }
5833}
5834
5835#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5836#[serde(deny_unknown_fields)]
5837pub struct SignCertificateRequest {
5838    /// The Charging Station SHALL send the public key in form of a Certificate Signing Request (CSR) as described in RFC 2986 \[22\] and then PEM encoded, using the &lt;&lt;signcertificaterequest,SignCertificateRequest&gt;&gt; message.
5839    #[serde(rename = "csr")]
5840    pub csr: String,
5841    #[serde(
5842        rename = "certificateType",
5843        default,
5844        skip_serializing_if = "Option::is_none"
5845    )]
5846    pub certificate_type: Option<CertificateSigningUseEnum>,
5847    #[serde(
5848        rename = "hashRootCertificate",
5849        default,
5850        skip_serializing_if = "Option::is_none"
5851    )]
5852    pub hash_root_certificate: Option<CertificateHashData>,
5853    /// *(2.1)* RequestId to match this message with the CertificateSignedRequest.
5854    #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")]
5855    pub request_id: Option<i64>,
5856    #[serde(
5857        rename = "customData",
5858        default,
5859        skip_serializing_if = "Option::is_none"
5860    )]
5861    pub custom_data: Option<CustomData>,
5862}
5863
5864impl Validate for SignCertificateRequest {
5865    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5866        {
5867            let x = &self.csr;
5868            let p = path.field("csr");
5869            v::max_length(x, 5500, &p)?;
5870        }
5871        if let Some(x) = &self.hash_root_certificate {
5872            let p = path.field("hashRootCertificate");
5873            x.validate(&p)?;
5874        }
5875        if let Some(x) = &self.custom_data {
5876            let p = path.field("customData");
5877            x.validate(&p)?;
5878        }
5879        Ok(())
5880    }
5881}
5882
5883#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5884#[serde(deny_unknown_fields)]
5885pub struct SignCertificateResponse {
5886    #[serde(rename = "status")]
5887    pub status: GenericStatusEnum,
5888    #[serde(
5889        rename = "statusInfo",
5890        default,
5891        skip_serializing_if = "Option::is_none"
5892    )]
5893    pub status_info: Option<StatusInfo>,
5894    #[serde(
5895        rename = "customData",
5896        default,
5897        skip_serializing_if = "Option::is_none"
5898    )]
5899    pub custom_data: Option<CustomData>,
5900}
5901
5902impl Validate for SignCertificateResponse {
5903    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5904        if let Some(x) = &self.status_info {
5905            let p = path.field("statusInfo");
5906            x.validate(&p)?;
5907        }
5908        if let Some(x) = &self.custom_data {
5909            let p = path.field("customData");
5910            x.validate(&p)?;
5911        }
5912        Ok(())
5913    }
5914}
5915
5916#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5917#[serde(deny_unknown_fields)]
5918pub struct StatusNotificationRequest {
5919    /// The time for which the status is reported.
5920    #[serde(rename = "timestamp")]
5921    pub timestamp: DateTime,
5922    #[serde(rename = "connectorStatus")]
5923    pub connector_status: ConnectorStatusEnum,
5924    /// The id of the EVSE to which the connector belongs for which the the status is reported.
5925    #[serde(rename = "evseId")]
5926    pub evse_id: i64,
5927    /// The id of the connector within the EVSE for which the status is reported.
5928    #[serde(rename = "connectorId")]
5929    pub connector_id: i64,
5930    #[serde(
5931        rename = "customData",
5932        default,
5933        skip_serializing_if = "Option::is_none"
5934    )]
5935    pub custom_data: Option<CustomData>,
5936}
5937
5938impl Validate for StatusNotificationRequest {
5939    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5940        {
5941            let x = &self.evse_id;
5942            let p = path.field("evseId");
5943            v::minimum(*x, 0i64, &p)?;
5944        }
5945        {
5946            let x = &self.connector_id;
5947            let p = path.field("connectorId");
5948            v::minimum(*x, 0i64, &p)?;
5949        }
5950        if let Some(x) = &self.custom_data {
5951            let p = path.field("customData");
5952            x.validate(&p)?;
5953        }
5954        Ok(())
5955    }
5956}
5957
5958#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
5959#[serde(deny_unknown_fields)]
5960pub struct StatusNotificationResponse {
5961    #[serde(
5962        rename = "customData",
5963        default,
5964        skip_serializing_if = "Option::is_none"
5965    )]
5966    pub custom_data: Option<CustomData>,
5967}
5968
5969impl Validate for StatusNotificationResponse {
5970    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
5971        if let Some(x) = &self.custom_data {
5972            let p = path.field("customData");
5973            x.validate(&p)?;
5974        }
5975        Ok(())
5976    }
5977}
5978
5979#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5980#[serde(deny_unknown_fields)]
5981pub struct TransactionEventRequest {
5982    #[serde(
5983        rename = "costDetails",
5984        default,
5985        skip_serializing_if = "Option::is_none"
5986    )]
5987    pub cost_details: Option<CostDetails>,
5988    #[serde(rename = "eventType")]
5989    pub event_type: TransactionEventEnum,
5990    #[serde(
5991        rename = "meterValue",
5992        default,
5993        skip_serializing_if = "Option::is_none"
5994    )]
5995    pub meter_value: Option<Vec<MeterValue>>,
5996    /// The date and time at which this transaction event occurred.
5997    #[serde(rename = "timestamp")]
5998    pub timestamp: DateTime,
5999    #[serde(rename = "triggerReason")]
6000    pub trigger_reason: TriggerReasonEnum,
6001    /// Incremental sequence number, helps with determining if all messages of a transaction have been received.
6002    #[serde(rename = "seqNo")]
6003    pub seq_no: i64,
6004    /// Indication that this transaction event happened when the Charging Station was offline. Default = false, meaning: the event occurred when the Charging Station was online.
6005    #[serde(rename = "offline", default, skip_serializing_if = "Option::is_none")]
6006    pub offline: Option<bool>,
6007    /// If the Charging Station is able to report the number of phases used, then it SHALL provide it.
6008    /// When omitted the CSMS may be able to determine the number of phases used as follows: +
6009    /// 1: The numberPhases in the currently used ChargingSchedule. +
6010    /// 2: The number of phases provided via device management.
6011    #[serde(
6012        rename = "numberOfPhasesUsed",
6013        default,
6014        skip_serializing_if = "Option::is_none"
6015    )]
6016    pub number_of_phases_used: Option<i64>,
6017    /// The maximum current of the connected cable in Ampere (A).
6018    #[serde(
6019        rename = "cableMaxCurrent",
6020        default,
6021        skip_serializing_if = "Option::is_none"
6022    )]
6023    pub cable_max_current: Option<i64>,
6024    /// This contains the Id of the reservation that terminates as a result of this transaction.
6025    #[serde(
6026        rename = "reservationId",
6027        default,
6028        skip_serializing_if = "Option::is_none"
6029    )]
6030    pub reservation_id: Option<i64>,
6031    #[serde(
6032        rename = "preconditioningStatus",
6033        default,
6034        skip_serializing_if = "Option::is_none"
6035    )]
6036    pub preconditioning_status: Option<PreconditioningStatusEnum>,
6037    /// *(2.1)* True when EVSE electronics are in sleep mode for this transaction. Default value (when absent) is false.
6038    #[serde(rename = "evseSleep", default, skip_serializing_if = "Option::is_none")]
6039    pub evse_sleep: Option<bool>,
6040    #[serde(rename = "transactionInfo")]
6041    pub transaction_info: Transaction,
6042    #[serde(rename = "evse", default, skip_serializing_if = "Option::is_none")]
6043    pub evse: Option<EVSE>,
6044    #[serde(rename = "idToken", default, skip_serializing_if = "Option::is_none")]
6045    pub id_token: Option<IdToken>,
6046    #[serde(
6047        rename = "customData",
6048        default,
6049        skip_serializing_if = "Option::is_none"
6050    )]
6051    pub custom_data: Option<CustomData>,
6052}
6053
6054impl Validate for TransactionEventRequest {
6055    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6056        if let Some(x) = &self.cost_details {
6057            let p = path.field("costDetails");
6058            x.validate(&p)?;
6059        }
6060        if let Some(x) = &self.meter_value {
6061            let p = path.field("meterValue");
6062            v::items(x, Some(1), None, &p)?;
6063            for (i0, it0) in x.iter().enumerate() {
6064                let p0 = p.index(i0);
6065                it0.validate(&p0)?;
6066            }
6067        }
6068        {
6069            let x = &self.seq_no;
6070            let p = path.field("seqNo");
6071            v::minimum(*x, 0i64, &p)?;
6072        }
6073        if let Some(x) = &self.number_of_phases_used {
6074            let p = path.field("numberOfPhasesUsed");
6075            v::minimum(*x, 0i64, &p)?;
6076            v::maximum(*x, 3i64, &p)?;
6077        }
6078        if let Some(x) = &self.reservation_id {
6079            let p = path.field("reservationId");
6080            v::minimum(*x, 0i64, &p)?;
6081        }
6082        {
6083            let x = &self.transaction_info;
6084            let p = path.field("transactionInfo");
6085            x.validate(&p)?;
6086        }
6087        if let Some(x) = &self.evse {
6088            let p = path.field("evse");
6089            x.validate(&p)?;
6090        }
6091        if let Some(x) = &self.id_token {
6092            let p = path.field("idToken");
6093            x.validate(&p)?;
6094        }
6095        if let Some(x) = &self.custom_data {
6096            let p = path.field("customData");
6097            x.validate(&p)?;
6098        }
6099        Ok(())
6100    }
6101}
6102
6103#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
6104#[serde(deny_unknown_fields)]
6105pub struct TransactionEventResponse {
6106    /// When _eventType_ of TransactionEventRequest is Updated, then this value contains the running cost. When _eventType_ of TransactionEventRequest is Ended, then this contains the final total cost of this transaction, including taxes, in the currency configured with the Configuration Variable: Currency. Absence of this value does not imply that the transaction was free. To indicate a free transaction, the CSMS SHALL send a value of 0.00.
6107    #[serde(rename = "totalCost", default, skip_serializing_if = "Option::is_none")]
6108    pub total_cost: Option<f64>,
6109    /// Priority from a business point of view. Default priority is 0, The range is from -9 to 9. Higher values indicate a higher priority. The chargingPriority in &lt;&lt;transactioneventresponse,TransactionEventResponse&gt;&gt; is temporarily, so it may not be set in the &lt;&lt;cmn_idtokeninfotype,IdTokenInfoType&gt;&gt; afterwards. Also the chargingPriority in &lt;&lt;transactioneventresponse,TransactionEventResponse&gt;&gt; has a higher priority than the one in &lt;&lt;cmn_idtokeninfotype,IdTokenInfoType&gt;&gt;.
6110    #[serde(
6111        rename = "chargingPriority",
6112        default,
6113        skip_serializing_if = "Option::is_none"
6114    )]
6115    pub charging_priority: Option<i64>,
6116    #[serde(
6117        rename = "idTokenInfo",
6118        default,
6119        skip_serializing_if = "Option::is_none"
6120    )]
6121    pub id_token_info: Option<IdTokenInfo>,
6122    #[serde(
6123        rename = "transactionLimit",
6124        default,
6125        skip_serializing_if = "Option::is_none"
6126    )]
6127    pub transaction_limit: Option<TransactionLimit>,
6128    #[serde(
6129        rename = "updatedPersonalMessage",
6130        default,
6131        skip_serializing_if = "Option::is_none"
6132    )]
6133    pub updated_personal_message: Option<MessageContent>,
6134    #[serde(
6135        rename = "updatedPersonalMessageExtra",
6136        default,
6137        skip_serializing_if = "Option::is_none"
6138    )]
6139    pub updated_personal_message_extra: Option<Vec<MessageContent>>,
6140    #[serde(
6141        rename = "customData",
6142        default,
6143        skip_serializing_if = "Option::is_none"
6144    )]
6145    pub custom_data: Option<CustomData>,
6146}
6147
6148impl Validate for TransactionEventResponse {
6149    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6150        if let Some(x) = &self.id_token_info {
6151            let p = path.field("idTokenInfo");
6152            x.validate(&p)?;
6153        }
6154        if let Some(x) = &self.transaction_limit {
6155            let p = path.field("transactionLimit");
6156            x.validate(&p)?;
6157        }
6158        if let Some(x) = &self.updated_personal_message {
6159            let p = path.field("updatedPersonalMessage");
6160            x.validate(&p)?;
6161        }
6162        if let Some(x) = &self.updated_personal_message_extra {
6163            let p = path.field("updatedPersonalMessageExtra");
6164            v::items(x, Some(1), Some(4), &p)?;
6165            for (i0, it0) in x.iter().enumerate() {
6166                let p0 = p.index(i0);
6167                it0.validate(&p0)?;
6168            }
6169        }
6170        if let Some(x) = &self.custom_data {
6171            let p = path.field("customData");
6172            x.validate(&p)?;
6173        }
6174        Ok(())
6175    }
6176}
6177
6178#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6179#[serde(deny_unknown_fields)]
6180pub struct TriggerMessageRequest {
6181    #[serde(rename = "evse", default, skip_serializing_if = "Option::is_none")]
6182    pub evse: Option<EVSE>,
6183    #[serde(rename = "requestedMessage")]
6184    pub requested_message: MessageTriggerEnum,
6185    /// *(2.1)* When _requestedMessage_ = `CustomTrigger` this will trigger sending the corresponding message in field _customTrigger_, if supported by Charging Station.
6186    #[serde(
6187        rename = "customTrigger",
6188        default,
6189        skip_serializing_if = "Option::is_none"
6190    )]
6191    pub custom_trigger: Option<String>,
6192    #[serde(
6193        rename = "customData",
6194        default,
6195        skip_serializing_if = "Option::is_none"
6196    )]
6197    pub custom_data: Option<CustomData>,
6198}
6199
6200impl Validate for TriggerMessageRequest {
6201    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6202        if let Some(x) = &self.evse {
6203            let p = path.field("evse");
6204            x.validate(&p)?;
6205        }
6206        if let Some(x) = &self.custom_trigger {
6207            let p = path.field("customTrigger");
6208            v::max_length(x, 50, &p)?;
6209        }
6210        if let Some(x) = &self.custom_data {
6211            let p = path.field("customData");
6212            x.validate(&p)?;
6213        }
6214        Ok(())
6215    }
6216}
6217
6218#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6219#[serde(deny_unknown_fields)]
6220pub struct TriggerMessageResponse {
6221    #[serde(rename = "status")]
6222    pub status: TriggerMessageStatusEnum,
6223    #[serde(
6224        rename = "statusInfo",
6225        default,
6226        skip_serializing_if = "Option::is_none"
6227    )]
6228    pub status_info: Option<StatusInfo>,
6229    #[serde(
6230        rename = "customData",
6231        default,
6232        skip_serializing_if = "Option::is_none"
6233    )]
6234    pub custom_data: Option<CustomData>,
6235}
6236
6237impl Validate for TriggerMessageResponse {
6238    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6239        if let Some(x) = &self.status_info {
6240            let p = path.field("statusInfo");
6241            x.validate(&p)?;
6242        }
6243        if let Some(x) = &self.custom_data {
6244            let p = path.field("customData");
6245            x.validate(&p)?;
6246        }
6247        Ok(())
6248    }
6249}
6250
6251#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6252#[serde(deny_unknown_fields)]
6253pub struct UnlockConnectorRequest {
6254    /// This contains the identifier of the EVSE for which a connector needs to be unlocked.
6255    #[serde(rename = "evseId")]
6256    pub evse_id: i64,
6257    /// This contains the identifier of the connector that needs to be unlocked.
6258    #[serde(rename = "connectorId")]
6259    pub connector_id: i64,
6260    #[serde(
6261        rename = "customData",
6262        default,
6263        skip_serializing_if = "Option::is_none"
6264    )]
6265    pub custom_data: Option<CustomData>,
6266}
6267
6268impl Validate for UnlockConnectorRequest {
6269    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6270        {
6271            let x = &self.evse_id;
6272            let p = path.field("evseId");
6273            v::minimum(*x, 0i64, &p)?;
6274        }
6275        {
6276            let x = &self.connector_id;
6277            let p = path.field("connectorId");
6278            v::minimum(*x, 0i64, &p)?;
6279        }
6280        if let Some(x) = &self.custom_data {
6281            let p = path.field("customData");
6282            x.validate(&p)?;
6283        }
6284        Ok(())
6285    }
6286}
6287
6288#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6289#[serde(deny_unknown_fields)]
6290pub struct UnlockConnectorResponse {
6291    #[serde(rename = "status")]
6292    pub status: UnlockStatusEnum,
6293    #[serde(
6294        rename = "statusInfo",
6295        default,
6296        skip_serializing_if = "Option::is_none"
6297    )]
6298    pub status_info: Option<StatusInfo>,
6299    #[serde(
6300        rename = "customData",
6301        default,
6302        skip_serializing_if = "Option::is_none"
6303    )]
6304    pub custom_data: Option<CustomData>,
6305}
6306
6307impl Validate for UnlockConnectorResponse {
6308    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6309        if let Some(x) = &self.status_info {
6310            let p = path.field("statusInfo");
6311            x.validate(&p)?;
6312        }
6313        if let Some(x) = &self.custom_data {
6314            let p = path.field("customData");
6315            x.validate(&p)?;
6316        }
6317        Ok(())
6318    }
6319}
6320
6321#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6322#[serde(deny_unknown_fields)]
6323pub struct UnpublishFirmwareRequest {
6324    /// The MD5 checksum over the entire firmware file as a hexadecimal string of length 32.
6325    #[serde(rename = "checksum")]
6326    pub checksum: String,
6327    #[serde(
6328        rename = "customData",
6329        default,
6330        skip_serializing_if = "Option::is_none"
6331    )]
6332    pub custom_data: Option<CustomData>,
6333}
6334
6335impl Validate for UnpublishFirmwareRequest {
6336    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6337        {
6338            let x = &self.checksum;
6339            let p = path.field("checksum");
6340            v::max_length(x, 32, &p)?;
6341        }
6342        if let Some(x) = &self.custom_data {
6343            let p = path.field("customData");
6344            x.validate(&p)?;
6345        }
6346        Ok(())
6347    }
6348}
6349
6350#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6351#[serde(deny_unknown_fields)]
6352pub struct UnpublishFirmwareResponse {
6353    #[serde(rename = "status")]
6354    pub status: UnpublishFirmwareStatusEnum,
6355    #[serde(
6356        rename = "customData",
6357        default,
6358        skip_serializing_if = "Option::is_none"
6359    )]
6360    pub custom_data: Option<CustomData>,
6361}
6362
6363impl Validate for UnpublishFirmwareResponse {
6364    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6365        if let Some(x) = &self.custom_data {
6366            let p = path.field("customData");
6367            x.validate(&p)?;
6368        }
6369        Ok(())
6370    }
6371}
6372
6373/// Id of dynamic charging profile to update.
6374#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6375#[serde(deny_unknown_fields)]
6376pub struct UpdateDynamicScheduleRequest {
6377    /// Id of charging profile to update.
6378    #[serde(rename = "chargingProfileId")]
6379    pub charging_profile_id: i64,
6380    #[serde(rename = "scheduleUpdate")]
6381    pub schedule_update: ChargingScheduleUpdate,
6382    #[serde(
6383        rename = "customData",
6384        default,
6385        skip_serializing_if = "Option::is_none"
6386    )]
6387    pub custom_data: Option<CustomData>,
6388}
6389
6390impl Validate for UpdateDynamicScheduleRequest {
6391    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6392        {
6393            let x = &self.schedule_update;
6394            let p = path.field("scheduleUpdate");
6395            x.validate(&p)?;
6396        }
6397        if let Some(x) = &self.custom_data {
6398            let p = path.field("customData");
6399            x.validate(&p)?;
6400        }
6401        Ok(())
6402    }
6403}
6404
6405#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6406#[serde(deny_unknown_fields)]
6407pub struct UpdateDynamicScheduleResponse {
6408    #[serde(rename = "status")]
6409    pub status: ChargingProfileStatusEnum,
6410    #[serde(
6411        rename = "statusInfo",
6412        default,
6413        skip_serializing_if = "Option::is_none"
6414    )]
6415    pub status_info: Option<StatusInfo>,
6416    #[serde(
6417        rename = "customData",
6418        default,
6419        skip_serializing_if = "Option::is_none"
6420    )]
6421    pub custom_data: Option<CustomData>,
6422}
6423
6424impl Validate for UpdateDynamicScheduleResponse {
6425    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6426        if let Some(x) = &self.status_info {
6427            let p = path.field("statusInfo");
6428            x.validate(&p)?;
6429        }
6430        if let Some(x) = &self.custom_data {
6431            let p = path.field("customData");
6432            x.validate(&p)?;
6433        }
6434        Ok(())
6435    }
6436}
6437
6438#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6439#[serde(deny_unknown_fields)]
6440pub struct UpdateFirmwareRequest {
6441    /// This specifies how many times Charging Station must retry to download the firmware before giving up. If this field is not present, it is left to Charging Station to decide how many times it wants to retry.
6442    /// If the value is 0, it means: no retries.
6443    #[serde(rename = "retries", default, skip_serializing_if = "Option::is_none")]
6444    pub retries: Option<i64>,
6445    /// The interval in seconds after which a retry may be attempted. If this field is not present, it is left to Charging Station to decide how long to wait between attempts.
6446    #[serde(
6447        rename = "retryInterval",
6448        default,
6449        skip_serializing_if = "Option::is_none"
6450    )]
6451    pub retry_interval: Option<i64>,
6452    /// The Id of this request
6453    #[serde(rename = "requestId")]
6454    pub request_id: i64,
6455    #[serde(rename = "firmware")]
6456    pub firmware: Firmware,
6457    #[serde(
6458        rename = "customData",
6459        default,
6460        skip_serializing_if = "Option::is_none"
6461    )]
6462    pub custom_data: Option<CustomData>,
6463}
6464
6465impl Validate for UpdateFirmwareRequest {
6466    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6467        if let Some(x) = &self.retries {
6468            let p = path.field("retries");
6469            v::minimum(*x, 0i64, &p)?;
6470        }
6471        {
6472            let x = &self.firmware;
6473            let p = path.field("firmware");
6474            x.validate(&p)?;
6475        }
6476        if let Some(x) = &self.custom_data {
6477            let p = path.field("customData");
6478            x.validate(&p)?;
6479        }
6480        Ok(())
6481    }
6482}
6483
6484#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6485#[serde(deny_unknown_fields)]
6486pub struct UpdateFirmwareResponse {
6487    #[serde(rename = "status")]
6488    pub status: UpdateFirmwareStatusEnum,
6489    #[serde(
6490        rename = "statusInfo",
6491        default,
6492        skip_serializing_if = "Option::is_none"
6493    )]
6494    pub status_info: Option<StatusInfo>,
6495    #[serde(
6496        rename = "customData",
6497        default,
6498        skip_serializing_if = "Option::is_none"
6499    )]
6500    pub custom_data: Option<CustomData>,
6501}
6502
6503impl Validate for UpdateFirmwareResponse {
6504    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6505        if let Some(x) = &self.status_info {
6506            let p = path.field("statusInfo");
6507            x.validate(&p)?;
6508        }
6509        if let Some(x) = &self.custom_data {
6510            let p = path.field("customData");
6511            x.validate(&p)?;
6512        }
6513        Ok(())
6514    }
6515}
6516
6517#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6518#[serde(deny_unknown_fields)]
6519pub struct UsePriorityChargingRequest {
6520    /// The transaction for which priority charging is requested.
6521    #[serde(rename = "transactionId")]
6522    pub transaction_id: String,
6523    /// True to request priority charging.
6524    /// False to request stopping priority charging.
6525    #[serde(rename = "activate")]
6526    pub activate: bool,
6527    #[serde(
6528        rename = "customData",
6529        default,
6530        skip_serializing_if = "Option::is_none"
6531    )]
6532    pub custom_data: Option<CustomData>,
6533}
6534
6535impl Validate for UsePriorityChargingRequest {
6536    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6537        {
6538            let x = &self.transaction_id;
6539            let p = path.field("transactionId");
6540            v::max_length(x, 36, &p)?;
6541        }
6542        if let Some(x) = &self.custom_data {
6543            let p = path.field("customData");
6544            x.validate(&p)?;
6545        }
6546        Ok(())
6547    }
6548}
6549
6550#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6551#[serde(deny_unknown_fields)]
6552pub struct UsePriorityChargingResponse {
6553    #[serde(rename = "status")]
6554    pub status: PriorityChargingStatusEnum,
6555    #[serde(
6556        rename = "statusInfo",
6557        default,
6558        skip_serializing_if = "Option::is_none"
6559    )]
6560    pub status_info: Option<StatusInfo>,
6561    #[serde(
6562        rename = "customData",
6563        default,
6564        skip_serializing_if = "Option::is_none"
6565    )]
6566    pub custom_data: Option<CustomData>,
6567}
6568
6569impl Validate for UsePriorityChargingResponse {
6570    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6571        if let Some(x) = &self.status_info {
6572            let p = path.field("statusInfo");
6573            x.validate(&p)?;
6574        }
6575        if let Some(x) = &self.custom_data {
6576            let p = path.field("customData");
6577            x.validate(&p)?;
6578        }
6579        Ok(())
6580    }
6581}
6582
6583#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6584#[serde(deny_unknown_fields)]
6585pub struct VatNumberValidationRequest {
6586    /// VAT number to check.
6587    #[serde(rename = "vatNumber")]
6588    pub vat_number: String,
6589    /// EVSE id for which check is done
6590    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
6591    pub evse_id: Option<i64>,
6592    #[serde(
6593        rename = "customData",
6594        default,
6595        skip_serializing_if = "Option::is_none"
6596    )]
6597    pub custom_data: Option<CustomData>,
6598}
6599
6600impl Validate for VatNumberValidationRequest {
6601    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6602        {
6603            let x = &self.vat_number;
6604            let p = path.field("vatNumber");
6605            v::max_length(x, 20, &p)?;
6606        }
6607        if let Some(x) = &self.evse_id {
6608            let p = path.field("evseId");
6609            v::minimum(*x, 0i64, &p)?;
6610        }
6611        if let Some(x) = &self.custom_data {
6612            let p = path.field("customData");
6613            x.validate(&p)?;
6614        }
6615        Ok(())
6616    }
6617}
6618
6619#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6620#[serde(deny_unknown_fields)]
6621pub struct VatNumberValidationResponse {
6622    #[serde(rename = "company", default, skip_serializing_if = "Option::is_none")]
6623    pub company: Option<Address>,
6624    #[serde(
6625        rename = "statusInfo",
6626        default,
6627        skip_serializing_if = "Option::is_none"
6628    )]
6629    pub status_info: Option<StatusInfo>,
6630    /// VAT number that was requested.
6631    #[serde(rename = "vatNumber")]
6632    pub vat_number: String,
6633    /// EVSE id for which check was requested.
6634    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
6635    pub evse_id: Option<i64>,
6636    #[serde(rename = "status")]
6637    pub status: GenericStatusEnum,
6638    #[serde(
6639        rename = "customData",
6640        default,
6641        skip_serializing_if = "Option::is_none"
6642    )]
6643    pub custom_data: Option<CustomData>,
6644}
6645
6646impl Validate for VatNumberValidationResponse {
6647    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
6648        if let Some(x) = &self.company {
6649            let p = path.field("company");
6650            x.validate(&p)?;
6651        }
6652        if let Some(x) = &self.status_info {
6653            let p = path.field("statusInfo");
6654            x.validate(&p)?;
6655        }
6656        {
6657            let x = &self.vat_number;
6658            let p = path.field("vatNumber");
6659            v::max_length(x, 20, &p)?;
6660        }
6661        if let Some(x) = &self.evse_id {
6662            let p = path.field("evseId");
6663            v::minimum(*x, 0i64, &p)?;
6664        }
6665        if let Some(x) = &self.custom_data {
6666            let p = path.field("customData");
6667            x.validate(&p)?;
6668        }
6669        Ok(())
6670    }
6671}