Skip to main content

codetics_ocpp201/
messages.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Kevin Vavelin, Codetics (https://codetics.fr)
3
4//! OCPP 2.0.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 AuthorizeRequest {
16    #[serde(
17        rename = "customData",
18        default,
19        skip_serializing_if = "Option::is_none"
20    )]
21    pub custom_data: Option<CustomData>,
22    #[serde(rename = "idToken")]
23    pub id_token: IdToken,
24    /// The X.509 certificated presented by EV and encoded in PEM format.
25    #[serde(
26        rename = "certificate",
27        default,
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub certificate: Option<String>,
31    #[serde(
32        rename = "iso15118CertificateHashData",
33        default,
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub iso15118_certificate_hash_data: Option<Vec<OCSPRequestData>>,
37}
38
39impl Validate for AuthorizeRequest {
40    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
41        if let Some(x) = &self.custom_data {
42            let p = path.field("customData");
43            x.validate(&p)?;
44        }
45        {
46            let x = &self.id_token;
47            let p = path.field("idToken");
48            x.validate(&p)?;
49        }
50        if let Some(x) = &self.certificate {
51            let p = path.field("certificate");
52            v::max_length(x, 5500, &p)?;
53        }
54        if let Some(x) = &self.iso15118_certificate_hash_data {
55            let p = path.field("iso15118CertificateHashData");
56            v::items(x, Some(1), Some(4), &p)?;
57            for (i0, it0) in x.iter().enumerate() {
58                let p0 = p.index(i0);
59                it0.validate(&p0)?;
60            }
61        }
62        Ok(())
63    }
64}
65
66#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
67#[serde(deny_unknown_fields)]
68pub struct AuthorizeResponse {
69    #[serde(
70        rename = "customData",
71        default,
72        skip_serializing_if = "Option::is_none"
73    )]
74    pub custom_data: Option<CustomData>,
75    #[serde(rename = "idTokenInfo")]
76    pub id_token_info: IdTokenInfo,
77    #[serde(
78        rename = "certificateStatus",
79        default,
80        skip_serializing_if = "Option::is_none"
81    )]
82    pub certificate_status: Option<AuthorizeCertificateStatusEnum>,
83}
84
85impl Validate for AuthorizeResponse {
86    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
87        if let Some(x) = &self.custom_data {
88            let p = path.field("customData");
89            x.validate(&p)?;
90        }
91        {
92            let x = &self.id_token_info;
93            let p = path.field("idTokenInfo");
94            x.validate(&p)?;
95        }
96        Ok(())
97    }
98}
99
100#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
101#[serde(deny_unknown_fields)]
102pub struct BootNotificationRequest {
103    #[serde(
104        rename = "customData",
105        default,
106        skip_serializing_if = "Option::is_none"
107    )]
108    pub custom_data: Option<CustomData>,
109    #[serde(rename = "chargingStation")]
110    pub charging_station: ChargingStation,
111    #[serde(rename = "reason")]
112    pub reason: BootReasonEnum,
113}
114
115impl Validate for BootNotificationRequest {
116    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
117        if let Some(x) = &self.custom_data {
118            let p = path.field("customData");
119            x.validate(&p)?;
120        }
121        {
122            let x = &self.charging_station;
123            let p = path.field("chargingStation");
124            x.validate(&p)?;
125        }
126        Ok(())
127    }
128}
129
130#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
131#[serde(deny_unknown_fields)]
132pub struct BootNotificationResponse {
133    #[serde(
134        rename = "customData",
135        default,
136        skip_serializing_if = "Option::is_none"
137    )]
138    pub custom_data: Option<CustomData>,
139    /// This contains the CSMS’s current time.
140    #[serde(rename = "currentTime")]
141    pub current_time: DateTime,
142    /// 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.
143    #[serde(rename = "interval")]
144    pub interval: i64,
145    #[serde(rename = "status")]
146    pub status: RegistrationStatusEnum,
147    #[serde(
148        rename = "statusInfo",
149        default,
150        skip_serializing_if = "Option::is_none"
151    )]
152    pub status_info: Option<StatusInfo>,
153}
154
155impl Validate for BootNotificationResponse {
156    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
157        if let Some(x) = &self.custom_data {
158            let p = path.field("customData");
159            x.validate(&p)?;
160        }
161        if let Some(x) = &self.status_info {
162            let p = path.field("statusInfo");
163            x.validate(&p)?;
164        }
165        Ok(())
166    }
167}
168
169#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
170#[serde(deny_unknown_fields)]
171pub struct CancelReservationRequest {
172    #[serde(
173        rename = "customData",
174        default,
175        skip_serializing_if = "Option::is_none"
176    )]
177    pub custom_data: Option<CustomData>,
178    /// Id of the reservation to cancel.
179    #[serde(rename = "reservationId")]
180    pub reservation_id: i64,
181}
182
183impl Validate for CancelReservationRequest {
184    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
185        if let Some(x) = &self.custom_data {
186            let p = path.field("customData");
187            x.validate(&p)?;
188        }
189        Ok(())
190    }
191}
192
193#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
194#[serde(deny_unknown_fields)]
195pub struct CancelReservationResponse {
196    #[serde(
197        rename = "customData",
198        default,
199        skip_serializing_if = "Option::is_none"
200    )]
201    pub custom_data: Option<CustomData>,
202    #[serde(rename = "status")]
203    pub status: CancelReservationStatusEnum,
204    #[serde(
205        rename = "statusInfo",
206        default,
207        skip_serializing_if = "Option::is_none"
208    )]
209    pub status_info: Option<StatusInfo>,
210}
211
212impl Validate for CancelReservationResponse {
213    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
214        if let Some(x) = &self.custom_data {
215            let p = path.field("customData");
216            x.validate(&p)?;
217        }
218        if let Some(x) = &self.status_info {
219            let p = path.field("statusInfo");
220            x.validate(&p)?;
221        }
222        Ok(())
223    }
224}
225
226#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
227#[serde(deny_unknown_fields)]
228pub struct CertificateSignedRequest {
229    #[serde(
230        rename = "customData",
231        default,
232        skip_serializing_if = "Option::is_none"
233    )]
234    pub custom_data: Option<CustomData>,
235    /// The signed PEM encoded X.509 certificate. This can also contain the necessary sub CA certificates. In that case, the order of the bundle should follow the certificate chain, starting from the leaf certificate.
236    /// The Configuration Variable &lt;&lt;configkey-max-certificate-chain-size,MaxCertificateChainSize&gt;&gt; can be used to limit the maximum size of this field.
237    #[serde(rename = "certificateChain")]
238    pub certificate_chain: String,
239    #[serde(
240        rename = "certificateType",
241        default,
242        skip_serializing_if = "Option::is_none"
243    )]
244    pub certificate_type: Option<CertificateSigningUseEnum>,
245}
246
247impl Validate for CertificateSignedRequest {
248    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
249        if let Some(x) = &self.custom_data {
250            let p = path.field("customData");
251            x.validate(&p)?;
252        }
253        {
254            let x = &self.certificate_chain;
255            let p = path.field("certificateChain");
256            v::max_length(x, 10000, &p)?;
257        }
258        Ok(())
259    }
260}
261
262#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
263#[serde(deny_unknown_fields)]
264pub struct CertificateSignedResponse {
265    #[serde(
266        rename = "customData",
267        default,
268        skip_serializing_if = "Option::is_none"
269    )]
270    pub custom_data: Option<CustomData>,
271    #[serde(rename = "status")]
272    pub status: CertificateSignedStatusEnum,
273    #[serde(
274        rename = "statusInfo",
275        default,
276        skip_serializing_if = "Option::is_none"
277    )]
278    pub status_info: Option<StatusInfo>,
279}
280
281impl Validate for CertificateSignedResponse {
282    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
283        if let Some(x) = &self.custom_data {
284            let p = path.field("customData");
285            x.validate(&p)?;
286        }
287        if let Some(x) = &self.status_info {
288            let p = path.field("statusInfo");
289            x.validate(&p)?;
290        }
291        Ok(())
292    }
293}
294
295#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
296#[serde(deny_unknown_fields)]
297pub struct ChangeAvailabilityRequest {
298    #[serde(
299        rename = "customData",
300        default,
301        skip_serializing_if = "Option::is_none"
302    )]
303    pub custom_data: Option<CustomData>,
304    #[serde(rename = "evse", default, skip_serializing_if = "Option::is_none")]
305    pub evse: Option<EVSE>,
306    #[serde(rename = "operationalStatus")]
307    pub operational_status: OperationalStatusEnum,
308}
309
310impl Validate for ChangeAvailabilityRequest {
311    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
312        if let Some(x) = &self.custom_data {
313            let p = path.field("customData");
314            x.validate(&p)?;
315        }
316        if let Some(x) = &self.evse {
317            let p = path.field("evse");
318            x.validate(&p)?;
319        }
320        Ok(())
321    }
322}
323
324#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
325#[serde(deny_unknown_fields)]
326pub struct ChangeAvailabilityResponse {
327    #[serde(
328        rename = "customData",
329        default,
330        skip_serializing_if = "Option::is_none"
331    )]
332    pub custom_data: Option<CustomData>,
333    #[serde(rename = "status")]
334    pub status: ChangeAvailabilityStatusEnum,
335    #[serde(
336        rename = "statusInfo",
337        default,
338        skip_serializing_if = "Option::is_none"
339    )]
340    pub status_info: Option<StatusInfo>,
341}
342
343impl Validate for ChangeAvailabilityResponse {
344    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
345        if let Some(x) = &self.custom_data {
346            let p = path.field("customData");
347            x.validate(&p)?;
348        }
349        if let Some(x) = &self.status_info {
350            let p = path.field("statusInfo");
351            x.validate(&p)?;
352        }
353        Ok(())
354    }
355}
356
357#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
358#[serde(deny_unknown_fields)]
359pub struct ClearCacheRequest {
360    #[serde(
361        rename = "customData",
362        default,
363        skip_serializing_if = "Option::is_none"
364    )]
365    pub custom_data: Option<CustomData>,
366}
367
368impl Validate for ClearCacheRequest {
369    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
370        if let Some(x) = &self.custom_data {
371            let p = path.field("customData");
372            x.validate(&p)?;
373        }
374        Ok(())
375    }
376}
377
378#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
379#[serde(deny_unknown_fields)]
380pub struct ClearCacheResponse {
381    #[serde(
382        rename = "customData",
383        default,
384        skip_serializing_if = "Option::is_none"
385    )]
386    pub custom_data: Option<CustomData>,
387    #[serde(rename = "status")]
388    pub status: ClearCacheStatusEnum,
389    #[serde(
390        rename = "statusInfo",
391        default,
392        skip_serializing_if = "Option::is_none"
393    )]
394    pub status_info: Option<StatusInfo>,
395}
396
397impl Validate for ClearCacheResponse {
398    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
399        if let Some(x) = &self.custom_data {
400            let p = path.field("customData");
401            x.validate(&p)?;
402        }
403        if let Some(x) = &self.status_info {
404            let p = path.field("statusInfo");
405            x.validate(&p)?;
406        }
407        Ok(())
408    }
409}
410
411#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
412#[serde(deny_unknown_fields)]
413pub struct ClearChargingProfileRequest {
414    #[serde(
415        rename = "customData",
416        default,
417        skip_serializing_if = "Option::is_none"
418    )]
419    pub custom_data: Option<CustomData>,
420    /// The Id of the charging profile to clear.
421    #[serde(
422        rename = "chargingProfileId",
423        default,
424        skip_serializing_if = "Option::is_none"
425    )]
426    pub charging_profile_id: Option<i64>,
427    #[serde(
428        rename = "chargingProfileCriteria",
429        default,
430        skip_serializing_if = "Option::is_none"
431    )]
432    pub charging_profile_criteria: Option<ClearChargingProfile>,
433}
434
435impl Validate for ClearChargingProfileRequest {
436    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
437        if let Some(x) = &self.custom_data {
438            let p = path.field("customData");
439            x.validate(&p)?;
440        }
441        if let Some(x) = &self.charging_profile_criteria {
442            let p = path.field("chargingProfileCriteria");
443            x.validate(&p)?;
444        }
445        Ok(())
446    }
447}
448
449#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
450#[serde(deny_unknown_fields)]
451pub struct ClearChargingProfileResponse {
452    #[serde(
453        rename = "customData",
454        default,
455        skip_serializing_if = "Option::is_none"
456    )]
457    pub custom_data: Option<CustomData>,
458    #[serde(rename = "status")]
459    pub status: ClearChargingProfileStatusEnum,
460    #[serde(
461        rename = "statusInfo",
462        default,
463        skip_serializing_if = "Option::is_none"
464    )]
465    pub status_info: Option<StatusInfo>,
466}
467
468impl Validate for ClearChargingProfileResponse {
469    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
470        if let Some(x) = &self.custom_data {
471            let p = path.field("customData");
472            x.validate(&p)?;
473        }
474        if let Some(x) = &self.status_info {
475            let p = path.field("statusInfo");
476            x.validate(&p)?;
477        }
478        Ok(())
479    }
480}
481
482#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
483#[serde(deny_unknown_fields)]
484pub struct ClearDisplayMessageRequest {
485    #[serde(
486        rename = "customData",
487        default,
488        skip_serializing_if = "Option::is_none"
489    )]
490    pub custom_data: Option<CustomData>,
491    /// Id of the message that SHALL be removed from the Charging Station.
492    #[serde(rename = "id")]
493    pub id: i64,
494}
495
496impl Validate for ClearDisplayMessageRequest {
497    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
498        if let Some(x) = &self.custom_data {
499            let p = path.field("customData");
500            x.validate(&p)?;
501        }
502        Ok(())
503    }
504}
505
506#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
507#[serde(deny_unknown_fields)]
508pub struct ClearDisplayMessageResponse {
509    #[serde(
510        rename = "customData",
511        default,
512        skip_serializing_if = "Option::is_none"
513    )]
514    pub custom_data: Option<CustomData>,
515    #[serde(rename = "status")]
516    pub status: ClearMessageStatusEnum,
517    #[serde(
518        rename = "statusInfo",
519        default,
520        skip_serializing_if = "Option::is_none"
521    )]
522    pub status_info: Option<StatusInfo>,
523}
524
525impl Validate for ClearDisplayMessageResponse {
526    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
527        if let Some(x) = &self.custom_data {
528            let p = path.field("customData");
529            x.validate(&p)?;
530        }
531        if let Some(x) = &self.status_info {
532            let p = path.field("statusInfo");
533            x.validate(&p)?;
534        }
535        Ok(())
536    }
537}
538
539#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
540#[serde(deny_unknown_fields)]
541pub struct ClearVariableMonitoringRequest {
542    #[serde(
543        rename = "customData",
544        default,
545        skip_serializing_if = "Option::is_none"
546    )]
547    pub custom_data: Option<CustomData>,
548    /// List of the monitors to be cleared, identified by there Id.
549    #[serde(rename = "id")]
550    pub id: Vec<i64>,
551}
552
553impl Validate for ClearVariableMonitoringRequest {
554    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
555        if let Some(x) = &self.custom_data {
556            let p = path.field("customData");
557            x.validate(&p)?;
558        }
559        {
560            let x = &self.id;
561            let p = path.field("id");
562            v::items(x, Some(1), None, &p)?;
563        }
564        Ok(())
565    }
566}
567
568#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
569#[serde(deny_unknown_fields)]
570pub struct ClearVariableMonitoringResponse {
571    #[serde(
572        rename = "customData",
573        default,
574        skip_serializing_if = "Option::is_none"
575    )]
576    pub custom_data: Option<CustomData>,
577    #[serde(rename = "clearMonitoringResult")]
578    pub clear_monitoring_result: Vec<ClearMonitoringResult>,
579}
580
581impl Validate for ClearVariableMonitoringResponse {
582    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
583        if let Some(x) = &self.custom_data {
584            let p = path.field("customData");
585            x.validate(&p)?;
586        }
587        {
588            let x = &self.clear_monitoring_result;
589            let p = path.field("clearMonitoringResult");
590            v::items(x, Some(1), None, &p)?;
591            for (i0, it0) in x.iter().enumerate() {
592                let p0 = p.index(i0);
593                it0.validate(&p0)?;
594            }
595        }
596        Ok(())
597    }
598}
599
600#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
601#[serde(deny_unknown_fields)]
602pub struct ClearedChargingLimitRequest {
603    #[serde(
604        rename = "customData",
605        default,
606        skip_serializing_if = "Option::is_none"
607    )]
608    pub custom_data: Option<CustomData>,
609    #[serde(rename = "chargingLimitSource")]
610    pub charging_limit_source: ChargingLimitSourceEnum,
611    /// EVSE Identifier.
612    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
613    pub evse_id: Option<i64>,
614}
615
616impl Validate for ClearedChargingLimitRequest {
617    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
618        if let Some(x) = &self.custom_data {
619            let p = path.field("customData");
620            x.validate(&p)?;
621        }
622        Ok(())
623    }
624}
625
626#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
627#[serde(deny_unknown_fields)]
628pub struct ClearedChargingLimitResponse {
629    #[serde(
630        rename = "customData",
631        default,
632        skip_serializing_if = "Option::is_none"
633    )]
634    pub custom_data: Option<CustomData>,
635}
636
637impl Validate for ClearedChargingLimitResponse {
638    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
639        if let Some(x) = &self.custom_data {
640            let p = path.field("customData");
641            x.validate(&p)?;
642        }
643        Ok(())
644    }
645}
646
647#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
648#[serde(deny_unknown_fields)]
649pub struct CostUpdatedRequest {
650    #[serde(
651        rename = "customData",
652        default,
653        skip_serializing_if = "Option::is_none"
654    )]
655    pub custom_data: Option<CustomData>,
656    /// 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;\]
657    #[serde(rename = "totalCost")]
658    pub total_cost: f64,
659    /// Transaction Id of the transaction the current cost are asked for.
660    #[serde(rename = "transactionId")]
661    pub transaction_id: String,
662}
663
664impl Validate for CostUpdatedRequest {
665    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
666        if let Some(x) = &self.custom_data {
667            let p = path.field("customData");
668            x.validate(&p)?;
669        }
670        {
671            let x = &self.transaction_id;
672            let p = path.field("transactionId");
673            v::max_length(x, 36, &p)?;
674        }
675        Ok(())
676    }
677}
678
679#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
680#[serde(deny_unknown_fields)]
681pub struct CostUpdatedResponse {
682    #[serde(
683        rename = "customData",
684        default,
685        skip_serializing_if = "Option::is_none"
686    )]
687    pub custom_data: Option<CustomData>,
688}
689
690impl Validate for CostUpdatedResponse {
691    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
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, Serialize, Deserialize)]
701#[serde(deny_unknown_fields)]
702pub struct CustomerInformationRequest {
703    #[serde(
704        rename = "customData",
705        default,
706        skip_serializing_if = "Option::is_none"
707    )]
708    pub custom_data: Option<CustomData>,
709    #[serde(
710        rename = "customerCertificate",
711        default,
712        skip_serializing_if = "Option::is_none"
713    )]
714    pub customer_certificate: Option<CertificateHashData>,
715    #[serde(rename = "idToken", default, skip_serializing_if = "Option::is_none")]
716    pub id_token: Option<IdToken>,
717    /// The Id of the request.
718    #[serde(rename = "requestId")]
719    pub request_id: i64,
720    /// Flag indicating whether the Charging Station should return NotifyCustomerInformationRequest messages containing information about the customer referred to.
721    #[serde(rename = "report")]
722    pub report: bool,
723    /// Flag indicating whether the Charging Station should clear all information about the customer referred to.
724    #[serde(rename = "clear")]
725    pub clear: bool,
726    /// A (e.g. vendor specific) identifier of the customer this request refers to. This field contains a custom identifier other than IdToken and Certificate.
727    /// One of the possible identifiers (customerIdentifier, customerIdToken or customerCertificate) should be in the request message.
728    #[serde(
729        rename = "customerIdentifier",
730        default,
731        skip_serializing_if = "Option::is_none"
732    )]
733    pub customer_identifier: Option<String>,
734}
735
736impl Validate for CustomerInformationRequest {
737    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
738        if let Some(x) = &self.custom_data {
739            let p = path.field("customData");
740            x.validate(&p)?;
741        }
742        if let Some(x) = &self.customer_certificate {
743            let p = path.field("customerCertificate");
744            x.validate(&p)?;
745        }
746        if let Some(x) = &self.id_token {
747            let p = path.field("idToken");
748            x.validate(&p)?;
749        }
750        if let Some(x) = &self.customer_identifier {
751            let p = path.field("customerIdentifier");
752            v::max_length(x, 64, &p)?;
753        }
754        Ok(())
755    }
756}
757
758#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
759#[serde(deny_unknown_fields)]
760pub struct CustomerInformationResponse {
761    #[serde(
762        rename = "customData",
763        default,
764        skip_serializing_if = "Option::is_none"
765    )]
766    pub custom_data: Option<CustomData>,
767    #[serde(rename = "status")]
768    pub status: CustomerInformationStatusEnum,
769    #[serde(
770        rename = "statusInfo",
771        default,
772        skip_serializing_if = "Option::is_none"
773    )]
774    pub status_info: Option<StatusInfo>,
775}
776
777impl Validate for CustomerInformationResponse {
778    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
779        if let Some(x) = &self.custom_data {
780            let p = path.field("customData");
781            x.validate(&p)?;
782        }
783        if let Some(x) = &self.status_info {
784            let p = path.field("statusInfo");
785            x.validate(&p)?;
786        }
787        Ok(())
788    }
789}
790
791#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
792#[serde(deny_unknown_fields)]
793pub struct DataTransferRequest {
794    #[serde(
795        rename = "customData",
796        default,
797        skip_serializing_if = "Option::is_none"
798    )]
799    pub custom_data: Option<CustomData>,
800    /// May be used to indicate a specific message or implementation.
801    #[serde(rename = "messageId", default, skip_serializing_if = "Option::is_none")]
802    pub message_id: Option<String>,
803    /// Data without specified length or format. This needs to be decided by both parties (Open to implementation).
804    #[serde(rename = "data", default, skip_serializing_if = "Option::is_none")]
805    pub data: Option<serde_json::Value>,
806    /// This identifies the Vendor specific implementation
807    #[serde(rename = "vendorId")]
808    pub vendor_id: String,
809}
810
811impl Validate for DataTransferRequest {
812    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
813        if let Some(x) = &self.custom_data {
814            let p = path.field("customData");
815            x.validate(&p)?;
816        }
817        if let Some(x) = &self.message_id {
818            let p = path.field("messageId");
819            v::max_length(x, 50, &p)?;
820        }
821        {
822            let x = &self.vendor_id;
823            let p = path.field("vendorId");
824            v::max_length(x, 255, &p)?;
825        }
826        Ok(())
827    }
828}
829
830#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
831#[serde(deny_unknown_fields)]
832pub struct DataTransferResponse {
833    #[serde(
834        rename = "customData",
835        default,
836        skip_serializing_if = "Option::is_none"
837    )]
838    pub custom_data: Option<CustomData>,
839    #[serde(rename = "status")]
840    pub status: DataTransferStatusEnum,
841    #[serde(
842        rename = "statusInfo",
843        default,
844        skip_serializing_if = "Option::is_none"
845    )]
846    pub status_info: Option<StatusInfo>,
847    /// Data without specified length or format, in response to request.
848    #[serde(rename = "data", default, skip_serializing_if = "Option::is_none")]
849    pub data: Option<serde_json::Value>,
850}
851
852impl Validate for DataTransferResponse {
853    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
854        if let Some(x) = &self.custom_data {
855            let p = path.field("customData");
856            x.validate(&p)?;
857        }
858        if let Some(x) = &self.status_info {
859            let p = path.field("statusInfo");
860            x.validate(&p)?;
861        }
862        Ok(())
863    }
864}
865
866#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
867#[serde(deny_unknown_fields)]
868pub struct DeleteCertificateRequest {
869    #[serde(
870        rename = "customData",
871        default,
872        skip_serializing_if = "Option::is_none"
873    )]
874    pub custom_data: Option<CustomData>,
875    #[serde(rename = "certificateHashData")]
876    pub certificate_hash_data: CertificateHashData,
877}
878
879impl Validate for DeleteCertificateRequest {
880    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
881        if let Some(x) = &self.custom_data {
882            let p = path.field("customData");
883            x.validate(&p)?;
884        }
885        {
886            let x = &self.certificate_hash_data;
887            let p = path.field("certificateHashData");
888            x.validate(&p)?;
889        }
890        Ok(())
891    }
892}
893
894#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
895#[serde(deny_unknown_fields)]
896pub struct DeleteCertificateResponse {
897    #[serde(
898        rename = "customData",
899        default,
900        skip_serializing_if = "Option::is_none"
901    )]
902    pub custom_data: Option<CustomData>,
903    #[serde(rename = "status")]
904    pub status: DeleteCertificateStatusEnum,
905    #[serde(
906        rename = "statusInfo",
907        default,
908        skip_serializing_if = "Option::is_none"
909    )]
910    pub status_info: Option<StatusInfo>,
911}
912
913impl Validate for DeleteCertificateResponse {
914    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
915        if let Some(x) = &self.custom_data {
916            let p = path.field("customData");
917            x.validate(&p)?;
918        }
919        if let Some(x) = &self.status_info {
920            let p = path.field("statusInfo");
921            x.validate(&p)?;
922        }
923        Ok(())
924    }
925}
926
927#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
928#[serde(deny_unknown_fields)]
929pub struct FirmwareStatusNotificationRequest {
930    #[serde(
931        rename = "customData",
932        default,
933        skip_serializing_if = "Option::is_none"
934    )]
935    pub custom_data: Option<CustomData>,
936    #[serde(rename = "status")]
937    pub status: FirmwareStatusEnum,
938    /// The request id that was provided in the
939    /// UpdateFirmwareRequest that started this firmware update.
940    /// This field is mandatory, unless the message was triggered by a TriggerMessageRequest AND there is no firmware update ongoing.
941    #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")]
942    pub request_id: Option<i64>,
943}
944
945impl Validate for FirmwareStatusNotificationRequest {
946    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
947        if let Some(x) = &self.custom_data {
948            let p = path.field("customData");
949            x.validate(&p)?;
950        }
951        Ok(())
952    }
953}
954
955#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
956#[serde(deny_unknown_fields)]
957pub struct FirmwareStatusNotificationResponse {
958    #[serde(
959        rename = "customData",
960        default,
961        skip_serializing_if = "Option::is_none"
962    )]
963    pub custom_data: Option<CustomData>,
964}
965
966impl Validate for FirmwareStatusNotificationResponse {
967    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
968        if let Some(x) = &self.custom_data {
969            let p = path.field("customData");
970            x.validate(&p)?;
971        }
972        Ok(())
973    }
974}
975
976#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
977#[serde(deny_unknown_fields)]
978pub struct Get15118EVCertificateRequest {
979    #[serde(
980        rename = "customData",
981        default,
982        skip_serializing_if = "Option::is_none"
983    )]
984    pub custom_data: Option<CustomData>,
985    /// Schema version currently used for the 15118 session between EV and Charging Station. Needed for parsing of the EXI stream by the CSMS.
986    #[serde(rename = "iso15118SchemaVersion")]
987    pub iso15118_schema_version: String,
988    #[serde(rename = "action")]
989    pub action: CertificateActionEnum,
990    /// Raw CertificateInstallationReq request from EV, Base64 encoded.
991    #[serde(rename = "exiRequest")]
992    pub exi_request: String,
993}
994
995impl Validate for Get15118EVCertificateRequest {
996    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
997        if let Some(x) = &self.custom_data {
998            let p = path.field("customData");
999            x.validate(&p)?;
1000        }
1001        {
1002            let x = &self.iso15118_schema_version;
1003            let p = path.field("iso15118SchemaVersion");
1004            v::max_length(x, 50, &p)?;
1005        }
1006        {
1007            let x = &self.exi_request;
1008            let p = path.field("exiRequest");
1009            v::max_length(x, 5600, &p)?;
1010        }
1011        Ok(())
1012    }
1013}
1014
1015#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1016#[serde(deny_unknown_fields)]
1017pub struct Get15118EVCertificateResponse {
1018    #[serde(
1019        rename = "customData",
1020        default,
1021        skip_serializing_if = "Option::is_none"
1022    )]
1023    pub custom_data: Option<CustomData>,
1024    #[serde(rename = "status")]
1025    pub status: Iso15118EVCertificateStatusEnum,
1026    #[serde(
1027        rename = "statusInfo",
1028        default,
1029        skip_serializing_if = "Option::is_none"
1030    )]
1031    pub status_info: Option<StatusInfo>,
1032    /// Raw CertificateInstallationRes response for the EV, Base64 encoded.
1033    #[serde(rename = "exiResponse")]
1034    pub exi_response: String,
1035}
1036
1037impl Validate for Get15118EVCertificateResponse {
1038    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1039        if let Some(x) = &self.custom_data {
1040            let p = path.field("customData");
1041            x.validate(&p)?;
1042        }
1043        if let Some(x) = &self.status_info {
1044            let p = path.field("statusInfo");
1045            x.validate(&p)?;
1046        }
1047        {
1048            let x = &self.exi_response;
1049            let p = path.field("exiResponse");
1050            v::max_length(x, 5600, &p)?;
1051        }
1052        Ok(())
1053    }
1054}
1055
1056#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1057#[serde(deny_unknown_fields)]
1058pub struct GetBaseReportRequest {
1059    #[serde(
1060        rename = "customData",
1061        default,
1062        skip_serializing_if = "Option::is_none"
1063    )]
1064    pub custom_data: Option<CustomData>,
1065    /// The Id of the request.
1066    #[serde(rename = "requestId")]
1067    pub request_id: i64,
1068    #[serde(rename = "reportBase")]
1069    pub report_base: ReportBaseEnum,
1070}
1071
1072impl Validate for GetBaseReportRequest {
1073    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1074        if let Some(x) = &self.custom_data {
1075            let p = path.field("customData");
1076            x.validate(&p)?;
1077        }
1078        Ok(())
1079    }
1080}
1081
1082#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1083#[serde(deny_unknown_fields)]
1084pub struct GetBaseReportResponse {
1085    #[serde(
1086        rename = "customData",
1087        default,
1088        skip_serializing_if = "Option::is_none"
1089    )]
1090    pub custom_data: Option<CustomData>,
1091    #[serde(rename = "status")]
1092    pub status: GenericDeviceModelStatusEnum,
1093    #[serde(
1094        rename = "statusInfo",
1095        default,
1096        skip_serializing_if = "Option::is_none"
1097    )]
1098    pub status_info: Option<StatusInfo>,
1099}
1100
1101impl Validate for GetBaseReportResponse {
1102    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1103        if let Some(x) = &self.custom_data {
1104            let p = path.field("customData");
1105            x.validate(&p)?;
1106        }
1107        if let Some(x) = &self.status_info {
1108            let p = path.field("statusInfo");
1109            x.validate(&p)?;
1110        }
1111        Ok(())
1112    }
1113}
1114
1115#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1116#[serde(deny_unknown_fields)]
1117pub struct GetCertificateStatusRequest {
1118    #[serde(
1119        rename = "customData",
1120        default,
1121        skip_serializing_if = "Option::is_none"
1122    )]
1123    pub custom_data: Option<CustomData>,
1124    #[serde(rename = "ocspRequestData")]
1125    pub ocsp_request_data: OCSPRequestData,
1126}
1127
1128impl Validate for GetCertificateStatusRequest {
1129    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1130        if let Some(x) = &self.custom_data {
1131            let p = path.field("customData");
1132            x.validate(&p)?;
1133        }
1134        {
1135            let x = &self.ocsp_request_data;
1136            let p = path.field("ocspRequestData");
1137            x.validate(&p)?;
1138        }
1139        Ok(())
1140    }
1141}
1142
1143#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1144#[serde(deny_unknown_fields)]
1145pub struct GetCertificateStatusResponse {
1146    #[serde(
1147        rename = "customData",
1148        default,
1149        skip_serializing_if = "Option::is_none"
1150    )]
1151    pub custom_data: Option<CustomData>,
1152    #[serde(rename = "status")]
1153    pub status: GetCertificateStatusEnum,
1154    #[serde(
1155        rename = "statusInfo",
1156        default,
1157        skip_serializing_if = "Option::is_none"
1158    )]
1159    pub status_info: Option<StatusInfo>,
1160    /// 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.
1161    #[serde(
1162        rename = "ocspResult",
1163        default,
1164        skip_serializing_if = "Option::is_none"
1165    )]
1166    pub ocsp_result: Option<String>,
1167}
1168
1169impl Validate for GetCertificateStatusResponse {
1170    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1171        if let Some(x) = &self.custom_data {
1172            let p = path.field("customData");
1173            x.validate(&p)?;
1174        }
1175        if let Some(x) = &self.status_info {
1176            let p = path.field("statusInfo");
1177            x.validate(&p)?;
1178        }
1179        if let Some(x) = &self.ocsp_result {
1180            let p = path.field("ocspResult");
1181            v::max_length(x, 5500, &p)?;
1182        }
1183        Ok(())
1184    }
1185}
1186
1187#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1188#[serde(deny_unknown_fields)]
1189pub struct GetChargingProfilesRequest {
1190    #[serde(
1191        rename = "customData",
1192        default,
1193        skip_serializing_if = "Option::is_none"
1194    )]
1195    pub custom_data: Option<CustomData>,
1196    /// Reference identification that is to be used by the Charging Station in the &lt;&lt;reportchargingprofilesrequest, ReportChargingProfilesRequest&gt;&gt; when provided.
1197    #[serde(rename = "requestId")]
1198    pub request_id: i64,
1199    /// 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.
1200    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
1201    pub evse_id: Option<i64>,
1202    #[serde(rename = "chargingProfile")]
1203    pub charging_profile: ChargingProfileCriterion,
1204}
1205
1206impl Validate for GetChargingProfilesRequest {
1207    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1208        if let Some(x) = &self.custom_data {
1209            let p = path.field("customData");
1210            x.validate(&p)?;
1211        }
1212        {
1213            let x = &self.charging_profile;
1214            let p = path.field("chargingProfile");
1215            x.validate(&p)?;
1216        }
1217        Ok(())
1218    }
1219}
1220
1221#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1222#[serde(deny_unknown_fields)]
1223pub struct GetChargingProfilesResponse {
1224    #[serde(
1225        rename = "customData",
1226        default,
1227        skip_serializing_if = "Option::is_none"
1228    )]
1229    pub custom_data: Option<CustomData>,
1230    #[serde(rename = "status")]
1231    pub status: GetChargingProfileStatusEnum,
1232    #[serde(
1233        rename = "statusInfo",
1234        default,
1235        skip_serializing_if = "Option::is_none"
1236    )]
1237    pub status_info: Option<StatusInfo>,
1238}
1239
1240impl Validate for GetChargingProfilesResponse {
1241    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1242        if let Some(x) = &self.custom_data {
1243            let p = path.field("customData");
1244            x.validate(&p)?;
1245        }
1246        if let Some(x) = &self.status_info {
1247            let p = path.field("statusInfo");
1248            x.validate(&p)?;
1249        }
1250        Ok(())
1251    }
1252}
1253
1254#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1255#[serde(deny_unknown_fields)]
1256pub struct GetCompositeScheduleRequest {
1257    #[serde(
1258        rename = "customData",
1259        default,
1260        skip_serializing_if = "Option::is_none"
1261    )]
1262    pub custom_data: Option<CustomData>,
1263    /// Length of the requested schedule in seconds.
1264    #[serde(rename = "duration")]
1265    pub duration: i64,
1266    #[serde(
1267        rename = "chargingRateUnit",
1268        default,
1269        skip_serializing_if = "Option::is_none"
1270    )]
1271    pub charging_rate_unit: Option<ChargingRateUnitEnum>,
1272    /// 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.
1273    #[serde(rename = "evseId")]
1274    pub evse_id: i64,
1275}
1276
1277impl Validate for GetCompositeScheduleRequest {
1278    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1279        if let Some(x) = &self.custom_data {
1280            let p = path.field("customData");
1281            x.validate(&p)?;
1282        }
1283        Ok(())
1284    }
1285}
1286
1287#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1288#[serde(deny_unknown_fields)]
1289pub struct GetCompositeScheduleResponse {
1290    #[serde(
1291        rename = "customData",
1292        default,
1293        skip_serializing_if = "Option::is_none"
1294    )]
1295    pub custom_data: Option<CustomData>,
1296    #[serde(rename = "status")]
1297    pub status: GenericStatusEnum,
1298    #[serde(
1299        rename = "statusInfo",
1300        default,
1301        skip_serializing_if = "Option::is_none"
1302    )]
1303    pub status_info: Option<StatusInfo>,
1304    #[serde(rename = "schedule", default, skip_serializing_if = "Option::is_none")]
1305    pub schedule: Option<CompositeSchedule>,
1306}
1307
1308impl Validate for GetCompositeScheduleResponse {
1309    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1310        if let Some(x) = &self.custom_data {
1311            let p = path.field("customData");
1312            x.validate(&p)?;
1313        }
1314        if let Some(x) = &self.status_info {
1315            let p = path.field("statusInfo");
1316            x.validate(&p)?;
1317        }
1318        if let Some(x) = &self.schedule {
1319            let p = path.field("schedule");
1320            x.validate(&p)?;
1321        }
1322        Ok(())
1323    }
1324}
1325
1326#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1327#[serde(deny_unknown_fields)]
1328pub struct GetDisplayMessagesRequest {
1329    #[serde(
1330        rename = "customData",
1331        default,
1332        skip_serializing_if = "Option::is_none"
1333    )]
1334    pub custom_data: Option<CustomData>,
1335    /// 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;
1336    #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1337    pub id: Option<Vec<i64>>,
1338    /// The Id of this request.
1339    #[serde(rename = "requestId")]
1340    pub request_id: i64,
1341    #[serde(rename = "priority", default, skip_serializing_if = "Option::is_none")]
1342    pub priority: Option<MessagePriorityEnum>,
1343    #[serde(rename = "state", default, skip_serializing_if = "Option::is_none")]
1344    pub state: Option<MessageStateEnum>,
1345}
1346
1347impl Validate for GetDisplayMessagesRequest {
1348    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1349        if let Some(x) = &self.custom_data {
1350            let p = path.field("customData");
1351            x.validate(&p)?;
1352        }
1353        if let Some(x) = &self.id {
1354            let p = path.field("id");
1355            v::items(x, Some(1), None, &p)?;
1356        }
1357        Ok(())
1358    }
1359}
1360
1361#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1362#[serde(deny_unknown_fields)]
1363pub struct GetDisplayMessagesResponse {
1364    #[serde(
1365        rename = "customData",
1366        default,
1367        skip_serializing_if = "Option::is_none"
1368    )]
1369    pub custom_data: Option<CustomData>,
1370    #[serde(rename = "status")]
1371    pub status: GetDisplayMessagesStatusEnum,
1372    #[serde(
1373        rename = "statusInfo",
1374        default,
1375        skip_serializing_if = "Option::is_none"
1376    )]
1377    pub status_info: Option<StatusInfo>,
1378}
1379
1380impl Validate for GetDisplayMessagesResponse {
1381    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1382        if let Some(x) = &self.custom_data {
1383            let p = path.field("customData");
1384            x.validate(&p)?;
1385        }
1386        if let Some(x) = &self.status_info {
1387            let p = path.field("statusInfo");
1388            x.validate(&p)?;
1389        }
1390        Ok(())
1391    }
1392}
1393
1394#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1395#[serde(deny_unknown_fields)]
1396pub struct GetInstalledCertificateIdsRequest {
1397    #[serde(
1398        rename = "customData",
1399        default,
1400        skip_serializing_if = "Option::is_none"
1401    )]
1402    pub custom_data: Option<CustomData>,
1403    /// Indicates the type of certificates requested. When omitted, all certificate types are requested.
1404    #[serde(
1405        rename = "certificateType",
1406        default,
1407        skip_serializing_if = "Option::is_none"
1408    )]
1409    pub certificate_type: Option<Vec<GetCertificateIdUseEnum>>,
1410}
1411
1412impl Validate for GetInstalledCertificateIdsRequest {
1413    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1414        if let Some(x) = &self.custom_data {
1415            let p = path.field("customData");
1416            x.validate(&p)?;
1417        }
1418        if let Some(x) = &self.certificate_type {
1419            let p = path.field("certificateType");
1420            v::items(x, Some(1), None, &p)?;
1421        }
1422        Ok(())
1423    }
1424}
1425
1426#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1427#[serde(deny_unknown_fields)]
1428pub struct GetInstalledCertificateIdsResponse {
1429    #[serde(
1430        rename = "customData",
1431        default,
1432        skip_serializing_if = "Option::is_none"
1433    )]
1434    pub custom_data: Option<CustomData>,
1435    #[serde(rename = "status")]
1436    pub status: GetInstalledCertificateStatusEnum,
1437    #[serde(
1438        rename = "statusInfo",
1439        default,
1440        skip_serializing_if = "Option::is_none"
1441    )]
1442    pub status_info: Option<StatusInfo>,
1443    #[serde(
1444        rename = "certificateHashDataChain",
1445        default,
1446        skip_serializing_if = "Option::is_none"
1447    )]
1448    pub certificate_hash_data_chain: Option<Vec<CertificateHashDataChain>>,
1449}
1450
1451impl Validate for GetInstalledCertificateIdsResponse {
1452    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1453        if let Some(x) = &self.custom_data {
1454            let p = path.field("customData");
1455            x.validate(&p)?;
1456        }
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.certificate_hash_data_chain {
1462            let p = path.field("certificateHashDataChain");
1463            v::items(x, Some(1), None, &p)?;
1464            for (i0, it0) in x.iter().enumerate() {
1465                let p0 = p.index(i0);
1466                it0.validate(&p0)?;
1467            }
1468        }
1469        Ok(())
1470    }
1471}
1472
1473#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1474#[serde(deny_unknown_fields)]
1475pub struct GetLocalListVersionRequest {
1476    #[serde(
1477        rename = "customData",
1478        default,
1479        skip_serializing_if = "Option::is_none"
1480    )]
1481    pub custom_data: Option<CustomData>,
1482}
1483
1484impl Validate for GetLocalListVersionRequest {
1485    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1486        if let Some(x) = &self.custom_data {
1487            let p = path.field("customData");
1488            x.validate(&p)?;
1489        }
1490        Ok(())
1491    }
1492}
1493
1494#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1495#[serde(deny_unknown_fields)]
1496pub struct GetLocalListVersionResponse {
1497    #[serde(
1498        rename = "customData",
1499        default,
1500        skip_serializing_if = "Option::is_none"
1501    )]
1502    pub custom_data: Option<CustomData>,
1503    /// This contains the current version number of the local authorization list in the Charging Station.
1504    #[serde(rename = "versionNumber")]
1505    pub version_number: i64,
1506}
1507
1508impl Validate for GetLocalListVersionResponse {
1509    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1510        if let Some(x) = &self.custom_data {
1511            let p = path.field("customData");
1512            x.validate(&p)?;
1513        }
1514        Ok(())
1515    }
1516}
1517
1518#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1519#[serde(deny_unknown_fields)]
1520pub struct GetLogRequest {
1521    #[serde(
1522        rename = "customData",
1523        default,
1524        skip_serializing_if = "Option::is_none"
1525    )]
1526    pub custom_data: Option<CustomData>,
1527    #[serde(rename = "log")]
1528    pub log: LogParameters,
1529    #[serde(rename = "logType")]
1530    pub log_type: LogEnum,
1531    /// The Id of this request
1532    #[serde(rename = "requestId")]
1533    pub request_id: i64,
1534    /// This specifies how many times the Charging Station must try 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.
1535    #[serde(rename = "retries", default, skip_serializing_if = "Option::is_none")]
1536    pub retries: Option<i64>,
1537    /// 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.
1538    #[serde(
1539        rename = "retryInterval",
1540        default,
1541        skip_serializing_if = "Option::is_none"
1542    )]
1543    pub retry_interval: Option<i64>,
1544}
1545
1546impl Validate for GetLogRequest {
1547    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1548        if let Some(x) = &self.custom_data {
1549            let p = path.field("customData");
1550            x.validate(&p)?;
1551        }
1552        {
1553            let x = &self.log;
1554            let p = path.field("log");
1555            x.validate(&p)?;
1556        }
1557        Ok(())
1558    }
1559}
1560
1561#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1562#[serde(deny_unknown_fields)]
1563pub struct GetLogResponse {
1564    #[serde(
1565        rename = "customData",
1566        default,
1567        skip_serializing_if = "Option::is_none"
1568    )]
1569    pub custom_data: Option<CustomData>,
1570    #[serde(rename = "status")]
1571    pub status: LogStatusEnum,
1572    #[serde(
1573        rename = "statusInfo",
1574        default,
1575        skip_serializing_if = "Option::is_none"
1576    )]
1577    pub status_info: Option<StatusInfo>,
1578    /// This contains the name of the log file that will be uploaded. This field is not present when no logging information is available.
1579    #[serde(rename = "filename", default, skip_serializing_if = "Option::is_none")]
1580    pub filename: Option<String>,
1581}
1582
1583impl Validate for GetLogResponse {
1584    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1585        if let Some(x) = &self.custom_data {
1586            let p = path.field("customData");
1587            x.validate(&p)?;
1588        }
1589        if let Some(x) = &self.status_info {
1590            let p = path.field("statusInfo");
1591            x.validate(&p)?;
1592        }
1593        if let Some(x) = &self.filename {
1594            let p = path.field("filename");
1595            v::max_length(x, 255, &p)?;
1596        }
1597        Ok(())
1598    }
1599}
1600
1601#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1602#[serde(deny_unknown_fields)]
1603pub struct GetMonitoringReportRequest {
1604    #[serde(
1605        rename = "customData",
1606        default,
1607        skip_serializing_if = "Option::is_none"
1608    )]
1609    pub custom_data: Option<CustomData>,
1610    #[serde(
1611        rename = "componentVariable",
1612        default,
1613        skip_serializing_if = "Option::is_none"
1614    )]
1615    pub component_variable: Option<Vec<ComponentVariable>>,
1616    /// The Id of the request.
1617    #[serde(rename = "requestId")]
1618    pub request_id: i64,
1619    /// This field contains criteria for components for which a monitoring report is requested
1620    #[serde(
1621        rename = "monitoringCriteria",
1622        default,
1623        skip_serializing_if = "Option::is_none"
1624    )]
1625    pub monitoring_criteria: Option<Vec<MonitoringCriterionEnum>>,
1626}
1627
1628impl Validate for GetMonitoringReportRequest {
1629    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1630        if let Some(x) = &self.custom_data {
1631            let p = path.field("customData");
1632            x.validate(&p)?;
1633        }
1634        if let Some(x) = &self.component_variable {
1635            let p = path.field("componentVariable");
1636            v::items(x, Some(1), None, &p)?;
1637            for (i0, it0) in x.iter().enumerate() {
1638                let p0 = p.index(i0);
1639                it0.validate(&p0)?;
1640            }
1641        }
1642        if let Some(x) = &self.monitoring_criteria {
1643            let p = path.field("monitoringCriteria");
1644            v::items(x, Some(1), Some(3), &p)?;
1645        }
1646        Ok(())
1647    }
1648}
1649
1650#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1651#[serde(deny_unknown_fields)]
1652pub struct GetMonitoringReportResponse {
1653    #[serde(
1654        rename = "customData",
1655        default,
1656        skip_serializing_if = "Option::is_none"
1657    )]
1658    pub custom_data: Option<CustomData>,
1659    #[serde(rename = "status")]
1660    pub status: GenericDeviceModelStatusEnum,
1661    #[serde(
1662        rename = "statusInfo",
1663        default,
1664        skip_serializing_if = "Option::is_none"
1665    )]
1666    pub status_info: Option<StatusInfo>,
1667}
1668
1669impl Validate for GetMonitoringReportResponse {
1670    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1671        if let Some(x) = &self.custom_data {
1672            let p = path.field("customData");
1673            x.validate(&p)?;
1674        }
1675        if let Some(x) = &self.status_info {
1676            let p = path.field("statusInfo");
1677            x.validate(&p)?;
1678        }
1679        Ok(())
1680    }
1681}
1682
1683#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1684#[serde(deny_unknown_fields)]
1685pub struct GetReportRequest {
1686    #[serde(
1687        rename = "customData",
1688        default,
1689        skip_serializing_if = "Option::is_none"
1690    )]
1691    pub custom_data: Option<CustomData>,
1692    #[serde(
1693        rename = "componentVariable",
1694        default,
1695        skip_serializing_if = "Option::is_none"
1696    )]
1697    pub component_variable: Option<Vec<ComponentVariable>>,
1698    /// The Id of the request.
1699    #[serde(rename = "requestId")]
1700    pub request_id: i64,
1701    /// This field contains criteria for components for which a report is requested
1702    #[serde(
1703        rename = "componentCriteria",
1704        default,
1705        skip_serializing_if = "Option::is_none"
1706    )]
1707    pub component_criteria: Option<Vec<ComponentCriterionEnum>>,
1708}
1709
1710impl Validate for GetReportRequest {
1711    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1712        if let Some(x) = &self.custom_data {
1713            let p = path.field("customData");
1714            x.validate(&p)?;
1715        }
1716        if let Some(x) = &self.component_variable {
1717            let p = path.field("componentVariable");
1718            v::items(x, Some(1), None, &p)?;
1719            for (i0, it0) in x.iter().enumerate() {
1720                let p0 = p.index(i0);
1721                it0.validate(&p0)?;
1722            }
1723        }
1724        if let Some(x) = &self.component_criteria {
1725            let p = path.field("componentCriteria");
1726            v::items(x, Some(1), Some(4), &p)?;
1727        }
1728        Ok(())
1729    }
1730}
1731
1732#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1733#[serde(deny_unknown_fields)]
1734pub struct GetReportResponse {
1735    #[serde(
1736        rename = "customData",
1737        default,
1738        skip_serializing_if = "Option::is_none"
1739    )]
1740    pub custom_data: Option<CustomData>,
1741    #[serde(rename = "status")]
1742    pub status: GenericDeviceModelStatusEnum,
1743    #[serde(
1744        rename = "statusInfo",
1745        default,
1746        skip_serializing_if = "Option::is_none"
1747    )]
1748    pub status_info: Option<StatusInfo>,
1749}
1750
1751impl Validate for GetReportResponse {
1752    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1753        if let Some(x) = &self.custom_data {
1754            let p = path.field("customData");
1755            x.validate(&p)?;
1756        }
1757        if let Some(x) = &self.status_info {
1758            let p = path.field("statusInfo");
1759            x.validate(&p)?;
1760        }
1761        Ok(())
1762    }
1763}
1764
1765#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1766#[serde(deny_unknown_fields)]
1767pub struct GetTransactionStatusRequest {
1768    #[serde(
1769        rename = "customData",
1770        default,
1771        skip_serializing_if = "Option::is_none"
1772    )]
1773    pub custom_data: Option<CustomData>,
1774    /// The Id of the transaction for which the status is requested.
1775    #[serde(
1776        rename = "transactionId",
1777        default,
1778        skip_serializing_if = "Option::is_none"
1779    )]
1780    pub transaction_id: Option<String>,
1781}
1782
1783impl Validate for GetTransactionStatusRequest {
1784    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1785        if let Some(x) = &self.custom_data {
1786            let p = path.field("customData");
1787            x.validate(&p)?;
1788        }
1789        if let Some(x) = &self.transaction_id {
1790            let p = path.field("transactionId");
1791            v::max_length(x, 36, &p)?;
1792        }
1793        Ok(())
1794    }
1795}
1796
1797#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1798#[serde(deny_unknown_fields)]
1799pub struct GetTransactionStatusResponse {
1800    #[serde(
1801        rename = "customData",
1802        default,
1803        skip_serializing_if = "Option::is_none"
1804    )]
1805    pub custom_data: Option<CustomData>,
1806    /// Whether the transaction is still ongoing.
1807    #[serde(
1808        rename = "ongoingIndicator",
1809        default,
1810        skip_serializing_if = "Option::is_none"
1811    )]
1812    pub ongoing_indicator: Option<bool>,
1813    /// Whether there are still message to be delivered.
1814    #[serde(rename = "messagesInQueue")]
1815    pub messages_in_queue: bool,
1816}
1817
1818impl Validate for GetTransactionStatusResponse {
1819    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1820        if let Some(x) = &self.custom_data {
1821            let p = path.field("customData");
1822            x.validate(&p)?;
1823        }
1824        Ok(())
1825    }
1826}
1827
1828#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1829#[serde(deny_unknown_fields)]
1830pub struct GetVariablesRequest {
1831    #[serde(
1832        rename = "customData",
1833        default,
1834        skip_serializing_if = "Option::is_none"
1835    )]
1836    pub custom_data: Option<CustomData>,
1837    #[serde(rename = "getVariableData")]
1838    pub get_variable_data: Vec<GetVariableData>,
1839}
1840
1841impl Validate for GetVariablesRequest {
1842    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1843        if let Some(x) = &self.custom_data {
1844            let p = path.field("customData");
1845            x.validate(&p)?;
1846        }
1847        {
1848            let x = &self.get_variable_data;
1849            let p = path.field("getVariableData");
1850            v::items(x, Some(1), None, &p)?;
1851            for (i0, it0) in x.iter().enumerate() {
1852                let p0 = p.index(i0);
1853                it0.validate(&p0)?;
1854            }
1855        }
1856        Ok(())
1857    }
1858}
1859
1860#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1861#[serde(deny_unknown_fields)]
1862pub struct GetVariablesResponse {
1863    #[serde(
1864        rename = "customData",
1865        default,
1866        skip_serializing_if = "Option::is_none"
1867    )]
1868    pub custom_data: Option<CustomData>,
1869    #[serde(rename = "getVariableResult")]
1870    pub get_variable_result: Vec<GetVariableResult>,
1871}
1872
1873impl Validate for GetVariablesResponse {
1874    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1875        if let Some(x) = &self.custom_data {
1876            let p = path.field("customData");
1877            x.validate(&p)?;
1878        }
1879        {
1880            let x = &self.get_variable_result;
1881            let p = path.field("getVariableResult");
1882            v::items(x, Some(1), None, &p)?;
1883            for (i0, it0) in x.iter().enumerate() {
1884                let p0 = p.index(i0);
1885                it0.validate(&p0)?;
1886            }
1887        }
1888        Ok(())
1889    }
1890}
1891
1892#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1893#[serde(deny_unknown_fields)]
1894pub struct HeartbeatRequest {
1895    #[serde(
1896        rename = "customData",
1897        default,
1898        skip_serializing_if = "Option::is_none"
1899    )]
1900    pub custom_data: Option<CustomData>,
1901}
1902
1903impl Validate for HeartbeatRequest {
1904    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1905        if let Some(x) = &self.custom_data {
1906            let p = path.field("customData");
1907            x.validate(&p)?;
1908        }
1909        Ok(())
1910    }
1911}
1912
1913#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1914#[serde(deny_unknown_fields)]
1915pub struct HeartbeatResponse {
1916    #[serde(
1917        rename = "customData",
1918        default,
1919        skip_serializing_if = "Option::is_none"
1920    )]
1921    pub custom_data: Option<CustomData>,
1922    /// Contains the current time of the CSMS.
1923    #[serde(rename = "currentTime")]
1924    pub current_time: DateTime,
1925}
1926
1927impl Validate for HeartbeatResponse {
1928    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1929        if let Some(x) = &self.custom_data {
1930            let p = path.field("customData");
1931            x.validate(&p)?;
1932        }
1933        Ok(())
1934    }
1935}
1936
1937#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1938#[serde(deny_unknown_fields)]
1939pub struct InstallCertificateRequest {
1940    #[serde(
1941        rename = "customData",
1942        default,
1943        skip_serializing_if = "Option::is_none"
1944    )]
1945    pub custom_data: Option<CustomData>,
1946    #[serde(rename = "certificateType")]
1947    pub certificate_type: InstallCertificateUseEnum,
1948    /// A PEM encoded X.509 certificate.
1949    #[serde(rename = "certificate")]
1950    pub certificate: String,
1951}
1952
1953impl Validate for InstallCertificateRequest {
1954    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1955        if let Some(x) = &self.custom_data {
1956            let p = path.field("customData");
1957            x.validate(&p)?;
1958        }
1959        {
1960            let x = &self.certificate;
1961            let p = path.field("certificate");
1962            v::max_length(x, 5500, &p)?;
1963        }
1964        Ok(())
1965    }
1966}
1967
1968#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1969#[serde(deny_unknown_fields)]
1970pub struct InstallCertificateResponse {
1971    #[serde(
1972        rename = "customData",
1973        default,
1974        skip_serializing_if = "Option::is_none"
1975    )]
1976    pub custom_data: Option<CustomData>,
1977    #[serde(rename = "status")]
1978    pub status: InstallCertificateStatusEnum,
1979    #[serde(
1980        rename = "statusInfo",
1981        default,
1982        skip_serializing_if = "Option::is_none"
1983    )]
1984    pub status_info: Option<StatusInfo>,
1985}
1986
1987impl Validate for InstallCertificateResponse {
1988    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1989        if let Some(x) = &self.custom_data {
1990            let p = path.field("customData");
1991            x.validate(&p)?;
1992        }
1993        if let Some(x) = &self.status_info {
1994            let p = path.field("statusInfo");
1995            x.validate(&p)?;
1996        }
1997        Ok(())
1998    }
1999}
2000
2001#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2002#[serde(deny_unknown_fields)]
2003pub struct LogStatusNotificationRequest {
2004    #[serde(
2005        rename = "customData",
2006        default,
2007        skip_serializing_if = "Option::is_none"
2008    )]
2009    pub custom_data: Option<CustomData>,
2010    #[serde(rename = "status")]
2011    pub status: UploadLogStatusEnum,
2012    /// The request id that was provided in GetLogRequest that started this log upload. This field is mandatory,
2013    /// unless the message was triggered by a TriggerMessageRequest AND there is no log upload ongoing.
2014    #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")]
2015    pub request_id: Option<i64>,
2016}
2017
2018impl Validate for LogStatusNotificationRequest {
2019    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
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, Default, Serialize, Deserialize)]
2029#[serde(deny_unknown_fields)]
2030pub struct LogStatusNotificationResponse {
2031    #[serde(
2032        rename = "customData",
2033        default,
2034        skip_serializing_if = "Option::is_none"
2035    )]
2036    pub custom_data: Option<CustomData>,
2037}
2038
2039impl Validate for LogStatusNotificationResponse {
2040    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2041        if let Some(x) = &self.custom_data {
2042            let p = path.field("customData");
2043            x.validate(&p)?;
2044        }
2045        Ok(())
2046    }
2047}
2048
2049/// Request_ Body
2050#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2051#[serde(deny_unknown_fields)]
2052pub struct MeterValuesRequest {
2053    #[serde(
2054        rename = "customData",
2055        default,
2056        skip_serializing_if = "Option::is_none"
2057    )]
2058    pub custom_data: Option<CustomData>,
2059    /// Request_ Body. EVSEID. Numeric_ Identifier
2060    /// This contains a number (&gt;0) designating an EVSE of the Charging Station. ‘0’ (zero) is used to designate the main power meter.
2061    #[serde(rename = "evseId")]
2062    pub evse_id: i64,
2063    #[serde(rename = "meterValue")]
2064    pub meter_value: Vec<MeterValue>,
2065}
2066
2067impl Validate for MeterValuesRequest {
2068    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2069        if let Some(x) = &self.custom_data {
2070            let p = path.field("customData");
2071            x.validate(&p)?;
2072        }
2073        {
2074            let x = &self.meter_value;
2075            let p = path.field("meterValue");
2076            v::items(x, Some(1), None, &p)?;
2077            for (i0, it0) in x.iter().enumerate() {
2078                let p0 = p.index(i0);
2079                it0.validate(&p0)?;
2080            }
2081        }
2082        Ok(())
2083    }
2084}
2085
2086#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2087#[serde(deny_unknown_fields)]
2088pub struct MeterValuesResponse {
2089    #[serde(
2090        rename = "customData",
2091        default,
2092        skip_serializing_if = "Option::is_none"
2093    )]
2094    pub custom_data: Option<CustomData>,
2095}
2096
2097impl Validate for MeterValuesResponse {
2098    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2099        if let Some(x) = &self.custom_data {
2100            let p = path.field("customData");
2101            x.validate(&p)?;
2102        }
2103        Ok(())
2104    }
2105}
2106
2107#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2108#[serde(deny_unknown_fields)]
2109pub struct NotifyChargingLimitRequest {
2110    #[serde(
2111        rename = "customData",
2112        default,
2113        skip_serializing_if = "Option::is_none"
2114    )]
2115    pub custom_data: Option<CustomData>,
2116    #[serde(
2117        rename = "chargingSchedule",
2118        default,
2119        skip_serializing_if = "Option::is_none"
2120    )]
2121    pub charging_schedule: Option<Vec<ChargingSchedule>>,
2122    /// The charging schedule contained in this notification applies to an EVSE. evseId must be &gt; 0.
2123    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
2124    pub evse_id: Option<i64>,
2125    #[serde(rename = "chargingLimit")]
2126    pub charging_limit: ChargingLimit,
2127}
2128
2129impl Validate for NotifyChargingLimitRequest {
2130    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2131        if let Some(x) = &self.custom_data {
2132            let p = path.field("customData");
2133            x.validate(&p)?;
2134        }
2135        if let Some(x) = &self.charging_schedule {
2136            let p = path.field("chargingSchedule");
2137            v::items(x, Some(1), None, &p)?;
2138            for (i0, it0) in x.iter().enumerate() {
2139                let p0 = p.index(i0);
2140                it0.validate(&p0)?;
2141            }
2142        }
2143        {
2144            let x = &self.charging_limit;
2145            let p = path.field("chargingLimit");
2146            x.validate(&p)?;
2147        }
2148        Ok(())
2149    }
2150}
2151
2152#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2153#[serde(deny_unknown_fields)]
2154pub struct NotifyChargingLimitResponse {
2155    #[serde(
2156        rename = "customData",
2157        default,
2158        skip_serializing_if = "Option::is_none"
2159    )]
2160    pub custom_data: Option<CustomData>,
2161}
2162
2163impl Validate for NotifyChargingLimitResponse {
2164    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2165        if let Some(x) = &self.custom_data {
2166            let p = path.field("customData");
2167            x.validate(&p)?;
2168        }
2169        Ok(())
2170    }
2171}
2172
2173#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2174#[serde(deny_unknown_fields)]
2175pub struct NotifyCustomerInformationRequest {
2176    #[serde(
2177        rename = "customData",
2178        default,
2179        skip_serializing_if = "Option::is_none"
2180    )]
2181    pub custom_data: Option<CustomData>,
2182    /// (Part of) the requested data. No format specified in which the data is returned. Should be human readable.
2183    #[serde(rename = "data")]
2184    pub data: String,
2185    /// “to be continued” indicator. Indicates whether another part of the monitoringData follows in an upcoming notifyMonitoringReportRequest message. Default value when omitted is false.
2186    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
2187    pub tbc: Option<bool>,
2188    /// Sequence number of this message. First message starts at 0.
2189    #[serde(rename = "seqNo")]
2190    pub seq_no: i64,
2191    /// Timestamp of the moment this message was generated at the Charging Station.
2192    #[serde(rename = "generatedAt")]
2193    pub generated_at: DateTime,
2194    /// The Id of the request.
2195    #[serde(rename = "requestId")]
2196    pub request_id: i64,
2197}
2198
2199impl Validate for NotifyCustomerInformationRequest {
2200    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2201        if let Some(x) = &self.custom_data {
2202            let p = path.field("customData");
2203            x.validate(&p)?;
2204        }
2205        {
2206            let x = &self.data;
2207            let p = path.field("data");
2208            v::max_length(x, 512, &p)?;
2209        }
2210        Ok(())
2211    }
2212}
2213
2214#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2215#[serde(deny_unknown_fields)]
2216pub struct NotifyCustomerInformationResponse {
2217    #[serde(
2218        rename = "customData",
2219        default,
2220        skip_serializing_if = "Option::is_none"
2221    )]
2222    pub custom_data: Option<CustomData>,
2223}
2224
2225impl Validate for NotifyCustomerInformationResponse {
2226    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2227        if let Some(x) = &self.custom_data {
2228            let p = path.field("customData");
2229            x.validate(&p)?;
2230        }
2231        Ok(())
2232    }
2233}
2234
2235#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2236#[serde(deny_unknown_fields)]
2237pub struct NotifyDisplayMessagesRequest {
2238    #[serde(
2239        rename = "customData",
2240        default,
2241        skip_serializing_if = "Option::is_none"
2242    )]
2243    pub custom_data: Option<CustomData>,
2244    #[serde(
2245        rename = "messageInfo",
2246        default,
2247        skip_serializing_if = "Option::is_none"
2248    )]
2249    pub message_info: Option<Vec<MessageInfo>>,
2250    /// The id of the &lt;&lt;getdisplaymessagesrequest,GetDisplayMessagesRequest&gt;&gt; that requested this message.
2251    #[serde(rename = "requestId")]
2252    pub request_id: i64,
2253    /// "to be continued" indicator. Indicates whether another part of the report follows in an upcoming NotifyDisplayMessagesRequest message. Default value when omitted is false.
2254    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
2255    pub tbc: Option<bool>,
2256}
2257
2258impl Validate for NotifyDisplayMessagesRequest {
2259    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2260        if let Some(x) = &self.custom_data {
2261            let p = path.field("customData");
2262            x.validate(&p)?;
2263        }
2264        if let Some(x) = &self.message_info {
2265            let p = path.field("messageInfo");
2266            v::items(x, Some(1), None, &p)?;
2267            for (i0, it0) in x.iter().enumerate() {
2268                let p0 = p.index(i0);
2269                it0.validate(&p0)?;
2270            }
2271        }
2272        Ok(())
2273    }
2274}
2275
2276#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2277#[serde(deny_unknown_fields)]
2278pub struct NotifyDisplayMessagesResponse {
2279    #[serde(
2280        rename = "customData",
2281        default,
2282        skip_serializing_if = "Option::is_none"
2283    )]
2284    pub custom_data: Option<CustomData>,
2285}
2286
2287impl Validate for NotifyDisplayMessagesResponse {
2288    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2289        if let Some(x) = &self.custom_data {
2290            let p = path.field("customData");
2291            x.validate(&p)?;
2292        }
2293        Ok(())
2294    }
2295}
2296
2297#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2298#[serde(deny_unknown_fields)]
2299pub struct NotifyEVChargingNeedsRequest {
2300    #[serde(
2301        rename = "customData",
2302        default,
2303        skip_serializing_if = "Option::is_none"
2304    )]
2305    pub custom_data: Option<CustomData>,
2306    /// Contains the maximum schedule tuples the car supports per schedule.
2307    #[serde(
2308        rename = "maxScheduleTuples",
2309        default,
2310        skip_serializing_if = "Option::is_none"
2311    )]
2312    pub max_schedule_tuples: Option<i64>,
2313    #[serde(rename = "chargingNeeds")]
2314    pub charging_needs: ChargingNeeds,
2315    /// Defines the EVSE and connector to which the EV is connected. EvseId may not be 0.
2316    #[serde(rename = "evseId")]
2317    pub evse_id: i64,
2318}
2319
2320impl Validate for NotifyEVChargingNeedsRequest {
2321    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2322        if let Some(x) = &self.custom_data {
2323            let p = path.field("customData");
2324            x.validate(&p)?;
2325        }
2326        {
2327            let x = &self.charging_needs;
2328            let p = path.field("chargingNeeds");
2329            x.validate(&p)?;
2330        }
2331        Ok(())
2332    }
2333}
2334
2335#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2336#[serde(deny_unknown_fields)]
2337pub struct NotifyEVChargingNeedsResponse {
2338    #[serde(
2339        rename = "customData",
2340        default,
2341        skip_serializing_if = "Option::is_none"
2342    )]
2343    pub custom_data: Option<CustomData>,
2344    #[serde(rename = "status")]
2345    pub status: NotifyEVChargingNeedsStatusEnum,
2346    #[serde(
2347        rename = "statusInfo",
2348        default,
2349        skip_serializing_if = "Option::is_none"
2350    )]
2351    pub status_info: Option<StatusInfo>,
2352}
2353
2354impl Validate for NotifyEVChargingNeedsResponse {
2355    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2356        if let Some(x) = &self.custom_data {
2357            let p = path.field("customData");
2358            x.validate(&p)?;
2359        }
2360        if let Some(x) = &self.status_info {
2361            let p = path.field("statusInfo");
2362            x.validate(&p)?;
2363        }
2364        Ok(())
2365    }
2366}
2367
2368#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2369#[serde(deny_unknown_fields)]
2370pub struct NotifyEVChargingScheduleRequest {
2371    #[serde(
2372        rename = "customData",
2373        default,
2374        skip_serializing_if = "Option::is_none"
2375    )]
2376    pub custom_data: Option<CustomData>,
2377    /// Periods contained in the charging profile are relative to this point in time.
2378    #[serde(rename = "timeBase")]
2379    pub time_base: DateTime,
2380    #[serde(rename = "chargingSchedule")]
2381    pub charging_schedule: ChargingSchedule,
2382    /// The charging schedule contained in this notification applies to an EVSE. EvseId must be &gt; 0.
2383    #[serde(rename = "evseId")]
2384    pub evse_id: i64,
2385}
2386
2387impl Validate for NotifyEVChargingScheduleRequest {
2388    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2389        if let Some(x) = &self.custom_data {
2390            let p = path.field("customData");
2391            x.validate(&p)?;
2392        }
2393        {
2394            let x = &self.charging_schedule;
2395            let p = path.field("chargingSchedule");
2396            x.validate(&p)?;
2397        }
2398        Ok(())
2399    }
2400}
2401
2402#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2403#[serde(deny_unknown_fields)]
2404pub struct NotifyEVChargingScheduleResponse {
2405    #[serde(
2406        rename = "customData",
2407        default,
2408        skip_serializing_if = "Option::is_none"
2409    )]
2410    pub custom_data: Option<CustomData>,
2411    #[serde(rename = "status")]
2412    pub status: GenericStatusEnum,
2413    #[serde(
2414        rename = "statusInfo",
2415        default,
2416        skip_serializing_if = "Option::is_none"
2417    )]
2418    pub status_info: Option<StatusInfo>,
2419}
2420
2421impl Validate for NotifyEVChargingScheduleResponse {
2422    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2423        if let Some(x) = &self.custom_data {
2424            let p = path.field("customData");
2425            x.validate(&p)?;
2426        }
2427        if let Some(x) = &self.status_info {
2428            let p = path.field("statusInfo");
2429            x.validate(&p)?;
2430        }
2431        Ok(())
2432    }
2433}
2434
2435#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2436#[serde(deny_unknown_fields)]
2437pub struct NotifyEventRequest {
2438    #[serde(
2439        rename = "customData",
2440        default,
2441        skip_serializing_if = "Option::is_none"
2442    )]
2443    pub custom_data: Option<CustomData>,
2444    /// Timestamp of the moment this message was generated at the Charging Station.
2445    #[serde(rename = "generatedAt")]
2446    pub generated_at: DateTime,
2447    /// “to be continued” indicator. Indicates whether another part of the report follows in an upcoming notifyEventRequest message. Default value when omitted is false.
2448    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
2449    pub tbc: Option<bool>,
2450    /// Sequence number of this message. First message starts at 0.
2451    #[serde(rename = "seqNo")]
2452    pub seq_no: i64,
2453    #[serde(rename = "eventData")]
2454    pub event_data: Vec<EventData>,
2455}
2456
2457impl Validate for NotifyEventRequest {
2458    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2459        if let Some(x) = &self.custom_data {
2460            let p = path.field("customData");
2461            x.validate(&p)?;
2462        }
2463        {
2464            let x = &self.event_data;
2465            let p = path.field("eventData");
2466            v::items(x, Some(1), None, &p)?;
2467            for (i0, it0) in x.iter().enumerate() {
2468                let p0 = p.index(i0);
2469                it0.validate(&p0)?;
2470            }
2471        }
2472        Ok(())
2473    }
2474}
2475
2476#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2477#[serde(deny_unknown_fields)]
2478pub struct NotifyEventResponse {
2479    #[serde(
2480        rename = "customData",
2481        default,
2482        skip_serializing_if = "Option::is_none"
2483    )]
2484    pub custom_data: Option<CustomData>,
2485}
2486
2487impl Validate for NotifyEventResponse {
2488    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2489        if let Some(x) = &self.custom_data {
2490            let p = path.field("customData");
2491            x.validate(&p)?;
2492        }
2493        Ok(())
2494    }
2495}
2496
2497#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2498#[serde(deny_unknown_fields)]
2499pub struct NotifyMonitoringReportRequest {
2500    #[serde(
2501        rename = "customData",
2502        default,
2503        skip_serializing_if = "Option::is_none"
2504    )]
2505    pub custom_data: Option<CustomData>,
2506    #[serde(rename = "monitor", default, skip_serializing_if = "Option::is_none")]
2507    pub monitor: Option<Vec<MonitoringData>>,
2508    /// The id of the GetMonitoringRequest that requested this report.
2509    #[serde(rename = "requestId")]
2510    pub request_id: i64,
2511    /// “to be continued” indicator. Indicates whether another part of the monitoringData follows in an upcoming notifyMonitoringReportRequest message. Default value when omitted is false.
2512    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
2513    pub tbc: Option<bool>,
2514    /// Sequence number of this message. First message starts at 0.
2515    #[serde(rename = "seqNo")]
2516    pub seq_no: i64,
2517    /// Timestamp of the moment this message was generated at the Charging Station.
2518    #[serde(rename = "generatedAt")]
2519    pub generated_at: DateTime,
2520}
2521
2522impl Validate for NotifyMonitoringReportRequest {
2523    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2524        if let Some(x) = &self.custom_data {
2525            let p = path.field("customData");
2526            x.validate(&p)?;
2527        }
2528        if let Some(x) = &self.monitor {
2529            let p = path.field("monitor");
2530            v::items(x, Some(1), None, &p)?;
2531            for (i0, it0) in x.iter().enumerate() {
2532                let p0 = p.index(i0);
2533                it0.validate(&p0)?;
2534            }
2535        }
2536        Ok(())
2537    }
2538}
2539
2540#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2541#[serde(deny_unknown_fields)]
2542pub struct NotifyMonitoringReportResponse {
2543    #[serde(
2544        rename = "customData",
2545        default,
2546        skip_serializing_if = "Option::is_none"
2547    )]
2548    pub custom_data: Option<CustomData>,
2549}
2550
2551impl Validate for NotifyMonitoringReportResponse {
2552    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
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 NotifyReportRequest {
2564    #[serde(
2565        rename = "customData",
2566        default,
2567        skip_serializing_if = "Option::is_none"
2568    )]
2569    pub custom_data: Option<CustomData>,
2570    /// The id of the GetReportRequest  or GetBaseReportRequest that requested this report
2571    #[serde(rename = "requestId")]
2572    pub request_id: i64,
2573    /// Timestamp of the moment this message was generated at the Charging Station.
2574    #[serde(rename = "generatedAt")]
2575    pub generated_at: DateTime,
2576    #[serde(
2577        rename = "reportData",
2578        default,
2579        skip_serializing_if = "Option::is_none"
2580    )]
2581    pub report_data: Option<Vec<ReportData>>,
2582    /// “to be continued” indicator. Indicates whether another part of the report follows in an upcoming notifyReportRequest message. Default value when omitted is false.
2583    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
2584    pub tbc: Option<bool>,
2585    /// Sequence number of this message. First message starts at 0.
2586    #[serde(rename = "seqNo")]
2587    pub seq_no: i64,
2588}
2589
2590impl Validate for NotifyReportRequest {
2591    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2592        if let Some(x) = &self.custom_data {
2593            let p = path.field("customData");
2594            x.validate(&p)?;
2595        }
2596        if let Some(x) = &self.report_data {
2597            let p = path.field("reportData");
2598            v::items(x, Some(1), None, &p)?;
2599            for (i0, it0) in x.iter().enumerate() {
2600                let p0 = p.index(i0);
2601                it0.validate(&p0)?;
2602            }
2603        }
2604        Ok(())
2605    }
2606}
2607
2608#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2609#[serde(deny_unknown_fields)]
2610pub struct NotifyReportResponse {
2611    #[serde(
2612        rename = "customData",
2613        default,
2614        skip_serializing_if = "Option::is_none"
2615    )]
2616    pub custom_data: Option<CustomData>,
2617}
2618
2619impl Validate for NotifyReportResponse {
2620    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2621        if let Some(x) = &self.custom_data {
2622            let p = path.field("customData");
2623            x.validate(&p)?;
2624        }
2625        Ok(())
2626    }
2627}
2628
2629#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2630#[serde(deny_unknown_fields)]
2631pub struct PublishFirmwareRequest {
2632    #[serde(
2633        rename = "customData",
2634        default,
2635        skip_serializing_if = "Option::is_none"
2636    )]
2637    pub custom_data: Option<CustomData>,
2638    /// This contains a string containing a URI pointing to a
2639    /// location from which to retrieve the firmware.
2640    #[serde(rename = "location")]
2641    pub location: String,
2642    /// This specifies how many times Charging Station must try
2643    /// to download the firmware before giving up. If this field is not
2644    /// present, it is left to Charging Station to decide how many times it wants to retry.
2645    #[serde(rename = "retries", default, skip_serializing_if = "Option::is_none")]
2646    pub retries: Option<i64>,
2647    /// The MD5 checksum over the entire firmware file as a hexadecimal string of length 32.
2648    #[serde(rename = "checksum")]
2649    pub checksum: String,
2650    /// The Id of the request.
2651    #[serde(rename = "requestId")]
2652    pub request_id: i64,
2653    /// The interval in seconds
2654    /// after which a retry may be
2655    /// attempted. If this field is not
2656    /// present, it is left to Charging
2657    /// Station to decide how long to wait
2658    /// between attempts.
2659    #[serde(
2660        rename = "retryInterval",
2661        default,
2662        skip_serializing_if = "Option::is_none"
2663    )]
2664    pub retry_interval: Option<i64>,
2665}
2666
2667impl Validate for PublishFirmwareRequest {
2668    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2669        if let Some(x) = &self.custom_data {
2670            let p = path.field("customData");
2671            x.validate(&p)?;
2672        }
2673        {
2674            let x = &self.location;
2675            let p = path.field("location");
2676            v::max_length(x, 512, &p)?;
2677        }
2678        {
2679            let x = &self.checksum;
2680            let p = path.field("checksum");
2681            v::max_length(x, 32, &p)?;
2682        }
2683        Ok(())
2684    }
2685}
2686
2687#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2688#[serde(deny_unknown_fields)]
2689pub struct PublishFirmwareResponse {
2690    #[serde(
2691        rename = "customData",
2692        default,
2693        skip_serializing_if = "Option::is_none"
2694    )]
2695    pub custom_data: Option<CustomData>,
2696    #[serde(rename = "status")]
2697    pub status: GenericStatusEnum,
2698    #[serde(
2699        rename = "statusInfo",
2700        default,
2701        skip_serializing_if = "Option::is_none"
2702    )]
2703    pub status_info: Option<StatusInfo>,
2704}
2705
2706impl Validate for PublishFirmwareResponse {
2707    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2708        if let Some(x) = &self.custom_data {
2709            let p = path.field("customData");
2710            x.validate(&p)?;
2711        }
2712        if let Some(x) = &self.status_info {
2713            let p = path.field("statusInfo");
2714            x.validate(&p)?;
2715        }
2716        Ok(())
2717    }
2718}
2719
2720#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2721#[serde(deny_unknown_fields)]
2722pub struct PublishFirmwareStatusNotificationRequest {
2723    #[serde(
2724        rename = "customData",
2725        default,
2726        skip_serializing_if = "Option::is_none"
2727    )]
2728    pub custom_data: Option<CustomData>,
2729    #[serde(rename = "status")]
2730    pub status: PublishFirmwareStatusEnum,
2731    /// Required if status is Published. Can be multiple URI’s, if the Local Controller supports e.g. HTTP, HTTPS, and FTP.
2732    #[serde(rename = "location", default, skip_serializing_if = "Option::is_none")]
2733    pub location: Option<Vec<String>>,
2734    /// The request id that was
2735    /// provided in the
2736    /// PublishFirmwareRequest which
2737    /// triggered this action.
2738    #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")]
2739    pub request_id: Option<i64>,
2740}
2741
2742impl Validate for PublishFirmwareStatusNotificationRequest {
2743    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2744        if let Some(x) = &self.custom_data {
2745            let p = path.field("customData");
2746            x.validate(&p)?;
2747        }
2748        if let Some(x) = &self.location {
2749            let p = path.field("location");
2750            v::items(x, Some(1), None, &p)?;
2751            for (i0, it0) in x.iter().enumerate() {
2752                let p0 = p.index(i0);
2753                v::max_length(it0, 512, &p0)?;
2754            }
2755        }
2756        Ok(())
2757    }
2758}
2759
2760#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2761#[serde(deny_unknown_fields)]
2762pub struct PublishFirmwareStatusNotificationResponse {
2763    #[serde(
2764        rename = "customData",
2765        default,
2766        skip_serializing_if = "Option::is_none"
2767    )]
2768    pub custom_data: Option<CustomData>,
2769}
2770
2771impl Validate for PublishFirmwareStatusNotificationResponse {
2772    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2773        if let Some(x) = &self.custom_data {
2774            let p = path.field("customData");
2775            x.validate(&p)?;
2776        }
2777        Ok(())
2778    }
2779}
2780
2781#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2782#[serde(deny_unknown_fields)]
2783pub struct ReportChargingProfilesRequest {
2784    #[serde(
2785        rename = "customData",
2786        default,
2787        skip_serializing_if = "Option::is_none"
2788    )]
2789    pub custom_data: Option<CustomData>,
2790    /// 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.
2791    #[serde(rename = "requestId")]
2792    pub request_id: i64,
2793    #[serde(rename = "chargingLimitSource")]
2794    pub charging_limit_source: ChargingLimitSourceEnum,
2795    #[serde(rename = "chargingProfile")]
2796    pub charging_profile: Vec<ChargingProfile>,
2797    /// To Be Continued. Default value when omitted: false. false indicates that there are no further messages as part of this report.
2798    #[serde(rename = "tbc", default, skip_serializing_if = "Option::is_none")]
2799    pub tbc: Option<bool>,
2800    /// The evse to which the charging profile applies. If evseId = 0, the message contains an overall limit for the Charging Station.
2801    #[serde(rename = "evseId")]
2802    pub evse_id: i64,
2803}
2804
2805impl Validate for ReportChargingProfilesRequest {
2806    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2807        if let Some(x) = &self.custom_data {
2808            let p = path.field("customData");
2809            x.validate(&p)?;
2810        }
2811        {
2812            let x = &self.charging_profile;
2813            let p = path.field("chargingProfile");
2814            v::items(x, Some(1), None, &p)?;
2815            for (i0, it0) in x.iter().enumerate() {
2816                let p0 = p.index(i0);
2817                it0.validate(&p0)?;
2818            }
2819        }
2820        Ok(())
2821    }
2822}
2823
2824#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2825#[serde(deny_unknown_fields)]
2826pub struct ReportChargingProfilesResponse {
2827    #[serde(
2828        rename = "customData",
2829        default,
2830        skip_serializing_if = "Option::is_none"
2831    )]
2832    pub custom_data: Option<CustomData>,
2833}
2834
2835impl Validate for ReportChargingProfilesResponse {
2836    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2837        if let Some(x) = &self.custom_data {
2838            let p = path.field("customData");
2839            x.validate(&p)?;
2840        }
2841        Ok(())
2842    }
2843}
2844
2845#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2846#[serde(deny_unknown_fields)]
2847pub struct RequestStartTransactionRequest {
2848    #[serde(
2849        rename = "customData",
2850        default,
2851        skip_serializing_if = "Option::is_none"
2852    )]
2853    pub custom_data: Option<CustomData>,
2854    /// Number of the EVSE on which to start the transaction. EvseId SHALL be &gt; 0
2855    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
2856    pub evse_id: Option<i64>,
2857    #[serde(
2858        rename = "groupIdToken",
2859        default,
2860        skip_serializing_if = "Option::is_none"
2861    )]
2862    pub group_id_token: Option<IdToken>,
2863    #[serde(rename = "idToken")]
2864    pub id_token: IdToken,
2865    /// Id given by the server to this start request. The Charging Station might 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.
2866    #[serde(rename = "remoteStartId")]
2867    pub remote_start_id: i64,
2868    #[serde(
2869        rename = "chargingProfile",
2870        default,
2871        skip_serializing_if = "Option::is_none"
2872    )]
2873    pub charging_profile: Option<ChargingProfile>,
2874}
2875
2876impl Validate for RequestStartTransactionRequest {
2877    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2878        if let Some(x) = &self.custom_data {
2879            let p = path.field("customData");
2880            x.validate(&p)?;
2881        }
2882        if let Some(x) = &self.group_id_token {
2883            let p = path.field("groupIdToken");
2884            x.validate(&p)?;
2885        }
2886        {
2887            let x = &self.id_token;
2888            let p = path.field("idToken");
2889            x.validate(&p)?;
2890        }
2891        if let Some(x) = &self.charging_profile {
2892            let p = path.field("chargingProfile");
2893            x.validate(&p)?;
2894        }
2895        Ok(())
2896    }
2897}
2898
2899#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2900#[serde(deny_unknown_fields)]
2901pub struct RequestStartTransactionResponse {
2902    #[serde(
2903        rename = "customData",
2904        default,
2905        skip_serializing_if = "Option::is_none"
2906    )]
2907    pub custom_data: Option<CustomData>,
2908    #[serde(rename = "status")]
2909    pub status: RequestStartStopStatusEnum,
2910    #[serde(
2911        rename = "statusInfo",
2912        default,
2913        skip_serializing_if = "Option::is_none"
2914    )]
2915    pub status_info: Option<StatusInfo>,
2916    /// 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.
2917    #[serde(
2918        rename = "transactionId",
2919        default,
2920        skip_serializing_if = "Option::is_none"
2921    )]
2922    pub transaction_id: Option<String>,
2923}
2924
2925impl Validate for RequestStartTransactionResponse {
2926    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2927        if let Some(x) = &self.custom_data {
2928            let p = path.field("customData");
2929            x.validate(&p)?;
2930        }
2931        if let Some(x) = &self.status_info {
2932            let p = path.field("statusInfo");
2933            x.validate(&p)?;
2934        }
2935        if let Some(x) = &self.transaction_id {
2936            let p = path.field("transactionId");
2937            v::max_length(x, 36, &p)?;
2938        }
2939        Ok(())
2940    }
2941}
2942
2943#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2944#[serde(deny_unknown_fields)]
2945pub struct RequestStopTransactionRequest {
2946    #[serde(
2947        rename = "customData",
2948        default,
2949        skip_serializing_if = "Option::is_none"
2950    )]
2951    pub custom_data: Option<CustomData>,
2952    /// The identifier of the transaction which the Charging Station is requested to stop.
2953    #[serde(rename = "transactionId")]
2954    pub transaction_id: String,
2955}
2956
2957impl Validate for RequestStopTransactionRequest {
2958    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2959        if let Some(x) = &self.custom_data {
2960            let p = path.field("customData");
2961            x.validate(&p)?;
2962        }
2963        {
2964            let x = &self.transaction_id;
2965            let p = path.field("transactionId");
2966            v::max_length(x, 36, &p)?;
2967        }
2968        Ok(())
2969    }
2970}
2971
2972#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2973#[serde(deny_unknown_fields)]
2974pub struct RequestStopTransactionResponse {
2975    #[serde(
2976        rename = "customData",
2977        default,
2978        skip_serializing_if = "Option::is_none"
2979    )]
2980    pub custom_data: Option<CustomData>,
2981    #[serde(rename = "status")]
2982    pub status: RequestStartStopStatusEnum,
2983    #[serde(
2984        rename = "statusInfo",
2985        default,
2986        skip_serializing_if = "Option::is_none"
2987    )]
2988    pub status_info: Option<StatusInfo>,
2989}
2990
2991impl Validate for RequestStopTransactionResponse {
2992    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2993        if let Some(x) = &self.custom_data {
2994            let p = path.field("customData");
2995            x.validate(&p)?;
2996        }
2997        if let Some(x) = &self.status_info {
2998            let p = path.field("statusInfo");
2999            x.validate(&p)?;
3000        }
3001        Ok(())
3002    }
3003}
3004
3005#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3006#[serde(deny_unknown_fields)]
3007pub struct ReservationStatusUpdateRequest {
3008    #[serde(
3009        rename = "customData",
3010        default,
3011        skip_serializing_if = "Option::is_none"
3012    )]
3013    pub custom_data: Option<CustomData>,
3014    /// The ID of the reservation.
3015    #[serde(rename = "reservationId")]
3016    pub reservation_id: i64,
3017    #[serde(rename = "reservationUpdateStatus")]
3018    pub reservation_update_status: ReservationUpdateStatusEnum,
3019}
3020
3021impl Validate for ReservationStatusUpdateRequest {
3022    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3023        if let Some(x) = &self.custom_data {
3024            let p = path.field("customData");
3025            x.validate(&p)?;
3026        }
3027        Ok(())
3028    }
3029}
3030
3031#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3032#[serde(deny_unknown_fields)]
3033pub struct ReservationStatusUpdateResponse {
3034    #[serde(
3035        rename = "customData",
3036        default,
3037        skip_serializing_if = "Option::is_none"
3038    )]
3039    pub custom_data: Option<CustomData>,
3040}
3041
3042impl Validate for ReservationStatusUpdateResponse {
3043    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3044        if let Some(x) = &self.custom_data {
3045            let p = path.field("customData");
3046            x.validate(&p)?;
3047        }
3048        Ok(())
3049    }
3050}
3051
3052#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3053#[serde(deny_unknown_fields)]
3054pub struct ReserveNowRequest {
3055    #[serde(
3056        rename = "customData",
3057        default,
3058        skip_serializing_if = "Option::is_none"
3059    )]
3060    pub custom_data: Option<CustomData>,
3061    /// Id of reservation.
3062    #[serde(rename = "id")]
3063    pub id: i64,
3064    /// Date and time at which the reservation expires.
3065    #[serde(rename = "expiryDateTime")]
3066    pub expiry_date_time: DateTime,
3067    #[serde(
3068        rename = "connectorType",
3069        default,
3070        skip_serializing_if = "Option::is_none"
3071    )]
3072    pub connector_type: Option<ConnectorEnum>,
3073    #[serde(rename = "idToken")]
3074    pub id_token: IdToken,
3075    /// This contains ID of the evse to be reserved.
3076    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
3077    pub evse_id: Option<i64>,
3078    #[serde(
3079        rename = "groupIdToken",
3080        default,
3081        skip_serializing_if = "Option::is_none"
3082    )]
3083    pub group_id_token: Option<IdToken>,
3084}
3085
3086impl Validate for ReserveNowRequest {
3087    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3088        if let Some(x) = &self.custom_data {
3089            let p = path.field("customData");
3090            x.validate(&p)?;
3091        }
3092        {
3093            let x = &self.id_token;
3094            let p = path.field("idToken");
3095            x.validate(&p)?;
3096        }
3097        if let Some(x) = &self.group_id_token {
3098            let p = path.field("groupIdToken");
3099            x.validate(&p)?;
3100        }
3101        Ok(())
3102    }
3103}
3104
3105#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3106#[serde(deny_unknown_fields)]
3107pub struct ReserveNowResponse {
3108    #[serde(
3109        rename = "customData",
3110        default,
3111        skip_serializing_if = "Option::is_none"
3112    )]
3113    pub custom_data: Option<CustomData>,
3114    #[serde(rename = "status")]
3115    pub status: ReserveNowStatusEnum,
3116    #[serde(
3117        rename = "statusInfo",
3118        default,
3119        skip_serializing_if = "Option::is_none"
3120    )]
3121    pub status_info: Option<StatusInfo>,
3122}
3123
3124impl Validate for ReserveNowResponse {
3125    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3126        if let Some(x) = &self.custom_data {
3127            let p = path.field("customData");
3128            x.validate(&p)?;
3129        }
3130        if let Some(x) = &self.status_info {
3131            let p = path.field("statusInfo");
3132            x.validate(&p)?;
3133        }
3134        Ok(())
3135    }
3136}
3137
3138#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3139#[serde(deny_unknown_fields)]
3140pub struct ResetRequest {
3141    #[serde(
3142        rename = "customData",
3143        default,
3144        skip_serializing_if = "Option::is_none"
3145    )]
3146    pub custom_data: Option<CustomData>,
3147    #[serde(rename = "type")]
3148    pub r#type: ResetEnum,
3149    /// This contains the ID of a specific EVSE that needs to be reset, instead of the entire Charging Station.
3150    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
3151    pub evse_id: Option<i64>,
3152}
3153
3154impl Validate for ResetRequest {
3155    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3156        if let Some(x) = &self.custom_data {
3157            let p = path.field("customData");
3158            x.validate(&p)?;
3159        }
3160        Ok(())
3161    }
3162}
3163
3164#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3165#[serde(deny_unknown_fields)]
3166pub struct ResetResponse {
3167    #[serde(
3168        rename = "customData",
3169        default,
3170        skip_serializing_if = "Option::is_none"
3171    )]
3172    pub custom_data: Option<CustomData>,
3173    #[serde(rename = "status")]
3174    pub status: ResetStatusEnum,
3175    #[serde(
3176        rename = "statusInfo",
3177        default,
3178        skip_serializing_if = "Option::is_none"
3179    )]
3180    pub status_info: Option<StatusInfo>,
3181}
3182
3183impl Validate for ResetResponse {
3184    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3185        if let Some(x) = &self.custom_data {
3186            let p = path.field("customData");
3187            x.validate(&p)?;
3188        }
3189        if let Some(x) = &self.status_info {
3190            let p = path.field("statusInfo");
3191            x.validate(&p)?;
3192        }
3193        Ok(())
3194    }
3195}
3196
3197#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3198#[serde(deny_unknown_fields)]
3199pub struct SecurityEventNotificationRequest {
3200    #[serde(
3201        rename = "customData",
3202        default,
3203        skip_serializing_if = "Option::is_none"
3204    )]
3205    pub custom_data: Option<CustomData>,
3206    /// Type of the security event. This value should be taken from the Security events list.
3207    #[serde(rename = "type")]
3208    pub r#type: String,
3209    /// Date and time at which the event occurred.
3210    #[serde(rename = "timestamp")]
3211    pub timestamp: DateTime,
3212    /// Additional information about the occurred security event.
3213    #[serde(rename = "techInfo", default, skip_serializing_if = "Option::is_none")]
3214    pub tech_info: Option<String>,
3215}
3216
3217impl Validate for SecurityEventNotificationRequest {
3218    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3219        if let Some(x) = &self.custom_data {
3220            let p = path.field("customData");
3221            x.validate(&p)?;
3222        }
3223        {
3224            let x = &self.r#type;
3225            let p = path.field("type");
3226            v::max_length(x, 50, &p)?;
3227        }
3228        if let Some(x) = &self.tech_info {
3229            let p = path.field("techInfo");
3230            v::max_length(x, 255, &p)?;
3231        }
3232        Ok(())
3233    }
3234}
3235
3236#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3237#[serde(deny_unknown_fields)]
3238pub struct SecurityEventNotificationResponse {
3239    #[serde(
3240        rename = "customData",
3241        default,
3242        skip_serializing_if = "Option::is_none"
3243    )]
3244    pub custom_data: Option<CustomData>,
3245}
3246
3247impl Validate for SecurityEventNotificationResponse {
3248    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3249        if let Some(x) = &self.custom_data {
3250            let p = path.field("customData");
3251            x.validate(&p)?;
3252        }
3253        Ok(())
3254    }
3255}
3256
3257#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3258#[serde(deny_unknown_fields)]
3259pub struct SendLocalListRequest {
3260    #[serde(
3261        rename = "customData",
3262        default,
3263        skip_serializing_if = "Option::is_none"
3264    )]
3265    pub custom_data: Option<CustomData>,
3266    #[serde(
3267        rename = "localAuthorizationList",
3268        default,
3269        skip_serializing_if = "Option::is_none"
3270    )]
3271    pub local_authorization_list: Option<Vec<AuthorizationData>>,
3272    /// 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.
3273    #[serde(rename = "versionNumber")]
3274    pub version_number: i64,
3275    #[serde(rename = "updateType")]
3276    pub update_type: UpdateEnum,
3277}
3278
3279impl Validate for SendLocalListRequest {
3280    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3281        if let Some(x) = &self.custom_data {
3282            let p = path.field("customData");
3283            x.validate(&p)?;
3284        }
3285        if let Some(x) = &self.local_authorization_list {
3286            let p = path.field("localAuthorizationList");
3287            v::items(x, Some(1), None, &p)?;
3288            for (i0, it0) in x.iter().enumerate() {
3289                let p0 = p.index(i0);
3290                it0.validate(&p0)?;
3291            }
3292        }
3293        Ok(())
3294    }
3295}
3296
3297#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3298#[serde(deny_unknown_fields)]
3299pub struct SendLocalListResponse {
3300    #[serde(
3301        rename = "customData",
3302        default,
3303        skip_serializing_if = "Option::is_none"
3304    )]
3305    pub custom_data: Option<CustomData>,
3306    #[serde(rename = "status")]
3307    pub status: SendLocalListStatusEnum,
3308    #[serde(
3309        rename = "statusInfo",
3310        default,
3311        skip_serializing_if = "Option::is_none"
3312    )]
3313    pub status_info: Option<StatusInfo>,
3314}
3315
3316impl Validate for SendLocalListResponse {
3317    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3318        if let Some(x) = &self.custom_data {
3319            let p = path.field("customData");
3320            x.validate(&p)?;
3321        }
3322        if let Some(x) = &self.status_info {
3323            let p = path.field("statusInfo");
3324            x.validate(&p)?;
3325        }
3326        Ok(())
3327    }
3328}
3329
3330#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3331#[serde(deny_unknown_fields)]
3332pub struct SetChargingProfileRequest {
3333    #[serde(
3334        rename = "customData",
3335        default,
3336        skip_serializing_if = "Option::is_none"
3337    )]
3338    pub custom_data: Option<CustomData>,
3339    /// 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.
3340    #[serde(rename = "evseId")]
3341    pub evse_id: i64,
3342    #[serde(rename = "chargingProfile")]
3343    pub charging_profile: ChargingProfile,
3344}
3345
3346impl Validate for SetChargingProfileRequest {
3347    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3348        if let Some(x) = &self.custom_data {
3349            let p = path.field("customData");
3350            x.validate(&p)?;
3351        }
3352        {
3353            let x = &self.charging_profile;
3354            let p = path.field("chargingProfile");
3355            x.validate(&p)?;
3356        }
3357        Ok(())
3358    }
3359}
3360
3361#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3362#[serde(deny_unknown_fields)]
3363pub struct SetChargingProfileResponse {
3364    #[serde(
3365        rename = "customData",
3366        default,
3367        skip_serializing_if = "Option::is_none"
3368    )]
3369    pub custom_data: Option<CustomData>,
3370    #[serde(rename = "status")]
3371    pub status: ChargingProfileStatusEnum,
3372    #[serde(
3373        rename = "statusInfo",
3374        default,
3375        skip_serializing_if = "Option::is_none"
3376    )]
3377    pub status_info: Option<StatusInfo>,
3378}
3379
3380impl Validate for SetChargingProfileResponse {
3381    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3382        if let Some(x) = &self.custom_data {
3383            let p = path.field("customData");
3384            x.validate(&p)?;
3385        }
3386        if let Some(x) = &self.status_info {
3387            let p = path.field("statusInfo");
3388            x.validate(&p)?;
3389        }
3390        Ok(())
3391    }
3392}
3393
3394#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3395#[serde(deny_unknown_fields)]
3396pub struct SetDisplayMessageRequest {
3397    #[serde(
3398        rename = "customData",
3399        default,
3400        skip_serializing_if = "Option::is_none"
3401    )]
3402    pub custom_data: Option<CustomData>,
3403    #[serde(rename = "message")]
3404    pub message: MessageInfo,
3405}
3406
3407impl Validate for SetDisplayMessageRequest {
3408    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3409        if let Some(x) = &self.custom_data {
3410            let p = path.field("customData");
3411            x.validate(&p)?;
3412        }
3413        {
3414            let x = &self.message;
3415            let p = path.field("message");
3416            x.validate(&p)?;
3417        }
3418        Ok(())
3419    }
3420}
3421
3422#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3423#[serde(deny_unknown_fields)]
3424pub struct SetDisplayMessageResponse {
3425    #[serde(
3426        rename = "customData",
3427        default,
3428        skip_serializing_if = "Option::is_none"
3429    )]
3430    pub custom_data: Option<CustomData>,
3431    #[serde(rename = "status")]
3432    pub status: DisplayMessageStatusEnum,
3433    #[serde(
3434        rename = "statusInfo",
3435        default,
3436        skip_serializing_if = "Option::is_none"
3437    )]
3438    pub status_info: Option<StatusInfo>,
3439}
3440
3441impl Validate for SetDisplayMessageResponse {
3442    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3443        if let Some(x) = &self.custom_data {
3444            let p = path.field("customData");
3445            x.validate(&p)?;
3446        }
3447        if let Some(x) = &self.status_info {
3448            let p = path.field("statusInfo");
3449            x.validate(&p)?;
3450        }
3451        Ok(())
3452    }
3453}
3454
3455#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3456#[serde(deny_unknown_fields)]
3457pub struct SetMonitoringBaseRequest {
3458    #[serde(
3459        rename = "customData",
3460        default,
3461        skip_serializing_if = "Option::is_none"
3462    )]
3463    pub custom_data: Option<CustomData>,
3464    #[serde(rename = "monitoringBase")]
3465    pub monitoring_base: MonitoringBaseEnum,
3466}
3467
3468impl Validate for SetMonitoringBaseRequest {
3469    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3470        if let Some(x) = &self.custom_data {
3471            let p = path.field("customData");
3472            x.validate(&p)?;
3473        }
3474        Ok(())
3475    }
3476}
3477
3478#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3479#[serde(deny_unknown_fields)]
3480pub struct SetMonitoringBaseResponse {
3481    #[serde(
3482        rename = "customData",
3483        default,
3484        skip_serializing_if = "Option::is_none"
3485    )]
3486    pub custom_data: Option<CustomData>,
3487    #[serde(rename = "status")]
3488    pub status: GenericDeviceModelStatusEnum,
3489    #[serde(
3490        rename = "statusInfo",
3491        default,
3492        skip_serializing_if = "Option::is_none"
3493    )]
3494    pub status_info: Option<StatusInfo>,
3495}
3496
3497impl Validate for SetMonitoringBaseResponse {
3498    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3499        if let Some(x) = &self.custom_data {
3500            let p = path.field("customData");
3501            x.validate(&p)?;
3502        }
3503        if let Some(x) = &self.status_info {
3504            let p = path.field("statusInfo");
3505            x.validate(&p)?;
3506        }
3507        Ok(())
3508    }
3509}
3510
3511#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3512#[serde(deny_unknown_fields)]
3513pub struct SetMonitoringLevelRequest {
3514    #[serde(
3515        rename = "customData",
3516        default,
3517        skip_serializing_if = "Option::is_none"
3518    )]
3519    pub custom_data: Option<CustomData>,
3520    /// The Charging Station SHALL only report events with a severity number lower than or equal to this severity.
3521    /// The severity range is 0-9, with 0 as the highest and 9 as the lowest severity level.
3522    /// The severity levels have the following meaning: +
3523    /// *0-Danger* +
3524    /// Indicates lives are potentially in danger. Urgent attention is needed and action should be taken immediately. +
3525    /// *1-Hardware Failure* +
3526    /// Indicates that the Charging Station is unable to continue regular operations due to Hardware issues. Action is required. +
3527    /// *2-System Failure* +
3528    /// Indicates that the Charging Station is unable to continue regular operations due to software or minor hardware issues. Action is required. +
3529    /// *3-Critical* +
3530    /// Indicates a critical error. Action is required. +
3531    /// *4-Error* +
3532    /// Indicates a non-urgent error. Action is required. +
3533    /// *5-Alert* +
3534    /// Indicates an alert event. Default severity for any type of monitoring event.  +
3535    /// *6-Warning* +
3536    /// Indicates a warning event. Action may be required. +
3537    /// *7-Notice* +
3538    /// Indicates an unusual event. No immediate action is required. +
3539    /// *8-Informational* +
3540    /// Indicates a regular operational event. May be used for reporting, measuring throughput, etc. No action is required. +
3541    /// *9-Debug* +
3542    /// Indicates information useful to developers for debugging, not useful during operations.
3543    #[serde(rename = "severity")]
3544    pub severity: i64,
3545}
3546
3547impl Validate for SetMonitoringLevelRequest {
3548    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3549        if let Some(x) = &self.custom_data {
3550            let p = path.field("customData");
3551            x.validate(&p)?;
3552        }
3553        Ok(())
3554    }
3555}
3556
3557#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3558#[serde(deny_unknown_fields)]
3559pub struct SetMonitoringLevelResponse {
3560    #[serde(
3561        rename = "customData",
3562        default,
3563        skip_serializing_if = "Option::is_none"
3564    )]
3565    pub custom_data: Option<CustomData>,
3566    #[serde(rename = "status")]
3567    pub status: GenericStatusEnum,
3568    #[serde(
3569        rename = "statusInfo",
3570        default,
3571        skip_serializing_if = "Option::is_none"
3572    )]
3573    pub status_info: Option<StatusInfo>,
3574}
3575
3576impl Validate for SetMonitoringLevelResponse {
3577    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3578        if let Some(x) = &self.custom_data {
3579            let p = path.field("customData");
3580            x.validate(&p)?;
3581        }
3582        if let Some(x) = &self.status_info {
3583            let p = path.field("statusInfo");
3584            x.validate(&p)?;
3585        }
3586        Ok(())
3587    }
3588}
3589
3590#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3591#[serde(deny_unknown_fields)]
3592pub struct SetNetworkProfileRequest {
3593    #[serde(
3594        rename = "customData",
3595        default,
3596        skip_serializing_if = "Option::is_none"
3597    )]
3598    pub custom_data: Option<CustomData>,
3599    /// Slot in which the configuration should be stored.
3600    #[serde(rename = "configurationSlot")]
3601    pub configuration_slot: i64,
3602    #[serde(rename = "connectionData")]
3603    pub connection_data: NetworkConnectionProfile,
3604}
3605
3606impl Validate for SetNetworkProfileRequest {
3607    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3608        if let Some(x) = &self.custom_data {
3609            let p = path.field("customData");
3610            x.validate(&p)?;
3611        }
3612        {
3613            let x = &self.connection_data;
3614            let p = path.field("connectionData");
3615            x.validate(&p)?;
3616        }
3617        Ok(())
3618    }
3619}
3620
3621#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3622#[serde(deny_unknown_fields)]
3623pub struct SetNetworkProfileResponse {
3624    #[serde(
3625        rename = "customData",
3626        default,
3627        skip_serializing_if = "Option::is_none"
3628    )]
3629    pub custom_data: Option<CustomData>,
3630    #[serde(rename = "status")]
3631    pub status: SetNetworkProfileStatusEnum,
3632    #[serde(
3633        rename = "statusInfo",
3634        default,
3635        skip_serializing_if = "Option::is_none"
3636    )]
3637    pub status_info: Option<StatusInfo>,
3638}
3639
3640impl Validate for SetNetworkProfileResponse {
3641    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3642        if let Some(x) = &self.custom_data {
3643            let p = path.field("customData");
3644            x.validate(&p)?;
3645        }
3646        if let Some(x) = &self.status_info {
3647            let p = path.field("statusInfo");
3648            x.validate(&p)?;
3649        }
3650        Ok(())
3651    }
3652}
3653
3654#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3655#[serde(deny_unknown_fields)]
3656pub struct SetVariableMonitoringRequest {
3657    #[serde(
3658        rename = "customData",
3659        default,
3660        skip_serializing_if = "Option::is_none"
3661    )]
3662    pub custom_data: Option<CustomData>,
3663    #[serde(rename = "setMonitoringData")]
3664    pub set_monitoring_data: Vec<SetMonitoringData>,
3665}
3666
3667impl Validate for SetVariableMonitoringRequest {
3668    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3669        if let Some(x) = &self.custom_data {
3670            let p = path.field("customData");
3671            x.validate(&p)?;
3672        }
3673        {
3674            let x = &self.set_monitoring_data;
3675            let p = path.field("setMonitoringData");
3676            v::items(x, Some(1), None, &p)?;
3677            for (i0, it0) in x.iter().enumerate() {
3678                let p0 = p.index(i0);
3679                it0.validate(&p0)?;
3680            }
3681        }
3682        Ok(())
3683    }
3684}
3685
3686#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3687#[serde(deny_unknown_fields)]
3688pub struct SetVariableMonitoringResponse {
3689    #[serde(
3690        rename = "customData",
3691        default,
3692        skip_serializing_if = "Option::is_none"
3693    )]
3694    pub custom_data: Option<CustomData>,
3695    #[serde(rename = "setMonitoringResult")]
3696    pub set_monitoring_result: Vec<SetMonitoringResult>,
3697}
3698
3699impl Validate for SetVariableMonitoringResponse {
3700    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3701        if let Some(x) = &self.custom_data {
3702            let p = path.field("customData");
3703            x.validate(&p)?;
3704        }
3705        {
3706            let x = &self.set_monitoring_result;
3707            let p = path.field("setMonitoringResult");
3708            v::items(x, Some(1), None, &p)?;
3709            for (i0, it0) in x.iter().enumerate() {
3710                let p0 = p.index(i0);
3711                it0.validate(&p0)?;
3712            }
3713        }
3714        Ok(())
3715    }
3716}
3717
3718#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3719#[serde(deny_unknown_fields)]
3720pub struct SetVariablesRequest {
3721    #[serde(
3722        rename = "customData",
3723        default,
3724        skip_serializing_if = "Option::is_none"
3725    )]
3726    pub custom_data: Option<CustomData>,
3727    #[serde(rename = "setVariableData")]
3728    pub set_variable_data: Vec<SetVariableData>,
3729}
3730
3731impl Validate for SetVariablesRequest {
3732    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3733        if let Some(x) = &self.custom_data {
3734            let p = path.field("customData");
3735            x.validate(&p)?;
3736        }
3737        {
3738            let x = &self.set_variable_data;
3739            let p = path.field("setVariableData");
3740            v::items(x, Some(1), None, &p)?;
3741            for (i0, it0) in x.iter().enumerate() {
3742                let p0 = p.index(i0);
3743                it0.validate(&p0)?;
3744            }
3745        }
3746        Ok(())
3747    }
3748}
3749
3750#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3751#[serde(deny_unknown_fields)]
3752pub struct SetVariablesResponse {
3753    #[serde(
3754        rename = "customData",
3755        default,
3756        skip_serializing_if = "Option::is_none"
3757    )]
3758    pub custom_data: Option<CustomData>,
3759    #[serde(rename = "setVariableResult")]
3760    pub set_variable_result: Vec<SetVariableResult>,
3761}
3762
3763impl Validate for SetVariablesResponse {
3764    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3765        if let Some(x) = &self.custom_data {
3766            let p = path.field("customData");
3767            x.validate(&p)?;
3768        }
3769        {
3770            let x = &self.set_variable_result;
3771            let p = path.field("setVariableResult");
3772            v::items(x, Some(1), None, &p)?;
3773            for (i0, it0) in x.iter().enumerate() {
3774                let p0 = p.index(i0);
3775                it0.validate(&p0)?;
3776            }
3777        }
3778        Ok(())
3779    }
3780}
3781
3782#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3783#[serde(deny_unknown_fields)]
3784pub struct SignCertificateRequest {
3785    #[serde(
3786        rename = "customData",
3787        default,
3788        skip_serializing_if = "Option::is_none"
3789    )]
3790    pub custom_data: Option<CustomData>,
3791    /// 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.
3792    #[serde(rename = "csr")]
3793    pub csr: String,
3794    #[serde(
3795        rename = "certificateType",
3796        default,
3797        skip_serializing_if = "Option::is_none"
3798    )]
3799    pub certificate_type: Option<CertificateSigningUseEnum>,
3800}
3801
3802impl Validate for SignCertificateRequest {
3803    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3804        if let Some(x) = &self.custom_data {
3805            let p = path.field("customData");
3806            x.validate(&p)?;
3807        }
3808        {
3809            let x = &self.csr;
3810            let p = path.field("csr");
3811            v::max_length(x, 5500, &p)?;
3812        }
3813        Ok(())
3814    }
3815}
3816
3817#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3818#[serde(deny_unknown_fields)]
3819pub struct SignCertificateResponse {
3820    #[serde(
3821        rename = "customData",
3822        default,
3823        skip_serializing_if = "Option::is_none"
3824    )]
3825    pub custom_data: Option<CustomData>,
3826    #[serde(rename = "status")]
3827    pub status: GenericStatusEnum,
3828    #[serde(
3829        rename = "statusInfo",
3830        default,
3831        skip_serializing_if = "Option::is_none"
3832    )]
3833    pub status_info: Option<StatusInfo>,
3834}
3835
3836impl Validate for SignCertificateResponse {
3837    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3838        if let Some(x) = &self.custom_data {
3839            let p = path.field("customData");
3840            x.validate(&p)?;
3841        }
3842        if let Some(x) = &self.status_info {
3843            let p = path.field("statusInfo");
3844            x.validate(&p)?;
3845        }
3846        Ok(())
3847    }
3848}
3849
3850#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3851#[serde(deny_unknown_fields)]
3852pub struct StatusNotificationRequest {
3853    #[serde(
3854        rename = "customData",
3855        default,
3856        skip_serializing_if = "Option::is_none"
3857    )]
3858    pub custom_data: Option<CustomData>,
3859    /// The time for which the status is reported. If absent time of receipt of the message will be assumed.
3860    #[serde(rename = "timestamp")]
3861    pub timestamp: DateTime,
3862    #[serde(rename = "connectorStatus")]
3863    pub connector_status: ConnectorStatusEnum,
3864    /// The id of the EVSE to which the connector belongs for which the the status is reported.
3865    #[serde(rename = "evseId")]
3866    pub evse_id: i64,
3867    /// The id of the connector within the EVSE for which the status is reported.
3868    #[serde(rename = "connectorId")]
3869    pub connector_id: i64,
3870}
3871
3872impl Validate for StatusNotificationRequest {
3873    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3874        if let Some(x) = &self.custom_data {
3875            let p = path.field("customData");
3876            x.validate(&p)?;
3877        }
3878        Ok(())
3879    }
3880}
3881
3882#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3883#[serde(deny_unknown_fields)]
3884pub struct StatusNotificationResponse {
3885    #[serde(
3886        rename = "customData",
3887        default,
3888        skip_serializing_if = "Option::is_none"
3889    )]
3890    pub custom_data: Option<CustomData>,
3891}
3892
3893impl Validate for StatusNotificationResponse {
3894    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3895        if let Some(x) = &self.custom_data {
3896            let p = path.field("customData");
3897            x.validate(&p)?;
3898        }
3899        Ok(())
3900    }
3901}
3902
3903#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3904#[serde(deny_unknown_fields)]
3905pub struct TransactionEventRequest {
3906    #[serde(
3907        rename = "customData",
3908        default,
3909        skip_serializing_if = "Option::is_none"
3910    )]
3911    pub custom_data: Option<CustomData>,
3912    #[serde(rename = "eventType")]
3913    pub event_type: TransactionEventEnum,
3914    #[serde(
3915        rename = "meterValue",
3916        default,
3917        skip_serializing_if = "Option::is_none"
3918    )]
3919    pub meter_value: Option<Vec<MeterValue>>,
3920    /// The date and time at which this transaction event occurred.
3921    #[serde(rename = "timestamp")]
3922    pub timestamp: DateTime,
3923    #[serde(rename = "triggerReason")]
3924    pub trigger_reason: TriggerReasonEnum,
3925    /// Incremental sequence number, helps with determining if all messages of a transaction have been received.
3926    #[serde(rename = "seqNo")]
3927    pub seq_no: i64,
3928    /// Indication that this transaction event happened when the Charging Station was offline. Default = false, meaning: the event occurred when the Charging Station was online.
3929    #[serde(rename = "offline", default, skip_serializing_if = "Option::is_none")]
3930    pub offline: Option<bool>,
3931    /// If the Charging Station is able to report the number of phases used, then it SHALL provide it. When omitted the CSMS may be able to determine the number of phases used via device management.
3932    #[serde(
3933        rename = "numberOfPhasesUsed",
3934        default,
3935        skip_serializing_if = "Option::is_none"
3936    )]
3937    pub number_of_phases_used: Option<i64>,
3938    /// The maximum current of the connected cable in Ampere (A).
3939    #[serde(
3940        rename = "cableMaxCurrent",
3941        default,
3942        skip_serializing_if = "Option::is_none"
3943    )]
3944    pub cable_max_current: Option<i64>,
3945    /// This contains the Id of the reservation that terminates as a result of this transaction.
3946    #[serde(
3947        rename = "reservationId",
3948        default,
3949        skip_serializing_if = "Option::is_none"
3950    )]
3951    pub reservation_id: Option<i64>,
3952    #[serde(rename = "transactionInfo")]
3953    pub transaction_info: Transaction,
3954    #[serde(rename = "evse", default, skip_serializing_if = "Option::is_none")]
3955    pub evse: Option<EVSE>,
3956    #[serde(rename = "idToken", default, skip_serializing_if = "Option::is_none")]
3957    pub id_token: Option<IdToken>,
3958}
3959
3960impl Validate for TransactionEventRequest {
3961    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
3962        if let Some(x) = &self.custom_data {
3963            let p = path.field("customData");
3964            x.validate(&p)?;
3965        }
3966        if let Some(x) = &self.meter_value {
3967            let p = path.field("meterValue");
3968            v::items(x, Some(1), None, &p)?;
3969            for (i0, it0) in x.iter().enumerate() {
3970                let p0 = p.index(i0);
3971                it0.validate(&p0)?;
3972            }
3973        }
3974        {
3975            let x = &self.transaction_info;
3976            let p = path.field("transactionInfo");
3977            x.validate(&p)?;
3978        }
3979        if let Some(x) = &self.evse {
3980            let p = path.field("evse");
3981            x.validate(&p)?;
3982        }
3983        if let Some(x) = &self.id_token {
3984            let p = path.field("idToken");
3985            x.validate(&p)?;
3986        }
3987        Ok(())
3988    }
3989}
3990
3991#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
3992#[serde(deny_unknown_fields)]
3993pub struct TransactionEventResponse {
3994    #[serde(
3995        rename = "customData",
3996        default,
3997        skip_serializing_if = "Option::is_none"
3998    )]
3999    pub custom_data: Option<CustomData>,
4000    /// SHALL only be sent when charging has ended. Final total cost of this transaction, including taxes. In the currency configured with the Configuration Variable: &lt;&lt;configkey-currency,`Currency`&gt;&gt;. When omitted, the transaction was NOT free. To indicate a free transaction, the CSMS SHALL send 0.00.
4001    #[serde(rename = "totalCost", default, skip_serializing_if = "Option::is_none")]
4002    pub total_cost: Option<f64>,
4003    /// 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; overrules the one in &lt;&lt;cmn_idtokeninfotype,IdTokenInfoType&gt;&gt;.
4004    #[serde(
4005        rename = "chargingPriority",
4006        default,
4007        skip_serializing_if = "Option::is_none"
4008    )]
4009    pub charging_priority: Option<i64>,
4010    #[serde(
4011        rename = "idTokenInfo",
4012        default,
4013        skip_serializing_if = "Option::is_none"
4014    )]
4015    pub id_token_info: Option<IdTokenInfo>,
4016    #[serde(
4017        rename = "updatedPersonalMessage",
4018        default,
4019        skip_serializing_if = "Option::is_none"
4020    )]
4021    pub updated_personal_message: Option<MessageContent>,
4022}
4023
4024impl Validate for TransactionEventResponse {
4025    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4026        if let Some(x) = &self.custom_data {
4027            let p = path.field("customData");
4028            x.validate(&p)?;
4029        }
4030        if let Some(x) = &self.id_token_info {
4031            let p = path.field("idTokenInfo");
4032            x.validate(&p)?;
4033        }
4034        if let Some(x) = &self.updated_personal_message {
4035            let p = path.field("updatedPersonalMessage");
4036            x.validate(&p)?;
4037        }
4038        Ok(())
4039    }
4040}
4041
4042#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4043#[serde(deny_unknown_fields)]
4044pub struct TriggerMessageRequest {
4045    #[serde(
4046        rename = "customData",
4047        default,
4048        skip_serializing_if = "Option::is_none"
4049    )]
4050    pub custom_data: Option<CustomData>,
4051    #[serde(rename = "evse", default, skip_serializing_if = "Option::is_none")]
4052    pub evse: Option<EVSE>,
4053    #[serde(rename = "requestedMessage")]
4054    pub requested_message: MessageTriggerEnum,
4055}
4056
4057impl Validate for TriggerMessageRequest {
4058    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4059        if let Some(x) = &self.custom_data {
4060            let p = path.field("customData");
4061            x.validate(&p)?;
4062        }
4063        if let Some(x) = &self.evse {
4064            let p = path.field("evse");
4065            x.validate(&p)?;
4066        }
4067        Ok(())
4068    }
4069}
4070
4071#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4072#[serde(deny_unknown_fields)]
4073pub struct TriggerMessageResponse {
4074    #[serde(
4075        rename = "customData",
4076        default,
4077        skip_serializing_if = "Option::is_none"
4078    )]
4079    pub custom_data: Option<CustomData>,
4080    #[serde(rename = "status")]
4081    pub status: TriggerMessageStatusEnum,
4082    #[serde(
4083        rename = "statusInfo",
4084        default,
4085        skip_serializing_if = "Option::is_none"
4086    )]
4087    pub status_info: Option<StatusInfo>,
4088}
4089
4090impl Validate for TriggerMessageResponse {
4091    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4092        if let Some(x) = &self.custom_data {
4093            let p = path.field("customData");
4094            x.validate(&p)?;
4095        }
4096        if let Some(x) = &self.status_info {
4097            let p = path.field("statusInfo");
4098            x.validate(&p)?;
4099        }
4100        Ok(())
4101    }
4102}
4103
4104#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4105#[serde(deny_unknown_fields)]
4106pub struct UnlockConnectorRequest {
4107    #[serde(
4108        rename = "customData",
4109        default,
4110        skip_serializing_if = "Option::is_none"
4111    )]
4112    pub custom_data: Option<CustomData>,
4113    /// This contains the identifier of the EVSE for which a connector needs to be unlocked.
4114    #[serde(rename = "evseId")]
4115    pub evse_id: i64,
4116    /// This contains the identifier of the connector that needs to be unlocked.
4117    #[serde(rename = "connectorId")]
4118    pub connector_id: i64,
4119}
4120
4121impl Validate for UnlockConnectorRequest {
4122    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4123        if let Some(x) = &self.custom_data {
4124            let p = path.field("customData");
4125            x.validate(&p)?;
4126        }
4127        Ok(())
4128    }
4129}
4130
4131#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4132#[serde(deny_unknown_fields)]
4133pub struct UnlockConnectorResponse {
4134    #[serde(
4135        rename = "customData",
4136        default,
4137        skip_serializing_if = "Option::is_none"
4138    )]
4139    pub custom_data: Option<CustomData>,
4140    #[serde(rename = "status")]
4141    pub status: UnlockStatusEnum,
4142    #[serde(
4143        rename = "statusInfo",
4144        default,
4145        skip_serializing_if = "Option::is_none"
4146    )]
4147    pub status_info: Option<StatusInfo>,
4148}
4149
4150impl Validate for UnlockConnectorResponse {
4151    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4152        if let Some(x) = &self.custom_data {
4153            let p = path.field("customData");
4154            x.validate(&p)?;
4155        }
4156        if let Some(x) = &self.status_info {
4157            let p = path.field("statusInfo");
4158            x.validate(&p)?;
4159        }
4160        Ok(())
4161    }
4162}
4163
4164#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4165#[serde(deny_unknown_fields)]
4166pub struct UnpublishFirmwareRequest {
4167    #[serde(
4168        rename = "customData",
4169        default,
4170        skip_serializing_if = "Option::is_none"
4171    )]
4172    pub custom_data: Option<CustomData>,
4173    /// The MD5 checksum over the entire firmware file as a hexadecimal string of length 32.
4174    #[serde(rename = "checksum")]
4175    pub checksum: String,
4176}
4177
4178impl Validate for UnpublishFirmwareRequest {
4179    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4180        if let Some(x) = &self.custom_data {
4181            let p = path.field("customData");
4182            x.validate(&p)?;
4183        }
4184        {
4185            let x = &self.checksum;
4186            let p = path.field("checksum");
4187            v::max_length(x, 32, &p)?;
4188        }
4189        Ok(())
4190    }
4191}
4192
4193#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4194#[serde(deny_unknown_fields)]
4195pub struct UnpublishFirmwareResponse {
4196    #[serde(
4197        rename = "customData",
4198        default,
4199        skip_serializing_if = "Option::is_none"
4200    )]
4201    pub custom_data: Option<CustomData>,
4202    #[serde(rename = "status")]
4203    pub status: UnpublishFirmwareStatusEnum,
4204}
4205
4206impl Validate for UnpublishFirmwareResponse {
4207    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4208        if let Some(x) = &self.custom_data {
4209            let p = path.field("customData");
4210            x.validate(&p)?;
4211        }
4212        Ok(())
4213    }
4214}
4215
4216#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4217#[serde(deny_unknown_fields)]
4218pub struct UpdateFirmwareRequest {
4219    #[serde(
4220        rename = "customData",
4221        default,
4222        skip_serializing_if = "Option::is_none"
4223    )]
4224    pub custom_data: Option<CustomData>,
4225    /// This specifies how many times Charging Station must try 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.
4226    #[serde(rename = "retries", default, skip_serializing_if = "Option::is_none")]
4227    pub retries: Option<i64>,
4228    /// 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.
4229    #[serde(
4230        rename = "retryInterval",
4231        default,
4232        skip_serializing_if = "Option::is_none"
4233    )]
4234    pub retry_interval: Option<i64>,
4235    /// The Id of this request
4236    #[serde(rename = "requestId")]
4237    pub request_id: i64,
4238    #[serde(rename = "firmware")]
4239    pub firmware: Firmware,
4240}
4241
4242impl Validate for UpdateFirmwareRequest {
4243    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4244        if let Some(x) = &self.custom_data {
4245            let p = path.field("customData");
4246            x.validate(&p)?;
4247        }
4248        {
4249            let x = &self.firmware;
4250            let p = path.field("firmware");
4251            x.validate(&p)?;
4252        }
4253        Ok(())
4254    }
4255}
4256
4257#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4258#[serde(deny_unknown_fields)]
4259pub struct UpdateFirmwareResponse {
4260    #[serde(
4261        rename = "customData",
4262        default,
4263        skip_serializing_if = "Option::is_none"
4264    )]
4265    pub custom_data: Option<CustomData>,
4266    #[serde(rename = "status")]
4267    pub status: UpdateFirmwareStatusEnum,
4268    #[serde(
4269        rename = "statusInfo",
4270        default,
4271        skip_serializing_if = "Option::is_none"
4272    )]
4273    pub status_info: Option<StatusInfo>,
4274}
4275
4276impl Validate for UpdateFirmwareResponse {
4277    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
4278        if let Some(x) = &self.custom_data {
4279            let p = path.field("customData");
4280            x.validate(&p)?;
4281        }
4282        if let Some(x) = &self.status_info {
4283            let p = path.field("statusInfo");
4284            x.validate(&p)?;
4285        }
4286        Ok(())
4287    }
4288}