Skip to main content

codetics_ocpp201/
datatypes.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Kevin Vavelin, Codetics (https://codetics.fr)
3
4//! OCPP 2.0.1 composite datatypes.
5
6use ocpp_core::DateTime;
7use ocpp_core::validate::{self as v, Path, Validate, Violation};
8use serde::{Deserialize, Serialize};
9
10use crate::enums::*;
11
12/// AC_ Charging_ Parameters
13/// EV AC charging parameters.
14#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
15#[serde(deny_unknown_fields)]
16pub struct ACChargingParameters {
17    #[serde(
18        rename = "customData",
19        default,
20        skip_serializing_if = "Option::is_none"
21    )]
22    pub custom_data: Option<CustomData>,
23    /// AC_ Charging_ Parameters. Energy_ Amount. Energy_ Amount
24    /// Amount of energy requested (in Wh). This includes energy required for preconditioning.
25    #[serde(rename = "energyAmount")]
26    pub energy_amount: i64,
27    /// AC_ Charging_ Parameters. EV_ Min. Current
28    /// Minimum current (amps) supported by the electric vehicle (per phase).
29    #[serde(rename = "evMinCurrent")]
30    pub ev_min_current: i64,
31    /// AC_ Charging_ Parameters. EV_ Max. Current
32    /// Maximum current (amps) supported by the electric vehicle (per phase). Includes cable capacity.
33    #[serde(rename = "evMaxCurrent")]
34    pub ev_max_current: i64,
35    /// AC_ Charging_ Parameters. EV_ Max. Voltage
36    /// Maximum voltage supported by the electric vehicle
37    #[serde(rename = "evMaxVoltage")]
38    pub ev_max_voltage: i64,
39}
40
41impl Validate for ACChargingParameters {
42    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
43        if let Some(x) = &self.custom_data {
44            let p = path.field("customData");
45            x.validate(&p)?;
46        }
47        Ok(())
48    }
49}
50
51/// APN
52/// Collection of configuration data needed to make a data-connection over a cellular network.
53/// NOTE: When asking a GSM modem to dial in, it is possible to specify which mobile operator should be used. This can be done with the mobile country code (MCC) in combination with a mobile network code (MNC). Example: If your preferred network is Vodafone Netherlands, the MCC=204 and the MNC=04 which means the key PreferredNetwork = 20404 Some modems allows to specify a preferred network, which means, if this network is not available, a different network is used. If you specify UseOnlyPreferredNetwork and this network is not available, the modem will not dial in.
54#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
55#[serde(deny_unknown_fields)]
56pub struct APN {
57    #[serde(
58        rename = "customData",
59        default,
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub custom_data: Option<CustomData>,
63    /// APN. APN. URI
64    /// The Access Point Name as an URL.
65    #[serde(rename = "apn")]
66    pub apn: String,
67    /// APN. APN. User_ Name
68    /// APN username.
69    #[serde(
70        rename = "apnUserName",
71        default,
72        skip_serializing_if = "Option::is_none"
73    )]
74    pub apn_user_name: Option<String>,
75    /// APN. APN. Password
76    /// APN Password.
77    #[serde(
78        rename = "apnPassword",
79        default,
80        skip_serializing_if = "Option::is_none"
81    )]
82    pub apn_password: Option<String>,
83    /// APN. SIMPIN. PIN_ Code
84    /// SIM card pin code.
85    #[serde(rename = "simPin", default, skip_serializing_if = "Option::is_none")]
86    pub sim_pin: Option<i64>,
87    /// APN. Preferred_ Network. Mobile_ Network_ ID
88    /// Preferred network, written as MCC and MNC concatenated. See note.
89    #[serde(
90        rename = "preferredNetwork",
91        default,
92        skip_serializing_if = "Option::is_none"
93    )]
94    pub preferred_network: Option<String>,
95    /// APN. Use_ Only_ Preferred_ Network. Indicator
96    /// Default: false. Use only the preferred Network, do
97    /// not dial in when not available. See Note.
98    #[serde(
99        rename = "useOnlyPreferredNetwork",
100        default,
101        skip_serializing_if = "Option::is_none"
102    )]
103    pub use_only_preferred_network: Option<bool>,
104    #[serde(rename = "apnAuthentication")]
105    pub apn_authentication: APNAuthenticationEnum,
106}
107
108impl Validate for APN {
109    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
110        if let Some(x) = &self.custom_data {
111            let p = path.field("customData");
112            x.validate(&p)?;
113        }
114        {
115            let x = &self.apn;
116            let p = path.field("apn");
117            v::max_length(x, 512, &p)?;
118        }
119        if let Some(x) = &self.apn_user_name {
120            let p = path.field("apnUserName");
121            v::max_length(x, 20, &p)?;
122        }
123        if let Some(x) = &self.apn_password {
124            let p = path.field("apnPassword");
125            v::max_length(x, 20, &p)?;
126        }
127        if let Some(x) = &self.preferred_network {
128            let p = path.field("preferredNetwork");
129            v::max_length(x, 6, &p)?;
130        }
131        Ok(())
132    }
133}
134
135/// Contains a case insensitive identifier to use for the authorization and the type of authorization to support multiple forms of identifiers.
136#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
137#[serde(deny_unknown_fields)]
138pub struct AdditionalInfo {
139    #[serde(
140        rename = "customData",
141        default,
142        skip_serializing_if = "Option::is_none"
143    )]
144    pub custom_data: Option<CustomData>,
145    /// This field specifies the additional IdToken.
146    #[serde(rename = "additionalIdToken")]
147    pub additional_id_token: String,
148    /// This defines the type of the additionalIdToken. This is a custom type, so the implementation needs to be agreed upon by all involved parties.
149    #[serde(rename = "type")]
150    pub r#type: String,
151}
152
153impl Validate for AdditionalInfo {
154    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
155        if let Some(x) = &self.custom_data {
156            let p = path.field("customData");
157            x.validate(&p)?;
158        }
159        {
160            let x = &self.additional_id_token;
161            let p = path.field("additionalIdToken");
162            v::max_length(x, 36, &p)?;
163        }
164        {
165            let x = &self.r#type;
166            let p = path.field("type");
167            v::max_length(x, 50, &p)?;
168        }
169        Ok(())
170    }
171}
172
173/// Contains the identifier to use for authorization.
174#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
175#[serde(deny_unknown_fields)]
176pub struct AuthorizationData {
177    #[serde(
178        rename = "customData",
179        default,
180        skip_serializing_if = "Option::is_none"
181    )]
182    pub custom_data: Option<CustomData>,
183    #[serde(rename = "idToken")]
184    pub id_token: IdToken,
185    #[serde(
186        rename = "idTokenInfo",
187        default,
188        skip_serializing_if = "Option::is_none"
189    )]
190    pub id_token_info: Option<IdTokenInfo>,
191}
192
193impl Validate for AuthorizationData {
194    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
195        if let Some(x) = &self.custom_data {
196            let p = path.field("customData");
197            x.validate(&p)?;
198        }
199        {
200            let x = &self.id_token;
201            let p = path.field("idToken");
202            x.validate(&p)?;
203        }
204        if let Some(x) = &self.id_token_info {
205            let p = path.field("idTokenInfo");
206            x.validate(&p)?;
207        }
208        Ok(())
209    }
210}
211
212#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
213#[serde(deny_unknown_fields)]
214pub struct CertificateHashData {
215    #[serde(
216        rename = "customData",
217        default,
218        skip_serializing_if = "Option::is_none"
219    )]
220    pub custom_data: Option<CustomData>,
221    #[serde(rename = "hashAlgorithm")]
222    pub hash_algorithm: HashAlgorithmEnum,
223    /// Hashed value of the Issuer DN (Distinguished Name).
224    #[serde(rename = "issuerNameHash")]
225    pub issuer_name_hash: String,
226    /// Hashed value of the issuers public key
227    #[serde(rename = "issuerKeyHash")]
228    pub issuer_key_hash: String,
229    /// The serial number of the certificate.
230    #[serde(rename = "serialNumber")]
231    pub serial_number: String,
232}
233
234impl Validate for CertificateHashData {
235    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
236        if let Some(x) = &self.custom_data {
237            let p = path.field("customData");
238            x.validate(&p)?;
239        }
240        {
241            let x = &self.issuer_name_hash;
242            let p = path.field("issuerNameHash");
243            v::max_length(x, 128, &p)?;
244        }
245        {
246            let x = &self.issuer_key_hash;
247            let p = path.field("issuerKeyHash");
248            v::max_length(x, 128, &p)?;
249        }
250        {
251            let x = &self.serial_number;
252            let p = path.field("serialNumber");
253            v::max_length(x, 40, &p)?;
254        }
255        Ok(())
256    }
257}
258
259#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
260#[serde(deny_unknown_fields)]
261pub struct CertificateHashDataChain {
262    #[serde(
263        rename = "customData",
264        default,
265        skip_serializing_if = "Option::is_none"
266    )]
267    pub custom_data: Option<CustomData>,
268    #[serde(rename = "certificateHashData")]
269    pub certificate_hash_data: CertificateHashData,
270    #[serde(rename = "certificateType")]
271    pub certificate_type: GetCertificateIdUseEnum,
272    #[serde(
273        rename = "childCertificateHashData",
274        default,
275        skip_serializing_if = "Option::is_none"
276    )]
277    pub child_certificate_hash_data: Option<Vec<CertificateHashData>>,
278}
279
280impl Validate for CertificateHashDataChain {
281    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
282        if let Some(x) = &self.custom_data {
283            let p = path.field("customData");
284            x.validate(&p)?;
285        }
286        {
287            let x = &self.certificate_hash_data;
288            let p = path.field("certificateHashData");
289            x.validate(&p)?;
290        }
291        if let Some(x) = &self.child_certificate_hash_data {
292            let p = path.field("childCertificateHashData");
293            v::items(x, Some(1), Some(4), &p)?;
294            for (i0, it0) in x.iter().enumerate() {
295                let p0 = p.index(i0);
296                it0.validate(&p0)?;
297            }
298        }
299        Ok(())
300    }
301}
302
303/// Charging_ Limit
304#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
305#[serde(deny_unknown_fields)]
306pub struct ChargingLimit {
307    #[serde(
308        rename = "customData",
309        default,
310        skip_serializing_if = "Option::is_none"
311    )]
312    pub custom_data: Option<CustomData>,
313    #[serde(rename = "chargingLimitSource")]
314    pub charging_limit_source: ChargingLimitSourceEnum,
315    /// Charging_ Limit. Is_ Grid_ Critical. Indicator
316    /// Indicates whether the charging limit is critical for the grid.
317    #[serde(
318        rename = "isGridCritical",
319        default,
320        skip_serializing_if = "Option::is_none"
321    )]
322    pub is_grid_critical: Option<bool>,
323}
324
325impl Validate for ChargingLimit {
326    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
327        if let Some(x) = &self.custom_data {
328            let p = path.field("customData");
329            x.validate(&p)?;
330        }
331        Ok(())
332    }
333}
334
335/// Charging_ Needs
336#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
337#[serde(deny_unknown_fields)]
338pub struct ChargingNeeds {
339    #[serde(
340        rename = "customData",
341        default,
342        skip_serializing_if = "Option::is_none"
343    )]
344    pub custom_data: Option<CustomData>,
345    #[serde(
346        rename = "acChargingParameters",
347        default,
348        skip_serializing_if = "Option::is_none"
349    )]
350    pub ac_charging_parameters: Option<ACChargingParameters>,
351    #[serde(
352        rename = "dcChargingParameters",
353        default,
354        skip_serializing_if = "Option::is_none"
355    )]
356    pub dc_charging_parameters: Option<DCChargingParameters>,
357    #[serde(rename = "requestedEnergyTransfer")]
358    pub requested_energy_transfer: EnergyTransferModeEnum,
359    /// Charging_ Needs. Departure_ Time. Date_ Time
360    /// Estimated departure time of the EV.
361    #[serde(
362        rename = "departureTime",
363        default,
364        skip_serializing_if = "Option::is_none"
365    )]
366    pub departure_time: Option<DateTime>,
367}
368
369impl Validate for ChargingNeeds {
370    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
371        if let Some(x) = &self.custom_data {
372            let p = path.field("customData");
373            x.validate(&p)?;
374        }
375        if let Some(x) = &self.ac_charging_parameters {
376            let p = path.field("acChargingParameters");
377            x.validate(&p)?;
378        }
379        if let Some(x) = &self.dc_charging_parameters {
380            let p = path.field("dcChargingParameters");
381            x.validate(&p)?;
382        }
383        Ok(())
384    }
385}
386
387/// Charging_ Profile
388/// A ChargingProfile consists of ChargingSchedule, describing the amount of power or current that can be delivered per time interval.
389#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
390#[serde(deny_unknown_fields)]
391pub struct ChargingProfile {
392    #[serde(
393        rename = "customData",
394        default,
395        skip_serializing_if = "Option::is_none"
396    )]
397    pub custom_data: Option<CustomData>,
398    /// Identified_ Object. MRID. Numeric_ Identifier
399    /// Id of ChargingProfile.
400    #[serde(rename = "id")]
401    pub id: i64,
402    /// Charging_ Profile. Stack_ Level. Counter
403    /// Value determining level in hierarchy stack of profiles. Higher values have precedence over lower values. Lowest level is 0.
404    #[serde(rename = "stackLevel")]
405    pub stack_level: i64,
406    #[serde(rename = "chargingProfilePurpose")]
407    pub charging_profile_purpose: ChargingProfilePurposeEnum,
408    #[serde(rename = "chargingProfileKind")]
409    pub charging_profile_kind: ChargingProfileKindEnum,
410    #[serde(
411        rename = "recurrencyKind",
412        default,
413        skip_serializing_if = "Option::is_none"
414    )]
415    pub recurrency_kind: Option<RecurrencyKindEnum>,
416    /// Charging_ Profile. Valid_ From. Date_ Time
417    /// Point in time at which the profile starts to be valid. If absent, the profile is valid as soon as it is received by the Charging Station.
418    #[serde(rename = "validFrom", default, skip_serializing_if = "Option::is_none")]
419    pub valid_from: Option<DateTime>,
420    /// Charging_ Profile. Valid_ To. Date_ Time
421    /// Point in time at which the profile stops to be valid. If absent, the profile is valid until it is replaced by another profile.
422    #[serde(rename = "validTo", default, skip_serializing_if = "Option::is_none")]
423    pub valid_to: Option<DateTime>,
424    #[serde(rename = "chargingSchedule")]
425    pub charging_schedule: Vec<ChargingSchedule>,
426    /// SHALL only be included if ChargingProfilePurpose is set to TxProfile. The transactionId is used to match the profile to a specific transaction.
427    #[serde(
428        rename = "transactionId",
429        default,
430        skip_serializing_if = "Option::is_none"
431    )]
432    pub transaction_id: Option<String>,
433}
434
435impl Validate for ChargingProfile {
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        {
442            let x = &self.charging_schedule;
443            let p = path.field("chargingSchedule");
444            v::items(x, Some(1), Some(3), &p)?;
445            for (i0, it0) in x.iter().enumerate() {
446                let p0 = p.index(i0);
447                it0.validate(&p0)?;
448            }
449        }
450        if let Some(x) = &self.transaction_id {
451            let p = path.field("transactionId");
452            v::max_length(x, 36, &p)?;
453        }
454        Ok(())
455    }
456}
457
458/// Charging_ Profile
459/// A ChargingProfile consists of ChargingSchedule, describing the amount of power or current that can be delivered per time interval.
460#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
461#[serde(deny_unknown_fields)]
462pub struct ChargingProfileCriterion {
463    #[serde(
464        rename = "customData",
465        default,
466        skip_serializing_if = "Option::is_none"
467    )]
468    pub custom_data: Option<CustomData>,
469    #[serde(
470        rename = "chargingProfilePurpose",
471        default,
472        skip_serializing_if = "Option::is_none"
473    )]
474    pub charging_profile_purpose: Option<ChargingProfilePurposeEnum>,
475    /// Charging_ Profile. Stack_ Level. Counter
476    /// Value determining level in hierarchy stack of profiles. Higher values have precedence over lower values. Lowest level is 0.
477    #[serde(
478        rename = "stackLevel",
479        default,
480        skip_serializing_if = "Option::is_none"
481    )]
482    pub stack_level: Option<i64>,
483    /// List of all the chargingProfileIds requested. Any ChargingProfile that matches one of these profiles will be reported. If omitted, the Charging Station SHALL not filter on chargingProfileId. This field SHALL NOT contain more ids than set in &lt;&lt;configkey-charging-profile-entries,ChargingProfileEntries.maxLimit&gt;&gt;
484    #[serde(
485        rename = "chargingProfileId",
486        default,
487        skip_serializing_if = "Option::is_none"
488    )]
489    pub charging_profile_id: Option<Vec<i64>>,
490    /// For which charging limit sources, charging profiles SHALL be reported. If omitted, the Charging Station SHALL not filter on chargingLimitSource.
491    #[serde(
492        rename = "chargingLimitSource",
493        default,
494        skip_serializing_if = "Option::is_none"
495    )]
496    pub charging_limit_source: Option<Vec<ChargingLimitSourceEnum>>,
497}
498
499impl Validate for ChargingProfileCriterion {
500    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
501        if let Some(x) = &self.custom_data {
502            let p = path.field("customData");
503            x.validate(&p)?;
504        }
505        if let Some(x) = &self.charging_profile_id {
506            let p = path.field("chargingProfileId");
507            v::items(x, Some(1), None, &p)?;
508        }
509        if let Some(x) = &self.charging_limit_source {
510            let p = path.field("chargingLimitSource");
511            v::items(x, Some(1), Some(4), &p)?;
512        }
513        Ok(())
514    }
515}
516
517/// Charging_ Schedule
518/// Charging schedule structure defines a list of charging periods, as used in: GetCompositeSchedule.conf and ChargingProfile.
519#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
520#[serde(deny_unknown_fields)]
521pub struct ChargingSchedule {
522    #[serde(
523        rename = "customData",
524        default,
525        skip_serializing_if = "Option::is_none"
526    )]
527    pub custom_data: Option<CustomData>,
528    /// Identifies the ChargingSchedule.
529    #[serde(rename = "id")]
530    pub id: i64,
531    /// Charging_ Schedule. Start_ Schedule. Date_ Time
532    /// Starting point of an absolute schedule. If absent the schedule will be relative to start of charging.
533    #[serde(
534        rename = "startSchedule",
535        default,
536        skip_serializing_if = "Option::is_none"
537    )]
538    pub start_schedule: Option<DateTime>,
539    /// Charging_ Schedule. Duration. Elapsed_ Time
540    /// Duration of the charging schedule in seconds. If the duration is left empty, the last period will continue indefinitely or until end of the transaction if chargingProfilePurpose = TxProfile.
541    #[serde(rename = "duration", default, skip_serializing_if = "Option::is_none")]
542    pub duration: Option<i64>,
543    #[serde(rename = "chargingRateUnit")]
544    pub charging_rate_unit: ChargingRateUnitEnum,
545    #[serde(rename = "chargingSchedulePeriod")]
546    pub charging_schedule_period: Vec<ChargingSchedulePeriod>,
547    /// Charging_ Schedule. Min_ Charging_ Rate. Numeric
548    /// Minimum charging rate supported by the EV. The unit of measure is defined by the chargingRateUnit. This parameter is intended to be used by a local smart charging algorithm to optimize the power allocation for in the case a charging process is inefficient at lower charging rates. Accepts at most one digit fraction (e.g. 8.1)
549    #[serde(
550        rename = "minChargingRate",
551        default,
552        skip_serializing_if = "Option::is_none"
553    )]
554    pub min_charging_rate: Option<f64>,
555    #[serde(
556        rename = "salesTariff",
557        default,
558        skip_serializing_if = "Option::is_none"
559    )]
560    pub sales_tariff: Option<SalesTariff>,
561}
562
563impl Validate for ChargingSchedule {
564    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
565        if let Some(x) = &self.custom_data {
566            let p = path.field("customData");
567            x.validate(&p)?;
568        }
569        {
570            let x = &self.charging_schedule_period;
571            let p = path.field("chargingSchedulePeriod");
572            v::items(x, Some(1), Some(1024), &p)?;
573            for (i0, it0) in x.iter().enumerate() {
574                let p0 = p.index(i0);
575                it0.validate(&p0)?;
576            }
577        }
578        if let Some(x) = &self.sales_tariff {
579            let p = path.field("salesTariff");
580            x.validate(&p)?;
581        }
582        Ok(())
583    }
584}
585
586/// Charging_ Schedule_ Period
587/// Charging schedule period structure defines a time period in a charging schedule.
588#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
589#[serde(deny_unknown_fields)]
590pub struct ChargingSchedulePeriod {
591    #[serde(
592        rename = "customData",
593        default,
594        skip_serializing_if = "Option::is_none"
595    )]
596    pub custom_data: Option<CustomData>,
597    /// Charging_ Schedule_ Period. Start_ Period. Elapsed_ Time
598    /// Start of the period, in seconds from the start of schedule. The value of StartPeriod also defines the stop time of the previous period.
599    #[serde(rename = "startPeriod")]
600    pub start_period: i64,
601    /// Charging_ Schedule_ Period. Limit. Measure
602    /// Charging rate limit during the schedule period, in the applicable chargingRateUnit, for example in Amperes (A) or Watts (W). Accepts at most one digit fraction (e.g. 8.1).
603    #[serde(rename = "limit")]
604    pub limit: f64,
605    /// Charging_ Schedule_ Period. Number_ Phases. Counter
606    /// The number of phases that can be used for charging. If a number of phases is needed, numberPhases=3 will be assumed unless another number is given.
607    #[serde(
608        rename = "numberPhases",
609        default,
610        skip_serializing_if = "Option::is_none"
611    )]
612    pub number_phases: Option<i64>,
613    /// Values: 1..3, Used if numberPhases=1 and if the EVSE is capable of switching the phase connected to the EV, i.e. ACPhaseSwitchingSupported is defined and true. It’s not allowed unless both conditions above are true. If both conditions are true, and phaseToUse is omitted, the Charging Station / EVSE will make the selection on its own.
614    #[serde(
615        rename = "phaseToUse",
616        default,
617        skip_serializing_if = "Option::is_none"
618    )]
619    pub phase_to_use: Option<i64>,
620}
621
622impl Validate for ChargingSchedulePeriod {
623    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
624        if let Some(x) = &self.custom_data {
625            let p = path.field("customData");
626            x.validate(&p)?;
627        }
628        Ok(())
629    }
630}
631
632/// Charge_ Point
633/// The physical system where an Electrical Vehicle (EV) can be charged.
634#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
635#[serde(deny_unknown_fields)]
636pub struct ChargingStation {
637    #[serde(
638        rename = "customData",
639        default,
640        skip_serializing_if = "Option::is_none"
641    )]
642    pub custom_data: Option<CustomData>,
643    /// Device. Serial_ Number. Serial_ Number
644    /// Vendor-specific device identifier.
645    #[serde(
646        rename = "serialNumber",
647        default,
648        skip_serializing_if = "Option::is_none"
649    )]
650    pub serial_number: Option<String>,
651    /// Device. Model. CI20_ Text
652    /// Defines the model of the device.
653    #[serde(rename = "model")]
654    pub model: String,
655    #[serde(rename = "modem", default, skip_serializing_if = "Option::is_none")]
656    pub modem: Option<Modem>,
657    /// Identifies the vendor (not necessarily in a unique manner).
658    #[serde(rename = "vendorName")]
659    pub vendor_name: String,
660    /// This contains the firmware version of the Charging Station.
661    #[serde(
662        rename = "firmwareVersion",
663        default,
664        skip_serializing_if = "Option::is_none"
665    )]
666    pub firmware_version: Option<String>,
667}
668
669impl Validate for ChargingStation {
670    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
671        if let Some(x) = &self.custom_data {
672            let p = path.field("customData");
673            x.validate(&p)?;
674        }
675        if let Some(x) = &self.serial_number {
676            let p = path.field("serialNumber");
677            v::max_length(x, 25, &p)?;
678        }
679        {
680            let x = &self.model;
681            let p = path.field("model");
682            v::max_length(x, 20, &p)?;
683        }
684        if let Some(x) = &self.modem {
685            let p = path.field("modem");
686            x.validate(&p)?;
687        }
688        {
689            let x = &self.vendor_name;
690            let p = path.field("vendorName");
691            v::max_length(x, 50, &p)?;
692        }
693        if let Some(x) = &self.firmware_version {
694            let p = path.field("firmwareVersion");
695            v::max_length(x, 50, &p)?;
696        }
697        Ok(())
698    }
699}
700
701/// Charging_ Profile
702/// A ChargingProfile consists of a ChargingSchedule, describing the amount of power or current that can be delivered per time interval.
703#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
704#[serde(deny_unknown_fields)]
705pub struct ClearChargingProfile {
706    #[serde(
707        rename = "customData",
708        default,
709        skip_serializing_if = "Option::is_none"
710    )]
711    pub custom_data: Option<CustomData>,
712    /// Identified_ Object. MRID. Numeric_ Identifier
713    /// Specifies the id of the EVSE for which to clear charging profiles. An evseId of zero (0) specifies the charging profile for the overall Charging Station. Absence of this parameter means the clearing applies to all charging profiles that match the other criteria in the request.
714    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
715    pub evse_id: Option<i64>,
716    #[serde(
717        rename = "chargingProfilePurpose",
718        default,
719        skip_serializing_if = "Option::is_none"
720    )]
721    pub charging_profile_purpose: Option<ChargingProfilePurposeEnum>,
722    /// Charging_ Profile. Stack_ Level. Counter
723    /// Specifies the stackLevel for which charging profiles will be cleared, if they meet the other criteria in the request.
724    #[serde(
725        rename = "stackLevel",
726        default,
727        skip_serializing_if = "Option::is_none"
728    )]
729    pub stack_level: Option<i64>,
730}
731
732impl Validate for ClearChargingProfile {
733    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
734        if let Some(x) = &self.custom_data {
735            let p = path.field("customData");
736            x.validate(&p)?;
737        }
738        Ok(())
739    }
740}
741
742#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
743#[serde(deny_unknown_fields)]
744pub struct ClearMonitoringResult {
745    #[serde(
746        rename = "customData",
747        default,
748        skip_serializing_if = "Option::is_none"
749    )]
750    pub custom_data: Option<CustomData>,
751    #[serde(rename = "status")]
752    pub status: ClearMonitoringStatusEnum,
753    /// Id of the monitor of which a clear was requested.
754    #[serde(rename = "id")]
755    pub id: i64,
756    #[serde(
757        rename = "statusInfo",
758        default,
759        skip_serializing_if = "Option::is_none"
760    )]
761    pub status_info: Option<StatusInfo>,
762}
763
764impl Validate for ClearMonitoringResult {
765    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
766        if let Some(x) = &self.custom_data {
767            let p = path.field("customData");
768            x.validate(&p)?;
769        }
770        if let Some(x) = &self.status_info {
771            let p = path.field("statusInfo");
772            x.validate(&p)?;
773        }
774        Ok(())
775    }
776}
777
778/// A physical or logical component
779#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
780#[serde(deny_unknown_fields)]
781pub struct Component {
782    #[serde(
783        rename = "customData",
784        default,
785        skip_serializing_if = "Option::is_none"
786    )]
787    pub custom_data: Option<CustomData>,
788    #[serde(rename = "evse", default, skip_serializing_if = "Option::is_none")]
789    pub evse: Option<EVSE>,
790    /// Name of the component. Name should be taken from the list of standardized component names whenever possible. Case Insensitive. strongly advised to use Camel Case.
791    #[serde(rename = "name")]
792    pub name: String,
793    /// Name of instance in case the component exists as multiple instances. Case Insensitive. strongly advised to use Camel Case.
794    #[serde(rename = "instance", default, skip_serializing_if = "Option::is_none")]
795    pub instance: Option<String>,
796}
797
798impl Validate for Component {
799    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
800        if let Some(x) = &self.custom_data {
801            let p = path.field("customData");
802            x.validate(&p)?;
803        }
804        if let Some(x) = &self.evse {
805            let p = path.field("evse");
806            x.validate(&p)?;
807        }
808        {
809            let x = &self.name;
810            let p = path.field("name");
811            v::max_length(x, 50, &p)?;
812        }
813        if let Some(x) = &self.instance {
814            let p = path.field("instance");
815            v::max_length(x, 50, &p)?;
816        }
817        Ok(())
818    }
819}
820
821/// Class to report components, variables and variable attributes and characteristics.
822#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
823#[serde(deny_unknown_fields)]
824pub struct ComponentVariable {
825    #[serde(
826        rename = "customData",
827        default,
828        skip_serializing_if = "Option::is_none"
829    )]
830    pub custom_data: Option<CustomData>,
831    #[serde(rename = "component")]
832    pub component: Component,
833    #[serde(rename = "variable", default, skip_serializing_if = "Option::is_none")]
834    pub variable: Option<Variable>,
835}
836
837impl Validate for ComponentVariable {
838    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
839        if let Some(x) = &self.custom_data {
840            let p = path.field("customData");
841            x.validate(&p)?;
842        }
843        {
844            let x = &self.component;
845            let p = path.field("component");
846            x.validate(&p)?;
847        }
848        if let Some(x) = &self.variable {
849            let p = path.field("variable");
850            x.validate(&p)?;
851        }
852        Ok(())
853    }
854}
855
856/// Composite_ Schedule
857#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
858#[serde(deny_unknown_fields)]
859pub struct CompositeSchedule {
860    #[serde(
861        rename = "customData",
862        default,
863        skip_serializing_if = "Option::is_none"
864    )]
865    pub custom_data: Option<CustomData>,
866    #[serde(rename = "chargingSchedulePeriod")]
867    pub charging_schedule_period: Vec<ChargingSchedulePeriod>,
868    /// The ID of the EVSE for which the
869    /// schedule is requested. When evseid=0, the
870    /// Charging Station calculated the expected
871    /// consumption for the grid connection.
872    #[serde(rename = "evseId")]
873    pub evse_id: i64,
874    /// Duration of the schedule in seconds.
875    #[serde(rename = "duration")]
876    pub duration: i64,
877    /// Composite_ Schedule. Start. Date_ Time
878    /// Date and time at which the schedule becomes active. All time measurements within the schedule are relative to this timestamp.
879    #[serde(rename = "scheduleStart")]
880    pub schedule_start: DateTime,
881    #[serde(rename = "chargingRateUnit")]
882    pub charging_rate_unit: ChargingRateUnitEnum,
883}
884
885impl Validate for CompositeSchedule {
886    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
887        if let Some(x) = &self.custom_data {
888            let p = path.field("customData");
889            x.validate(&p)?;
890        }
891        {
892            let x = &self.charging_schedule_period;
893            let p = path.field("chargingSchedulePeriod");
894            v::items(x, Some(1), None, &p)?;
895            for (i0, it0) in x.iter().enumerate() {
896                let p0 = p.index(i0);
897                it0.validate(&p0)?;
898            }
899        }
900        Ok(())
901    }
902}
903
904/// Consumption_ Cost
905#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
906#[serde(deny_unknown_fields)]
907pub struct ConsumptionCost {
908    #[serde(
909        rename = "customData",
910        default,
911        skip_serializing_if = "Option::is_none"
912    )]
913    pub custom_data: Option<CustomData>,
914    /// Consumption_ Cost. Start_ Value. Numeric
915    /// The lowest level of consumption that defines the starting point of this consumption block. The block interval extends to the start of the next interval.
916    #[serde(rename = "startValue")]
917    pub start_value: f64,
918    #[serde(rename = "cost")]
919    pub cost: Vec<Cost>,
920}
921
922impl Validate for ConsumptionCost {
923    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
924        if let Some(x) = &self.custom_data {
925            let p = path.field("customData");
926            x.validate(&p)?;
927        }
928        {
929            let x = &self.cost;
930            let p = path.field("cost");
931            v::items(x, Some(1), Some(3), &p)?;
932            for (i0, it0) in x.iter().enumerate() {
933                let p0 = p.index(i0);
934                it0.validate(&p0)?;
935            }
936        }
937        Ok(())
938    }
939}
940
941/// Cost
942#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
943#[serde(deny_unknown_fields)]
944pub struct Cost {
945    #[serde(
946        rename = "customData",
947        default,
948        skip_serializing_if = "Option::is_none"
949    )]
950    pub custom_data: Option<CustomData>,
951    #[serde(rename = "costKind")]
952    pub cost_kind: CostKindEnum,
953    /// Cost. Amount. Amount
954    /// The estimated or actual cost per kWh
955    #[serde(rename = "amount")]
956    pub amount: i64,
957    /// Cost. Amount_ Multiplier. Integer
958    /// Values: -3..3, The amountMultiplier defines the exponent to base 10 (dec). The final value is determined by: amount * 10 ^ amountMultiplier
959    #[serde(
960        rename = "amountMultiplier",
961        default,
962        skip_serializing_if = "Option::is_none"
963    )]
964    pub amount_multiplier: Option<i64>,
965}
966
967impl Validate for Cost {
968    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
969        if let Some(x) = &self.custom_data {
970            let p = path.field("customData");
971            x.validate(&p)?;
972        }
973        Ok(())
974    }
975}
976
977/// This class does not get 'AdditionalProperties = false' in the schema generation, so it can be extended with arbitrary JSON properties to allow adding custom data.
978#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
979pub struct CustomData {
980    #[serde(rename = "vendorId")]
981    pub vendor_id: String,
982    /// Vendor-specific properties.
983    #[serde(flatten)]
984    pub extra: serde_json::Map<String, serde_json::Value>,
985}
986
987impl Validate for CustomData {
988    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
989        {
990            let x = &self.vendor_id;
991            let p = path.field("vendorId");
992            v::max_length(x, 255, &p)?;
993        }
994        Ok(())
995    }
996}
997
998/// DC_ Charging_ Parameters
999/// EV DC charging parameters
1000#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1001#[serde(deny_unknown_fields)]
1002pub struct DCChargingParameters {
1003    #[serde(
1004        rename = "customData",
1005        default,
1006        skip_serializing_if = "Option::is_none"
1007    )]
1008    pub custom_data: Option<CustomData>,
1009    /// DC_ Charging_ Parameters. EV_ Max. Current
1010    /// Maximum current (amps) supported by the electric vehicle. Includes cable capacity.
1011    #[serde(rename = "evMaxCurrent")]
1012    pub ev_max_current: i64,
1013    /// DC_ Charging_ Parameters. EV_ Max. Voltage
1014    /// Maximum voltage supported by the electric vehicle
1015    #[serde(rename = "evMaxVoltage")]
1016    pub ev_max_voltage: i64,
1017    /// DC_ Charging_ Parameters. Energy_ Amount. Energy_ Amount
1018    /// Amount of energy requested (in Wh). This inludes energy required for preconditioning.
1019    #[serde(
1020        rename = "energyAmount",
1021        default,
1022        skip_serializing_if = "Option::is_none"
1023    )]
1024    pub energy_amount: Option<i64>,
1025    /// DC_ Charging_ Parameters. EV_ Max. Power
1026    /// Maximum power (in W) supported by the electric vehicle. Required for DC charging.
1027    #[serde(
1028        rename = "evMaxPower",
1029        default,
1030        skip_serializing_if = "Option::is_none"
1031    )]
1032    pub ev_max_power: Option<i64>,
1033    /// DC_ Charging_ Parameters. State_ Of_ Charge. Numeric
1034    /// Energy available in the battery (in percent of the battery capacity)
1035    #[serde(
1036        rename = "stateOfCharge",
1037        default,
1038        skip_serializing_if = "Option::is_none"
1039    )]
1040    pub state_of_charge: Option<i64>,
1041    /// DC_ Charging_ Parameters. EV_ Energy_ Capacity. Numeric
1042    /// Capacity of the electric vehicle battery (in Wh)
1043    #[serde(
1044        rename = "evEnergyCapacity",
1045        default,
1046        skip_serializing_if = "Option::is_none"
1047    )]
1048    pub ev_energy_capacity: Option<i64>,
1049    /// DC_ Charging_ Parameters. Full_ SOC. Percentage
1050    /// Percentage of SoC at which the EV considers the battery fully charged. (possible values: 0 - 100)
1051    #[serde(rename = "fullSoC", default, skip_serializing_if = "Option::is_none")]
1052    pub full_so_c: Option<i64>,
1053    /// DC_ Charging_ Parameters. Bulk_ SOC. Percentage
1054    /// Percentage of SoC at which the EV considers a fast charging process to end. (possible values: 0 - 100)
1055    #[serde(rename = "bulkSoC", default, skip_serializing_if = "Option::is_none")]
1056    pub bulk_so_c: Option<i64>,
1057}
1058
1059impl Validate for DCChargingParameters {
1060    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1061        if let Some(x) = &self.custom_data {
1062            let p = path.field("customData");
1063            x.validate(&p)?;
1064        }
1065        if let Some(x) = &self.state_of_charge {
1066            let p = path.field("stateOfCharge");
1067            v::minimum(*x, 0i64, &p)?;
1068            v::maximum(*x, 100i64, &p)?;
1069        }
1070        if let Some(x) = &self.full_so_c {
1071            let p = path.field("fullSoC");
1072            v::minimum(*x, 0i64, &p)?;
1073            v::maximum(*x, 100i64, &p)?;
1074        }
1075        if let Some(x) = &self.bulk_so_c {
1076            let p = path.field("bulkSoC");
1077            v::minimum(*x, 0i64, &p)?;
1078            v::maximum(*x, 100i64, &p)?;
1079        }
1080        Ok(())
1081    }
1082}
1083
1084/// EVSE
1085/// Electric Vehicle Supply Equipment
1086#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1087#[serde(deny_unknown_fields)]
1088pub struct EVSE {
1089    #[serde(
1090        rename = "customData",
1091        default,
1092        skip_serializing_if = "Option::is_none"
1093    )]
1094    pub custom_data: Option<CustomData>,
1095    /// Identified_ Object. MRID. Numeric_ Identifier
1096    /// EVSE Identifier. This contains a number (&gt; 0) designating an EVSE of the Charging Station.
1097    #[serde(rename = "id")]
1098    pub id: i64,
1099    /// An id to designate a specific connector (on an EVSE) by connector index number.
1100    #[serde(
1101        rename = "connectorId",
1102        default,
1103        skip_serializing_if = "Option::is_none"
1104    )]
1105    pub connector_id: Option<i64>,
1106}
1107
1108impl Validate for EVSE {
1109    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1110        if let Some(x) = &self.custom_data {
1111            let p = path.field("customData");
1112            x.validate(&p)?;
1113        }
1114        Ok(())
1115    }
1116}
1117
1118/// Class to report an event notification for a component-variable.
1119#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1120#[serde(deny_unknown_fields)]
1121pub struct EventData {
1122    #[serde(
1123        rename = "customData",
1124        default,
1125        skip_serializing_if = "Option::is_none"
1126    )]
1127    pub custom_data: Option<CustomData>,
1128    /// Identifies the event. This field can be referred to as a cause by other events.
1129    #[serde(rename = "eventId")]
1130    pub event_id: i64,
1131    /// Timestamp of the moment the report was generated.
1132    #[serde(rename = "timestamp")]
1133    pub timestamp: DateTime,
1134    #[serde(rename = "trigger")]
1135    pub trigger: EventTriggerEnum,
1136    /// Refers to the Id of an event that is considered to be the cause for this event.
1137    #[serde(rename = "cause", default, skip_serializing_if = "Option::is_none")]
1138    pub cause: Option<i64>,
1139    /// Actual value (_attributeType_ Actual) of the variable.
1140    /// The Configuration Variable &lt;&lt;configkey-reporting-value-size,ReportingValueSize&gt;&gt; can be used to limit GetVariableResult.attributeValue, VariableAttribute.value and EventData.actualValue. The max size of these values will always remain equal.
1141    #[serde(rename = "actualValue")]
1142    pub actual_value: String,
1143    /// Technical (error) code as reported by component.
1144    #[serde(rename = "techCode", default, skip_serializing_if = "Option::is_none")]
1145    pub tech_code: Option<String>,
1146    /// Technical detail information as reported by component.
1147    #[serde(rename = "techInfo", default, skip_serializing_if = "Option::is_none")]
1148    pub tech_info: Option<String>,
1149    /// _Cleared_ is set to true to report the clearing of a monitored situation, i.e. a 'return to normal'.
1150    #[serde(rename = "cleared", default, skip_serializing_if = "Option::is_none")]
1151    pub cleared: Option<bool>,
1152    /// If an event notification is linked to a specific transaction, this field can be used to specify its transactionId.
1153    #[serde(
1154        rename = "transactionId",
1155        default,
1156        skip_serializing_if = "Option::is_none"
1157    )]
1158    pub transaction_id: Option<String>,
1159    #[serde(rename = "component")]
1160    pub component: Component,
1161    /// Identifies the VariableMonitoring which triggered the event.
1162    #[serde(
1163        rename = "variableMonitoringId",
1164        default,
1165        skip_serializing_if = "Option::is_none"
1166    )]
1167    pub variable_monitoring_id: Option<i64>,
1168    #[serde(rename = "eventNotificationType")]
1169    pub event_notification_type: EventNotificationEnum,
1170    #[serde(rename = "variable")]
1171    pub variable: Variable,
1172}
1173
1174impl Validate for EventData {
1175    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1176        if let Some(x) = &self.custom_data {
1177            let p = path.field("customData");
1178            x.validate(&p)?;
1179        }
1180        {
1181            let x = &self.actual_value;
1182            let p = path.field("actualValue");
1183            v::max_length(x, 2500, &p)?;
1184        }
1185        if let Some(x) = &self.tech_code {
1186            let p = path.field("techCode");
1187            v::max_length(x, 50, &p)?;
1188        }
1189        if let Some(x) = &self.tech_info {
1190            let p = path.field("techInfo");
1191            v::max_length(x, 500, &p)?;
1192        }
1193        if let Some(x) = &self.transaction_id {
1194            let p = path.field("transactionId");
1195            v::max_length(x, 36, &p)?;
1196        }
1197        {
1198            let x = &self.component;
1199            let p = path.field("component");
1200            x.validate(&p)?;
1201        }
1202        {
1203            let x = &self.variable;
1204            let p = path.field("variable");
1205            x.validate(&p)?;
1206        }
1207        Ok(())
1208    }
1209}
1210
1211/// Firmware
1212/// Represents a copy of the firmware that can be loaded/updated on the Charging Station.
1213#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1214#[serde(deny_unknown_fields)]
1215pub struct Firmware {
1216    #[serde(
1217        rename = "customData",
1218        default,
1219        skip_serializing_if = "Option::is_none"
1220    )]
1221    pub custom_data: Option<CustomData>,
1222    /// Firmware. Location. URI
1223    /// URI defining the origin of the firmware.
1224    #[serde(rename = "location")]
1225    pub location: String,
1226    /// Firmware. Retrieve. Date_ Time
1227    /// Date and time at which the firmware shall be retrieved.
1228    #[serde(rename = "retrieveDateTime")]
1229    pub retrieve_date_time: DateTime,
1230    /// Firmware. Install. Date_ Time
1231    /// Date and time at which the firmware shall be installed.
1232    #[serde(
1233        rename = "installDateTime",
1234        default,
1235        skip_serializing_if = "Option::is_none"
1236    )]
1237    pub install_date_time: Option<DateTime>,
1238    /// Certificate with which the firmware was signed.
1239    /// PEM encoded X.509 certificate.
1240    #[serde(
1241        rename = "signingCertificate",
1242        default,
1243        skip_serializing_if = "Option::is_none"
1244    )]
1245    pub signing_certificate: Option<String>,
1246    /// Firmware. Signature. Signature
1247    /// Base64 encoded firmware signature.
1248    #[serde(rename = "signature", default, skip_serializing_if = "Option::is_none")]
1249    pub signature: Option<String>,
1250}
1251
1252impl Validate for Firmware {
1253    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1254        if let Some(x) = &self.custom_data {
1255            let p = path.field("customData");
1256            x.validate(&p)?;
1257        }
1258        {
1259            let x = &self.location;
1260            let p = path.field("location");
1261            v::max_length(x, 512, &p)?;
1262        }
1263        if let Some(x) = &self.signing_certificate {
1264            let p = path.field("signingCertificate");
1265            v::max_length(x, 5500, &p)?;
1266        }
1267        if let Some(x) = &self.signature {
1268            let p = path.field("signature");
1269            v::max_length(x, 800, &p)?;
1270        }
1271        Ok(())
1272    }
1273}
1274
1275/// Class to hold parameters for GetVariables request.
1276#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1277#[serde(deny_unknown_fields)]
1278pub struct GetVariableData {
1279    #[serde(
1280        rename = "customData",
1281        default,
1282        skip_serializing_if = "Option::is_none"
1283    )]
1284    pub custom_data: Option<CustomData>,
1285    #[serde(
1286        rename = "attributeType",
1287        default,
1288        skip_serializing_if = "Option::is_none"
1289    )]
1290    pub attribute_type: Option<AttributeEnum>,
1291    #[serde(rename = "component")]
1292    pub component: Component,
1293    #[serde(rename = "variable")]
1294    pub variable: Variable,
1295}
1296
1297impl Validate for GetVariableData {
1298    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1299        if let Some(x) = &self.custom_data {
1300            let p = path.field("customData");
1301            x.validate(&p)?;
1302        }
1303        {
1304            let x = &self.component;
1305            let p = path.field("component");
1306            x.validate(&p)?;
1307        }
1308        {
1309            let x = &self.variable;
1310            let p = path.field("variable");
1311            x.validate(&p)?;
1312        }
1313        Ok(())
1314    }
1315}
1316
1317/// Class to hold results of GetVariables request.
1318#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1319#[serde(deny_unknown_fields)]
1320pub struct GetVariableResult {
1321    #[serde(
1322        rename = "customData",
1323        default,
1324        skip_serializing_if = "Option::is_none"
1325    )]
1326    pub custom_data: Option<CustomData>,
1327    #[serde(
1328        rename = "attributeStatusInfo",
1329        default,
1330        skip_serializing_if = "Option::is_none"
1331    )]
1332    pub attribute_status_info: Option<StatusInfo>,
1333    #[serde(rename = "attributeStatus")]
1334    pub attribute_status: GetVariableStatusEnum,
1335    #[serde(
1336        rename = "attributeType",
1337        default,
1338        skip_serializing_if = "Option::is_none"
1339    )]
1340    pub attribute_type: Option<AttributeEnum>,
1341    /// Value of requested attribute type of component-variable. This field can only be empty when the given status is NOT accepted.
1342    /// The Configuration Variable &lt;&lt;configkey-reporting-value-size,ReportingValueSize&gt;&gt; can be used to limit GetVariableResult.attributeValue, VariableAttribute.value and EventData.actualValue. The max size of these values will always remain equal.
1343    #[serde(
1344        rename = "attributeValue",
1345        default,
1346        skip_serializing_if = "Option::is_none"
1347    )]
1348    pub attribute_value: Option<String>,
1349    #[serde(rename = "component")]
1350    pub component: Component,
1351    #[serde(rename = "variable")]
1352    pub variable: Variable,
1353}
1354
1355impl Validate for GetVariableResult {
1356    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1357        if let Some(x) = &self.custom_data {
1358            let p = path.field("customData");
1359            x.validate(&p)?;
1360        }
1361        if let Some(x) = &self.attribute_status_info {
1362            let p = path.field("attributeStatusInfo");
1363            x.validate(&p)?;
1364        }
1365        if let Some(x) = &self.attribute_value {
1366            let p = path.field("attributeValue");
1367            v::max_length(x, 2500, &p)?;
1368        }
1369        {
1370            let x = &self.component;
1371            let p = path.field("component");
1372            x.validate(&p)?;
1373        }
1374        {
1375            let x = &self.variable;
1376            let p = path.field("variable");
1377            x.validate(&p)?;
1378        }
1379        Ok(())
1380    }
1381}
1382
1383/// Contains a case insensitive identifier to use for the authorization and the type of authorization to support multiple forms of identifiers.
1384#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1385#[serde(deny_unknown_fields)]
1386pub struct IdToken {
1387    #[serde(
1388        rename = "customData",
1389        default,
1390        skip_serializing_if = "Option::is_none"
1391    )]
1392    pub custom_data: Option<CustomData>,
1393    #[serde(
1394        rename = "additionalInfo",
1395        default,
1396        skip_serializing_if = "Option::is_none"
1397    )]
1398    pub additional_info: Option<Vec<AdditionalInfo>>,
1399    /// IdToken is case insensitive. Might hold the hidden id of an RFID tag, but can for example also contain a UUID.
1400    #[serde(rename = "idToken")]
1401    pub id_token: String,
1402    #[serde(rename = "type")]
1403    pub r#type: IdTokenEnum,
1404}
1405
1406impl Validate for IdToken {
1407    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1408        if let Some(x) = &self.custom_data {
1409            let p = path.field("customData");
1410            x.validate(&p)?;
1411        }
1412        if let Some(x) = &self.additional_info {
1413            let p = path.field("additionalInfo");
1414            v::items(x, Some(1), None, &p)?;
1415            for (i0, it0) in x.iter().enumerate() {
1416                let p0 = p.index(i0);
1417                it0.validate(&p0)?;
1418            }
1419        }
1420        {
1421            let x = &self.id_token;
1422            let p = path.field("idToken");
1423            v::max_length(x, 36, &p)?;
1424        }
1425        Ok(())
1426    }
1427}
1428
1429/// ID_ Token
1430/// Contains status information about an identifier.
1431/// It is advised to not stop charging for a token that expires during charging, as ExpiryDate is only used for caching purposes. If ExpiryDate is not given, the status has no end date.
1432#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1433#[serde(deny_unknown_fields)]
1434pub struct IdTokenInfo {
1435    #[serde(
1436        rename = "customData",
1437        default,
1438        skip_serializing_if = "Option::is_none"
1439    )]
1440    pub custom_data: Option<CustomData>,
1441    #[serde(rename = "status")]
1442    pub status: AuthorizationStatusEnum,
1443    /// ID_ Token. Expiry. Date_ Time
1444    /// Date and Time after which the token must be considered invalid.
1445    #[serde(
1446        rename = "cacheExpiryDateTime",
1447        default,
1448        skip_serializing_if = "Option::is_none"
1449    )]
1450    pub cache_expiry_date_time: Option<DateTime>,
1451    /// 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; overrules this one.
1452    #[serde(
1453        rename = "chargingPriority",
1454        default,
1455        skip_serializing_if = "Option::is_none"
1456    )]
1457    pub charging_priority: Option<i64>,
1458    /// ID_ Token. Language1. Language_ Code
1459    /// Preferred user interface language of identifier user. Contains a language code as defined in &lt;&lt;ref-RFC5646,\[RFC5646\]&gt;&gt;.
1460    #[serde(rename = "language1", default, skip_serializing_if = "Option::is_none")]
1461    pub language1: Option<String>,
1462    /// Only used when the IdToken is only valid for one or more specific EVSEs, not for the entire Charging Station.
1463    #[serde(rename = "evseId", default, skip_serializing_if = "Option::is_none")]
1464    pub evse_id: Option<Vec<i64>>,
1465    #[serde(
1466        rename = "groupIdToken",
1467        default,
1468        skip_serializing_if = "Option::is_none"
1469    )]
1470    pub group_id_token: Option<IdToken>,
1471    /// ID_ Token. Language2. Language_ Code
1472    /// Second preferred user interface language of identifier user. Don’t use when language1 is omitted, has to be different from language1. Contains a language code as defined in &lt;&lt;ref-RFC5646,\[RFC5646\]&gt;&gt;.
1473    #[serde(rename = "language2", default, skip_serializing_if = "Option::is_none")]
1474    pub language2: Option<String>,
1475    #[serde(
1476        rename = "personalMessage",
1477        default,
1478        skip_serializing_if = "Option::is_none"
1479    )]
1480    pub personal_message: Option<MessageContent>,
1481}
1482
1483impl Validate for IdTokenInfo {
1484    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1485        if let Some(x) = &self.custom_data {
1486            let p = path.field("customData");
1487            x.validate(&p)?;
1488        }
1489        if let Some(x) = &self.language1 {
1490            let p = path.field("language1");
1491            v::max_length(x, 8, &p)?;
1492        }
1493        if let Some(x) = &self.evse_id {
1494            let p = path.field("evseId");
1495            v::items(x, Some(1), None, &p)?;
1496        }
1497        if let Some(x) = &self.group_id_token {
1498            let p = path.field("groupIdToken");
1499            x.validate(&p)?;
1500        }
1501        if let Some(x) = &self.language2 {
1502            let p = path.field("language2");
1503            v::max_length(x, 8, &p)?;
1504        }
1505        if let Some(x) = &self.personal_message {
1506            let p = path.field("personalMessage");
1507            x.validate(&p)?;
1508        }
1509        Ok(())
1510    }
1511}
1512
1513/// Log
1514/// Generic class for the configuration of logging entries.
1515#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1516#[serde(deny_unknown_fields)]
1517pub struct LogParameters {
1518    #[serde(
1519        rename = "customData",
1520        default,
1521        skip_serializing_if = "Option::is_none"
1522    )]
1523    pub custom_data: Option<CustomData>,
1524    /// Log. Remote_ Location. URI
1525    /// The URL of the location at the remote system where the log should be stored.
1526    #[serde(rename = "remoteLocation")]
1527    pub remote_location: String,
1528    /// Log. Oldest_ Timestamp. Date_ Time
1529    /// This contains the date and time of the oldest logging information to include in the diagnostics.
1530    #[serde(
1531        rename = "oldestTimestamp",
1532        default,
1533        skip_serializing_if = "Option::is_none"
1534    )]
1535    pub oldest_timestamp: Option<DateTime>,
1536    /// Log. Latest_ Timestamp. Date_ Time
1537    /// This contains the date and time of the latest logging information to include in the diagnostics.
1538    #[serde(
1539        rename = "latestTimestamp",
1540        default,
1541        skip_serializing_if = "Option::is_none"
1542    )]
1543    pub latest_timestamp: Option<DateTime>,
1544}
1545
1546impl Validate for LogParameters {
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.remote_location;
1554            let p = path.field("remoteLocation");
1555            v::max_length(x, 512, &p)?;
1556        }
1557        Ok(())
1558    }
1559}
1560
1561/// Message_ Content
1562/// Contains message details, for a message to be displayed on a Charging Station.
1563#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1564#[serde(deny_unknown_fields)]
1565pub struct MessageContent {
1566    #[serde(
1567        rename = "customData",
1568        default,
1569        skip_serializing_if = "Option::is_none"
1570    )]
1571    pub custom_data: Option<CustomData>,
1572    #[serde(rename = "format")]
1573    pub format: MessageFormatEnum,
1574    /// Message_ Content. Language. Language_ Code
1575    /// Message language identifier. Contains a language code as defined in &lt;&lt;ref-RFC5646,\[RFC5646\]&gt;&gt;.
1576    #[serde(rename = "language", default, skip_serializing_if = "Option::is_none")]
1577    pub language: Option<String>,
1578    /// Message_ Content. Content. Message
1579    /// Message contents.
1580    #[serde(rename = "content")]
1581    pub content: String,
1582}
1583
1584impl Validate for MessageContent {
1585    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1586        if let Some(x) = &self.custom_data {
1587            let p = path.field("customData");
1588            x.validate(&p)?;
1589        }
1590        if let Some(x) = &self.language {
1591            let p = path.field("language");
1592            v::max_length(x, 8, &p)?;
1593        }
1594        {
1595            let x = &self.content;
1596            let p = path.field("content");
1597            v::max_length(x, 512, &p)?;
1598        }
1599        Ok(())
1600    }
1601}
1602
1603/// Message_ Info
1604/// Contains message details, for a message to be displayed on a Charging Station.
1605#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1606#[serde(deny_unknown_fields)]
1607pub struct MessageInfo {
1608    #[serde(
1609        rename = "customData",
1610        default,
1611        skip_serializing_if = "Option::is_none"
1612    )]
1613    pub custom_data: Option<CustomData>,
1614    #[serde(rename = "display", default, skip_serializing_if = "Option::is_none")]
1615    pub display: Option<Component>,
1616    /// Identified_ Object. MRID. Numeric_ Identifier
1617    /// Master resource identifier, unique within an exchange context. It is defined within the OCPP context as a positive Integer value (greater or equal to zero).
1618    #[serde(rename = "id")]
1619    pub id: i64,
1620    #[serde(rename = "priority")]
1621    pub priority: MessagePriorityEnum,
1622    #[serde(rename = "state", default, skip_serializing_if = "Option::is_none")]
1623    pub state: Option<MessageStateEnum>,
1624    /// Message_ Info. Start. Date_ Time
1625    /// From what date-time should this message be shown. If omitted: directly.
1626    #[serde(
1627        rename = "startDateTime",
1628        default,
1629        skip_serializing_if = "Option::is_none"
1630    )]
1631    pub start_date_time: Option<DateTime>,
1632    /// Message_ Info. End. Date_ Time
1633    /// Until what date-time should this message be shown, after this date/time this message SHALL be removed.
1634    #[serde(
1635        rename = "endDateTime",
1636        default,
1637        skip_serializing_if = "Option::is_none"
1638    )]
1639    pub end_date_time: Option<DateTime>,
1640    /// During which transaction shall this message be shown.
1641    /// Message SHALL be removed by the Charging Station after transaction has
1642    /// ended.
1643    #[serde(
1644        rename = "transactionId",
1645        default,
1646        skip_serializing_if = "Option::is_none"
1647    )]
1648    pub transaction_id: Option<String>,
1649    #[serde(rename = "message")]
1650    pub message: MessageContent,
1651}
1652
1653impl Validate for MessageInfo {
1654    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1655        if let Some(x) = &self.custom_data {
1656            let p = path.field("customData");
1657            x.validate(&p)?;
1658        }
1659        if let Some(x) = &self.display {
1660            let p = path.field("display");
1661            x.validate(&p)?;
1662        }
1663        if let Some(x) = &self.transaction_id {
1664            let p = path.field("transactionId");
1665            v::max_length(x, 36, &p)?;
1666        }
1667        {
1668            let x = &self.message;
1669            let p = path.field("message");
1670            x.validate(&p)?;
1671        }
1672        Ok(())
1673    }
1674}
1675
1676/// Meter_ Value
1677/// Collection of one or more sampled values in MeterValuesRequest and TransactionEvent. All sampled values in a MeterValue are sampled at the same point in time.
1678#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1679#[serde(deny_unknown_fields)]
1680pub struct MeterValue {
1681    #[serde(
1682        rename = "customData",
1683        default,
1684        skip_serializing_if = "Option::is_none"
1685    )]
1686    pub custom_data: Option<CustomData>,
1687    #[serde(rename = "sampledValue")]
1688    pub sampled_value: Vec<SampledValue>,
1689    /// Meter_ Value. Timestamp. Date_ Time
1690    /// Timestamp for measured value(s).
1691    #[serde(rename = "timestamp")]
1692    pub timestamp: DateTime,
1693}
1694
1695impl Validate for MeterValue {
1696    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1697        if let Some(x) = &self.custom_data {
1698            let p = path.field("customData");
1699            x.validate(&p)?;
1700        }
1701        {
1702            let x = &self.sampled_value;
1703            let p = path.field("sampledValue");
1704            v::items(x, Some(1), None, &p)?;
1705            for (i0, it0) in x.iter().enumerate() {
1706                let p0 = p.index(i0);
1707                it0.validate(&p0)?;
1708            }
1709        }
1710        Ok(())
1711    }
1712}
1713
1714/// Wireless_ Communication_ Module
1715/// Defines parameters required for initiating and maintaining wireless communication with other devices.
1716#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1717#[serde(deny_unknown_fields)]
1718pub struct Modem {
1719    #[serde(
1720        rename = "customData",
1721        default,
1722        skip_serializing_if = "Option::is_none"
1723    )]
1724    pub custom_data: Option<CustomData>,
1725    /// Wireless_ Communication_ Module. ICCID. CI20_ Text
1726    /// This contains the ICCID of the modem’s SIM card.
1727    #[serde(rename = "iccid", default, skip_serializing_if = "Option::is_none")]
1728    pub iccid: Option<String>,
1729    /// Wireless_ Communication_ Module. IMSI. CI20_ Text
1730    /// This contains the IMSI of the modem’s SIM card.
1731    #[serde(rename = "imsi", default, skip_serializing_if = "Option::is_none")]
1732    pub imsi: Option<String>,
1733}
1734
1735impl Validate for Modem {
1736    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1737        if let Some(x) = &self.custom_data {
1738            let p = path.field("customData");
1739            x.validate(&p)?;
1740        }
1741        if let Some(x) = &self.iccid {
1742            let p = path.field("iccid");
1743            v::max_length(x, 20, &p)?;
1744        }
1745        if let Some(x) = &self.imsi {
1746            let p = path.field("imsi");
1747            v::max_length(x, 20, &p)?;
1748        }
1749        Ok(())
1750    }
1751}
1752
1753/// Class to hold parameters of SetVariableMonitoring request.
1754#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1755#[serde(deny_unknown_fields)]
1756pub struct MonitoringData {
1757    #[serde(
1758        rename = "customData",
1759        default,
1760        skip_serializing_if = "Option::is_none"
1761    )]
1762    pub custom_data: Option<CustomData>,
1763    #[serde(rename = "component")]
1764    pub component: Component,
1765    #[serde(rename = "variable")]
1766    pub variable: Variable,
1767    #[serde(rename = "variableMonitoring")]
1768    pub variable_monitoring: Vec<VariableMonitoring>,
1769}
1770
1771impl Validate for MonitoringData {
1772    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1773        if let Some(x) = &self.custom_data {
1774            let p = path.field("customData");
1775            x.validate(&p)?;
1776        }
1777        {
1778            let x = &self.component;
1779            let p = path.field("component");
1780            x.validate(&p)?;
1781        }
1782        {
1783            let x = &self.variable;
1784            let p = path.field("variable");
1785            x.validate(&p)?;
1786        }
1787        {
1788            let x = &self.variable_monitoring;
1789            let p = path.field("variableMonitoring");
1790            v::items(x, Some(1), None, &p)?;
1791            for (i0, it0) in x.iter().enumerate() {
1792                let p0 = p.index(i0);
1793                it0.validate(&p0)?;
1794            }
1795        }
1796        Ok(())
1797    }
1798}
1799
1800/// Communication_ Function
1801/// The NetworkConnectionProfile defines the functional and technical parameters of a communication link.
1802#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1803#[serde(deny_unknown_fields)]
1804pub struct NetworkConnectionProfile {
1805    #[serde(
1806        rename = "customData",
1807        default,
1808        skip_serializing_if = "Option::is_none"
1809    )]
1810    pub custom_data: Option<CustomData>,
1811    #[serde(rename = "apn", default, skip_serializing_if = "Option::is_none")]
1812    pub apn: Option<APN>,
1813    #[serde(rename = "ocppVersion")]
1814    pub ocpp_version: OCPPVersionEnum,
1815    #[serde(rename = "ocppTransport")]
1816    pub ocpp_transport: OCPPTransportEnum,
1817    /// Communication_ Function. OCPP_ Central_ System_ URL. URI
1818    /// URL of the CSMS(s) that this Charging Station  communicates with.
1819    #[serde(rename = "ocppCsmsUrl")]
1820    pub ocpp_csms_url: String,
1821    /// Duration in seconds before a message send by the Charging Station via this network connection times-out.
1822    /// The best setting depends on the underlying network and response times of the CSMS.
1823    /// If you are looking for a some guideline: use 30 seconds as a starting point.
1824    #[serde(rename = "messageTimeout")]
1825    pub message_timeout: i64,
1826    /// This field specifies the security profile used when connecting to the CSMS with this NetworkConnectionProfile.
1827    #[serde(rename = "securityProfile")]
1828    pub security_profile: i64,
1829    #[serde(rename = "ocppInterface")]
1830    pub ocpp_interface: OCPPInterfaceEnum,
1831    #[serde(rename = "vpn", default, skip_serializing_if = "Option::is_none")]
1832    pub vpn: Option<VPN>,
1833}
1834
1835impl Validate for NetworkConnectionProfile {
1836    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1837        if let Some(x) = &self.custom_data {
1838            let p = path.field("customData");
1839            x.validate(&p)?;
1840        }
1841        if let Some(x) = &self.apn {
1842            let p = path.field("apn");
1843            x.validate(&p)?;
1844        }
1845        {
1846            let x = &self.ocpp_csms_url;
1847            let p = path.field("ocppCsmsUrl");
1848            v::max_length(x, 512, &p)?;
1849        }
1850        if let Some(x) = &self.vpn {
1851            let p = path.field("vpn");
1852            x.validate(&p)?;
1853        }
1854        Ok(())
1855    }
1856}
1857
1858#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1859#[serde(deny_unknown_fields)]
1860pub struct OCSPRequestData {
1861    #[serde(
1862        rename = "customData",
1863        default,
1864        skip_serializing_if = "Option::is_none"
1865    )]
1866    pub custom_data: Option<CustomData>,
1867    #[serde(rename = "hashAlgorithm")]
1868    pub hash_algorithm: HashAlgorithmEnum,
1869    /// Hashed value of the Issuer DN (Distinguished Name).
1870    #[serde(rename = "issuerNameHash")]
1871    pub issuer_name_hash: String,
1872    /// Hashed value of the issuers public key
1873    #[serde(rename = "issuerKeyHash")]
1874    pub issuer_key_hash: String,
1875    /// The serial number of the certificate.
1876    #[serde(rename = "serialNumber")]
1877    pub serial_number: String,
1878    /// This contains the responder URL (Case insensitive).
1879    #[serde(rename = "responderURL")]
1880    pub responder_url: String,
1881}
1882
1883impl Validate for OCSPRequestData {
1884    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1885        if let Some(x) = &self.custom_data {
1886            let p = path.field("customData");
1887            x.validate(&p)?;
1888        }
1889        {
1890            let x = &self.issuer_name_hash;
1891            let p = path.field("issuerNameHash");
1892            v::max_length(x, 128, &p)?;
1893        }
1894        {
1895            let x = &self.issuer_key_hash;
1896            let p = path.field("issuerKeyHash");
1897            v::max_length(x, 128, &p)?;
1898        }
1899        {
1900            let x = &self.serial_number;
1901            let p = path.field("serialNumber");
1902            v::max_length(x, 40, &p)?;
1903        }
1904        {
1905            let x = &self.responder_url;
1906            let p = path.field("responderURL");
1907            v::max_length(x, 512, &p)?;
1908        }
1909        Ok(())
1910    }
1911}
1912
1913/// Relative_ Timer_ Interval
1914#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1915#[serde(deny_unknown_fields)]
1916pub struct RelativeTimeInterval {
1917    #[serde(
1918        rename = "customData",
1919        default,
1920        skip_serializing_if = "Option::is_none"
1921    )]
1922    pub custom_data: Option<CustomData>,
1923    /// Relative_ Timer_ Interval. Start. Elapsed_ Time
1924    /// Start of the interval, in seconds from NOW.
1925    #[serde(rename = "start")]
1926    pub start: i64,
1927    /// Relative_ Timer_ Interval. Duration. Elapsed_ Time
1928    /// Duration of the interval, in seconds.
1929    #[serde(rename = "duration", default, skip_serializing_if = "Option::is_none")]
1930    pub duration: Option<i64>,
1931}
1932
1933impl Validate for RelativeTimeInterval {
1934    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1935        if let Some(x) = &self.custom_data {
1936            let p = path.field("customData");
1937            x.validate(&p)?;
1938        }
1939        Ok(())
1940    }
1941}
1942
1943/// Class to report components, variables and variable attributes and characteristics.
1944#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1945#[serde(deny_unknown_fields)]
1946pub struct ReportData {
1947    #[serde(
1948        rename = "customData",
1949        default,
1950        skip_serializing_if = "Option::is_none"
1951    )]
1952    pub custom_data: Option<CustomData>,
1953    #[serde(rename = "component")]
1954    pub component: Component,
1955    #[serde(rename = "variable")]
1956    pub variable: Variable,
1957    #[serde(rename = "variableAttribute")]
1958    pub variable_attribute: Vec<VariableAttribute>,
1959    #[serde(
1960        rename = "variableCharacteristics",
1961        default,
1962        skip_serializing_if = "Option::is_none"
1963    )]
1964    pub variable_characteristics: Option<VariableCharacteristics>,
1965}
1966
1967impl Validate for ReportData {
1968    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
1969        if let Some(x) = &self.custom_data {
1970            let p = path.field("customData");
1971            x.validate(&p)?;
1972        }
1973        {
1974            let x = &self.component;
1975            let p = path.field("component");
1976            x.validate(&p)?;
1977        }
1978        {
1979            let x = &self.variable;
1980            let p = path.field("variable");
1981            x.validate(&p)?;
1982        }
1983        {
1984            let x = &self.variable_attribute;
1985            let p = path.field("variableAttribute");
1986            v::items(x, Some(1), Some(4), &p)?;
1987            for (i0, it0) in x.iter().enumerate() {
1988                let p0 = p.index(i0);
1989                it0.validate(&p0)?;
1990            }
1991        }
1992        if let Some(x) = &self.variable_characteristics {
1993            let p = path.field("variableCharacteristics");
1994            x.validate(&p)?;
1995        }
1996        Ok(())
1997    }
1998}
1999
2000/// Sales_ Tariff
2001/// NOTE: This dataType is based on dataTypes from &lt;&lt;ref-ISOIEC15118-2,ISO 15118-2&gt;&gt;.
2002#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2003#[serde(deny_unknown_fields)]
2004pub struct SalesTariff {
2005    #[serde(
2006        rename = "customData",
2007        default,
2008        skip_serializing_if = "Option::is_none"
2009    )]
2010    pub custom_data: Option<CustomData>,
2011    /// Identified_ Object. MRID. Numeric_ Identifier
2012    /// SalesTariff identifier used to identify one sales tariff. An SAID remains a unique identifier for one schedule throughout a charging session.
2013    #[serde(rename = "id")]
2014    pub id: i64,
2015    /// Sales_ Tariff. Sales. Tariff_ Description
2016    /// A human readable title/short description of the sales tariff e.g. for HMI display purposes.
2017    #[serde(
2018        rename = "salesTariffDescription",
2019        default,
2020        skip_serializing_if = "Option::is_none"
2021    )]
2022    pub sales_tariff_description: Option<String>,
2023    /// Sales_ Tariff. Num_ E_ Price_ Levels. Counter
2024    /// Defines the overall number of distinct price levels used across all provided SalesTariff elements.
2025    #[serde(
2026        rename = "numEPriceLevels",
2027        default,
2028        skip_serializing_if = "Option::is_none"
2029    )]
2030    pub num_e_price_levels: Option<i64>,
2031    #[serde(rename = "salesTariffEntry")]
2032    pub sales_tariff_entry: Vec<SalesTariffEntry>,
2033}
2034
2035impl Validate for SalesTariff {
2036    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2037        if let Some(x) = &self.custom_data {
2038            let p = path.field("customData");
2039            x.validate(&p)?;
2040        }
2041        if let Some(x) = &self.sales_tariff_description {
2042            let p = path.field("salesTariffDescription");
2043            v::max_length(x, 32, &p)?;
2044        }
2045        {
2046            let x = &self.sales_tariff_entry;
2047            let p = path.field("salesTariffEntry");
2048            v::items(x, Some(1), Some(1024), &p)?;
2049            for (i0, it0) in x.iter().enumerate() {
2050                let p0 = p.index(i0);
2051                it0.validate(&p0)?;
2052            }
2053        }
2054        Ok(())
2055    }
2056}
2057
2058/// Sales_ Tariff_ Entry
2059#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2060#[serde(deny_unknown_fields)]
2061pub struct SalesTariffEntry {
2062    #[serde(
2063        rename = "customData",
2064        default,
2065        skip_serializing_if = "Option::is_none"
2066    )]
2067    pub custom_data: Option<CustomData>,
2068    #[serde(rename = "relativeTimeInterval")]
2069    pub relative_time_interval: RelativeTimeInterval,
2070    /// Sales_ Tariff_ Entry. E_ Price_ Level. Unsigned_ Integer
2071    /// Defines the price level of this SalesTariffEntry (referring to NumEPriceLevels). Small values for the EPriceLevel represent a cheaper TariffEntry. Large values for the EPriceLevel represent a more expensive TariffEntry.
2072    #[serde(
2073        rename = "ePriceLevel",
2074        default,
2075        skip_serializing_if = "Option::is_none"
2076    )]
2077    pub e_price_level: Option<i64>,
2078    #[serde(
2079        rename = "consumptionCost",
2080        default,
2081        skip_serializing_if = "Option::is_none"
2082    )]
2083    pub consumption_cost: Option<Vec<ConsumptionCost>>,
2084}
2085
2086impl Validate for SalesTariffEntry {
2087    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2088        if let Some(x) = &self.custom_data {
2089            let p = path.field("customData");
2090            x.validate(&p)?;
2091        }
2092        {
2093            let x = &self.relative_time_interval;
2094            let p = path.field("relativeTimeInterval");
2095            x.validate(&p)?;
2096        }
2097        if let Some(x) = &self.e_price_level {
2098            let p = path.field("ePriceLevel");
2099            v::minimum(*x, 0i64, &p)?;
2100        }
2101        if let Some(x) = &self.consumption_cost {
2102            let p = path.field("consumptionCost");
2103            v::items(x, Some(1), Some(3), &p)?;
2104            for (i0, it0) in x.iter().enumerate() {
2105                let p0 = p.index(i0);
2106                it0.validate(&p0)?;
2107            }
2108        }
2109        Ok(())
2110    }
2111}
2112
2113/// Sampled_ Value
2114/// Single sampled value in MeterValues. Each value can be accompanied by optional fields.
2115/// To save on mobile data usage, default values of all of the optional fields are such that. The value without any additional fields will be interpreted, as a register reading of active import energy in Wh (Watt-hour) units.
2116#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2117#[serde(deny_unknown_fields)]
2118pub struct SampledValue {
2119    #[serde(
2120        rename = "customData",
2121        default,
2122        skip_serializing_if = "Option::is_none"
2123    )]
2124    pub custom_data: Option<CustomData>,
2125    /// Sampled_ Value. Value. Measure
2126    /// Indicates the measured value.
2127    #[serde(rename = "value")]
2128    pub value: f64,
2129    #[serde(rename = "context", default, skip_serializing_if = "Option::is_none")]
2130    pub context: Option<ReadingContextEnum>,
2131    #[serde(rename = "measurand", default, skip_serializing_if = "Option::is_none")]
2132    pub measurand: Option<MeasurandEnum>,
2133    #[serde(rename = "phase", default, skip_serializing_if = "Option::is_none")]
2134    pub phase: Option<PhaseEnum>,
2135    #[serde(rename = "location", default, skip_serializing_if = "Option::is_none")]
2136    pub location: Option<LocationEnum>,
2137    #[serde(
2138        rename = "signedMeterValue",
2139        default,
2140        skip_serializing_if = "Option::is_none"
2141    )]
2142    pub signed_meter_value: Option<SignedMeterValue>,
2143    #[serde(
2144        rename = "unitOfMeasure",
2145        default,
2146        skip_serializing_if = "Option::is_none"
2147    )]
2148    pub unit_of_measure: Option<UnitOfMeasure>,
2149}
2150
2151impl Validate for SampledValue {
2152    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2153        if let Some(x) = &self.custom_data {
2154            let p = path.field("customData");
2155            x.validate(&p)?;
2156        }
2157        if let Some(x) = &self.signed_meter_value {
2158            let p = path.field("signedMeterValue");
2159            x.validate(&p)?;
2160        }
2161        if let Some(x) = &self.unit_of_measure {
2162            let p = path.field("unitOfMeasure");
2163            x.validate(&p)?;
2164        }
2165        Ok(())
2166    }
2167}
2168
2169/// Class to hold parameters of SetVariableMonitoring request.
2170#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2171#[serde(deny_unknown_fields)]
2172pub struct SetMonitoringData {
2173    #[serde(
2174        rename = "customData",
2175        default,
2176        skip_serializing_if = "Option::is_none"
2177    )]
2178    pub custom_data: Option<CustomData>,
2179    /// An id SHALL only be given to replace an existing monitor. The Charging Station handles the generation of id's for new monitors.
2180    #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2181    pub id: Option<i64>,
2182    /// Monitor only active when a transaction is ongoing on a component relevant to this transaction. Default = false.
2183    #[serde(
2184        rename = "transaction",
2185        default,
2186        skip_serializing_if = "Option::is_none"
2187    )]
2188    pub transaction: Option<bool>,
2189    /// Value for threshold or delta monitoring.
2190    /// For Periodic or PeriodicClockAligned this is the interval in seconds.
2191    #[serde(rename = "value")]
2192    pub value: f64,
2193    #[serde(rename = "type")]
2194    pub r#type: MonitorEnum,
2195    /// The severity that will be assigned to an event that is triggered by this monitor. The severity range is 0-9, with 0 as the highest and 9 as the lowest severity level.
2196    /// The severity levels have the following meaning: +
2197    /// *0-Danger* +
2198    /// Indicates lives are potentially in danger. Urgent attention is needed and action should be taken immediately. +
2199    /// *1-Hardware Failure* +
2200    /// Indicates that the Charging Station is unable to continue regular operations due to Hardware issues. Action is required. +
2201    /// *2-System Failure* +
2202    /// Indicates that the Charging Station is unable to continue regular operations due to software or minor hardware issues. Action is required. +
2203    /// *3-Critical* +
2204    /// Indicates a critical error. Action is required. +
2205    /// *4-Error* +
2206    /// Indicates a non-urgent error. Action is required. +
2207    /// *5-Alert* +
2208    /// Indicates an alert event. Default severity for any type of monitoring event.  +
2209    /// *6-Warning* +
2210    /// Indicates a warning event. Action may be required. +
2211    /// *7-Notice* +
2212    /// Indicates an unusual event. No immediate action is required. +
2213    /// *8-Informational* +
2214    /// Indicates a regular operational event. May be used for reporting, measuring throughput, etc. No action is required. +
2215    /// *9-Debug* +
2216    /// Indicates information useful to developers for debugging, not useful during operations.
2217    #[serde(rename = "severity")]
2218    pub severity: i64,
2219    #[serde(rename = "component")]
2220    pub component: Component,
2221    #[serde(rename = "variable")]
2222    pub variable: Variable,
2223}
2224
2225impl Validate for SetMonitoringData {
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        {
2232            let x = &self.component;
2233            let p = path.field("component");
2234            x.validate(&p)?;
2235        }
2236        {
2237            let x = &self.variable;
2238            let p = path.field("variable");
2239            x.validate(&p)?;
2240        }
2241        Ok(())
2242    }
2243}
2244
2245/// Class to hold result of SetVariableMonitoring request.
2246#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2247#[serde(deny_unknown_fields)]
2248pub struct SetMonitoringResult {
2249    #[serde(
2250        rename = "customData",
2251        default,
2252        skip_serializing_if = "Option::is_none"
2253    )]
2254    pub custom_data: Option<CustomData>,
2255    /// Id given to the VariableMonitor by the Charging Station. The Id is only returned when status is accepted. Installed VariableMonitors should have unique id's but the id's of removed Installed monitors should have unique id's but the id's of removed monitors MAY be reused.
2256    #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2257    pub id: Option<i64>,
2258    #[serde(
2259        rename = "statusInfo",
2260        default,
2261        skip_serializing_if = "Option::is_none"
2262    )]
2263    pub status_info: Option<StatusInfo>,
2264    #[serde(rename = "status")]
2265    pub status: SetMonitoringStatusEnum,
2266    #[serde(rename = "type")]
2267    pub r#type: MonitorEnum,
2268    #[serde(rename = "component")]
2269    pub component: Component,
2270    #[serde(rename = "variable")]
2271    pub variable: Variable,
2272    /// The severity that will be assigned to an event that is triggered by this monitor. The severity range is 0-9, with 0 as the highest and 9 as the lowest severity level.
2273    /// The severity levels have the following meaning: +
2274    /// *0-Danger* +
2275    /// Indicates lives are potentially in danger. Urgent attention is needed and action should be taken immediately. +
2276    /// *1-Hardware Failure* +
2277    /// Indicates that the Charging Station is unable to continue regular operations due to Hardware issues. Action is required. +
2278    /// *2-System Failure* +
2279    /// Indicates that the Charging Station is unable to continue regular operations due to software or minor hardware issues. Action is required. +
2280    /// *3-Critical* +
2281    /// Indicates a critical error. Action is required. +
2282    /// *4-Error* +
2283    /// Indicates a non-urgent error. Action is required. +
2284    /// *5-Alert* +
2285    /// Indicates an alert event. Default severity for any type of monitoring event.  +
2286    /// *6-Warning* +
2287    /// Indicates a warning event. Action may be required. +
2288    /// *7-Notice* +
2289    /// Indicates an unusual event. No immediate action is required. +
2290    /// *8-Informational* +
2291    /// Indicates a regular operational event. May be used for reporting, measuring throughput, etc. No action is required. +
2292    /// *9-Debug* +
2293    /// Indicates information useful to developers for debugging, not useful during operations.
2294    #[serde(rename = "severity")]
2295    pub severity: i64,
2296}
2297
2298impl Validate for SetMonitoringResult {
2299    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2300        if let Some(x) = &self.custom_data {
2301            let p = path.field("customData");
2302            x.validate(&p)?;
2303        }
2304        if let Some(x) = &self.status_info {
2305            let p = path.field("statusInfo");
2306            x.validate(&p)?;
2307        }
2308        {
2309            let x = &self.component;
2310            let p = path.field("component");
2311            x.validate(&p)?;
2312        }
2313        {
2314            let x = &self.variable;
2315            let p = path.field("variable");
2316            x.validate(&p)?;
2317        }
2318        Ok(())
2319    }
2320}
2321
2322#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2323#[serde(deny_unknown_fields)]
2324pub struct SetVariableData {
2325    #[serde(
2326        rename = "customData",
2327        default,
2328        skip_serializing_if = "Option::is_none"
2329    )]
2330    pub custom_data: Option<CustomData>,
2331    #[serde(
2332        rename = "attributeType",
2333        default,
2334        skip_serializing_if = "Option::is_none"
2335    )]
2336    pub attribute_type: Option<AttributeEnum>,
2337    /// Value to be assigned to attribute of variable.
2338    /// The Configuration Variable &lt;&lt;configkey-configuration-value-size,ConfigurationValueSize&gt;&gt; can be used to limit SetVariableData.attributeValue and VariableCharacteristics.valueList. The max size of these values will always remain equal.
2339    #[serde(rename = "attributeValue")]
2340    pub attribute_value: String,
2341    #[serde(rename = "component")]
2342    pub component: Component,
2343    #[serde(rename = "variable")]
2344    pub variable: Variable,
2345}
2346
2347impl Validate for SetVariableData {
2348    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2349        if let Some(x) = &self.custom_data {
2350            let p = path.field("customData");
2351            x.validate(&p)?;
2352        }
2353        {
2354            let x = &self.attribute_value;
2355            let p = path.field("attributeValue");
2356            v::max_length(x, 1000, &p)?;
2357        }
2358        {
2359            let x = &self.component;
2360            let p = path.field("component");
2361            x.validate(&p)?;
2362        }
2363        {
2364            let x = &self.variable;
2365            let p = path.field("variable");
2366            x.validate(&p)?;
2367        }
2368        Ok(())
2369    }
2370}
2371
2372#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2373#[serde(deny_unknown_fields)]
2374pub struct SetVariableResult {
2375    #[serde(
2376        rename = "customData",
2377        default,
2378        skip_serializing_if = "Option::is_none"
2379    )]
2380    pub custom_data: Option<CustomData>,
2381    #[serde(
2382        rename = "attributeType",
2383        default,
2384        skip_serializing_if = "Option::is_none"
2385    )]
2386    pub attribute_type: Option<AttributeEnum>,
2387    #[serde(rename = "attributeStatus")]
2388    pub attribute_status: SetVariableStatusEnum,
2389    #[serde(
2390        rename = "attributeStatusInfo",
2391        default,
2392        skip_serializing_if = "Option::is_none"
2393    )]
2394    pub attribute_status_info: Option<StatusInfo>,
2395    #[serde(rename = "component")]
2396    pub component: Component,
2397    #[serde(rename = "variable")]
2398    pub variable: Variable,
2399}
2400
2401impl Validate for SetVariableResult {
2402    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2403        if let Some(x) = &self.custom_data {
2404            let p = path.field("customData");
2405            x.validate(&p)?;
2406        }
2407        if let Some(x) = &self.attribute_status_info {
2408            let p = path.field("attributeStatusInfo");
2409            x.validate(&p)?;
2410        }
2411        {
2412            let x = &self.component;
2413            let p = path.field("component");
2414            x.validate(&p)?;
2415        }
2416        {
2417            let x = &self.variable;
2418            let p = path.field("variable");
2419            x.validate(&p)?;
2420        }
2421        Ok(())
2422    }
2423}
2424
2425/// Represent a signed version of the meter value.
2426#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2427#[serde(deny_unknown_fields)]
2428pub struct SignedMeterValue {
2429    #[serde(
2430        rename = "customData",
2431        default,
2432        skip_serializing_if = "Option::is_none"
2433    )]
2434    pub custom_data: Option<CustomData>,
2435    /// Base64 encoded, contains the signed data which might contain more then just the meter value. It can contain information like timestamps, reference to a customer etc.
2436    #[serde(rename = "signedMeterData")]
2437    pub signed_meter_data: String,
2438    /// Method used to create the digital signature.
2439    #[serde(rename = "signingMethod")]
2440    pub signing_method: String,
2441    /// Method used to encode the meter values before applying the digital signature algorithm.
2442    #[serde(rename = "encodingMethod")]
2443    pub encoding_method: String,
2444    /// Base64 encoded, sending depends on configuration variable _PublicKeyWithSignedMeterValue_.
2445    #[serde(rename = "publicKey")]
2446    pub public_key: String,
2447}
2448
2449impl Validate for SignedMeterValue {
2450    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2451        if let Some(x) = &self.custom_data {
2452            let p = path.field("customData");
2453            x.validate(&p)?;
2454        }
2455        {
2456            let x = &self.signed_meter_data;
2457            let p = path.field("signedMeterData");
2458            v::max_length(x, 2500, &p)?;
2459        }
2460        {
2461            let x = &self.signing_method;
2462            let p = path.field("signingMethod");
2463            v::max_length(x, 50, &p)?;
2464        }
2465        {
2466            let x = &self.encoding_method;
2467            let p = path.field("encodingMethod");
2468            v::max_length(x, 50, &p)?;
2469        }
2470        {
2471            let x = &self.public_key;
2472            let p = path.field("publicKey");
2473            v::max_length(x, 2500, &p)?;
2474        }
2475        Ok(())
2476    }
2477}
2478
2479/// Element providing more information about the status.
2480#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2481#[serde(deny_unknown_fields)]
2482pub struct StatusInfo {
2483    #[serde(
2484        rename = "customData",
2485        default,
2486        skip_serializing_if = "Option::is_none"
2487    )]
2488    pub custom_data: Option<CustomData>,
2489    /// A predefined code for the reason why the status is returned in this response. The string is case-insensitive.
2490    #[serde(rename = "reasonCode")]
2491    pub reason_code: String,
2492    /// Additional text to provide detailed information.
2493    #[serde(
2494        rename = "additionalInfo",
2495        default,
2496        skip_serializing_if = "Option::is_none"
2497    )]
2498    pub additional_info: Option<String>,
2499}
2500
2501impl Validate for StatusInfo {
2502    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2503        if let Some(x) = &self.custom_data {
2504            let p = path.field("customData");
2505            x.validate(&p)?;
2506        }
2507        {
2508            let x = &self.reason_code;
2509            let p = path.field("reasonCode");
2510            v::max_length(x, 20, &p)?;
2511        }
2512        if let Some(x) = &self.additional_info {
2513            let p = path.field("additionalInfo");
2514            v::max_length(x, 512, &p)?;
2515        }
2516        Ok(())
2517    }
2518}
2519
2520/// Transaction
2521#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2522#[serde(deny_unknown_fields)]
2523pub struct Transaction {
2524    #[serde(
2525        rename = "customData",
2526        default,
2527        skip_serializing_if = "Option::is_none"
2528    )]
2529    pub custom_data: Option<CustomData>,
2530    /// This contains the Id of the transaction.
2531    #[serde(rename = "transactionId")]
2532    pub transaction_id: String,
2533    #[serde(
2534        rename = "chargingState",
2535        default,
2536        skip_serializing_if = "Option::is_none"
2537    )]
2538    pub charging_state: Option<ChargingStateEnum>,
2539    /// Transaction. Time_ Spent_ Charging. Elapsed_ Time
2540    /// Contains the total time that energy flowed from EVSE to EV during the transaction (in seconds). Note that timeSpentCharging is smaller or equal to the duration of the transaction.
2541    #[serde(
2542        rename = "timeSpentCharging",
2543        default,
2544        skip_serializing_if = "Option::is_none"
2545    )]
2546    pub time_spent_charging: Option<i64>,
2547    #[serde(
2548        rename = "stoppedReason",
2549        default,
2550        skip_serializing_if = "Option::is_none"
2551    )]
2552    pub stopped_reason: Option<ReasonEnum>,
2553    /// The ID given to remote start request (&lt;&lt;requeststarttransactionrequest, RequestStartTransactionRequest&gt;&gt;. This enables to CSMS to match the started transaction to the given start request.
2554    #[serde(
2555        rename = "remoteStartId",
2556        default,
2557        skip_serializing_if = "Option::is_none"
2558    )]
2559    pub remote_start_id: Option<i64>,
2560}
2561
2562impl Validate for Transaction {
2563    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2564        if let Some(x) = &self.custom_data {
2565            let p = path.field("customData");
2566            x.validate(&p)?;
2567        }
2568        {
2569            let x = &self.transaction_id;
2570            let p = path.field("transactionId");
2571            v::max_length(x, 36, &p)?;
2572        }
2573        Ok(())
2574    }
2575}
2576
2577/// Represents a UnitOfMeasure with a multiplier
2578#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2579#[serde(deny_unknown_fields)]
2580pub struct UnitOfMeasure {
2581    #[serde(
2582        rename = "customData",
2583        default,
2584        skip_serializing_if = "Option::is_none"
2585    )]
2586    pub custom_data: Option<CustomData>,
2587    /// Unit of the value. Default = "Wh" if the (default) measurand is an "Energy" type.
2588    /// This field SHALL use a value from the list Standardized Units of Measurements in Part 2 Appendices.
2589    /// If an applicable unit is available in that list, otherwise a "custom" unit might be used.
2590    #[serde(rename = "unit", default, skip_serializing_if = "Option::is_none")]
2591    pub unit: Option<String>,
2592    /// Multiplier, this value represents the exponent to base 10. I.e. multiplier 3 means 10 raised to the 3rd power. Default is 0.
2593    #[serde(
2594        rename = "multiplier",
2595        default,
2596        skip_serializing_if = "Option::is_none"
2597    )]
2598    pub multiplier: Option<i64>,
2599}
2600
2601impl Validate for UnitOfMeasure {
2602    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2603        if let Some(x) = &self.custom_data {
2604            let p = path.field("customData");
2605            x.validate(&p)?;
2606        }
2607        if let Some(x) = &self.unit {
2608            let p = path.field("unit");
2609            v::max_length(x, 20, &p)?;
2610        }
2611        Ok(())
2612    }
2613}
2614
2615/// VPN
2616/// VPN Configuration settings
2617#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2618#[serde(deny_unknown_fields)]
2619pub struct VPN {
2620    #[serde(
2621        rename = "customData",
2622        default,
2623        skip_serializing_if = "Option::is_none"
2624    )]
2625    pub custom_data: Option<CustomData>,
2626    /// VPN. Server. URI
2627    /// VPN Server Address
2628    #[serde(rename = "server")]
2629    pub server: String,
2630    /// VPN. User. User_ Name
2631    /// VPN User
2632    #[serde(rename = "user")]
2633    pub user: String,
2634    /// VPN. Group. Group_ Name
2635    /// VPN group.
2636    #[serde(rename = "group", default, skip_serializing_if = "Option::is_none")]
2637    pub group: Option<String>,
2638    /// VPN. Password. Password
2639    /// VPN Password.
2640    #[serde(rename = "password")]
2641    pub password: String,
2642    /// VPN. Key. VPN_ Key
2643    /// VPN shared secret.
2644    #[serde(rename = "key")]
2645    pub key: String,
2646    #[serde(rename = "type")]
2647    pub r#type: VPNEnum,
2648}
2649
2650impl Validate for VPN {
2651    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2652        if let Some(x) = &self.custom_data {
2653            let p = path.field("customData");
2654            x.validate(&p)?;
2655        }
2656        {
2657            let x = &self.server;
2658            let p = path.field("server");
2659            v::max_length(x, 512, &p)?;
2660        }
2661        {
2662            let x = &self.user;
2663            let p = path.field("user");
2664            v::max_length(x, 20, &p)?;
2665        }
2666        if let Some(x) = &self.group {
2667            let p = path.field("group");
2668            v::max_length(x, 20, &p)?;
2669        }
2670        {
2671            let x = &self.password;
2672            let p = path.field("password");
2673            v::max_length(x, 20, &p)?;
2674        }
2675        {
2676            let x = &self.key;
2677            let p = path.field("key");
2678            v::max_length(x, 255, &p)?;
2679        }
2680        Ok(())
2681    }
2682}
2683
2684/// Reference key to a component-variable.
2685#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2686#[serde(deny_unknown_fields)]
2687pub struct Variable {
2688    #[serde(
2689        rename = "customData",
2690        default,
2691        skip_serializing_if = "Option::is_none"
2692    )]
2693    pub custom_data: Option<CustomData>,
2694    /// Name of the variable. Name should be taken from the list of standardized variable names whenever possible. Case Insensitive. strongly advised to use Camel Case.
2695    #[serde(rename = "name")]
2696    pub name: String,
2697    /// Name of instance in case the variable exists as multiple instances. Case Insensitive. strongly advised to use Camel Case.
2698    #[serde(rename = "instance", default, skip_serializing_if = "Option::is_none")]
2699    pub instance: Option<String>,
2700}
2701
2702impl Validate for Variable {
2703    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2704        if let Some(x) = &self.custom_data {
2705            let p = path.field("customData");
2706            x.validate(&p)?;
2707        }
2708        {
2709            let x = &self.name;
2710            let p = path.field("name");
2711            v::max_length(x, 50, &p)?;
2712        }
2713        if let Some(x) = &self.instance {
2714            let p = path.field("instance");
2715            v::max_length(x, 50, &p)?;
2716        }
2717        Ok(())
2718    }
2719}
2720
2721/// Attribute data of a variable.
2722#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2723#[serde(deny_unknown_fields)]
2724pub struct VariableAttribute {
2725    #[serde(
2726        rename = "customData",
2727        default,
2728        skip_serializing_if = "Option::is_none"
2729    )]
2730    pub custom_data: Option<CustomData>,
2731    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2732    pub r#type: Option<AttributeEnum>,
2733    /// Value of the attribute. May only be omitted when mutability is set to 'WriteOnly'.
2734    /// The Configuration Variable &lt;&lt;configkey-reporting-value-size,ReportingValueSize&gt;&gt; can be used to limit GetVariableResult.attributeValue, VariableAttribute.value and EventData.actualValue. The max size of these values will always remain equal.
2735    #[serde(rename = "value", default, skip_serializing_if = "Option::is_none")]
2736    pub value: Option<String>,
2737    #[serde(
2738        rename = "mutability",
2739        default,
2740        skip_serializing_if = "Option::is_none"
2741    )]
2742    pub mutability: Option<MutabilityEnum>,
2743    /// If true, value will be persistent across system reboots or power down. Default when omitted is false.
2744    #[serde(
2745        rename = "persistent",
2746        default,
2747        skip_serializing_if = "Option::is_none"
2748    )]
2749    pub persistent: Option<bool>,
2750    /// If true, value that will never be changed by the Charging Station at runtime. Default when omitted is false.
2751    #[serde(rename = "constant", default, skip_serializing_if = "Option::is_none")]
2752    pub constant: Option<bool>,
2753}
2754
2755impl Validate for VariableAttribute {
2756    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2757        if let Some(x) = &self.custom_data {
2758            let p = path.field("customData");
2759            x.validate(&p)?;
2760        }
2761        if let Some(x) = &self.value {
2762            let p = path.field("value");
2763            v::max_length(x, 2500, &p)?;
2764        }
2765        Ok(())
2766    }
2767}
2768
2769/// Fixed read-only parameters of a variable.
2770#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2771#[serde(deny_unknown_fields)]
2772pub struct VariableCharacteristics {
2773    #[serde(
2774        rename = "customData",
2775        default,
2776        skip_serializing_if = "Option::is_none"
2777    )]
2778    pub custom_data: Option<CustomData>,
2779    /// Unit of the variable. When the transmitted value has a unit, this field SHALL be included.
2780    #[serde(rename = "unit", default, skip_serializing_if = "Option::is_none")]
2781    pub unit: Option<String>,
2782    #[serde(rename = "dataType")]
2783    pub data_type: DataEnum,
2784    /// Minimum possible value of this variable.
2785    #[serde(rename = "minLimit", default, skip_serializing_if = "Option::is_none")]
2786    pub min_limit: Option<f64>,
2787    /// Maximum possible value of this variable. When the datatype of this Variable is String, OptionList, SequenceList or MemberList, this field defines the maximum length of the (CSV) string.
2788    #[serde(rename = "maxLimit", default, skip_serializing_if = "Option::is_none")]
2789    pub max_limit: Option<f64>,
2790    /// Allowed values when variable is Option/Member/SequenceList.
2791    /// * OptionList: The (Actual) Variable value must be a single value from the reported (CSV) enumeration list.
2792    /// * MemberList: The (Actual) Variable value  may be an (unordered) (sub-)set of the reported (CSV) valid values list.
2793    /// * SequenceList: The (Actual) Variable value  may be an ordered (priority, etc)  (sub-)set of the reported (CSV) valid values.
2794    ///
2795    /// This is a comma separated list.
2796    /// The Configuration Variable &lt;&lt;configkey-configuration-value-size,ConfigurationValueSize&gt;&gt; can be used to limit SetVariableData.attributeValue and VariableCharacteristics.valueList. The max size of these values will always remain equal.
2797    #[serde(
2798        rename = "valuesList",
2799        default,
2800        skip_serializing_if = "Option::is_none"
2801    )]
2802    pub values_list: Option<String>,
2803    /// Flag indicating if this variable supports monitoring.
2804    #[serde(rename = "supportsMonitoring")]
2805    pub supports_monitoring: bool,
2806}
2807
2808impl Validate for VariableCharacteristics {
2809    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2810        if let Some(x) = &self.custom_data {
2811            let p = path.field("customData");
2812            x.validate(&p)?;
2813        }
2814        if let Some(x) = &self.unit {
2815            let p = path.field("unit");
2816            v::max_length(x, 16, &p)?;
2817        }
2818        if let Some(x) = &self.values_list {
2819            let p = path.field("valuesList");
2820            v::max_length(x, 1000, &p)?;
2821        }
2822        Ok(())
2823    }
2824}
2825
2826/// A monitoring setting for a variable.
2827#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2828#[serde(deny_unknown_fields)]
2829pub struct VariableMonitoring {
2830    #[serde(
2831        rename = "customData",
2832        default,
2833        skip_serializing_if = "Option::is_none"
2834    )]
2835    pub custom_data: Option<CustomData>,
2836    /// Identifies the monitor.
2837    #[serde(rename = "id")]
2838    pub id: i64,
2839    /// Monitor only active when a transaction is ongoing on a component relevant to this transaction.
2840    #[serde(rename = "transaction")]
2841    pub transaction: bool,
2842    /// Value for threshold or delta monitoring.
2843    /// For Periodic or PeriodicClockAligned this is the interval in seconds.
2844    #[serde(rename = "value")]
2845    pub value: f64,
2846    #[serde(rename = "type")]
2847    pub r#type: MonitorEnum,
2848    /// The severity that will be assigned to an event that is triggered by this monitor. The severity range is 0-9, with 0 as the highest and 9 as the lowest severity level.
2849    /// The severity levels have the following meaning: +
2850    /// *0-Danger* +
2851    /// Indicates lives are potentially in danger. Urgent attention is needed and action should be taken immediately. +
2852    /// *1-Hardware Failure* +
2853    /// Indicates that the Charging Station is unable to continue regular operations due to Hardware issues. Action is required. +
2854    /// *2-System Failure* +
2855    /// Indicates that the Charging Station is unable to continue regular operations due to software or minor hardware issues. Action is required. +
2856    /// *3-Critical* +
2857    /// Indicates a critical error. Action is required. +
2858    /// *4-Error* +
2859    /// Indicates a non-urgent error. Action is required. +
2860    /// *5-Alert* +
2861    /// Indicates an alert event. Default severity for any type of monitoring event.  +
2862    /// *6-Warning* +
2863    /// Indicates a warning event. Action may be required. +
2864    /// *7-Notice* +
2865    /// Indicates an unusual event. No immediate action is required. +
2866    /// *8-Informational* +
2867    /// Indicates a regular operational event. May be used for reporting, measuring throughput, etc. No action is required. +
2868    /// *9-Debug* +
2869    /// Indicates information useful to developers for debugging, not useful during operations.
2870    #[serde(rename = "severity")]
2871    pub severity: i64,
2872}
2873
2874impl Validate for VariableMonitoring {
2875    fn validate(&self, path: &Path<'_>) -> Result<(), Violation> {
2876        if let Some(x) = &self.custom_data {
2877            let p = path.field("customData");
2878            x.validate(&p)?;
2879        }
2880        Ok(())
2881    }
2882}