1#![allow(unused_imports, clippy::doc_markdown, clippy::struct_excessive_bools)]
7#![allow(
8 clippy::too_many_lines,
9 clippy::too_many_arguments,
10 clippy::wildcard_imports
11)]
12#![allow(clippy::match_same_arms, clippy::fn_params_excessive_bools)]
13
14use alloc::string::String;
15use alloc::vec::Vec;
16
17use serde::{Deserialize, Serialize};
18
19use super::action::Action;
20use super::enums::*;
21use super::types::*;
22use crate::message::{Confirmed, MessageKind, Origin, Request, Response, Sealed, Unconfirmed};
23use crate::validate::{self, Validate, ValidationPath, Violations};
24
25#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
27pub struct AuthorizeRequest {
28 #[serde(rename = "idToken")]
30 pub id_token: IdToken,
31 #[serde(default, skip_serializing_if = "Option::is_none")]
33 pub certificate: Option<String>,
34 #[serde(rename = "iso15118CertificateHashData")]
36 #[serde(default, skip_serializing_if = "Option::is_none")]
37 pub iso15118_certificate_hash_data: Option<Vec<OCSPRequestData>>,
38 #[serde(rename = "customData")]
40 #[serde(default, skip_serializing_if = "Option::is_none")]
41 pub custom_data: Option<crate::types::CustomData>,
42}
43
44impl AuthorizeRequest {
45 #[must_use]
47 pub fn new(id_token: IdToken) -> Self {
48 Self {
49 id_token,
50 certificate: None,
51 iso15118_certificate_hash_data: None,
52 custom_data: None,
53 }
54 }
55
56 #[must_use]
58 pub fn with_certificate(mut self, value: impl Into<String>) -> Self {
59 self.certificate = Some(value.into());
60 self
61 }
62
63 #[must_use]
65 pub fn with_iso15118_certificate_hash_data(mut self, value: Vec<OCSPRequestData>) -> Self {
66 self.iso15118_certificate_hash_data = Some(value);
67 self
68 }
69
70 #[must_use]
72 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
73 self.custom_data = Some(value);
74 self
75 }
76}
77
78impl Validate for AuthorizeRequest {
79 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
80 path.push_key("idToken");
81 Validate::validate_at(&self.id_token, path, out);
82 path.pop();
83 path.push_key("certificate");
84 if let Some(value) = &self.certificate {
85 validate::string(value.as_str(), None, Some(5500), path, out);
86 }
87 path.pop();
88 path.push_key("iso15118CertificateHashData");
89 if let Some(value) = &self.iso15118_certificate_hash_data {
90 validate::list_len(value.len(), Some(1), Some(4), path, out);
91 for (index, item) in value.iter().enumerate() {
92 path.push_index(index);
93 Validate::validate_at(item, path, out);
94 path.pop();
95 }
96 }
97 path.pop();
98 path.push_key("customData");
99 if let Some(value) = &self.custom_data {
100 Validate::validate_at(value, path, out);
101 }
102 path.pop();
103 }
104}
105
106impl Sealed for AuthorizeRequest {}
107impl Request for AuthorizeRequest {
108 type Action = Action;
109 const ACTION: Action = Action::Authorize;
110 const KIND: MessageKind = MessageKind::Call;
111 const ORIGIN: Origin = Origin::ChargingStation;
112 type Response = AuthorizeResponse;
113}
114
115impl Confirmed for AuthorizeRequest {}
116
117#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
119pub struct AuthorizeResponse {
120 #[serde(rename = "idTokenInfo")]
122 pub id_token_info: IdTokenInfo,
123 #[serde(rename = "certificateStatus")]
125 #[serde(default, skip_serializing_if = "Option::is_none")]
126 pub certificate_status: Option<AuthorizeCertificateStatus>,
127 #[serde(rename = "customData")]
129 #[serde(default, skip_serializing_if = "Option::is_none")]
130 pub custom_data: Option<crate::types::CustomData>,
131}
132
133impl AuthorizeResponse {
134 #[must_use]
136 pub fn new(id_token_info: IdTokenInfo) -> Self {
137 Self {
138 id_token_info,
139 certificate_status: None,
140 custom_data: None,
141 }
142 }
143
144 #[must_use]
146 pub fn with_certificate_status(mut self, value: AuthorizeCertificateStatus) -> Self {
147 self.certificate_status = Some(value);
148 self
149 }
150
151 #[must_use]
153 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
154 self.custom_data = Some(value);
155 self
156 }
157}
158
159impl Validate for AuthorizeResponse {
160 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
161 path.push_key("idTokenInfo");
162 Validate::validate_at(&self.id_token_info, path, out);
163 path.pop();
164 path.push_key("certificateStatus");
165 if let Some(value) = &self.certificate_status {
166 Validate::validate_at(value, path, out);
167 }
168 path.pop();
169 path.push_key("customData");
170 if let Some(value) = &self.custom_data {
171 Validate::validate_at(value, path, out);
172 }
173 path.pop();
174 }
175}
176
177impl Sealed for AuthorizeResponse {}
178impl Response for AuthorizeResponse {}
179
180#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
182pub struct BootNotificationRequest {
183 #[serde(rename = "chargingStation")]
185 pub charging_station: ChargingStation,
186 pub reason: BootReason,
188 #[serde(rename = "customData")]
190 #[serde(default, skip_serializing_if = "Option::is_none")]
191 pub custom_data: Option<crate::types::CustomData>,
192}
193
194impl BootNotificationRequest {
195 #[must_use]
197 pub fn new(charging_station: ChargingStation, reason: BootReason) -> Self {
198 Self {
199 charging_station,
200 reason,
201 custom_data: None,
202 }
203 }
204
205 #[must_use]
207 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
208 self.custom_data = Some(value);
209 self
210 }
211}
212
213impl Validate for BootNotificationRequest {
214 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
215 path.push_key("chargingStation");
216 Validate::validate_at(&self.charging_station, path, out);
217 path.pop();
218 path.push_key("reason");
219 Validate::validate_at(&self.reason, path, out);
220 path.pop();
221 path.push_key("customData");
222 if let Some(value) = &self.custom_data {
223 Validate::validate_at(value, path, out);
224 }
225 path.pop();
226 }
227}
228
229impl Sealed for BootNotificationRequest {}
230impl Request for BootNotificationRequest {
231 type Action = Action;
232 const ACTION: Action = Action::BootNotification;
233 const KIND: MessageKind = MessageKind::Call;
234 const ORIGIN: Origin = Origin::ChargingStation;
235 type Response = BootNotificationResponse;
236}
237
238impl Confirmed for BootNotificationRequest {}
239
240#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
242pub struct BootNotificationResponse {
243 #[serde(rename = "currentTime")]
245 pub current_time: crate::types::DateTime,
246 #[serde(deserialize_with = "crate::types::integer::one")]
248 pub interval: i32,
249 pub status: RegistrationStatus,
251 #[serde(rename = "statusInfo")]
253 #[serde(default, skip_serializing_if = "Option::is_none")]
254 pub status_info: Option<StatusInfo>,
255 #[serde(rename = "customData")]
257 #[serde(default, skip_serializing_if = "Option::is_none")]
258 pub custom_data: Option<crate::types::CustomData>,
259}
260
261impl BootNotificationResponse {
262 #[must_use]
264 pub fn new(
265 current_time: impl Into<crate::types::DateTime>,
266 interval: i32,
267 status: RegistrationStatus,
268 ) -> Self {
269 Self {
270 current_time: current_time.into(),
271 interval,
272 status,
273 status_info: None,
274 custom_data: None,
275 }
276 }
277
278 #[must_use]
280 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
281 self.status_info = Some(value);
282 self
283 }
284
285 #[must_use]
287 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
288 self.custom_data = Some(value);
289 self
290 }
291}
292
293impl Validate for BootNotificationResponse {
294 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
295 path.push_key("status");
296 Validate::validate_at(&self.status, path, out);
297 path.pop();
298 path.push_key("statusInfo");
299 if let Some(value) = &self.status_info {
300 Validate::validate_at(value, path, out);
301 }
302 path.pop();
303 path.push_key("customData");
304 if let Some(value) = &self.custom_data {
305 Validate::validate_at(value, path, out);
306 }
307 path.pop();
308 }
309}
310
311impl Sealed for BootNotificationResponse {}
312impl Response for BootNotificationResponse {}
313
314#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
316pub struct CancelReservationRequest {
317 #[serde(rename = "reservationId")]
319 #[serde(deserialize_with = "crate::types::integer::one")]
320 pub reservation_id: i32,
321 #[serde(rename = "customData")]
323 #[serde(default, skip_serializing_if = "Option::is_none")]
324 pub custom_data: Option<crate::types::CustomData>,
325}
326
327impl CancelReservationRequest {
328 #[must_use]
330 pub fn new(reservation_id: i32) -> Self {
331 Self {
332 reservation_id,
333 custom_data: None,
334 }
335 }
336
337 #[must_use]
339 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
340 self.custom_data = Some(value);
341 self
342 }
343}
344
345impl Validate for CancelReservationRequest {
346 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
347 path.push_key("customData");
348 if let Some(value) = &self.custom_data {
349 Validate::validate_at(value, path, out);
350 }
351 path.pop();
352 }
353}
354
355impl Sealed for CancelReservationRequest {}
356impl Request for CancelReservationRequest {
357 type Action = Action;
358 const ACTION: Action = Action::CancelReservation;
359 const KIND: MessageKind = MessageKind::Call;
360 const ORIGIN: Origin = Origin::Csms;
361 type Response = CancelReservationResponse;
362}
363
364impl Confirmed for CancelReservationRequest {}
365
366#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
368pub struct CancelReservationResponse {
369 pub status: CancelReservationStatus,
371 #[serde(rename = "statusInfo")]
373 #[serde(default, skip_serializing_if = "Option::is_none")]
374 pub status_info: Option<StatusInfo>,
375 #[serde(rename = "customData")]
377 #[serde(default, skip_serializing_if = "Option::is_none")]
378 pub custom_data: Option<crate::types::CustomData>,
379}
380
381impl CancelReservationResponse {
382 #[must_use]
384 pub fn new(status: CancelReservationStatus) -> Self {
385 Self {
386 status,
387 status_info: None,
388 custom_data: None,
389 }
390 }
391
392 #[must_use]
394 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
395 self.status_info = Some(value);
396 self
397 }
398
399 #[must_use]
401 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
402 self.custom_data = Some(value);
403 self
404 }
405}
406
407impl Validate for CancelReservationResponse {
408 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
409 path.push_key("status");
410 Validate::validate_at(&self.status, path, out);
411 path.pop();
412 path.push_key("statusInfo");
413 if let Some(value) = &self.status_info {
414 Validate::validate_at(value, path, out);
415 }
416 path.pop();
417 path.push_key("customData");
418 if let Some(value) = &self.custom_data {
419 Validate::validate_at(value, path, out);
420 }
421 path.pop();
422 }
423}
424
425impl Sealed for CancelReservationResponse {}
426impl Response for CancelReservationResponse {}
427
428#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
430pub struct CertificateSignedRequest {
431 #[serde(rename = "certificateChain")]
435 pub certificate_chain: String,
436 #[serde(rename = "certificateType")]
438 #[serde(default, skip_serializing_if = "Option::is_none")]
439 pub certificate_type: Option<CertificateSigningUse>,
440 #[serde(rename = "customData")]
442 #[serde(default, skip_serializing_if = "Option::is_none")]
443 pub custom_data: Option<crate::types::CustomData>,
444}
445
446impl CertificateSignedRequest {
447 #[must_use]
449 pub fn new(certificate_chain: impl Into<String>) -> Self {
450 Self {
451 certificate_chain: certificate_chain.into(),
452 certificate_type: None,
453 custom_data: None,
454 }
455 }
456
457 #[must_use]
459 pub fn with_certificate_type(mut self, value: CertificateSigningUse) -> Self {
460 self.certificate_type = Some(value);
461 self
462 }
463
464 #[must_use]
466 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
467 self.custom_data = Some(value);
468 self
469 }
470}
471
472impl Validate for CertificateSignedRequest {
473 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
474 path.push_key("certificateChain");
475 validate::string(
476 self.certificate_chain.as_str(),
477 None,
478 Some(10000),
479 path,
480 out,
481 );
482 path.pop();
483 path.push_key("certificateType");
484 if let Some(value) = &self.certificate_type {
485 Validate::validate_at(value, path, out);
486 }
487 path.pop();
488 path.push_key("customData");
489 if let Some(value) = &self.custom_data {
490 Validate::validate_at(value, path, out);
491 }
492 path.pop();
493 }
494}
495
496impl Sealed for CertificateSignedRequest {}
497impl Request for CertificateSignedRequest {
498 type Action = Action;
499 const ACTION: Action = Action::CertificateSigned;
500 const KIND: MessageKind = MessageKind::Call;
501 const ORIGIN: Origin = Origin::Csms;
502 type Response = CertificateSignedResponse;
503}
504
505impl Confirmed for CertificateSignedRequest {}
506
507#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
509pub struct CertificateSignedResponse {
510 pub status: CertificateSignedStatus,
512 #[serde(rename = "statusInfo")]
514 #[serde(default, skip_serializing_if = "Option::is_none")]
515 pub status_info: Option<StatusInfo>,
516 #[serde(rename = "customData")]
518 #[serde(default, skip_serializing_if = "Option::is_none")]
519 pub custom_data: Option<crate::types::CustomData>,
520}
521
522impl CertificateSignedResponse {
523 #[must_use]
525 pub fn new(status: CertificateSignedStatus) -> Self {
526 Self {
527 status,
528 status_info: None,
529 custom_data: None,
530 }
531 }
532
533 #[must_use]
535 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
536 self.status_info = Some(value);
537 self
538 }
539
540 #[must_use]
542 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
543 self.custom_data = Some(value);
544 self
545 }
546}
547
548impl Validate for CertificateSignedResponse {
549 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
550 path.push_key("status");
551 Validate::validate_at(&self.status, path, out);
552 path.pop();
553 path.push_key("statusInfo");
554 if let Some(value) = &self.status_info {
555 Validate::validate_at(value, path, out);
556 }
557 path.pop();
558 path.push_key("customData");
559 if let Some(value) = &self.custom_data {
560 Validate::validate_at(value, path, out);
561 }
562 path.pop();
563 }
564}
565
566impl Sealed for CertificateSignedResponse {}
567impl Response for CertificateSignedResponse {}
568
569#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
571pub struct ChangeAvailabilityRequest {
572 #[serde(rename = "operationalStatus")]
574 pub operational_status: OperationalStatus,
575 #[serde(default, skip_serializing_if = "Option::is_none")]
577 pub evse: Option<EVSE>,
578 #[serde(rename = "customData")]
580 #[serde(default, skip_serializing_if = "Option::is_none")]
581 pub custom_data: Option<crate::types::CustomData>,
582}
583
584impl ChangeAvailabilityRequest {
585 #[must_use]
587 pub fn new(operational_status: OperationalStatus) -> Self {
588 Self {
589 operational_status,
590 evse: None,
591 custom_data: None,
592 }
593 }
594
595 #[must_use]
597 pub fn with_evse(mut self, value: EVSE) -> Self {
598 self.evse = Some(value);
599 self
600 }
601
602 #[must_use]
604 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
605 self.custom_data = Some(value);
606 self
607 }
608}
609
610impl Validate for ChangeAvailabilityRequest {
611 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
612 path.push_key("operationalStatus");
613 Validate::validate_at(&self.operational_status, path, out);
614 path.pop();
615 path.push_key("evse");
616 if let Some(value) = &self.evse {
617 Validate::validate_at(value, path, out);
618 }
619 path.pop();
620 path.push_key("customData");
621 if let Some(value) = &self.custom_data {
622 Validate::validate_at(value, path, out);
623 }
624 path.pop();
625 }
626}
627
628impl Sealed for ChangeAvailabilityRequest {}
629impl Request for ChangeAvailabilityRequest {
630 type Action = Action;
631 const ACTION: Action = Action::ChangeAvailability;
632 const KIND: MessageKind = MessageKind::Call;
633 const ORIGIN: Origin = Origin::Csms;
634 type Response = ChangeAvailabilityResponse;
635}
636
637impl Confirmed for ChangeAvailabilityRequest {}
638
639#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
641pub struct ChangeAvailabilityResponse {
642 pub status: ChangeAvailabilityStatus,
644 #[serde(rename = "statusInfo")]
646 #[serde(default, skip_serializing_if = "Option::is_none")]
647 pub status_info: Option<StatusInfo>,
648 #[serde(rename = "customData")]
650 #[serde(default, skip_serializing_if = "Option::is_none")]
651 pub custom_data: Option<crate::types::CustomData>,
652}
653
654impl ChangeAvailabilityResponse {
655 #[must_use]
657 pub fn new(status: ChangeAvailabilityStatus) -> Self {
658 Self {
659 status,
660 status_info: None,
661 custom_data: None,
662 }
663 }
664
665 #[must_use]
667 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
668 self.status_info = Some(value);
669 self
670 }
671
672 #[must_use]
674 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
675 self.custom_data = Some(value);
676 self
677 }
678}
679
680impl Validate for ChangeAvailabilityResponse {
681 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
682 path.push_key("status");
683 Validate::validate_at(&self.status, path, out);
684 path.pop();
685 path.push_key("statusInfo");
686 if let Some(value) = &self.status_info {
687 Validate::validate_at(value, path, out);
688 }
689 path.pop();
690 path.push_key("customData");
691 if let Some(value) = &self.custom_data {
692 Validate::validate_at(value, path, out);
693 }
694 path.pop();
695 }
696}
697
698impl Sealed for ChangeAvailabilityResponse {}
699impl Response for ChangeAvailabilityResponse {}
700
701#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
703pub struct ClearCacheRequest {
704 #[serde(rename = "customData")]
706 #[serde(default, skip_serializing_if = "Option::is_none")]
707 pub custom_data: Option<crate::types::CustomData>,
708}
709
710impl ClearCacheRequest {
711 #[must_use]
713 pub fn new() -> Self {
714 Self::default()
715 }
716
717 #[must_use]
719 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
720 self.custom_data = Some(value);
721 self
722 }
723}
724
725impl Validate for ClearCacheRequest {
726 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
727 path.push_key("customData");
728 if let Some(value) = &self.custom_data {
729 Validate::validate_at(value, path, out);
730 }
731 path.pop();
732 }
733}
734
735impl Sealed for ClearCacheRequest {}
736impl Request for ClearCacheRequest {
737 type Action = Action;
738 const ACTION: Action = Action::ClearCache;
739 const KIND: MessageKind = MessageKind::Call;
740 const ORIGIN: Origin = Origin::Csms;
741 type Response = ClearCacheResponse;
742}
743
744impl Confirmed for ClearCacheRequest {}
745
746#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
748pub struct ClearCacheResponse {
749 pub status: ClearCacheStatus,
751 #[serde(rename = "statusInfo")]
753 #[serde(default, skip_serializing_if = "Option::is_none")]
754 pub status_info: Option<StatusInfo>,
755 #[serde(rename = "customData")]
757 #[serde(default, skip_serializing_if = "Option::is_none")]
758 pub custom_data: Option<crate::types::CustomData>,
759}
760
761impl ClearCacheResponse {
762 #[must_use]
764 pub fn new(status: ClearCacheStatus) -> Self {
765 Self {
766 status,
767 status_info: None,
768 custom_data: None,
769 }
770 }
771
772 #[must_use]
774 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
775 self.status_info = Some(value);
776 self
777 }
778
779 #[must_use]
781 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
782 self.custom_data = Some(value);
783 self
784 }
785}
786
787impl Validate for ClearCacheResponse {
788 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
789 path.push_key("status");
790 Validate::validate_at(&self.status, path, out);
791 path.pop();
792 path.push_key("statusInfo");
793 if let Some(value) = &self.status_info {
794 Validate::validate_at(value, path, out);
795 }
796 path.pop();
797 path.push_key("customData");
798 if let Some(value) = &self.custom_data {
799 Validate::validate_at(value, path, out);
800 }
801 path.pop();
802 }
803}
804
805impl Sealed for ClearCacheResponse {}
806impl Response for ClearCacheResponse {}
807
808#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
810pub struct ClearChargingProfileRequest {
811 #[serde(rename = "chargingProfileId")]
813 #[serde(default, skip_serializing_if = "Option::is_none")]
814 #[serde(deserialize_with = "crate::types::integer::option")]
815 pub charging_profile_id: Option<i32>,
816 #[serde(rename = "chargingProfileCriteria")]
818 #[serde(default, skip_serializing_if = "Option::is_none")]
819 pub charging_profile_criteria: Option<ClearChargingProfile>,
820 #[serde(rename = "customData")]
822 #[serde(default, skip_serializing_if = "Option::is_none")]
823 pub custom_data: Option<crate::types::CustomData>,
824}
825
826impl ClearChargingProfileRequest {
827 #[must_use]
829 pub fn new() -> Self {
830 Self::default()
831 }
832
833 #[must_use]
835 pub fn with_charging_profile_id(mut self, value: i32) -> Self {
836 self.charging_profile_id = Some(value);
837 self
838 }
839
840 #[must_use]
842 pub fn with_charging_profile_criteria(mut self, value: ClearChargingProfile) -> Self {
843 self.charging_profile_criteria = Some(value);
844 self
845 }
846
847 #[must_use]
849 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
850 self.custom_data = Some(value);
851 self
852 }
853}
854
855impl Validate for ClearChargingProfileRequest {
856 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
857 path.push_key("chargingProfileCriteria");
858 if let Some(value) = &self.charging_profile_criteria {
859 Validate::validate_at(value, path, out);
860 }
861 path.pop();
862 path.push_key("customData");
863 if let Some(value) = &self.custom_data {
864 Validate::validate_at(value, path, out);
865 }
866 path.pop();
867 }
868}
869
870impl Sealed for ClearChargingProfileRequest {}
871impl Request for ClearChargingProfileRequest {
872 type Action = Action;
873 const ACTION: Action = Action::ClearChargingProfile;
874 const KIND: MessageKind = MessageKind::Call;
875 const ORIGIN: Origin = Origin::Csms;
876 type Response = ClearChargingProfileResponse;
877}
878
879impl Confirmed for ClearChargingProfileRequest {}
880
881#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
883pub struct ClearChargingProfileResponse {
884 pub status: ClearChargingProfileStatus,
886 #[serde(rename = "statusInfo")]
888 #[serde(default, skip_serializing_if = "Option::is_none")]
889 pub status_info: Option<StatusInfo>,
890 #[serde(rename = "customData")]
892 #[serde(default, skip_serializing_if = "Option::is_none")]
893 pub custom_data: Option<crate::types::CustomData>,
894}
895
896impl ClearChargingProfileResponse {
897 #[must_use]
899 pub fn new(status: ClearChargingProfileStatus) -> Self {
900 Self {
901 status,
902 status_info: None,
903 custom_data: None,
904 }
905 }
906
907 #[must_use]
909 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
910 self.status_info = Some(value);
911 self
912 }
913
914 #[must_use]
916 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
917 self.custom_data = Some(value);
918 self
919 }
920}
921
922impl Validate for ClearChargingProfileResponse {
923 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
924 path.push_key("status");
925 Validate::validate_at(&self.status, path, out);
926 path.pop();
927 path.push_key("statusInfo");
928 if let Some(value) = &self.status_info {
929 Validate::validate_at(value, path, out);
930 }
931 path.pop();
932 path.push_key("customData");
933 if let Some(value) = &self.custom_data {
934 Validate::validate_at(value, path, out);
935 }
936 path.pop();
937 }
938}
939
940impl Sealed for ClearChargingProfileResponse {}
941impl Response for ClearChargingProfileResponse {}
942
943#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
945pub struct ClearDisplayMessageRequest {
946 #[serde(deserialize_with = "crate::types::integer::one")]
948 pub id: i32,
949 #[serde(rename = "customData")]
951 #[serde(default, skip_serializing_if = "Option::is_none")]
952 pub custom_data: Option<crate::types::CustomData>,
953}
954
955impl ClearDisplayMessageRequest {
956 #[must_use]
958 pub fn new(id: i32) -> Self {
959 Self {
960 id,
961 custom_data: None,
962 }
963 }
964
965 #[must_use]
967 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
968 self.custom_data = Some(value);
969 self
970 }
971}
972
973impl Validate for ClearDisplayMessageRequest {
974 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
975 path.push_key("customData");
976 if let Some(value) = &self.custom_data {
977 Validate::validate_at(value, path, out);
978 }
979 path.pop();
980 }
981}
982
983impl Sealed for ClearDisplayMessageRequest {}
984impl Request for ClearDisplayMessageRequest {
985 type Action = Action;
986 const ACTION: Action = Action::ClearDisplayMessage;
987 const KIND: MessageKind = MessageKind::Call;
988 const ORIGIN: Origin = Origin::Csms;
989 type Response = ClearDisplayMessageResponse;
990}
991
992impl Confirmed for ClearDisplayMessageRequest {}
993
994#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
996pub struct ClearDisplayMessageResponse {
997 pub status: ClearMessageStatus,
999 #[serde(rename = "statusInfo")]
1001 #[serde(default, skip_serializing_if = "Option::is_none")]
1002 pub status_info: Option<StatusInfo>,
1003 #[serde(rename = "customData")]
1005 #[serde(default, skip_serializing_if = "Option::is_none")]
1006 pub custom_data: Option<crate::types::CustomData>,
1007}
1008
1009impl ClearDisplayMessageResponse {
1010 #[must_use]
1012 pub fn new(status: ClearMessageStatus) -> Self {
1013 Self {
1014 status,
1015 status_info: None,
1016 custom_data: None,
1017 }
1018 }
1019
1020 #[must_use]
1022 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1023 self.status_info = Some(value);
1024 self
1025 }
1026
1027 #[must_use]
1029 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1030 self.custom_data = Some(value);
1031 self
1032 }
1033}
1034
1035impl Validate for ClearDisplayMessageResponse {
1036 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1037 path.push_key("status");
1038 Validate::validate_at(&self.status, path, out);
1039 path.pop();
1040 path.push_key("statusInfo");
1041 if let Some(value) = &self.status_info {
1042 Validate::validate_at(value, path, out);
1043 }
1044 path.pop();
1045 path.push_key("customData");
1046 if let Some(value) = &self.custom_data {
1047 Validate::validate_at(value, path, out);
1048 }
1049 path.pop();
1050 }
1051}
1052
1053impl Sealed for ClearDisplayMessageResponse {}
1054impl Response for ClearDisplayMessageResponse {}
1055
1056#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1058pub struct ClearVariableMonitoringRequest {
1059 #[serde(deserialize_with = "crate::types::integer::list")]
1061 pub id: Vec<i32>,
1062 #[serde(rename = "customData")]
1064 #[serde(default, skip_serializing_if = "Option::is_none")]
1065 pub custom_data: Option<crate::types::CustomData>,
1066}
1067
1068impl ClearVariableMonitoringRequest {
1069 #[must_use]
1071 pub fn new(id: Vec<i32>) -> Self {
1072 Self {
1073 id,
1074 custom_data: None,
1075 }
1076 }
1077
1078 #[must_use]
1080 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1081 self.custom_data = Some(value);
1082 self
1083 }
1084}
1085
1086impl Validate for ClearVariableMonitoringRequest {
1087 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1088 path.push_key("id");
1089 validate::list_len(self.id.len(), Some(1), None, path, out);
1090 path.pop();
1091 path.push_key("customData");
1092 if let Some(value) = &self.custom_data {
1093 Validate::validate_at(value, path, out);
1094 }
1095 path.pop();
1096 }
1097}
1098
1099impl Sealed for ClearVariableMonitoringRequest {}
1100impl Request for ClearVariableMonitoringRequest {
1101 type Action = Action;
1102 const ACTION: Action = Action::ClearVariableMonitoring;
1103 const KIND: MessageKind = MessageKind::Call;
1104 const ORIGIN: Origin = Origin::Csms;
1105 type Response = ClearVariableMonitoringResponse;
1106}
1107
1108impl Confirmed for ClearVariableMonitoringRequest {}
1109
1110#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1112pub struct ClearVariableMonitoringResponse {
1113 #[serde(rename = "clearMonitoringResult")]
1115 pub clear_monitoring_result: Vec<ClearMonitoringResult>,
1116 #[serde(rename = "customData")]
1118 #[serde(default, skip_serializing_if = "Option::is_none")]
1119 pub custom_data: Option<crate::types::CustomData>,
1120}
1121
1122impl ClearVariableMonitoringResponse {
1123 #[must_use]
1125 pub fn new(clear_monitoring_result: Vec<ClearMonitoringResult>) -> Self {
1126 Self {
1127 clear_monitoring_result,
1128 custom_data: None,
1129 }
1130 }
1131
1132 #[must_use]
1134 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1135 self.custom_data = Some(value);
1136 self
1137 }
1138}
1139
1140impl Validate for ClearVariableMonitoringResponse {
1141 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1142 path.push_key("clearMonitoringResult");
1143 validate::list_len(self.clear_monitoring_result.len(), Some(1), None, path, out);
1144 for (index, item) in self.clear_monitoring_result.iter().enumerate() {
1145 path.push_index(index);
1146 Validate::validate_at(item, path, out);
1147 path.pop();
1148 }
1149 path.pop();
1150 path.push_key("customData");
1151 if let Some(value) = &self.custom_data {
1152 Validate::validate_at(value, path, out);
1153 }
1154 path.pop();
1155 }
1156}
1157
1158impl Sealed for ClearVariableMonitoringResponse {}
1159impl Response for ClearVariableMonitoringResponse {}
1160
1161#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1163pub struct ClearedChargingLimitRequest {
1164 #[serde(rename = "chargingLimitSource")]
1166 pub charging_limit_source: ChargingLimitSource,
1167 #[serde(rename = "evseId")]
1169 #[serde(default, skip_serializing_if = "Option::is_none")]
1170 #[serde(deserialize_with = "crate::types::integer::option")]
1171 pub evse_id: Option<i32>,
1172 #[serde(rename = "customData")]
1174 #[serde(default, skip_serializing_if = "Option::is_none")]
1175 pub custom_data: Option<crate::types::CustomData>,
1176}
1177
1178impl ClearedChargingLimitRequest {
1179 #[must_use]
1181 pub fn new(charging_limit_source: ChargingLimitSource) -> Self {
1182 Self {
1183 charging_limit_source,
1184 evse_id: None,
1185 custom_data: None,
1186 }
1187 }
1188
1189 #[must_use]
1191 pub fn with_evse_id(mut self, value: i32) -> Self {
1192 self.evse_id = Some(value);
1193 self
1194 }
1195
1196 #[must_use]
1198 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1199 self.custom_data = Some(value);
1200 self
1201 }
1202}
1203
1204impl Validate for ClearedChargingLimitRequest {
1205 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1206 path.push_key("chargingLimitSource");
1207 Validate::validate_at(&self.charging_limit_source, path, out);
1208 path.pop();
1209 path.push_key("customData");
1210 if let Some(value) = &self.custom_data {
1211 Validate::validate_at(value, path, out);
1212 }
1213 path.pop();
1214 }
1215}
1216
1217impl Sealed for ClearedChargingLimitRequest {}
1218impl Request for ClearedChargingLimitRequest {
1219 type Action = Action;
1220 const ACTION: Action = Action::ClearedChargingLimit;
1221 const KIND: MessageKind = MessageKind::Call;
1222 const ORIGIN: Origin = Origin::ChargingStation;
1223 type Response = ClearedChargingLimitResponse;
1224}
1225
1226impl Confirmed for ClearedChargingLimitRequest {}
1227
1228#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1230pub struct ClearedChargingLimitResponse {
1231 #[serde(rename = "customData")]
1233 #[serde(default, skip_serializing_if = "Option::is_none")]
1234 pub custom_data: Option<crate::types::CustomData>,
1235}
1236
1237impl ClearedChargingLimitResponse {
1238 #[must_use]
1240 pub fn new() -> Self {
1241 Self::default()
1242 }
1243
1244 #[must_use]
1246 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1247 self.custom_data = Some(value);
1248 self
1249 }
1250}
1251
1252impl Validate for ClearedChargingLimitResponse {
1253 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1254 path.push_key("customData");
1255 if let Some(value) = &self.custom_data {
1256 Validate::validate_at(value, path, out);
1257 }
1258 path.pop();
1259 }
1260}
1261
1262impl Sealed for ClearedChargingLimitResponse {}
1263impl Response for ClearedChargingLimitResponse {}
1264
1265#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1267pub struct CostUpdatedRequest {
1268 #[serde(rename = "totalCost")]
1270 pub total_cost: crate::types::Decimal,
1271 #[serde(rename = "transactionId")]
1273 pub transaction_id: String,
1274 #[serde(rename = "customData")]
1276 #[serde(default, skip_serializing_if = "Option::is_none")]
1277 pub custom_data: Option<crate::types::CustomData>,
1278}
1279
1280impl CostUpdatedRequest {
1281 #[must_use]
1283 pub fn new(
1284 total_cost: impl Into<crate::types::Decimal>,
1285 transaction_id: impl Into<String>,
1286 ) -> Self {
1287 Self {
1288 total_cost: total_cost.into(),
1289 transaction_id: transaction_id.into(),
1290 custom_data: None,
1291 }
1292 }
1293
1294 #[must_use]
1296 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1297 self.custom_data = Some(value);
1298 self
1299 }
1300}
1301
1302impl Validate for CostUpdatedRequest {
1303 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1304 path.push_key("transactionId");
1305 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
1306 path.pop();
1307 path.push_key("customData");
1308 if let Some(value) = &self.custom_data {
1309 Validate::validate_at(value, path, out);
1310 }
1311 path.pop();
1312 }
1313}
1314
1315impl Sealed for CostUpdatedRequest {}
1316impl Request for CostUpdatedRequest {
1317 type Action = Action;
1318 const ACTION: Action = Action::CostUpdated;
1319 const KIND: MessageKind = MessageKind::Call;
1320 const ORIGIN: Origin = Origin::Csms;
1321 type Response = CostUpdatedResponse;
1322}
1323
1324impl Confirmed for CostUpdatedRequest {}
1325
1326#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1328pub struct CostUpdatedResponse {
1329 #[serde(rename = "customData")]
1331 #[serde(default, skip_serializing_if = "Option::is_none")]
1332 pub custom_data: Option<crate::types::CustomData>,
1333}
1334
1335impl CostUpdatedResponse {
1336 #[must_use]
1338 pub fn new() -> Self {
1339 Self::default()
1340 }
1341
1342 #[must_use]
1344 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1345 self.custom_data = Some(value);
1346 self
1347 }
1348}
1349
1350impl Validate for CostUpdatedResponse {
1351 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1352 path.push_key("customData");
1353 if let Some(value) = &self.custom_data {
1354 Validate::validate_at(value, path, out);
1355 }
1356 path.pop();
1357 }
1358}
1359
1360impl Sealed for CostUpdatedResponse {}
1361impl Response for CostUpdatedResponse {}
1362
1363#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1365pub struct CustomerInformationRequest {
1366 #[serde(rename = "requestId")]
1368 #[serde(deserialize_with = "crate::types::integer::one")]
1369 pub request_id: i32,
1370 pub report: bool,
1372 pub clear: bool,
1374 #[serde(rename = "customerCertificate")]
1376 #[serde(default, skip_serializing_if = "Option::is_none")]
1377 pub customer_certificate: Option<CertificateHashData>,
1378 #[serde(rename = "idToken")]
1380 #[serde(default, skip_serializing_if = "Option::is_none")]
1381 pub id_token: Option<IdToken>,
1382 #[serde(rename = "customerIdentifier")]
1385 #[serde(default, skip_serializing_if = "Option::is_none")]
1386 pub customer_identifier: Option<String>,
1387 #[serde(rename = "customData")]
1389 #[serde(default, skip_serializing_if = "Option::is_none")]
1390 pub custom_data: Option<crate::types::CustomData>,
1391}
1392
1393impl CustomerInformationRequest {
1394 #[must_use]
1396 pub fn new(request_id: i32, report: bool, clear: bool) -> Self {
1397 Self {
1398 request_id,
1399 report,
1400 clear,
1401 customer_certificate: None,
1402 id_token: None,
1403 customer_identifier: None,
1404 custom_data: None,
1405 }
1406 }
1407
1408 #[must_use]
1410 pub fn with_customer_certificate(mut self, value: CertificateHashData) -> Self {
1411 self.customer_certificate = Some(value);
1412 self
1413 }
1414
1415 #[must_use]
1417 pub fn with_id_token(mut self, value: IdToken) -> Self {
1418 self.id_token = Some(value);
1419 self
1420 }
1421
1422 #[must_use]
1424 pub fn with_customer_identifier(mut self, value: impl Into<String>) -> Self {
1425 self.customer_identifier = Some(value.into());
1426 self
1427 }
1428
1429 #[must_use]
1431 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1432 self.custom_data = Some(value);
1433 self
1434 }
1435}
1436
1437impl Validate for CustomerInformationRequest {
1438 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1439 path.push_key("customerCertificate");
1440 if let Some(value) = &self.customer_certificate {
1441 Validate::validate_at(value, path, out);
1442 }
1443 path.pop();
1444 path.push_key("idToken");
1445 if let Some(value) = &self.id_token {
1446 Validate::validate_at(value, path, out);
1447 }
1448 path.pop();
1449 path.push_key("customerIdentifier");
1450 if let Some(value) = &self.customer_identifier {
1451 validate::string(value.as_str(), None, Some(64), path, out);
1452 }
1453 path.pop();
1454 path.push_key("customData");
1455 if let Some(value) = &self.custom_data {
1456 Validate::validate_at(value, path, out);
1457 }
1458 path.pop();
1459 }
1460}
1461
1462impl Sealed for CustomerInformationRequest {}
1463impl Request for CustomerInformationRequest {
1464 type Action = Action;
1465 const ACTION: Action = Action::CustomerInformation;
1466 const KIND: MessageKind = MessageKind::Call;
1467 const ORIGIN: Origin = Origin::Csms;
1468 type Response = CustomerInformationResponse;
1469}
1470
1471impl Confirmed for CustomerInformationRequest {}
1472
1473#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1475pub struct CustomerInformationResponse {
1476 pub status: CustomerInformationStatus,
1478 #[serde(rename = "statusInfo")]
1480 #[serde(default, skip_serializing_if = "Option::is_none")]
1481 pub status_info: Option<StatusInfo>,
1482 #[serde(rename = "customData")]
1484 #[serde(default, skip_serializing_if = "Option::is_none")]
1485 pub custom_data: Option<crate::types::CustomData>,
1486}
1487
1488impl CustomerInformationResponse {
1489 #[must_use]
1491 pub fn new(status: CustomerInformationStatus) -> Self {
1492 Self {
1493 status,
1494 status_info: None,
1495 custom_data: None,
1496 }
1497 }
1498
1499 #[must_use]
1501 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1502 self.status_info = Some(value);
1503 self
1504 }
1505
1506 #[must_use]
1508 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1509 self.custom_data = Some(value);
1510 self
1511 }
1512}
1513
1514impl Validate for CustomerInformationResponse {
1515 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1516 path.push_key("status");
1517 Validate::validate_at(&self.status, path, out);
1518 path.pop();
1519 path.push_key("statusInfo");
1520 if let Some(value) = &self.status_info {
1521 Validate::validate_at(value, path, out);
1522 }
1523 path.pop();
1524 path.push_key("customData");
1525 if let Some(value) = &self.custom_data {
1526 Validate::validate_at(value, path, out);
1527 }
1528 path.pop();
1529 }
1530}
1531
1532impl Sealed for CustomerInformationResponse {}
1533impl Response for CustomerInformationResponse {}
1534
1535#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1537pub struct DataTransferRequest {
1538 #[serde(rename = "vendorId")]
1540 pub vendor_id: String,
1541 #[serde(rename = "messageId")]
1543 #[serde(default, skip_serializing_if = "Option::is_none")]
1544 pub message_id: Option<String>,
1545 #[serde(default, skip_serializing_if = "Option::is_none")]
1547 pub data: Option<serde_json::Value>,
1548 #[serde(rename = "customData")]
1550 #[serde(default, skip_serializing_if = "Option::is_none")]
1551 pub custom_data: Option<crate::types::CustomData>,
1552}
1553
1554impl DataTransferRequest {
1555 #[must_use]
1557 pub fn new(vendor_id: impl Into<String>) -> Self {
1558 Self {
1559 vendor_id: vendor_id.into(),
1560 message_id: None,
1561 data: None,
1562 custom_data: None,
1563 }
1564 }
1565
1566 #[must_use]
1568 pub fn with_message_id(mut self, value: impl Into<String>) -> Self {
1569 self.message_id = Some(value.into());
1570 self
1571 }
1572
1573 #[must_use]
1575 pub fn with_data(mut self, value: serde_json::Value) -> Self {
1576 self.data = Some(value);
1577 self
1578 }
1579
1580 #[must_use]
1582 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1583 self.custom_data = Some(value);
1584 self
1585 }
1586}
1587
1588impl Validate for DataTransferRequest {
1589 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1590 path.push_key("vendorId");
1591 validate::string(self.vendor_id.as_str(), None, Some(255), path, out);
1592 path.pop();
1593 path.push_key("messageId");
1594 if let Some(value) = &self.message_id {
1595 validate::string(value.as_str(), None, Some(50), path, out);
1596 }
1597 path.pop();
1598 path.push_key("customData");
1599 if let Some(value) = &self.custom_data {
1600 Validate::validate_at(value, path, out);
1601 }
1602 path.pop();
1603 }
1604}
1605
1606impl Sealed for DataTransferRequest {}
1607impl Request for DataTransferRequest {
1608 type Action = Action;
1609 const ACTION: Action = Action::DataTransfer;
1610 const KIND: MessageKind = MessageKind::Call;
1611 const ORIGIN: Origin = Origin::Both;
1612 type Response = DataTransferResponse;
1613}
1614
1615impl Confirmed for DataTransferRequest {}
1616
1617#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1619pub struct DataTransferResponse {
1620 pub status: DataTransferStatus,
1622 #[serde(rename = "statusInfo")]
1624 #[serde(default, skip_serializing_if = "Option::is_none")]
1625 pub status_info: Option<StatusInfo>,
1626 #[serde(default, skip_serializing_if = "Option::is_none")]
1628 pub data: Option<serde_json::Value>,
1629 #[serde(rename = "customData")]
1631 #[serde(default, skip_serializing_if = "Option::is_none")]
1632 pub custom_data: Option<crate::types::CustomData>,
1633}
1634
1635impl DataTransferResponse {
1636 #[must_use]
1638 pub fn new(status: DataTransferStatus) -> Self {
1639 Self {
1640 status,
1641 status_info: None,
1642 data: None,
1643 custom_data: None,
1644 }
1645 }
1646
1647 #[must_use]
1649 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1650 self.status_info = Some(value);
1651 self
1652 }
1653
1654 #[must_use]
1656 pub fn with_data(mut self, value: serde_json::Value) -> Self {
1657 self.data = Some(value);
1658 self
1659 }
1660
1661 #[must_use]
1663 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1664 self.custom_data = Some(value);
1665 self
1666 }
1667}
1668
1669impl Validate for DataTransferResponse {
1670 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1671 path.push_key("status");
1672 Validate::validate_at(&self.status, path, out);
1673 path.pop();
1674 path.push_key("statusInfo");
1675 if let Some(value) = &self.status_info {
1676 Validate::validate_at(value, path, out);
1677 }
1678 path.pop();
1679 path.push_key("customData");
1680 if let Some(value) = &self.custom_data {
1681 Validate::validate_at(value, path, out);
1682 }
1683 path.pop();
1684 }
1685}
1686
1687impl Sealed for DataTransferResponse {}
1688impl Response for DataTransferResponse {}
1689
1690#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1692pub struct DeleteCertificateRequest {
1693 #[serde(rename = "certificateHashData")]
1695 pub certificate_hash_data: CertificateHashData,
1696 #[serde(rename = "customData")]
1698 #[serde(default, skip_serializing_if = "Option::is_none")]
1699 pub custom_data: Option<crate::types::CustomData>,
1700}
1701
1702impl DeleteCertificateRequest {
1703 #[must_use]
1705 pub fn new(certificate_hash_data: CertificateHashData) -> Self {
1706 Self {
1707 certificate_hash_data,
1708 custom_data: None,
1709 }
1710 }
1711
1712 #[must_use]
1714 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1715 self.custom_data = Some(value);
1716 self
1717 }
1718}
1719
1720impl Validate for DeleteCertificateRequest {
1721 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1722 path.push_key("certificateHashData");
1723 Validate::validate_at(&self.certificate_hash_data, path, out);
1724 path.pop();
1725 path.push_key("customData");
1726 if let Some(value) = &self.custom_data {
1727 Validate::validate_at(value, path, out);
1728 }
1729 path.pop();
1730 }
1731}
1732
1733impl Sealed for DeleteCertificateRequest {}
1734impl Request for DeleteCertificateRequest {
1735 type Action = Action;
1736 const ACTION: Action = Action::DeleteCertificate;
1737 const KIND: MessageKind = MessageKind::Call;
1738 const ORIGIN: Origin = Origin::Csms;
1739 type Response = DeleteCertificateResponse;
1740}
1741
1742impl Confirmed for DeleteCertificateRequest {}
1743
1744#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1746pub struct DeleteCertificateResponse {
1747 pub status: DeleteCertificateStatus,
1749 #[serde(rename = "statusInfo")]
1751 #[serde(default, skip_serializing_if = "Option::is_none")]
1752 pub status_info: Option<StatusInfo>,
1753 #[serde(rename = "customData")]
1755 #[serde(default, skip_serializing_if = "Option::is_none")]
1756 pub custom_data: Option<crate::types::CustomData>,
1757}
1758
1759impl DeleteCertificateResponse {
1760 #[must_use]
1762 pub fn new(status: DeleteCertificateStatus) -> Self {
1763 Self {
1764 status,
1765 status_info: None,
1766 custom_data: None,
1767 }
1768 }
1769
1770 #[must_use]
1772 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1773 self.status_info = Some(value);
1774 self
1775 }
1776
1777 #[must_use]
1779 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1780 self.custom_data = Some(value);
1781 self
1782 }
1783}
1784
1785impl Validate for DeleteCertificateResponse {
1786 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1787 path.push_key("status");
1788 Validate::validate_at(&self.status, path, out);
1789 path.pop();
1790 path.push_key("statusInfo");
1791 if let Some(value) = &self.status_info {
1792 Validate::validate_at(value, path, out);
1793 }
1794 path.pop();
1795 path.push_key("customData");
1796 if let Some(value) = &self.custom_data {
1797 Validate::validate_at(value, path, out);
1798 }
1799 path.pop();
1800 }
1801}
1802
1803impl Sealed for DeleteCertificateResponse {}
1804impl Response for DeleteCertificateResponse {}
1805
1806#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1808pub struct FirmwareStatusNotificationRequest {
1809 pub status: FirmwareStatus,
1811 #[serde(rename = "requestId")]
1815 #[serde(default, skip_serializing_if = "Option::is_none")]
1816 #[serde(deserialize_with = "crate::types::integer::option")]
1817 pub request_id: Option<i32>,
1818 #[serde(rename = "customData")]
1820 #[serde(default, skip_serializing_if = "Option::is_none")]
1821 pub custom_data: Option<crate::types::CustomData>,
1822}
1823
1824impl FirmwareStatusNotificationRequest {
1825 #[must_use]
1827 pub fn new(status: FirmwareStatus) -> Self {
1828 Self {
1829 status,
1830 request_id: None,
1831 custom_data: None,
1832 }
1833 }
1834
1835 #[must_use]
1837 pub fn with_request_id(mut self, value: i32) -> Self {
1838 self.request_id = Some(value);
1839 self
1840 }
1841
1842 #[must_use]
1844 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1845 self.custom_data = Some(value);
1846 self
1847 }
1848}
1849
1850impl Validate for FirmwareStatusNotificationRequest {
1851 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1852 path.push_key("status");
1853 Validate::validate_at(&self.status, path, out);
1854 path.pop();
1855 path.push_key("customData");
1856 if let Some(value) = &self.custom_data {
1857 Validate::validate_at(value, path, out);
1858 }
1859 path.pop();
1860 }
1861}
1862
1863impl Sealed for FirmwareStatusNotificationRequest {}
1864impl Request for FirmwareStatusNotificationRequest {
1865 type Action = Action;
1866 const ACTION: Action = Action::FirmwareStatusNotification;
1867 const KIND: MessageKind = MessageKind::Call;
1868 const ORIGIN: Origin = Origin::ChargingStation;
1869 type Response = FirmwareStatusNotificationResponse;
1870}
1871
1872impl Confirmed for FirmwareStatusNotificationRequest {}
1873
1874#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1876pub struct FirmwareStatusNotificationResponse {
1877 #[serde(rename = "customData")]
1879 #[serde(default, skip_serializing_if = "Option::is_none")]
1880 pub custom_data: Option<crate::types::CustomData>,
1881}
1882
1883impl FirmwareStatusNotificationResponse {
1884 #[must_use]
1886 pub fn new() -> Self {
1887 Self::default()
1888 }
1889
1890 #[must_use]
1892 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1893 self.custom_data = Some(value);
1894 self
1895 }
1896}
1897
1898impl Validate for FirmwareStatusNotificationResponse {
1899 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1900 path.push_key("customData");
1901 if let Some(value) = &self.custom_data {
1902 Validate::validate_at(value, path, out);
1903 }
1904 path.pop();
1905 }
1906}
1907
1908impl Sealed for FirmwareStatusNotificationResponse {}
1909impl Response for FirmwareStatusNotificationResponse {}
1910
1911#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1913pub struct Get15118EVCertificateRequest {
1914 #[serde(rename = "iso15118SchemaVersion")]
1916 pub iso15118_schema_version: String,
1917 pub action: CertificateAction,
1919 #[serde(rename = "exiRequest")]
1921 pub exi_request: String,
1922 #[serde(rename = "customData")]
1924 #[serde(default, skip_serializing_if = "Option::is_none")]
1925 pub custom_data: Option<crate::types::CustomData>,
1926}
1927
1928impl Get15118EVCertificateRequest {
1929 #[must_use]
1931 pub fn new(
1932 iso15118_schema_version: impl Into<String>,
1933 action: CertificateAction,
1934 exi_request: impl Into<String>,
1935 ) -> Self {
1936 Self {
1937 iso15118_schema_version: iso15118_schema_version.into(),
1938 action,
1939 exi_request: exi_request.into(),
1940 custom_data: None,
1941 }
1942 }
1943
1944 #[must_use]
1946 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1947 self.custom_data = Some(value);
1948 self
1949 }
1950}
1951
1952impl Validate for Get15118EVCertificateRequest {
1953 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1954 path.push_key("iso15118SchemaVersion");
1955 validate::string(
1956 self.iso15118_schema_version.as_str(),
1957 None,
1958 Some(50),
1959 path,
1960 out,
1961 );
1962 path.pop();
1963 path.push_key("action");
1964 Validate::validate_at(&self.action, path, out);
1965 path.pop();
1966 path.push_key("exiRequest");
1967 validate::string(self.exi_request.as_str(), None, Some(5600), path, out);
1968 path.pop();
1969 path.push_key("customData");
1970 if let Some(value) = &self.custom_data {
1971 Validate::validate_at(value, path, out);
1972 }
1973 path.pop();
1974 }
1975}
1976
1977impl Sealed for Get15118EVCertificateRequest {}
1978impl Request for Get15118EVCertificateRequest {
1979 type Action = Action;
1980 const ACTION: Action = Action::Get15118EVCertificate;
1981 const KIND: MessageKind = MessageKind::Call;
1982 const ORIGIN: Origin = Origin::ChargingStation;
1983 type Response = Get15118EVCertificateResponse;
1984}
1985
1986impl Confirmed for Get15118EVCertificateRequest {}
1987
1988#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1990pub struct Get15118EVCertificateResponse {
1991 pub status: Iso15118EVCertificateStatus,
1993 #[serde(rename = "exiResponse")]
1995 pub exi_response: String,
1996 #[serde(rename = "statusInfo")]
1998 #[serde(default, skip_serializing_if = "Option::is_none")]
1999 pub status_info: Option<StatusInfo>,
2000 #[serde(rename = "customData")]
2002 #[serde(default, skip_serializing_if = "Option::is_none")]
2003 pub custom_data: Option<crate::types::CustomData>,
2004}
2005
2006impl Get15118EVCertificateResponse {
2007 #[must_use]
2009 pub fn new(status: Iso15118EVCertificateStatus, exi_response: impl Into<String>) -> Self {
2010 Self {
2011 status,
2012 exi_response: exi_response.into(),
2013 status_info: None,
2014 custom_data: None,
2015 }
2016 }
2017
2018 #[must_use]
2020 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2021 self.status_info = Some(value);
2022 self
2023 }
2024
2025 #[must_use]
2027 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2028 self.custom_data = Some(value);
2029 self
2030 }
2031}
2032
2033impl Validate for Get15118EVCertificateResponse {
2034 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2035 path.push_key("status");
2036 Validate::validate_at(&self.status, path, out);
2037 path.pop();
2038 path.push_key("exiResponse");
2039 validate::string(self.exi_response.as_str(), None, Some(5600), path, out);
2040 path.pop();
2041 path.push_key("statusInfo");
2042 if let Some(value) = &self.status_info {
2043 Validate::validate_at(value, path, out);
2044 }
2045 path.pop();
2046 path.push_key("customData");
2047 if let Some(value) = &self.custom_data {
2048 Validate::validate_at(value, path, out);
2049 }
2050 path.pop();
2051 }
2052}
2053
2054impl Sealed for Get15118EVCertificateResponse {}
2055impl Response for Get15118EVCertificateResponse {}
2056
2057#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2059pub struct GetBaseReportRequest {
2060 #[serde(rename = "requestId")]
2062 #[serde(deserialize_with = "crate::types::integer::one")]
2063 pub request_id: i32,
2064 #[serde(rename = "reportBase")]
2066 pub report_base: ReportBase,
2067 #[serde(rename = "customData")]
2069 #[serde(default, skip_serializing_if = "Option::is_none")]
2070 pub custom_data: Option<crate::types::CustomData>,
2071}
2072
2073impl GetBaseReportRequest {
2074 #[must_use]
2076 pub fn new(request_id: i32, report_base: ReportBase) -> Self {
2077 Self {
2078 request_id,
2079 report_base,
2080 custom_data: None,
2081 }
2082 }
2083
2084 #[must_use]
2086 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2087 self.custom_data = Some(value);
2088 self
2089 }
2090}
2091
2092impl Validate for GetBaseReportRequest {
2093 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2094 path.push_key("reportBase");
2095 Validate::validate_at(&self.report_base, path, out);
2096 path.pop();
2097 path.push_key("customData");
2098 if let Some(value) = &self.custom_data {
2099 Validate::validate_at(value, path, out);
2100 }
2101 path.pop();
2102 }
2103}
2104
2105impl Sealed for GetBaseReportRequest {}
2106impl Request for GetBaseReportRequest {
2107 type Action = Action;
2108 const ACTION: Action = Action::GetBaseReport;
2109 const KIND: MessageKind = MessageKind::Call;
2110 const ORIGIN: Origin = Origin::Csms;
2111 type Response = GetBaseReportResponse;
2112}
2113
2114impl Confirmed for GetBaseReportRequest {}
2115
2116#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2118pub struct GetBaseReportResponse {
2119 pub status: GenericDeviceModelStatus,
2121 #[serde(rename = "statusInfo")]
2123 #[serde(default, skip_serializing_if = "Option::is_none")]
2124 pub status_info: Option<StatusInfo>,
2125 #[serde(rename = "customData")]
2127 #[serde(default, skip_serializing_if = "Option::is_none")]
2128 pub custom_data: Option<crate::types::CustomData>,
2129}
2130
2131impl GetBaseReportResponse {
2132 #[must_use]
2134 pub fn new(status: GenericDeviceModelStatus) -> Self {
2135 Self {
2136 status,
2137 status_info: None,
2138 custom_data: None,
2139 }
2140 }
2141
2142 #[must_use]
2144 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2145 self.status_info = Some(value);
2146 self
2147 }
2148
2149 #[must_use]
2151 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2152 self.custom_data = Some(value);
2153 self
2154 }
2155}
2156
2157impl Validate for GetBaseReportResponse {
2158 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2159 path.push_key("status");
2160 Validate::validate_at(&self.status, path, out);
2161 path.pop();
2162 path.push_key("statusInfo");
2163 if let Some(value) = &self.status_info {
2164 Validate::validate_at(value, path, out);
2165 }
2166 path.pop();
2167 path.push_key("customData");
2168 if let Some(value) = &self.custom_data {
2169 Validate::validate_at(value, path, out);
2170 }
2171 path.pop();
2172 }
2173}
2174
2175impl Sealed for GetBaseReportResponse {}
2176impl Response for GetBaseReportResponse {}
2177
2178#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2180pub struct GetCertificateStatusRequest {
2181 #[serde(rename = "ocspRequestData")]
2183 pub ocsp_request_data: OCSPRequestData,
2184 #[serde(rename = "customData")]
2186 #[serde(default, skip_serializing_if = "Option::is_none")]
2187 pub custom_data: Option<crate::types::CustomData>,
2188}
2189
2190impl GetCertificateStatusRequest {
2191 #[must_use]
2193 pub fn new(ocsp_request_data: OCSPRequestData) -> Self {
2194 Self {
2195 ocsp_request_data,
2196 custom_data: None,
2197 }
2198 }
2199
2200 #[must_use]
2202 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2203 self.custom_data = Some(value);
2204 self
2205 }
2206}
2207
2208impl Validate for GetCertificateStatusRequest {
2209 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2210 path.push_key("ocspRequestData");
2211 Validate::validate_at(&self.ocsp_request_data, path, out);
2212 path.pop();
2213 path.push_key("customData");
2214 if let Some(value) = &self.custom_data {
2215 Validate::validate_at(value, path, out);
2216 }
2217 path.pop();
2218 }
2219}
2220
2221impl Sealed for GetCertificateStatusRequest {}
2222impl Request for GetCertificateStatusRequest {
2223 type Action = Action;
2224 const ACTION: Action = Action::GetCertificateStatus;
2225 const KIND: MessageKind = MessageKind::Call;
2226 const ORIGIN: Origin = Origin::ChargingStation;
2227 type Response = GetCertificateStatusResponse;
2228}
2229
2230impl Confirmed for GetCertificateStatusRequest {}
2231
2232#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2234pub struct GetCertificateStatusResponse {
2235 pub status: GetCertificateStatusEnum,
2237 #[serde(rename = "statusInfo")]
2239 #[serde(default, skip_serializing_if = "Option::is_none")]
2240 pub status_info: Option<StatusInfo>,
2241 #[serde(rename = "ocspResult")]
2243 #[serde(default, skip_serializing_if = "Option::is_none")]
2244 pub ocsp_result: Option<String>,
2245 #[serde(rename = "customData")]
2247 #[serde(default, skip_serializing_if = "Option::is_none")]
2248 pub custom_data: Option<crate::types::CustomData>,
2249}
2250
2251impl GetCertificateStatusResponse {
2252 #[must_use]
2254 pub fn new(status: GetCertificateStatusEnum) -> Self {
2255 Self {
2256 status,
2257 status_info: None,
2258 ocsp_result: None,
2259 custom_data: None,
2260 }
2261 }
2262
2263 #[must_use]
2265 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2266 self.status_info = Some(value);
2267 self
2268 }
2269
2270 #[must_use]
2272 pub fn with_ocsp_result(mut self, value: impl Into<String>) -> Self {
2273 self.ocsp_result = Some(value.into());
2274 self
2275 }
2276
2277 #[must_use]
2279 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2280 self.custom_data = Some(value);
2281 self
2282 }
2283}
2284
2285impl Validate for GetCertificateStatusResponse {
2286 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2287 path.push_key("status");
2288 Validate::validate_at(&self.status, path, out);
2289 path.pop();
2290 path.push_key("statusInfo");
2291 if let Some(value) = &self.status_info {
2292 Validate::validate_at(value, path, out);
2293 }
2294 path.pop();
2295 path.push_key("ocspResult");
2296 if let Some(value) = &self.ocsp_result {
2297 validate::string(value.as_str(), None, Some(5500), path, out);
2298 }
2299 path.pop();
2300 path.push_key("customData");
2301 if let Some(value) = &self.custom_data {
2302 Validate::validate_at(value, path, out);
2303 }
2304 path.pop();
2305 }
2306}
2307
2308impl Sealed for GetCertificateStatusResponse {}
2309impl Response for GetCertificateStatusResponse {}
2310
2311#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2313pub struct GetChargingProfilesRequest {
2314 #[serde(rename = "requestId")]
2316 #[serde(deserialize_with = "crate::types::integer::one")]
2317 pub request_id: i32,
2318 #[serde(rename = "chargingProfile")]
2320 pub charging_profile: ChargingProfileCriterion,
2321 #[serde(rename = "evseId")]
2323 #[serde(default, skip_serializing_if = "Option::is_none")]
2324 #[serde(deserialize_with = "crate::types::integer::option")]
2325 pub evse_id: Option<i32>,
2326 #[serde(rename = "customData")]
2328 #[serde(default, skip_serializing_if = "Option::is_none")]
2329 pub custom_data: Option<crate::types::CustomData>,
2330}
2331
2332impl GetChargingProfilesRequest {
2333 #[must_use]
2335 pub fn new(request_id: i32, charging_profile: ChargingProfileCriterion) -> Self {
2336 Self {
2337 request_id,
2338 charging_profile,
2339 evse_id: None,
2340 custom_data: None,
2341 }
2342 }
2343
2344 #[must_use]
2346 pub fn with_evse_id(mut self, value: i32) -> Self {
2347 self.evse_id = Some(value);
2348 self
2349 }
2350
2351 #[must_use]
2353 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2354 self.custom_data = Some(value);
2355 self
2356 }
2357}
2358
2359impl Validate for GetChargingProfilesRequest {
2360 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2361 path.push_key("chargingProfile");
2362 Validate::validate_at(&self.charging_profile, path, out);
2363 path.pop();
2364 path.push_key("customData");
2365 if let Some(value) = &self.custom_data {
2366 Validate::validate_at(value, path, out);
2367 }
2368 path.pop();
2369 }
2370}
2371
2372impl Sealed for GetChargingProfilesRequest {}
2373impl Request for GetChargingProfilesRequest {
2374 type Action = Action;
2375 const ACTION: Action = Action::GetChargingProfiles;
2376 const KIND: MessageKind = MessageKind::Call;
2377 const ORIGIN: Origin = Origin::Csms;
2378 type Response = GetChargingProfilesResponse;
2379}
2380
2381impl Confirmed for GetChargingProfilesRequest {}
2382
2383#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2385pub struct GetChargingProfilesResponse {
2386 pub status: GetChargingProfileStatus,
2388 #[serde(rename = "statusInfo")]
2390 #[serde(default, skip_serializing_if = "Option::is_none")]
2391 pub status_info: Option<StatusInfo>,
2392 #[serde(rename = "customData")]
2394 #[serde(default, skip_serializing_if = "Option::is_none")]
2395 pub custom_data: Option<crate::types::CustomData>,
2396}
2397
2398impl GetChargingProfilesResponse {
2399 #[must_use]
2401 pub fn new(status: GetChargingProfileStatus) -> Self {
2402 Self {
2403 status,
2404 status_info: None,
2405 custom_data: None,
2406 }
2407 }
2408
2409 #[must_use]
2411 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2412 self.status_info = Some(value);
2413 self
2414 }
2415
2416 #[must_use]
2418 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2419 self.custom_data = Some(value);
2420 self
2421 }
2422}
2423
2424impl Validate for GetChargingProfilesResponse {
2425 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2426 path.push_key("status");
2427 Validate::validate_at(&self.status, path, out);
2428 path.pop();
2429 path.push_key("statusInfo");
2430 if let Some(value) = &self.status_info {
2431 Validate::validate_at(value, path, out);
2432 }
2433 path.pop();
2434 path.push_key("customData");
2435 if let Some(value) = &self.custom_data {
2436 Validate::validate_at(value, path, out);
2437 }
2438 path.pop();
2439 }
2440}
2441
2442impl Sealed for GetChargingProfilesResponse {}
2443impl Response for GetChargingProfilesResponse {}
2444
2445#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2447pub struct GetCompositeScheduleRequest {
2448 #[serde(deserialize_with = "crate::types::integer::one")]
2450 pub duration: i32,
2451 #[serde(rename = "evseId")]
2453 #[serde(deserialize_with = "crate::types::integer::one")]
2454 pub evse_id: i32,
2455 #[serde(rename = "chargingRateUnit")]
2457 #[serde(default, skip_serializing_if = "Option::is_none")]
2458 pub charging_rate_unit: Option<ChargingRateUnit>,
2459 #[serde(rename = "customData")]
2461 #[serde(default, skip_serializing_if = "Option::is_none")]
2462 pub custom_data: Option<crate::types::CustomData>,
2463}
2464
2465impl GetCompositeScheduleRequest {
2466 #[must_use]
2468 pub fn new(duration: i32, evse_id: i32) -> Self {
2469 Self {
2470 duration,
2471 evse_id,
2472 charging_rate_unit: None,
2473 custom_data: None,
2474 }
2475 }
2476
2477 #[must_use]
2479 pub fn with_charging_rate_unit(mut self, value: ChargingRateUnit) -> Self {
2480 self.charging_rate_unit = Some(value);
2481 self
2482 }
2483
2484 #[must_use]
2486 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2487 self.custom_data = Some(value);
2488 self
2489 }
2490}
2491
2492impl Validate for GetCompositeScheduleRequest {
2493 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2494 path.push_key("chargingRateUnit");
2495 if let Some(value) = &self.charging_rate_unit {
2496 Validate::validate_at(value, path, out);
2497 }
2498 path.pop();
2499 path.push_key("customData");
2500 if let Some(value) = &self.custom_data {
2501 Validate::validate_at(value, path, out);
2502 }
2503 path.pop();
2504 }
2505}
2506
2507impl Sealed for GetCompositeScheduleRequest {}
2508impl Request for GetCompositeScheduleRequest {
2509 type Action = Action;
2510 const ACTION: Action = Action::GetCompositeSchedule;
2511 const KIND: MessageKind = MessageKind::Call;
2512 const ORIGIN: Origin = Origin::Csms;
2513 type Response = GetCompositeScheduleResponse;
2514}
2515
2516impl Confirmed for GetCompositeScheduleRequest {}
2517
2518#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2520pub struct GetCompositeScheduleResponse {
2521 pub status: GenericStatus,
2523 #[serde(rename = "statusInfo")]
2525 #[serde(default, skip_serializing_if = "Option::is_none")]
2526 pub status_info: Option<StatusInfo>,
2527 #[serde(default, skip_serializing_if = "Option::is_none")]
2529 pub schedule: Option<CompositeSchedule>,
2530 #[serde(rename = "customData")]
2532 #[serde(default, skip_serializing_if = "Option::is_none")]
2533 pub custom_data: Option<crate::types::CustomData>,
2534}
2535
2536impl GetCompositeScheduleResponse {
2537 #[must_use]
2539 pub fn new(status: GenericStatus) -> Self {
2540 Self {
2541 status,
2542 status_info: None,
2543 schedule: None,
2544 custom_data: None,
2545 }
2546 }
2547
2548 #[must_use]
2550 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2551 self.status_info = Some(value);
2552 self
2553 }
2554
2555 #[must_use]
2557 pub fn with_schedule(mut self, value: CompositeSchedule) -> Self {
2558 self.schedule = Some(value);
2559 self
2560 }
2561
2562 #[must_use]
2564 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2565 self.custom_data = Some(value);
2566 self
2567 }
2568}
2569
2570impl Validate for GetCompositeScheduleResponse {
2571 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2572 path.push_key("status");
2573 Validate::validate_at(&self.status, path, out);
2574 path.pop();
2575 path.push_key("statusInfo");
2576 if let Some(value) = &self.status_info {
2577 Validate::validate_at(value, path, out);
2578 }
2579 path.pop();
2580 path.push_key("schedule");
2581 if let Some(value) = &self.schedule {
2582 Validate::validate_at(value, path, out);
2583 }
2584 path.pop();
2585 path.push_key("customData");
2586 if let Some(value) = &self.custom_data {
2587 Validate::validate_at(value, path, out);
2588 }
2589 path.pop();
2590 }
2591}
2592
2593impl Sealed for GetCompositeScheduleResponse {}
2594impl Response for GetCompositeScheduleResponse {}
2595
2596#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2598pub struct GetDisplayMessagesRequest {
2599 #[serde(rename = "requestId")]
2601 #[serde(deserialize_with = "crate::types::integer::one")]
2602 pub request_id: i32,
2603 #[serde(default, skip_serializing_if = "Option::is_none")]
2605 #[serde(deserialize_with = "crate::types::integer::option_list")]
2606 pub id: Option<Vec<i32>>,
2607 #[serde(default, skip_serializing_if = "Option::is_none")]
2609 pub priority: Option<MessagePriority>,
2610 #[serde(default, skip_serializing_if = "Option::is_none")]
2612 pub state: Option<MessageState>,
2613 #[serde(rename = "customData")]
2615 #[serde(default, skip_serializing_if = "Option::is_none")]
2616 pub custom_data: Option<crate::types::CustomData>,
2617}
2618
2619impl GetDisplayMessagesRequest {
2620 #[must_use]
2622 pub fn new(request_id: i32) -> Self {
2623 Self {
2624 request_id,
2625 id: None,
2626 priority: None,
2627 state: None,
2628 custom_data: None,
2629 }
2630 }
2631
2632 #[must_use]
2634 pub fn with_id(mut self, value: Vec<i32>) -> Self {
2635 self.id = Some(value);
2636 self
2637 }
2638
2639 #[must_use]
2641 pub fn with_priority(mut self, value: MessagePriority) -> Self {
2642 self.priority = Some(value);
2643 self
2644 }
2645
2646 #[must_use]
2648 pub fn with_state(mut self, value: MessageState) -> Self {
2649 self.state = Some(value);
2650 self
2651 }
2652
2653 #[must_use]
2655 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2656 self.custom_data = Some(value);
2657 self
2658 }
2659}
2660
2661impl Validate for GetDisplayMessagesRequest {
2662 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2663 path.push_key("id");
2664 if let Some(value) = &self.id {
2665 validate::list_len(value.len(), Some(1), None, path, out);
2666 }
2667 path.pop();
2668 path.push_key("priority");
2669 if let Some(value) = &self.priority {
2670 Validate::validate_at(value, path, out);
2671 }
2672 path.pop();
2673 path.push_key("state");
2674 if let Some(value) = &self.state {
2675 Validate::validate_at(value, path, out);
2676 }
2677 path.pop();
2678 path.push_key("customData");
2679 if let Some(value) = &self.custom_data {
2680 Validate::validate_at(value, path, out);
2681 }
2682 path.pop();
2683 }
2684}
2685
2686impl Sealed for GetDisplayMessagesRequest {}
2687impl Request for GetDisplayMessagesRequest {
2688 type Action = Action;
2689 const ACTION: Action = Action::GetDisplayMessages;
2690 const KIND: MessageKind = MessageKind::Call;
2691 const ORIGIN: Origin = Origin::Csms;
2692 type Response = GetDisplayMessagesResponse;
2693}
2694
2695impl Confirmed for GetDisplayMessagesRequest {}
2696
2697#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2699pub struct GetDisplayMessagesResponse {
2700 pub status: GetDisplayMessagesStatus,
2702 #[serde(rename = "statusInfo")]
2704 #[serde(default, skip_serializing_if = "Option::is_none")]
2705 pub status_info: Option<StatusInfo>,
2706 #[serde(rename = "customData")]
2708 #[serde(default, skip_serializing_if = "Option::is_none")]
2709 pub custom_data: Option<crate::types::CustomData>,
2710}
2711
2712impl GetDisplayMessagesResponse {
2713 #[must_use]
2715 pub fn new(status: GetDisplayMessagesStatus) -> Self {
2716 Self {
2717 status,
2718 status_info: None,
2719 custom_data: None,
2720 }
2721 }
2722
2723 #[must_use]
2725 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2726 self.status_info = Some(value);
2727 self
2728 }
2729
2730 #[must_use]
2732 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2733 self.custom_data = Some(value);
2734 self
2735 }
2736}
2737
2738impl Validate for GetDisplayMessagesResponse {
2739 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2740 path.push_key("status");
2741 Validate::validate_at(&self.status, path, out);
2742 path.pop();
2743 path.push_key("statusInfo");
2744 if let Some(value) = &self.status_info {
2745 Validate::validate_at(value, path, out);
2746 }
2747 path.pop();
2748 path.push_key("customData");
2749 if let Some(value) = &self.custom_data {
2750 Validate::validate_at(value, path, out);
2751 }
2752 path.pop();
2753 }
2754}
2755
2756impl Sealed for GetDisplayMessagesResponse {}
2757impl Response for GetDisplayMessagesResponse {}
2758
2759#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2761pub struct GetInstalledCertificateIdsRequest {
2762 #[serde(rename = "certificateType")]
2764 #[serde(default, skip_serializing_if = "Option::is_none")]
2765 pub certificate_type: Option<Vec<GetCertificateIdUse>>,
2766 #[serde(rename = "customData")]
2768 #[serde(default, skip_serializing_if = "Option::is_none")]
2769 pub custom_data: Option<crate::types::CustomData>,
2770}
2771
2772impl GetInstalledCertificateIdsRequest {
2773 #[must_use]
2775 pub fn new() -> Self {
2776 Self::default()
2777 }
2778
2779 #[must_use]
2781 pub fn with_certificate_type(mut self, value: Vec<GetCertificateIdUse>) -> Self {
2782 self.certificate_type = Some(value);
2783 self
2784 }
2785
2786 #[must_use]
2788 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2789 self.custom_data = Some(value);
2790 self
2791 }
2792}
2793
2794impl Validate for GetInstalledCertificateIdsRequest {
2795 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2796 path.push_key("certificateType");
2797 if let Some(value) = &self.certificate_type {
2798 validate::list_len(value.len(), Some(1), None, path, out);
2799 for (index, item) in value.iter().enumerate() {
2800 path.push_index(index);
2801 Validate::validate_at(item, path, out);
2802 path.pop();
2803 }
2804 }
2805 path.pop();
2806 path.push_key("customData");
2807 if let Some(value) = &self.custom_data {
2808 Validate::validate_at(value, path, out);
2809 }
2810 path.pop();
2811 }
2812}
2813
2814impl Sealed for GetInstalledCertificateIdsRequest {}
2815impl Request for GetInstalledCertificateIdsRequest {
2816 type Action = Action;
2817 const ACTION: Action = Action::GetInstalledCertificateIds;
2818 const KIND: MessageKind = MessageKind::Call;
2819 const ORIGIN: Origin = Origin::Csms;
2820 type Response = GetInstalledCertificateIdsResponse;
2821}
2822
2823impl Confirmed for GetInstalledCertificateIdsRequest {}
2824
2825#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2827pub struct GetInstalledCertificateIdsResponse {
2828 pub status: GetInstalledCertificateStatus,
2830 #[serde(rename = "statusInfo")]
2832 #[serde(default, skip_serializing_if = "Option::is_none")]
2833 pub status_info: Option<StatusInfo>,
2834 #[serde(rename = "certificateHashDataChain")]
2836 #[serde(default, skip_serializing_if = "Option::is_none")]
2837 pub certificate_hash_data_chain: Option<Vec<CertificateHashDataChain>>,
2838 #[serde(rename = "customData")]
2840 #[serde(default, skip_serializing_if = "Option::is_none")]
2841 pub custom_data: Option<crate::types::CustomData>,
2842}
2843
2844impl GetInstalledCertificateIdsResponse {
2845 #[must_use]
2847 pub fn new(status: GetInstalledCertificateStatus) -> Self {
2848 Self {
2849 status,
2850 status_info: None,
2851 certificate_hash_data_chain: None,
2852 custom_data: None,
2853 }
2854 }
2855
2856 #[must_use]
2858 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2859 self.status_info = Some(value);
2860 self
2861 }
2862
2863 #[must_use]
2865 pub fn with_certificate_hash_data_chain(
2866 mut self,
2867 value: Vec<CertificateHashDataChain>,
2868 ) -> Self {
2869 self.certificate_hash_data_chain = Some(value);
2870 self
2871 }
2872
2873 #[must_use]
2875 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2876 self.custom_data = Some(value);
2877 self
2878 }
2879}
2880
2881impl Validate for GetInstalledCertificateIdsResponse {
2882 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2883 path.push_key("status");
2884 Validate::validate_at(&self.status, path, out);
2885 path.pop();
2886 path.push_key("statusInfo");
2887 if let Some(value) = &self.status_info {
2888 Validate::validate_at(value, path, out);
2889 }
2890 path.pop();
2891 path.push_key("certificateHashDataChain");
2892 if let Some(value) = &self.certificate_hash_data_chain {
2893 validate::list_len(value.len(), Some(1), None, path, out);
2894 for (index, item) in value.iter().enumerate() {
2895 path.push_index(index);
2896 Validate::validate_at(item, path, out);
2897 path.pop();
2898 }
2899 }
2900 path.pop();
2901 path.push_key("customData");
2902 if let Some(value) = &self.custom_data {
2903 Validate::validate_at(value, path, out);
2904 }
2905 path.pop();
2906 }
2907}
2908
2909impl Sealed for GetInstalledCertificateIdsResponse {}
2910impl Response for GetInstalledCertificateIdsResponse {}
2911
2912#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2914pub struct GetLocalListVersionRequest {
2915 #[serde(rename = "customData")]
2917 #[serde(default, skip_serializing_if = "Option::is_none")]
2918 pub custom_data: Option<crate::types::CustomData>,
2919}
2920
2921impl GetLocalListVersionRequest {
2922 #[must_use]
2924 pub fn new() -> Self {
2925 Self::default()
2926 }
2927
2928 #[must_use]
2930 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2931 self.custom_data = Some(value);
2932 self
2933 }
2934}
2935
2936impl Validate for GetLocalListVersionRequest {
2937 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2938 path.push_key("customData");
2939 if let Some(value) = &self.custom_data {
2940 Validate::validate_at(value, path, out);
2941 }
2942 path.pop();
2943 }
2944}
2945
2946impl Sealed for GetLocalListVersionRequest {}
2947impl Request for GetLocalListVersionRequest {
2948 type Action = Action;
2949 const ACTION: Action = Action::GetLocalListVersion;
2950 const KIND: MessageKind = MessageKind::Call;
2951 const ORIGIN: Origin = Origin::Csms;
2952 type Response = GetLocalListVersionResponse;
2953}
2954
2955impl Confirmed for GetLocalListVersionRequest {}
2956
2957#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2959pub struct GetLocalListVersionResponse {
2960 #[serde(rename = "versionNumber")]
2962 #[serde(deserialize_with = "crate::types::integer::one")]
2963 pub version_number: i32,
2964 #[serde(rename = "customData")]
2966 #[serde(default, skip_serializing_if = "Option::is_none")]
2967 pub custom_data: Option<crate::types::CustomData>,
2968}
2969
2970impl GetLocalListVersionResponse {
2971 #[must_use]
2973 pub fn new(version_number: i32) -> Self {
2974 Self {
2975 version_number,
2976 custom_data: None,
2977 }
2978 }
2979
2980 #[must_use]
2982 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2983 self.custom_data = Some(value);
2984 self
2985 }
2986}
2987
2988impl Validate for GetLocalListVersionResponse {
2989 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2990 path.push_key("customData");
2991 if let Some(value) = &self.custom_data {
2992 Validate::validate_at(value, path, out);
2993 }
2994 path.pop();
2995 }
2996}
2997
2998impl Sealed for GetLocalListVersionResponse {}
2999impl Response for GetLocalListVersionResponse {}
3000
3001#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3003pub struct GetLogRequest {
3004 pub log: LogParameters,
3006 #[serde(rename = "logType")]
3008 pub log_type: Log,
3009 #[serde(rename = "requestId")]
3011 #[serde(deserialize_with = "crate::types::integer::one")]
3012 pub request_id: i32,
3013 #[serde(default, skip_serializing_if = "Option::is_none")]
3015 #[serde(deserialize_with = "crate::types::integer::option")]
3016 pub retries: Option<i32>,
3017 #[serde(rename = "retryInterval")]
3019 #[serde(default, skip_serializing_if = "Option::is_none")]
3020 #[serde(deserialize_with = "crate::types::integer::option")]
3021 pub retry_interval: Option<i32>,
3022 #[serde(rename = "customData")]
3024 #[serde(default, skip_serializing_if = "Option::is_none")]
3025 pub custom_data: Option<crate::types::CustomData>,
3026}
3027
3028impl GetLogRequest {
3029 #[must_use]
3031 pub fn new(log: LogParameters, log_type: Log, request_id: i32) -> Self {
3032 Self {
3033 log,
3034 log_type,
3035 request_id,
3036 retries: None,
3037 retry_interval: None,
3038 custom_data: None,
3039 }
3040 }
3041
3042 #[must_use]
3044 pub fn with_retries(mut self, value: i32) -> Self {
3045 self.retries = Some(value);
3046 self
3047 }
3048
3049 #[must_use]
3051 pub fn with_retry_interval(mut self, value: i32) -> Self {
3052 self.retry_interval = Some(value);
3053 self
3054 }
3055
3056 #[must_use]
3058 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3059 self.custom_data = Some(value);
3060 self
3061 }
3062}
3063
3064impl Validate for GetLogRequest {
3065 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3066 path.push_key("log");
3067 Validate::validate_at(&self.log, path, out);
3068 path.pop();
3069 path.push_key("logType");
3070 Validate::validate_at(&self.log_type, path, out);
3071 path.pop();
3072 path.push_key("customData");
3073 if let Some(value) = &self.custom_data {
3074 Validate::validate_at(value, path, out);
3075 }
3076 path.pop();
3077 }
3078}
3079
3080impl Sealed for GetLogRequest {}
3081impl Request for GetLogRequest {
3082 type Action = Action;
3083 const ACTION: Action = Action::GetLog;
3084 const KIND: MessageKind = MessageKind::Call;
3085 const ORIGIN: Origin = Origin::Csms;
3086 type Response = GetLogResponse;
3087}
3088
3089impl Confirmed for GetLogRequest {}
3090
3091#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3093pub struct GetLogResponse {
3094 pub status: LogStatus,
3096 #[serde(rename = "statusInfo")]
3098 #[serde(default, skip_serializing_if = "Option::is_none")]
3099 pub status_info: Option<StatusInfo>,
3100 #[serde(default, skip_serializing_if = "Option::is_none")]
3102 pub filename: Option<String>,
3103 #[serde(rename = "customData")]
3105 #[serde(default, skip_serializing_if = "Option::is_none")]
3106 pub custom_data: Option<crate::types::CustomData>,
3107}
3108
3109impl GetLogResponse {
3110 #[must_use]
3112 pub fn new(status: LogStatus) -> Self {
3113 Self {
3114 status,
3115 status_info: None,
3116 filename: None,
3117 custom_data: None,
3118 }
3119 }
3120
3121 #[must_use]
3123 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3124 self.status_info = Some(value);
3125 self
3126 }
3127
3128 #[must_use]
3130 pub fn with_filename(mut self, value: impl Into<String>) -> Self {
3131 self.filename = Some(value.into());
3132 self
3133 }
3134
3135 #[must_use]
3137 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3138 self.custom_data = Some(value);
3139 self
3140 }
3141}
3142
3143impl Validate for GetLogResponse {
3144 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3145 path.push_key("status");
3146 Validate::validate_at(&self.status, path, out);
3147 path.pop();
3148 path.push_key("statusInfo");
3149 if let Some(value) = &self.status_info {
3150 Validate::validate_at(value, path, out);
3151 }
3152 path.pop();
3153 path.push_key("filename");
3154 if let Some(value) = &self.filename {
3155 validate::string(value.as_str(), None, Some(255), path, out);
3156 }
3157 path.pop();
3158 path.push_key("customData");
3159 if let Some(value) = &self.custom_data {
3160 Validate::validate_at(value, path, out);
3161 }
3162 path.pop();
3163 }
3164}
3165
3166impl Sealed for GetLogResponse {}
3167impl Response for GetLogResponse {}
3168
3169#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3171pub struct GetMonitoringReportRequest {
3172 #[serde(rename = "requestId")]
3174 #[serde(deserialize_with = "crate::types::integer::one")]
3175 pub request_id: i32,
3176 #[serde(rename = "componentVariable")]
3178 #[serde(default, skip_serializing_if = "Option::is_none")]
3179 pub component_variable: Option<Vec<ComponentVariable>>,
3180 #[serde(rename = "monitoringCriteria")]
3182 #[serde(default, skip_serializing_if = "Option::is_none")]
3183 pub monitoring_criteria: Option<Vec<MonitoringCriterion>>,
3184 #[serde(rename = "customData")]
3186 #[serde(default, skip_serializing_if = "Option::is_none")]
3187 pub custom_data: Option<crate::types::CustomData>,
3188}
3189
3190impl GetMonitoringReportRequest {
3191 #[must_use]
3193 pub fn new(request_id: i32) -> Self {
3194 Self {
3195 request_id,
3196 component_variable: None,
3197 monitoring_criteria: None,
3198 custom_data: None,
3199 }
3200 }
3201
3202 #[must_use]
3204 pub fn with_component_variable(mut self, value: Vec<ComponentVariable>) -> Self {
3205 self.component_variable = Some(value);
3206 self
3207 }
3208
3209 #[must_use]
3211 pub fn with_monitoring_criteria(mut self, value: Vec<MonitoringCriterion>) -> Self {
3212 self.monitoring_criteria = Some(value);
3213 self
3214 }
3215
3216 #[must_use]
3218 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3219 self.custom_data = Some(value);
3220 self
3221 }
3222}
3223
3224impl Validate for GetMonitoringReportRequest {
3225 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3226 path.push_key("componentVariable");
3227 if let Some(value) = &self.component_variable {
3228 validate::list_len(value.len(), Some(1), None, path, out);
3229 for (index, item) in value.iter().enumerate() {
3230 path.push_index(index);
3231 Validate::validate_at(item, path, out);
3232 path.pop();
3233 }
3234 }
3235 path.pop();
3236 path.push_key("monitoringCriteria");
3237 if let Some(value) = &self.monitoring_criteria {
3238 validate::list_len(value.len(), Some(1), Some(3), path, out);
3239 for (index, item) in value.iter().enumerate() {
3240 path.push_index(index);
3241 Validate::validate_at(item, path, out);
3242 path.pop();
3243 }
3244 }
3245 path.pop();
3246 path.push_key("customData");
3247 if let Some(value) = &self.custom_data {
3248 Validate::validate_at(value, path, out);
3249 }
3250 path.pop();
3251 }
3252}
3253
3254impl Sealed for GetMonitoringReportRequest {}
3255impl Request for GetMonitoringReportRequest {
3256 type Action = Action;
3257 const ACTION: Action = Action::GetMonitoringReport;
3258 const KIND: MessageKind = MessageKind::Call;
3259 const ORIGIN: Origin = Origin::Csms;
3260 type Response = GetMonitoringReportResponse;
3261}
3262
3263impl Confirmed for GetMonitoringReportRequest {}
3264
3265#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3267pub struct GetMonitoringReportResponse {
3268 pub status: GenericDeviceModelStatus,
3270 #[serde(rename = "statusInfo")]
3272 #[serde(default, skip_serializing_if = "Option::is_none")]
3273 pub status_info: Option<StatusInfo>,
3274 #[serde(rename = "customData")]
3276 #[serde(default, skip_serializing_if = "Option::is_none")]
3277 pub custom_data: Option<crate::types::CustomData>,
3278}
3279
3280impl GetMonitoringReportResponse {
3281 #[must_use]
3283 pub fn new(status: GenericDeviceModelStatus) -> Self {
3284 Self {
3285 status,
3286 status_info: None,
3287 custom_data: None,
3288 }
3289 }
3290
3291 #[must_use]
3293 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3294 self.status_info = Some(value);
3295 self
3296 }
3297
3298 #[must_use]
3300 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3301 self.custom_data = Some(value);
3302 self
3303 }
3304}
3305
3306impl Validate for GetMonitoringReportResponse {
3307 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3308 path.push_key("status");
3309 Validate::validate_at(&self.status, path, out);
3310 path.pop();
3311 path.push_key("statusInfo");
3312 if let Some(value) = &self.status_info {
3313 Validate::validate_at(value, path, out);
3314 }
3315 path.pop();
3316 path.push_key("customData");
3317 if let Some(value) = &self.custom_data {
3318 Validate::validate_at(value, path, out);
3319 }
3320 path.pop();
3321 }
3322}
3323
3324impl Sealed for GetMonitoringReportResponse {}
3325impl Response for GetMonitoringReportResponse {}
3326
3327#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3329pub struct GetReportRequest {
3330 #[serde(rename = "requestId")]
3332 #[serde(deserialize_with = "crate::types::integer::one")]
3333 pub request_id: i32,
3334 #[serde(rename = "componentVariable")]
3336 #[serde(default, skip_serializing_if = "Option::is_none")]
3337 pub component_variable: Option<Vec<ComponentVariable>>,
3338 #[serde(rename = "componentCriteria")]
3340 #[serde(default, skip_serializing_if = "Option::is_none")]
3341 pub component_criteria: Option<Vec<ComponentCriterion>>,
3342 #[serde(rename = "customData")]
3344 #[serde(default, skip_serializing_if = "Option::is_none")]
3345 pub custom_data: Option<crate::types::CustomData>,
3346}
3347
3348impl GetReportRequest {
3349 #[must_use]
3351 pub fn new(request_id: i32) -> Self {
3352 Self {
3353 request_id,
3354 component_variable: None,
3355 component_criteria: None,
3356 custom_data: None,
3357 }
3358 }
3359
3360 #[must_use]
3362 pub fn with_component_variable(mut self, value: Vec<ComponentVariable>) -> Self {
3363 self.component_variable = Some(value);
3364 self
3365 }
3366
3367 #[must_use]
3369 pub fn with_component_criteria(mut self, value: Vec<ComponentCriterion>) -> Self {
3370 self.component_criteria = Some(value);
3371 self
3372 }
3373
3374 #[must_use]
3376 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3377 self.custom_data = Some(value);
3378 self
3379 }
3380}
3381
3382impl Validate for GetReportRequest {
3383 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3384 path.push_key("componentVariable");
3385 if let Some(value) = &self.component_variable {
3386 validate::list_len(value.len(), Some(1), None, path, out);
3387 for (index, item) in value.iter().enumerate() {
3388 path.push_index(index);
3389 Validate::validate_at(item, path, out);
3390 path.pop();
3391 }
3392 }
3393 path.pop();
3394 path.push_key("componentCriteria");
3395 if let Some(value) = &self.component_criteria {
3396 validate::list_len(value.len(), Some(1), Some(4), path, out);
3397 for (index, item) in value.iter().enumerate() {
3398 path.push_index(index);
3399 Validate::validate_at(item, path, out);
3400 path.pop();
3401 }
3402 }
3403 path.pop();
3404 path.push_key("customData");
3405 if let Some(value) = &self.custom_data {
3406 Validate::validate_at(value, path, out);
3407 }
3408 path.pop();
3409 }
3410}
3411
3412impl Sealed for GetReportRequest {}
3413impl Request for GetReportRequest {
3414 type Action = Action;
3415 const ACTION: Action = Action::GetReport;
3416 const KIND: MessageKind = MessageKind::Call;
3417 const ORIGIN: Origin = Origin::Csms;
3418 type Response = GetReportResponse;
3419}
3420
3421impl Confirmed for GetReportRequest {}
3422
3423#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3425pub struct GetReportResponse {
3426 pub status: GenericDeviceModelStatus,
3428 #[serde(rename = "statusInfo")]
3430 #[serde(default, skip_serializing_if = "Option::is_none")]
3431 pub status_info: Option<StatusInfo>,
3432 #[serde(rename = "customData")]
3434 #[serde(default, skip_serializing_if = "Option::is_none")]
3435 pub custom_data: Option<crate::types::CustomData>,
3436}
3437
3438impl GetReportResponse {
3439 #[must_use]
3441 pub fn new(status: GenericDeviceModelStatus) -> Self {
3442 Self {
3443 status,
3444 status_info: None,
3445 custom_data: None,
3446 }
3447 }
3448
3449 #[must_use]
3451 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3452 self.status_info = Some(value);
3453 self
3454 }
3455
3456 #[must_use]
3458 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3459 self.custom_data = Some(value);
3460 self
3461 }
3462}
3463
3464impl Validate for GetReportResponse {
3465 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3466 path.push_key("status");
3467 Validate::validate_at(&self.status, path, out);
3468 path.pop();
3469 path.push_key("statusInfo");
3470 if let Some(value) = &self.status_info {
3471 Validate::validate_at(value, path, out);
3472 }
3473 path.pop();
3474 path.push_key("customData");
3475 if let Some(value) = &self.custom_data {
3476 Validate::validate_at(value, path, out);
3477 }
3478 path.pop();
3479 }
3480}
3481
3482impl Sealed for GetReportResponse {}
3483impl Response for GetReportResponse {}
3484
3485#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
3487pub struct GetTransactionStatusRequest {
3488 #[serde(rename = "transactionId")]
3490 #[serde(default, skip_serializing_if = "Option::is_none")]
3491 pub transaction_id: Option<String>,
3492 #[serde(rename = "customData")]
3494 #[serde(default, skip_serializing_if = "Option::is_none")]
3495 pub custom_data: Option<crate::types::CustomData>,
3496}
3497
3498impl GetTransactionStatusRequest {
3499 #[must_use]
3501 pub fn new() -> Self {
3502 Self::default()
3503 }
3504
3505 #[must_use]
3507 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
3508 self.transaction_id = Some(value.into());
3509 self
3510 }
3511
3512 #[must_use]
3514 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3515 self.custom_data = Some(value);
3516 self
3517 }
3518}
3519
3520impl Validate for GetTransactionStatusRequest {
3521 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3522 path.push_key("transactionId");
3523 if let Some(value) = &self.transaction_id {
3524 validate::string(value.as_str(), None, Some(36), path, out);
3525 }
3526 path.pop();
3527 path.push_key("customData");
3528 if let Some(value) = &self.custom_data {
3529 Validate::validate_at(value, path, out);
3530 }
3531 path.pop();
3532 }
3533}
3534
3535impl Sealed for GetTransactionStatusRequest {}
3536impl Request for GetTransactionStatusRequest {
3537 type Action = Action;
3538 const ACTION: Action = Action::GetTransactionStatus;
3539 const KIND: MessageKind = MessageKind::Call;
3540 const ORIGIN: Origin = Origin::Csms;
3541 type Response = GetTransactionStatusResponse;
3542}
3543
3544impl Confirmed for GetTransactionStatusRequest {}
3545
3546#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3548pub struct GetTransactionStatusResponse {
3549 #[serde(rename = "messagesInQueue")]
3551 pub messages_in_queue: bool,
3552 #[serde(rename = "ongoingIndicator")]
3554 #[serde(default, skip_serializing_if = "Option::is_none")]
3555 pub ongoing_indicator: Option<bool>,
3556 #[serde(rename = "customData")]
3558 #[serde(default, skip_serializing_if = "Option::is_none")]
3559 pub custom_data: Option<crate::types::CustomData>,
3560}
3561
3562impl GetTransactionStatusResponse {
3563 #[must_use]
3565 pub fn new(messages_in_queue: bool) -> Self {
3566 Self {
3567 messages_in_queue,
3568 ongoing_indicator: None,
3569 custom_data: None,
3570 }
3571 }
3572
3573 #[must_use]
3575 pub fn with_ongoing_indicator(mut self, value: bool) -> Self {
3576 self.ongoing_indicator = Some(value);
3577 self
3578 }
3579
3580 #[must_use]
3582 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3583 self.custom_data = Some(value);
3584 self
3585 }
3586}
3587
3588impl Validate for GetTransactionStatusResponse {
3589 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3590 path.push_key("customData");
3591 if let Some(value) = &self.custom_data {
3592 Validate::validate_at(value, path, out);
3593 }
3594 path.pop();
3595 }
3596}
3597
3598impl Sealed for GetTransactionStatusResponse {}
3599impl Response for GetTransactionStatusResponse {}
3600
3601#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3603pub struct GetVariablesRequest {
3604 #[serde(rename = "getVariableData")]
3606 pub get_variable_data: Vec<GetVariableData>,
3607 #[serde(rename = "customData")]
3609 #[serde(default, skip_serializing_if = "Option::is_none")]
3610 pub custom_data: Option<crate::types::CustomData>,
3611}
3612
3613impl GetVariablesRequest {
3614 #[must_use]
3616 pub fn new(get_variable_data: Vec<GetVariableData>) -> Self {
3617 Self {
3618 get_variable_data,
3619 custom_data: None,
3620 }
3621 }
3622
3623 #[must_use]
3625 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3626 self.custom_data = Some(value);
3627 self
3628 }
3629}
3630
3631impl Validate for GetVariablesRequest {
3632 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3633 path.push_key("getVariableData");
3634 validate::list_len(self.get_variable_data.len(), Some(1), None, path, out);
3635 for (index, item) in self.get_variable_data.iter().enumerate() {
3636 path.push_index(index);
3637 Validate::validate_at(item, path, out);
3638 path.pop();
3639 }
3640 path.pop();
3641 path.push_key("customData");
3642 if let Some(value) = &self.custom_data {
3643 Validate::validate_at(value, path, out);
3644 }
3645 path.pop();
3646 }
3647}
3648
3649impl Sealed for GetVariablesRequest {}
3650impl Request for GetVariablesRequest {
3651 type Action = Action;
3652 const ACTION: Action = Action::GetVariables;
3653 const KIND: MessageKind = MessageKind::Call;
3654 const ORIGIN: Origin = Origin::Csms;
3655 type Response = GetVariablesResponse;
3656}
3657
3658impl Confirmed for GetVariablesRequest {}
3659
3660#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3662pub struct GetVariablesResponse {
3663 #[serde(rename = "getVariableResult")]
3665 pub get_variable_result: Vec<GetVariableResult>,
3666 #[serde(rename = "customData")]
3668 #[serde(default, skip_serializing_if = "Option::is_none")]
3669 pub custom_data: Option<crate::types::CustomData>,
3670}
3671
3672impl GetVariablesResponse {
3673 #[must_use]
3675 pub fn new(get_variable_result: Vec<GetVariableResult>) -> Self {
3676 Self {
3677 get_variable_result,
3678 custom_data: None,
3679 }
3680 }
3681
3682 #[must_use]
3684 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3685 self.custom_data = Some(value);
3686 self
3687 }
3688}
3689
3690impl Validate for GetVariablesResponse {
3691 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3692 path.push_key("getVariableResult");
3693 validate::list_len(self.get_variable_result.len(), Some(1), None, path, out);
3694 for (index, item) in self.get_variable_result.iter().enumerate() {
3695 path.push_index(index);
3696 Validate::validate_at(item, path, out);
3697 path.pop();
3698 }
3699 path.pop();
3700 path.push_key("customData");
3701 if let Some(value) = &self.custom_data {
3702 Validate::validate_at(value, path, out);
3703 }
3704 path.pop();
3705 }
3706}
3707
3708impl Sealed for GetVariablesResponse {}
3709impl Response for GetVariablesResponse {}
3710
3711#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
3713pub struct HeartbeatRequest {
3714 #[serde(rename = "customData")]
3716 #[serde(default, skip_serializing_if = "Option::is_none")]
3717 pub custom_data: Option<crate::types::CustomData>,
3718}
3719
3720impl HeartbeatRequest {
3721 #[must_use]
3723 pub fn new() -> Self {
3724 Self::default()
3725 }
3726
3727 #[must_use]
3729 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3730 self.custom_data = Some(value);
3731 self
3732 }
3733}
3734
3735impl Validate for HeartbeatRequest {
3736 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3737 path.push_key("customData");
3738 if let Some(value) = &self.custom_data {
3739 Validate::validate_at(value, path, out);
3740 }
3741 path.pop();
3742 }
3743}
3744
3745impl Sealed for HeartbeatRequest {}
3746impl Request for HeartbeatRequest {
3747 type Action = Action;
3748 const ACTION: Action = Action::Heartbeat;
3749 const KIND: MessageKind = MessageKind::Call;
3750 const ORIGIN: Origin = Origin::ChargingStation;
3751 type Response = HeartbeatResponse;
3752}
3753
3754impl Confirmed for HeartbeatRequest {}
3755
3756#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3758pub struct HeartbeatResponse {
3759 #[serde(rename = "currentTime")]
3761 pub current_time: crate::types::DateTime,
3762 #[serde(rename = "customData")]
3764 #[serde(default, skip_serializing_if = "Option::is_none")]
3765 pub custom_data: Option<crate::types::CustomData>,
3766}
3767
3768impl HeartbeatResponse {
3769 #[must_use]
3771 pub fn new(current_time: impl Into<crate::types::DateTime>) -> Self {
3772 Self {
3773 current_time: current_time.into(),
3774 custom_data: None,
3775 }
3776 }
3777
3778 #[must_use]
3780 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3781 self.custom_data = Some(value);
3782 self
3783 }
3784}
3785
3786impl Validate for HeartbeatResponse {
3787 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3788 path.push_key("customData");
3789 if let Some(value) = &self.custom_data {
3790 Validate::validate_at(value, path, out);
3791 }
3792 path.pop();
3793 }
3794}
3795
3796impl Sealed for HeartbeatResponse {}
3797impl Response for HeartbeatResponse {}
3798
3799#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3801pub struct InstallCertificateRequest {
3802 #[serde(rename = "certificateType")]
3804 pub certificate_type: InstallCertificateUse,
3805 pub certificate: String,
3807 #[serde(rename = "customData")]
3809 #[serde(default, skip_serializing_if = "Option::is_none")]
3810 pub custom_data: Option<crate::types::CustomData>,
3811}
3812
3813impl InstallCertificateRequest {
3814 #[must_use]
3816 pub fn new(certificate_type: InstallCertificateUse, certificate: impl Into<String>) -> Self {
3817 Self {
3818 certificate_type,
3819 certificate: certificate.into(),
3820 custom_data: None,
3821 }
3822 }
3823
3824 #[must_use]
3826 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3827 self.custom_data = Some(value);
3828 self
3829 }
3830}
3831
3832impl Validate for InstallCertificateRequest {
3833 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3834 path.push_key("certificateType");
3835 Validate::validate_at(&self.certificate_type, path, out);
3836 path.pop();
3837 path.push_key("certificate");
3838 validate::string(self.certificate.as_str(), None, Some(5500), path, out);
3839 path.pop();
3840 path.push_key("customData");
3841 if let Some(value) = &self.custom_data {
3842 Validate::validate_at(value, path, out);
3843 }
3844 path.pop();
3845 }
3846}
3847
3848impl Sealed for InstallCertificateRequest {}
3849impl Request for InstallCertificateRequest {
3850 type Action = Action;
3851 const ACTION: Action = Action::InstallCertificate;
3852 const KIND: MessageKind = MessageKind::Call;
3853 const ORIGIN: Origin = Origin::Csms;
3854 type Response = InstallCertificateResponse;
3855}
3856
3857impl Confirmed for InstallCertificateRequest {}
3858
3859#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3861pub struct InstallCertificateResponse {
3862 pub status: InstallCertificateStatus,
3864 #[serde(rename = "statusInfo")]
3866 #[serde(default, skip_serializing_if = "Option::is_none")]
3867 pub status_info: Option<StatusInfo>,
3868 #[serde(rename = "customData")]
3870 #[serde(default, skip_serializing_if = "Option::is_none")]
3871 pub custom_data: Option<crate::types::CustomData>,
3872}
3873
3874impl InstallCertificateResponse {
3875 #[must_use]
3877 pub fn new(status: InstallCertificateStatus) -> Self {
3878 Self {
3879 status,
3880 status_info: None,
3881 custom_data: None,
3882 }
3883 }
3884
3885 #[must_use]
3887 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3888 self.status_info = Some(value);
3889 self
3890 }
3891
3892 #[must_use]
3894 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3895 self.custom_data = Some(value);
3896 self
3897 }
3898}
3899
3900impl Validate for InstallCertificateResponse {
3901 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3902 path.push_key("status");
3903 Validate::validate_at(&self.status, path, out);
3904 path.pop();
3905 path.push_key("statusInfo");
3906 if let Some(value) = &self.status_info {
3907 Validate::validate_at(value, path, out);
3908 }
3909 path.pop();
3910 path.push_key("customData");
3911 if let Some(value) = &self.custom_data {
3912 Validate::validate_at(value, path, out);
3913 }
3914 path.pop();
3915 }
3916}
3917
3918impl Sealed for InstallCertificateResponse {}
3919impl Response for InstallCertificateResponse {}
3920
3921#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3923pub struct LogStatusNotificationRequest {
3924 pub status: UploadLogStatus,
3926 #[serde(rename = "requestId")]
3929 #[serde(default, skip_serializing_if = "Option::is_none")]
3930 #[serde(deserialize_with = "crate::types::integer::option")]
3931 pub request_id: Option<i32>,
3932 #[serde(rename = "customData")]
3934 #[serde(default, skip_serializing_if = "Option::is_none")]
3935 pub custom_data: Option<crate::types::CustomData>,
3936}
3937
3938impl LogStatusNotificationRequest {
3939 #[must_use]
3941 pub fn new(status: UploadLogStatus) -> Self {
3942 Self {
3943 status,
3944 request_id: None,
3945 custom_data: None,
3946 }
3947 }
3948
3949 #[must_use]
3951 pub fn with_request_id(mut self, value: i32) -> Self {
3952 self.request_id = Some(value);
3953 self
3954 }
3955
3956 #[must_use]
3958 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3959 self.custom_data = Some(value);
3960 self
3961 }
3962}
3963
3964impl Validate for LogStatusNotificationRequest {
3965 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3966 path.push_key("status");
3967 Validate::validate_at(&self.status, path, out);
3968 path.pop();
3969 path.push_key("customData");
3970 if let Some(value) = &self.custom_data {
3971 Validate::validate_at(value, path, out);
3972 }
3973 path.pop();
3974 }
3975}
3976
3977impl Sealed for LogStatusNotificationRequest {}
3978impl Request for LogStatusNotificationRequest {
3979 type Action = Action;
3980 const ACTION: Action = Action::LogStatusNotification;
3981 const KIND: MessageKind = MessageKind::Call;
3982 const ORIGIN: Origin = Origin::ChargingStation;
3983 type Response = LogStatusNotificationResponse;
3984}
3985
3986impl Confirmed for LogStatusNotificationRequest {}
3987
3988#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
3990pub struct LogStatusNotificationResponse {
3991 #[serde(rename = "customData")]
3993 #[serde(default, skip_serializing_if = "Option::is_none")]
3994 pub custom_data: Option<crate::types::CustomData>,
3995}
3996
3997impl LogStatusNotificationResponse {
3998 #[must_use]
4000 pub fn new() -> Self {
4001 Self::default()
4002 }
4003
4004 #[must_use]
4006 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4007 self.custom_data = Some(value);
4008 self
4009 }
4010}
4011
4012impl Validate for LogStatusNotificationResponse {
4013 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4014 path.push_key("customData");
4015 if let Some(value) = &self.custom_data {
4016 Validate::validate_at(value, path, out);
4017 }
4018 path.pop();
4019 }
4020}
4021
4022impl Sealed for LogStatusNotificationResponse {}
4023impl Response for LogStatusNotificationResponse {}
4024
4025#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4030pub struct MeterValuesRequest {
4031 #[serde(rename = "evseId")]
4035 #[serde(deserialize_with = "crate::types::integer::one")]
4036 pub evse_id: i32,
4037 #[serde(rename = "meterValue")]
4039 pub meter_value: Vec<MeterValue>,
4040 #[serde(rename = "customData")]
4042 #[serde(default, skip_serializing_if = "Option::is_none")]
4043 pub custom_data: Option<crate::types::CustomData>,
4044}
4045
4046impl MeterValuesRequest {
4047 #[must_use]
4049 pub fn new(evse_id: i32, meter_value: Vec<MeterValue>) -> Self {
4050 Self {
4051 evse_id,
4052 meter_value,
4053 custom_data: None,
4054 }
4055 }
4056
4057 #[must_use]
4059 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4060 self.custom_data = Some(value);
4061 self
4062 }
4063}
4064
4065impl Validate for MeterValuesRequest {
4066 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4067 path.push_key("meterValue");
4068 validate::list_len(self.meter_value.len(), Some(1), None, path, out);
4069 for (index, item) in self.meter_value.iter().enumerate() {
4070 path.push_index(index);
4071 Validate::validate_at(item, path, out);
4072 path.pop();
4073 }
4074 path.pop();
4075 path.push_key("customData");
4076 if let Some(value) = &self.custom_data {
4077 Validate::validate_at(value, path, out);
4078 }
4079 path.pop();
4080 }
4081}
4082
4083impl Sealed for MeterValuesRequest {}
4084impl Request for MeterValuesRequest {
4085 type Action = Action;
4086 const ACTION: Action = Action::MeterValues;
4087 const KIND: MessageKind = MessageKind::Call;
4088 const ORIGIN: Origin = Origin::ChargingStation;
4089 type Response = MeterValuesResponse;
4090}
4091
4092impl Confirmed for MeterValuesRequest {}
4093
4094#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4096pub struct MeterValuesResponse {
4097 #[serde(rename = "customData")]
4099 #[serde(default, skip_serializing_if = "Option::is_none")]
4100 pub custom_data: Option<crate::types::CustomData>,
4101}
4102
4103impl MeterValuesResponse {
4104 #[must_use]
4106 pub fn new() -> Self {
4107 Self::default()
4108 }
4109
4110 #[must_use]
4112 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4113 self.custom_data = Some(value);
4114 self
4115 }
4116}
4117
4118impl Validate for MeterValuesResponse {
4119 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4120 path.push_key("customData");
4121 if let Some(value) = &self.custom_data {
4122 Validate::validate_at(value, path, out);
4123 }
4124 path.pop();
4125 }
4126}
4127
4128impl Sealed for MeterValuesResponse {}
4129impl Response for MeterValuesResponse {}
4130
4131#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4133pub struct NotifyChargingLimitRequest {
4134 #[serde(rename = "chargingLimit")]
4136 pub charging_limit: ChargingLimit,
4137 #[serde(rename = "chargingSchedule")]
4139 #[serde(default, skip_serializing_if = "Option::is_none")]
4140 pub charging_schedule: Option<Vec<ChargingSchedule>>,
4141 #[serde(rename = "evseId")]
4143 #[serde(default, skip_serializing_if = "Option::is_none")]
4144 #[serde(deserialize_with = "crate::types::integer::option")]
4145 pub evse_id: Option<i32>,
4146 #[serde(rename = "customData")]
4148 #[serde(default, skip_serializing_if = "Option::is_none")]
4149 pub custom_data: Option<crate::types::CustomData>,
4150}
4151
4152impl NotifyChargingLimitRequest {
4153 #[must_use]
4155 pub fn new(charging_limit: ChargingLimit) -> Self {
4156 Self {
4157 charging_limit,
4158 charging_schedule: None,
4159 evse_id: None,
4160 custom_data: None,
4161 }
4162 }
4163
4164 #[must_use]
4166 pub fn with_charging_schedule(mut self, value: Vec<ChargingSchedule>) -> Self {
4167 self.charging_schedule = Some(value);
4168 self
4169 }
4170
4171 #[must_use]
4173 pub fn with_evse_id(mut self, value: i32) -> Self {
4174 self.evse_id = Some(value);
4175 self
4176 }
4177
4178 #[must_use]
4180 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4181 self.custom_data = Some(value);
4182 self
4183 }
4184}
4185
4186impl Validate for NotifyChargingLimitRequest {
4187 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4188 path.push_key("chargingLimit");
4189 Validate::validate_at(&self.charging_limit, path, out);
4190 path.pop();
4191 path.push_key("chargingSchedule");
4192 if let Some(value) = &self.charging_schedule {
4193 validate::list_len(value.len(), Some(1), None, path, out);
4194 for (index, item) in value.iter().enumerate() {
4195 path.push_index(index);
4196 Validate::validate_at(item, path, out);
4197 path.pop();
4198 }
4199 }
4200 path.pop();
4201 path.push_key("customData");
4202 if let Some(value) = &self.custom_data {
4203 Validate::validate_at(value, path, out);
4204 }
4205 path.pop();
4206 }
4207}
4208
4209impl Sealed for NotifyChargingLimitRequest {}
4210impl Request for NotifyChargingLimitRequest {
4211 type Action = Action;
4212 const ACTION: Action = Action::NotifyChargingLimit;
4213 const KIND: MessageKind = MessageKind::Call;
4214 const ORIGIN: Origin = Origin::ChargingStation;
4215 type Response = NotifyChargingLimitResponse;
4216}
4217
4218impl Confirmed for NotifyChargingLimitRequest {}
4219
4220#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4222pub struct NotifyChargingLimitResponse {
4223 #[serde(rename = "customData")]
4225 #[serde(default, skip_serializing_if = "Option::is_none")]
4226 pub custom_data: Option<crate::types::CustomData>,
4227}
4228
4229impl NotifyChargingLimitResponse {
4230 #[must_use]
4232 pub fn new() -> Self {
4233 Self::default()
4234 }
4235
4236 #[must_use]
4238 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4239 self.custom_data = Some(value);
4240 self
4241 }
4242}
4243
4244impl Validate for NotifyChargingLimitResponse {
4245 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4246 path.push_key("customData");
4247 if let Some(value) = &self.custom_data {
4248 Validate::validate_at(value, path, out);
4249 }
4250 path.pop();
4251 }
4252}
4253
4254impl Sealed for NotifyChargingLimitResponse {}
4255impl Response for NotifyChargingLimitResponse {}
4256
4257#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4259pub struct NotifyCustomerInformationRequest {
4260 pub data: String,
4262 #[serde(rename = "seqNo")]
4264 #[serde(deserialize_with = "crate::types::integer::one")]
4265 pub seq_no: i32,
4266 #[serde(rename = "generatedAt")]
4268 pub generated_at: crate::types::DateTime,
4269 #[serde(rename = "requestId")]
4271 #[serde(deserialize_with = "crate::types::integer::one")]
4272 pub request_id: i32,
4273 #[serde(default, skip_serializing_if = "Option::is_none")]
4276 pub tbc: Option<bool>,
4277 #[serde(rename = "customData")]
4279 #[serde(default, skip_serializing_if = "Option::is_none")]
4280 pub custom_data: Option<crate::types::CustomData>,
4281}
4282
4283impl NotifyCustomerInformationRequest {
4284 #[must_use]
4286 pub fn new(
4287 data: impl Into<String>,
4288 seq_no: i32,
4289 generated_at: impl Into<crate::types::DateTime>,
4290 request_id: i32,
4291 ) -> Self {
4292 Self {
4293 data: data.into(),
4294 seq_no,
4295 generated_at: generated_at.into(),
4296 request_id,
4297 tbc: None,
4298 custom_data: None,
4299 }
4300 }
4301
4302 #[must_use]
4304 pub fn with_tbc(mut self, value: bool) -> Self {
4305 self.tbc = Some(value);
4306 self
4307 }
4308
4309 #[must_use]
4311 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4312 self.custom_data = Some(value);
4313 self
4314 }
4315}
4316
4317impl Validate for NotifyCustomerInformationRequest {
4318 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4319 path.push_key("data");
4320 validate::string(self.data.as_str(), None, Some(512), path, out);
4321 path.pop();
4322 path.push_key("customData");
4323 if let Some(value) = &self.custom_data {
4324 Validate::validate_at(value, path, out);
4325 }
4326 path.pop();
4327 }
4328}
4329
4330impl Sealed for NotifyCustomerInformationRequest {}
4331impl Request for NotifyCustomerInformationRequest {
4332 type Action = Action;
4333 const ACTION: Action = Action::NotifyCustomerInformation;
4334 const KIND: MessageKind = MessageKind::Call;
4335 const ORIGIN: Origin = Origin::ChargingStation;
4336 type Response = NotifyCustomerInformationResponse;
4337}
4338
4339impl Confirmed for NotifyCustomerInformationRequest {}
4340
4341#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4343pub struct NotifyCustomerInformationResponse {
4344 #[serde(rename = "customData")]
4346 #[serde(default, skip_serializing_if = "Option::is_none")]
4347 pub custom_data: Option<crate::types::CustomData>,
4348}
4349
4350impl NotifyCustomerInformationResponse {
4351 #[must_use]
4353 pub fn new() -> Self {
4354 Self::default()
4355 }
4356
4357 #[must_use]
4359 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4360 self.custom_data = Some(value);
4361 self
4362 }
4363}
4364
4365impl Validate for NotifyCustomerInformationResponse {
4366 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4367 path.push_key("customData");
4368 if let Some(value) = &self.custom_data {
4369 Validate::validate_at(value, path, out);
4370 }
4371 path.pop();
4372 }
4373}
4374
4375impl Sealed for NotifyCustomerInformationResponse {}
4376impl Response for NotifyCustomerInformationResponse {}
4377
4378#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4380pub struct NotifyDisplayMessagesRequest {
4381 #[serde(rename = "requestId")]
4383 #[serde(deserialize_with = "crate::types::integer::one")]
4384 pub request_id: i32,
4385 #[serde(rename = "messageInfo")]
4387 #[serde(default, skip_serializing_if = "Option::is_none")]
4388 pub message_info: Option<Vec<MessageInfo>>,
4389 #[serde(default, skip_serializing_if = "Option::is_none")]
4392 pub tbc: Option<bool>,
4393 #[serde(rename = "customData")]
4395 #[serde(default, skip_serializing_if = "Option::is_none")]
4396 pub custom_data: Option<crate::types::CustomData>,
4397}
4398
4399impl NotifyDisplayMessagesRequest {
4400 #[must_use]
4402 pub fn new(request_id: i32) -> Self {
4403 Self {
4404 request_id,
4405 message_info: None,
4406 tbc: None,
4407 custom_data: None,
4408 }
4409 }
4410
4411 #[must_use]
4413 pub fn with_message_info(mut self, value: Vec<MessageInfo>) -> Self {
4414 self.message_info = Some(value);
4415 self
4416 }
4417
4418 #[must_use]
4420 pub fn with_tbc(mut self, value: bool) -> Self {
4421 self.tbc = Some(value);
4422 self
4423 }
4424
4425 #[must_use]
4427 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4428 self.custom_data = Some(value);
4429 self
4430 }
4431}
4432
4433impl Validate for NotifyDisplayMessagesRequest {
4434 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4435 path.push_key("messageInfo");
4436 if let Some(value) = &self.message_info {
4437 validate::list_len(value.len(), Some(1), None, path, out);
4438 for (index, item) in value.iter().enumerate() {
4439 path.push_index(index);
4440 Validate::validate_at(item, path, out);
4441 path.pop();
4442 }
4443 }
4444 path.pop();
4445 path.push_key("customData");
4446 if let Some(value) = &self.custom_data {
4447 Validate::validate_at(value, path, out);
4448 }
4449 path.pop();
4450 }
4451}
4452
4453impl Sealed for NotifyDisplayMessagesRequest {}
4454impl Request for NotifyDisplayMessagesRequest {
4455 type Action = Action;
4456 const ACTION: Action = Action::NotifyDisplayMessages;
4457 const KIND: MessageKind = MessageKind::Call;
4458 const ORIGIN: Origin = Origin::ChargingStation;
4459 type Response = NotifyDisplayMessagesResponse;
4460}
4461
4462impl Confirmed for NotifyDisplayMessagesRequest {}
4463
4464#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4466pub struct NotifyDisplayMessagesResponse {
4467 #[serde(rename = "customData")]
4469 #[serde(default, skip_serializing_if = "Option::is_none")]
4470 pub custom_data: Option<crate::types::CustomData>,
4471}
4472
4473impl NotifyDisplayMessagesResponse {
4474 #[must_use]
4476 pub fn new() -> Self {
4477 Self::default()
4478 }
4479
4480 #[must_use]
4482 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4483 self.custom_data = Some(value);
4484 self
4485 }
4486}
4487
4488impl Validate for NotifyDisplayMessagesResponse {
4489 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4490 path.push_key("customData");
4491 if let Some(value) = &self.custom_data {
4492 Validate::validate_at(value, path, out);
4493 }
4494 path.pop();
4495 }
4496}
4497
4498impl Sealed for NotifyDisplayMessagesResponse {}
4499impl Response for NotifyDisplayMessagesResponse {}
4500
4501#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4503pub struct NotifyEVChargingNeedsRequest {
4504 #[serde(rename = "chargingNeeds")]
4506 pub charging_needs: ChargingNeeds,
4507 #[serde(rename = "evseId")]
4509 #[serde(deserialize_with = "crate::types::integer::one")]
4510 pub evse_id: i32,
4511 #[serde(rename = "maxScheduleTuples")]
4513 #[serde(default, skip_serializing_if = "Option::is_none")]
4514 #[serde(deserialize_with = "crate::types::integer::option")]
4515 pub max_schedule_tuples: Option<i32>,
4516 #[serde(rename = "customData")]
4518 #[serde(default, skip_serializing_if = "Option::is_none")]
4519 pub custom_data: Option<crate::types::CustomData>,
4520}
4521
4522impl NotifyEVChargingNeedsRequest {
4523 #[must_use]
4525 pub fn new(charging_needs: ChargingNeeds, evse_id: i32) -> Self {
4526 Self {
4527 charging_needs,
4528 evse_id,
4529 max_schedule_tuples: None,
4530 custom_data: None,
4531 }
4532 }
4533
4534 #[must_use]
4536 pub fn with_max_schedule_tuples(mut self, value: i32) -> Self {
4537 self.max_schedule_tuples = Some(value);
4538 self
4539 }
4540
4541 #[must_use]
4543 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4544 self.custom_data = Some(value);
4545 self
4546 }
4547}
4548
4549impl Validate for NotifyEVChargingNeedsRequest {
4550 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4551 path.push_key("chargingNeeds");
4552 Validate::validate_at(&self.charging_needs, path, out);
4553 path.pop();
4554 path.push_key("customData");
4555 if let Some(value) = &self.custom_data {
4556 Validate::validate_at(value, path, out);
4557 }
4558 path.pop();
4559 }
4560}
4561
4562impl Sealed for NotifyEVChargingNeedsRequest {}
4563impl Request for NotifyEVChargingNeedsRequest {
4564 type Action = Action;
4565 const ACTION: Action = Action::NotifyEVChargingNeeds;
4566 const KIND: MessageKind = MessageKind::Call;
4567 const ORIGIN: Origin = Origin::ChargingStation;
4568 type Response = NotifyEVChargingNeedsResponse;
4569}
4570
4571impl Confirmed for NotifyEVChargingNeedsRequest {}
4572
4573#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4575pub struct NotifyEVChargingNeedsResponse {
4576 pub status: NotifyEVChargingNeedsStatus,
4578 #[serde(rename = "statusInfo")]
4580 #[serde(default, skip_serializing_if = "Option::is_none")]
4581 pub status_info: Option<StatusInfo>,
4582 #[serde(rename = "customData")]
4584 #[serde(default, skip_serializing_if = "Option::is_none")]
4585 pub custom_data: Option<crate::types::CustomData>,
4586}
4587
4588impl NotifyEVChargingNeedsResponse {
4589 #[must_use]
4591 pub fn new(status: NotifyEVChargingNeedsStatus) -> Self {
4592 Self {
4593 status,
4594 status_info: None,
4595 custom_data: None,
4596 }
4597 }
4598
4599 #[must_use]
4601 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
4602 self.status_info = Some(value);
4603 self
4604 }
4605
4606 #[must_use]
4608 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4609 self.custom_data = Some(value);
4610 self
4611 }
4612}
4613
4614impl Validate for NotifyEVChargingNeedsResponse {
4615 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4616 path.push_key("status");
4617 Validate::validate_at(&self.status, path, out);
4618 path.pop();
4619 path.push_key("statusInfo");
4620 if let Some(value) = &self.status_info {
4621 Validate::validate_at(value, path, out);
4622 }
4623 path.pop();
4624 path.push_key("customData");
4625 if let Some(value) = &self.custom_data {
4626 Validate::validate_at(value, path, out);
4627 }
4628 path.pop();
4629 }
4630}
4631
4632impl Sealed for NotifyEVChargingNeedsResponse {}
4633impl Response for NotifyEVChargingNeedsResponse {}
4634
4635#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4637pub struct NotifyEVChargingScheduleRequest {
4638 #[serde(rename = "timeBase")]
4640 pub time_base: crate::types::DateTime,
4641 #[serde(rename = "chargingSchedule")]
4643 pub charging_schedule: ChargingSchedule,
4644 #[serde(rename = "evseId")]
4646 #[serde(deserialize_with = "crate::types::integer::one")]
4647 pub evse_id: i32,
4648 #[serde(rename = "customData")]
4650 #[serde(default, skip_serializing_if = "Option::is_none")]
4651 pub custom_data: Option<crate::types::CustomData>,
4652}
4653
4654impl NotifyEVChargingScheduleRequest {
4655 #[must_use]
4657 pub fn new(
4658 time_base: impl Into<crate::types::DateTime>,
4659 charging_schedule: ChargingSchedule,
4660 evse_id: i32,
4661 ) -> Self {
4662 Self {
4663 time_base: time_base.into(),
4664 charging_schedule,
4665 evse_id,
4666 custom_data: None,
4667 }
4668 }
4669
4670 #[must_use]
4672 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4673 self.custom_data = Some(value);
4674 self
4675 }
4676}
4677
4678impl Validate for NotifyEVChargingScheduleRequest {
4679 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4680 path.push_key("chargingSchedule");
4681 Validate::validate_at(&self.charging_schedule, path, out);
4682 path.pop();
4683 path.push_key("customData");
4684 if let Some(value) = &self.custom_data {
4685 Validate::validate_at(value, path, out);
4686 }
4687 path.pop();
4688 }
4689}
4690
4691impl Sealed for NotifyEVChargingScheduleRequest {}
4692impl Request for NotifyEVChargingScheduleRequest {
4693 type Action = Action;
4694 const ACTION: Action = Action::NotifyEVChargingSchedule;
4695 const KIND: MessageKind = MessageKind::Call;
4696 const ORIGIN: Origin = Origin::ChargingStation;
4697 type Response = NotifyEVChargingScheduleResponse;
4698}
4699
4700impl Confirmed for NotifyEVChargingScheduleRequest {}
4701
4702#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4704pub struct NotifyEVChargingScheduleResponse {
4705 pub status: GenericStatus,
4707 #[serde(rename = "statusInfo")]
4709 #[serde(default, skip_serializing_if = "Option::is_none")]
4710 pub status_info: Option<StatusInfo>,
4711 #[serde(rename = "customData")]
4713 #[serde(default, skip_serializing_if = "Option::is_none")]
4714 pub custom_data: Option<crate::types::CustomData>,
4715}
4716
4717impl NotifyEVChargingScheduleResponse {
4718 #[must_use]
4720 pub fn new(status: GenericStatus) -> Self {
4721 Self {
4722 status,
4723 status_info: None,
4724 custom_data: None,
4725 }
4726 }
4727
4728 #[must_use]
4730 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
4731 self.status_info = Some(value);
4732 self
4733 }
4734
4735 #[must_use]
4737 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4738 self.custom_data = Some(value);
4739 self
4740 }
4741}
4742
4743impl Validate for NotifyEVChargingScheduleResponse {
4744 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4745 path.push_key("status");
4746 Validate::validate_at(&self.status, path, out);
4747 path.pop();
4748 path.push_key("statusInfo");
4749 if let Some(value) = &self.status_info {
4750 Validate::validate_at(value, path, out);
4751 }
4752 path.pop();
4753 path.push_key("customData");
4754 if let Some(value) = &self.custom_data {
4755 Validate::validate_at(value, path, out);
4756 }
4757 path.pop();
4758 }
4759}
4760
4761impl Sealed for NotifyEVChargingScheduleResponse {}
4762impl Response for NotifyEVChargingScheduleResponse {}
4763
4764#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4766pub struct NotifyEventRequest {
4767 #[serde(rename = "generatedAt")]
4769 pub generated_at: crate::types::DateTime,
4770 #[serde(rename = "seqNo")]
4772 #[serde(deserialize_with = "crate::types::integer::one")]
4773 pub seq_no: i32,
4774 #[serde(rename = "eventData")]
4776 pub event_data: Vec<EventData>,
4777 #[serde(default, skip_serializing_if = "Option::is_none")]
4780 pub tbc: Option<bool>,
4781 #[serde(rename = "customData")]
4783 #[serde(default, skip_serializing_if = "Option::is_none")]
4784 pub custom_data: Option<crate::types::CustomData>,
4785}
4786
4787impl NotifyEventRequest {
4788 #[must_use]
4790 pub fn new(
4791 generated_at: impl Into<crate::types::DateTime>,
4792 seq_no: i32,
4793 event_data: Vec<EventData>,
4794 ) -> Self {
4795 Self {
4796 generated_at: generated_at.into(),
4797 seq_no,
4798 event_data,
4799 tbc: None,
4800 custom_data: None,
4801 }
4802 }
4803
4804 #[must_use]
4806 pub fn with_tbc(mut self, value: bool) -> Self {
4807 self.tbc = Some(value);
4808 self
4809 }
4810
4811 #[must_use]
4813 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4814 self.custom_data = Some(value);
4815 self
4816 }
4817}
4818
4819impl Validate for NotifyEventRequest {
4820 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4821 path.push_key("eventData");
4822 validate::list_len(self.event_data.len(), Some(1), None, path, out);
4823 for (index, item) in self.event_data.iter().enumerate() {
4824 path.push_index(index);
4825 Validate::validate_at(item, path, out);
4826 path.pop();
4827 }
4828 path.pop();
4829 path.push_key("customData");
4830 if let Some(value) = &self.custom_data {
4831 Validate::validate_at(value, path, out);
4832 }
4833 path.pop();
4834 }
4835}
4836
4837impl Sealed for NotifyEventRequest {}
4838impl Request for NotifyEventRequest {
4839 type Action = Action;
4840 const ACTION: Action = Action::NotifyEvent;
4841 const KIND: MessageKind = MessageKind::Call;
4842 const ORIGIN: Origin = Origin::ChargingStation;
4843 type Response = NotifyEventResponse;
4844}
4845
4846impl Confirmed for NotifyEventRequest {}
4847
4848#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4850pub struct NotifyEventResponse {
4851 #[serde(rename = "customData")]
4853 #[serde(default, skip_serializing_if = "Option::is_none")]
4854 pub custom_data: Option<crate::types::CustomData>,
4855}
4856
4857impl NotifyEventResponse {
4858 #[must_use]
4860 pub fn new() -> Self {
4861 Self::default()
4862 }
4863
4864 #[must_use]
4866 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4867 self.custom_data = Some(value);
4868 self
4869 }
4870}
4871
4872impl Validate for NotifyEventResponse {
4873 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4874 path.push_key("customData");
4875 if let Some(value) = &self.custom_data {
4876 Validate::validate_at(value, path, out);
4877 }
4878 path.pop();
4879 }
4880}
4881
4882impl Sealed for NotifyEventResponse {}
4883impl Response for NotifyEventResponse {}
4884
4885#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4887pub struct NotifyMonitoringReportRequest {
4888 #[serde(rename = "requestId")]
4890 #[serde(deserialize_with = "crate::types::integer::one")]
4891 pub request_id: i32,
4892 #[serde(rename = "seqNo")]
4894 #[serde(deserialize_with = "crate::types::integer::one")]
4895 pub seq_no: i32,
4896 #[serde(rename = "generatedAt")]
4898 pub generated_at: crate::types::DateTime,
4899 #[serde(default, skip_serializing_if = "Option::is_none")]
4901 pub monitor: Option<Vec<MonitoringData>>,
4902 #[serde(default, skip_serializing_if = "Option::is_none")]
4905 pub tbc: Option<bool>,
4906 #[serde(rename = "customData")]
4908 #[serde(default, skip_serializing_if = "Option::is_none")]
4909 pub custom_data: Option<crate::types::CustomData>,
4910}
4911
4912impl NotifyMonitoringReportRequest {
4913 #[must_use]
4915 pub fn new(
4916 request_id: i32,
4917 seq_no: i32,
4918 generated_at: impl Into<crate::types::DateTime>,
4919 ) -> Self {
4920 Self {
4921 request_id,
4922 seq_no,
4923 generated_at: generated_at.into(),
4924 monitor: None,
4925 tbc: None,
4926 custom_data: None,
4927 }
4928 }
4929
4930 #[must_use]
4932 pub fn with_monitor(mut self, value: Vec<MonitoringData>) -> Self {
4933 self.monitor = Some(value);
4934 self
4935 }
4936
4937 #[must_use]
4939 pub fn with_tbc(mut self, value: bool) -> Self {
4940 self.tbc = Some(value);
4941 self
4942 }
4943
4944 #[must_use]
4946 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4947 self.custom_data = Some(value);
4948 self
4949 }
4950}
4951
4952impl Validate for NotifyMonitoringReportRequest {
4953 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4954 path.push_key("monitor");
4955 if let Some(value) = &self.monitor {
4956 validate::list_len(value.len(), Some(1), None, path, out);
4957 for (index, item) in value.iter().enumerate() {
4958 path.push_index(index);
4959 Validate::validate_at(item, path, out);
4960 path.pop();
4961 }
4962 }
4963 path.pop();
4964 path.push_key("customData");
4965 if let Some(value) = &self.custom_data {
4966 Validate::validate_at(value, path, out);
4967 }
4968 path.pop();
4969 }
4970}
4971
4972impl Sealed for NotifyMonitoringReportRequest {}
4973impl Request for NotifyMonitoringReportRequest {
4974 type Action = Action;
4975 const ACTION: Action = Action::NotifyMonitoringReport;
4976 const KIND: MessageKind = MessageKind::Call;
4977 const ORIGIN: Origin = Origin::ChargingStation;
4978 type Response = NotifyMonitoringReportResponse;
4979}
4980
4981impl Confirmed for NotifyMonitoringReportRequest {}
4982
4983#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4985pub struct NotifyMonitoringReportResponse {
4986 #[serde(rename = "customData")]
4988 #[serde(default, skip_serializing_if = "Option::is_none")]
4989 pub custom_data: Option<crate::types::CustomData>,
4990}
4991
4992impl NotifyMonitoringReportResponse {
4993 #[must_use]
4995 pub fn new() -> Self {
4996 Self::default()
4997 }
4998
4999 #[must_use]
5001 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5002 self.custom_data = Some(value);
5003 self
5004 }
5005}
5006
5007impl Validate for NotifyMonitoringReportResponse {
5008 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5009 path.push_key("customData");
5010 if let Some(value) = &self.custom_data {
5011 Validate::validate_at(value, path, out);
5012 }
5013 path.pop();
5014 }
5015}
5016
5017impl Sealed for NotifyMonitoringReportResponse {}
5018impl Response for NotifyMonitoringReportResponse {}
5019
5020#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5022pub struct NotifyReportRequest {
5023 #[serde(rename = "requestId")]
5025 #[serde(deserialize_with = "crate::types::integer::one")]
5026 pub request_id: i32,
5027 #[serde(rename = "generatedAt")]
5029 pub generated_at: crate::types::DateTime,
5030 #[serde(rename = "seqNo")]
5032 #[serde(deserialize_with = "crate::types::integer::one")]
5033 pub seq_no: i32,
5034 #[serde(rename = "reportData")]
5036 #[serde(default, skip_serializing_if = "Option::is_none")]
5037 pub report_data: Option<Vec<ReportData>>,
5038 #[serde(default, skip_serializing_if = "Option::is_none")]
5041 pub tbc: Option<bool>,
5042 #[serde(rename = "customData")]
5044 #[serde(default, skip_serializing_if = "Option::is_none")]
5045 pub custom_data: Option<crate::types::CustomData>,
5046}
5047
5048impl NotifyReportRequest {
5049 #[must_use]
5051 pub fn new(
5052 request_id: i32,
5053 generated_at: impl Into<crate::types::DateTime>,
5054 seq_no: i32,
5055 ) -> Self {
5056 Self {
5057 request_id,
5058 generated_at: generated_at.into(),
5059 seq_no,
5060 report_data: None,
5061 tbc: None,
5062 custom_data: None,
5063 }
5064 }
5065
5066 #[must_use]
5068 pub fn with_report_data(mut self, value: Vec<ReportData>) -> Self {
5069 self.report_data = Some(value);
5070 self
5071 }
5072
5073 #[must_use]
5075 pub fn with_tbc(mut self, value: bool) -> Self {
5076 self.tbc = Some(value);
5077 self
5078 }
5079
5080 #[must_use]
5082 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5083 self.custom_data = Some(value);
5084 self
5085 }
5086}
5087
5088impl Validate for NotifyReportRequest {
5089 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5090 path.push_key("reportData");
5091 if let Some(value) = &self.report_data {
5092 validate::list_len(value.len(), Some(1), None, path, out);
5093 for (index, item) in value.iter().enumerate() {
5094 path.push_index(index);
5095 Validate::validate_at(item, path, out);
5096 path.pop();
5097 }
5098 }
5099 path.pop();
5100 path.push_key("customData");
5101 if let Some(value) = &self.custom_data {
5102 Validate::validate_at(value, path, out);
5103 }
5104 path.pop();
5105 }
5106}
5107
5108impl Sealed for NotifyReportRequest {}
5109impl Request for NotifyReportRequest {
5110 type Action = Action;
5111 const ACTION: Action = Action::NotifyReport;
5112 const KIND: MessageKind = MessageKind::Call;
5113 const ORIGIN: Origin = Origin::ChargingStation;
5114 type Response = NotifyReportResponse;
5115}
5116
5117impl Confirmed for NotifyReportRequest {}
5118
5119#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5121pub struct NotifyReportResponse {
5122 #[serde(rename = "customData")]
5124 #[serde(default, skip_serializing_if = "Option::is_none")]
5125 pub custom_data: Option<crate::types::CustomData>,
5126}
5127
5128impl NotifyReportResponse {
5129 #[must_use]
5131 pub fn new() -> Self {
5132 Self::default()
5133 }
5134
5135 #[must_use]
5137 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5138 self.custom_data = Some(value);
5139 self
5140 }
5141}
5142
5143impl Validate for NotifyReportResponse {
5144 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5145 path.push_key("customData");
5146 if let Some(value) = &self.custom_data {
5147 Validate::validate_at(value, path, out);
5148 }
5149 path.pop();
5150 }
5151}
5152
5153impl Sealed for NotifyReportResponse {}
5154impl Response for NotifyReportResponse {}
5155
5156#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5158pub struct PublishFirmwareRequest {
5159 pub location: String,
5162 pub checksum: String,
5164 #[serde(rename = "requestId")]
5166 #[serde(deserialize_with = "crate::types::integer::one")]
5167 pub request_id: i32,
5168 #[serde(default, skip_serializing_if = "Option::is_none")]
5172 #[serde(deserialize_with = "crate::types::integer::option")]
5173 pub retries: Option<i32>,
5174 #[serde(rename = "retryInterval")]
5181 #[serde(default, skip_serializing_if = "Option::is_none")]
5182 #[serde(deserialize_with = "crate::types::integer::option")]
5183 pub retry_interval: Option<i32>,
5184 #[serde(rename = "customData")]
5186 #[serde(default, skip_serializing_if = "Option::is_none")]
5187 pub custom_data: Option<crate::types::CustomData>,
5188}
5189
5190impl PublishFirmwareRequest {
5191 #[must_use]
5193 pub fn new(location: impl Into<String>, checksum: impl Into<String>, request_id: i32) -> Self {
5194 Self {
5195 location: location.into(),
5196 checksum: checksum.into(),
5197 request_id,
5198 retries: None,
5199 retry_interval: None,
5200 custom_data: None,
5201 }
5202 }
5203
5204 #[must_use]
5206 pub fn with_retries(mut self, value: i32) -> Self {
5207 self.retries = Some(value);
5208 self
5209 }
5210
5211 #[must_use]
5213 pub fn with_retry_interval(mut self, value: i32) -> Self {
5214 self.retry_interval = Some(value);
5215 self
5216 }
5217
5218 #[must_use]
5220 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5221 self.custom_data = Some(value);
5222 self
5223 }
5224}
5225
5226impl Validate for PublishFirmwareRequest {
5227 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5228 path.push_key("location");
5229 validate::string(self.location.as_str(), None, Some(512), path, out);
5230 path.pop();
5231 path.push_key("checksum");
5232 validate::string(self.checksum.as_str(), None, Some(32), path, out);
5233 path.pop();
5234 path.push_key("customData");
5235 if let Some(value) = &self.custom_data {
5236 Validate::validate_at(value, path, out);
5237 }
5238 path.pop();
5239 }
5240}
5241
5242impl Sealed for PublishFirmwareRequest {}
5243impl Request for PublishFirmwareRequest {
5244 type Action = Action;
5245 const ACTION: Action = Action::PublishFirmware;
5246 const KIND: MessageKind = MessageKind::Call;
5247 const ORIGIN: Origin = Origin::Csms;
5248 type Response = PublishFirmwareResponse;
5249}
5250
5251impl Confirmed for PublishFirmwareRequest {}
5252
5253#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5255pub struct PublishFirmwareResponse {
5256 pub status: GenericStatus,
5258 #[serde(rename = "statusInfo")]
5260 #[serde(default, skip_serializing_if = "Option::is_none")]
5261 pub status_info: Option<StatusInfo>,
5262 #[serde(rename = "customData")]
5264 #[serde(default, skip_serializing_if = "Option::is_none")]
5265 pub custom_data: Option<crate::types::CustomData>,
5266}
5267
5268impl PublishFirmwareResponse {
5269 #[must_use]
5271 pub fn new(status: GenericStatus) -> Self {
5272 Self {
5273 status,
5274 status_info: None,
5275 custom_data: None,
5276 }
5277 }
5278
5279 #[must_use]
5281 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
5282 self.status_info = Some(value);
5283 self
5284 }
5285
5286 #[must_use]
5288 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5289 self.custom_data = Some(value);
5290 self
5291 }
5292}
5293
5294impl Validate for PublishFirmwareResponse {
5295 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5296 path.push_key("status");
5297 Validate::validate_at(&self.status, path, out);
5298 path.pop();
5299 path.push_key("statusInfo");
5300 if let Some(value) = &self.status_info {
5301 Validate::validate_at(value, path, out);
5302 }
5303 path.pop();
5304 path.push_key("customData");
5305 if let Some(value) = &self.custom_data {
5306 Validate::validate_at(value, path, out);
5307 }
5308 path.pop();
5309 }
5310}
5311
5312impl Sealed for PublishFirmwareResponse {}
5313impl Response for PublishFirmwareResponse {}
5314
5315#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5317pub struct PublishFirmwareStatusNotificationRequest {
5318 pub status: PublishFirmwareStatus,
5320 #[serde(default, skip_serializing_if = "Option::is_none")]
5322 pub location: Option<Vec<String>>,
5323 #[serde(rename = "requestId")]
5328 #[serde(default, skip_serializing_if = "Option::is_none")]
5329 #[serde(deserialize_with = "crate::types::integer::option")]
5330 pub request_id: Option<i32>,
5331 #[serde(rename = "customData")]
5333 #[serde(default, skip_serializing_if = "Option::is_none")]
5334 pub custom_data: Option<crate::types::CustomData>,
5335}
5336
5337impl PublishFirmwareStatusNotificationRequest {
5338 #[must_use]
5340 pub fn new(status: PublishFirmwareStatus) -> Self {
5341 Self {
5342 status,
5343 location: None,
5344 request_id: None,
5345 custom_data: None,
5346 }
5347 }
5348
5349 #[must_use]
5351 pub fn with_location(mut self, value: impl IntoIterator<Item = impl Into<String>>) -> Self {
5352 self.location = Some(value.into_iter().map(Into::into).collect());
5353 self
5354 }
5355
5356 #[must_use]
5358 pub fn with_request_id(mut self, value: i32) -> Self {
5359 self.request_id = Some(value);
5360 self
5361 }
5362
5363 #[must_use]
5365 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5366 self.custom_data = Some(value);
5367 self
5368 }
5369}
5370
5371impl Validate for PublishFirmwareStatusNotificationRequest {
5372 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5373 path.push_key("status");
5374 Validate::validate_at(&self.status, path, out);
5375 path.pop();
5376 path.push_key("location");
5377 if let Some(value) = &self.location {
5378 validate::list_len(value.len(), Some(1), None, path, out);
5379 for (index, item) in value.iter().enumerate() {
5380 path.push_index(index);
5381 validate::string(item.as_str(), None, Some(512), path, out);
5382 path.pop();
5383 }
5384 }
5385 path.pop();
5386 path.push_key("customData");
5387 if let Some(value) = &self.custom_data {
5388 Validate::validate_at(value, path, out);
5389 }
5390 path.pop();
5391 }
5392}
5393
5394impl Sealed for PublishFirmwareStatusNotificationRequest {}
5395impl Request for PublishFirmwareStatusNotificationRequest {
5396 type Action = Action;
5397 const ACTION: Action = Action::PublishFirmwareStatusNotification;
5398 const KIND: MessageKind = MessageKind::Call;
5399 const ORIGIN: Origin = Origin::ChargingStation;
5400 type Response = PublishFirmwareStatusNotificationResponse;
5401}
5402
5403impl Confirmed for PublishFirmwareStatusNotificationRequest {}
5404
5405#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5407pub struct PublishFirmwareStatusNotificationResponse {
5408 #[serde(rename = "customData")]
5410 #[serde(default, skip_serializing_if = "Option::is_none")]
5411 pub custom_data: Option<crate::types::CustomData>,
5412}
5413
5414impl PublishFirmwareStatusNotificationResponse {
5415 #[must_use]
5417 pub fn new() -> Self {
5418 Self::default()
5419 }
5420
5421 #[must_use]
5423 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5424 self.custom_data = Some(value);
5425 self
5426 }
5427}
5428
5429impl Validate for PublishFirmwareStatusNotificationResponse {
5430 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5431 path.push_key("customData");
5432 if let Some(value) = &self.custom_data {
5433 Validate::validate_at(value, path, out);
5434 }
5435 path.pop();
5436 }
5437}
5438
5439impl Sealed for PublishFirmwareStatusNotificationResponse {}
5440impl Response for PublishFirmwareStatusNotificationResponse {}
5441
5442#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5444pub struct ReportChargingProfilesRequest {
5445 #[serde(rename = "requestId")]
5447 #[serde(deserialize_with = "crate::types::integer::one")]
5448 pub request_id: i32,
5449 #[serde(rename = "chargingLimitSource")]
5451 pub charging_limit_source: ChargingLimitSource,
5452 #[serde(rename = "chargingProfile")]
5454 pub charging_profile: Vec<ChargingProfile>,
5455 #[serde(rename = "evseId")]
5457 #[serde(deserialize_with = "crate::types::integer::one")]
5458 pub evse_id: i32,
5459 #[serde(default, skip_serializing_if = "Option::is_none")]
5462 pub tbc: Option<bool>,
5463 #[serde(rename = "customData")]
5465 #[serde(default, skip_serializing_if = "Option::is_none")]
5466 pub custom_data: Option<crate::types::CustomData>,
5467}
5468
5469impl ReportChargingProfilesRequest {
5470 #[must_use]
5472 pub fn new(
5473 request_id: i32,
5474 charging_limit_source: ChargingLimitSource,
5475 charging_profile: Vec<ChargingProfile>,
5476 evse_id: i32,
5477 ) -> Self {
5478 Self {
5479 request_id,
5480 charging_limit_source,
5481 charging_profile,
5482 evse_id,
5483 tbc: None,
5484 custom_data: None,
5485 }
5486 }
5487
5488 #[must_use]
5490 pub fn with_tbc(mut self, value: bool) -> Self {
5491 self.tbc = Some(value);
5492 self
5493 }
5494
5495 #[must_use]
5497 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5498 self.custom_data = Some(value);
5499 self
5500 }
5501}
5502
5503impl Validate for ReportChargingProfilesRequest {
5504 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5505 path.push_key("chargingLimitSource");
5506 Validate::validate_at(&self.charging_limit_source, path, out);
5507 path.pop();
5508 path.push_key("chargingProfile");
5509 validate::list_len(self.charging_profile.len(), Some(1), None, path, out);
5510 for (index, item) in self.charging_profile.iter().enumerate() {
5511 path.push_index(index);
5512 Validate::validate_at(item, path, out);
5513 path.pop();
5514 }
5515 path.pop();
5516 path.push_key("customData");
5517 if let Some(value) = &self.custom_data {
5518 Validate::validate_at(value, path, out);
5519 }
5520 path.pop();
5521 }
5522}
5523
5524impl Sealed for ReportChargingProfilesRequest {}
5525impl Request for ReportChargingProfilesRequest {
5526 type Action = Action;
5527 const ACTION: Action = Action::ReportChargingProfiles;
5528 const KIND: MessageKind = MessageKind::Call;
5529 const ORIGIN: Origin = Origin::ChargingStation;
5530 type Response = ReportChargingProfilesResponse;
5531}
5532
5533impl Confirmed for ReportChargingProfilesRequest {}
5534
5535#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5537pub struct ReportChargingProfilesResponse {
5538 #[serde(rename = "customData")]
5540 #[serde(default, skip_serializing_if = "Option::is_none")]
5541 pub custom_data: Option<crate::types::CustomData>,
5542}
5543
5544impl ReportChargingProfilesResponse {
5545 #[must_use]
5547 pub fn new() -> Self {
5548 Self::default()
5549 }
5550
5551 #[must_use]
5553 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5554 self.custom_data = Some(value);
5555 self
5556 }
5557}
5558
5559impl Validate for ReportChargingProfilesResponse {
5560 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5561 path.push_key("customData");
5562 if let Some(value) = &self.custom_data {
5563 Validate::validate_at(value, path, out);
5564 }
5565 path.pop();
5566 }
5567}
5568
5569impl Sealed for ReportChargingProfilesResponse {}
5570impl Response for ReportChargingProfilesResponse {}
5571
5572#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5574pub struct RequestStartTransactionRequest {
5575 #[serde(rename = "idToken")]
5577 pub id_token: IdToken,
5578 #[serde(rename = "remoteStartId")]
5580 #[serde(deserialize_with = "crate::types::integer::one")]
5581 pub remote_start_id: i32,
5582 #[serde(rename = "evseId")]
5584 #[serde(default, skip_serializing_if = "Option::is_none")]
5585 #[serde(deserialize_with = "crate::types::integer::option")]
5586 pub evse_id: Option<i32>,
5587 #[serde(rename = "groupIdToken")]
5589 #[serde(default, skip_serializing_if = "Option::is_none")]
5590 pub group_id_token: Option<IdToken>,
5591 #[serde(rename = "chargingProfile")]
5593 #[serde(default, skip_serializing_if = "Option::is_none")]
5594 pub charging_profile: Option<ChargingProfile>,
5595 #[serde(rename = "customData")]
5597 #[serde(default, skip_serializing_if = "Option::is_none")]
5598 pub custom_data: Option<crate::types::CustomData>,
5599}
5600
5601impl RequestStartTransactionRequest {
5602 #[must_use]
5604 pub fn new(id_token: IdToken, remote_start_id: i32) -> Self {
5605 Self {
5606 id_token,
5607 remote_start_id,
5608 evse_id: None,
5609 group_id_token: None,
5610 charging_profile: None,
5611 custom_data: None,
5612 }
5613 }
5614
5615 #[must_use]
5617 pub fn with_evse_id(mut self, value: i32) -> Self {
5618 self.evse_id = Some(value);
5619 self
5620 }
5621
5622 #[must_use]
5624 pub fn with_group_id_token(mut self, value: IdToken) -> Self {
5625 self.group_id_token = Some(value);
5626 self
5627 }
5628
5629 #[must_use]
5631 pub fn with_charging_profile(mut self, value: ChargingProfile) -> Self {
5632 self.charging_profile = Some(value);
5633 self
5634 }
5635
5636 #[must_use]
5638 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5639 self.custom_data = Some(value);
5640 self
5641 }
5642}
5643
5644impl Validate for RequestStartTransactionRequest {
5645 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5646 path.push_key("idToken");
5647 Validate::validate_at(&self.id_token, path, out);
5648 path.pop();
5649 path.push_key("groupIdToken");
5650 if let Some(value) = &self.group_id_token {
5651 Validate::validate_at(value, path, out);
5652 }
5653 path.pop();
5654 path.push_key("chargingProfile");
5655 if let Some(value) = &self.charging_profile {
5656 Validate::validate_at(value, path, out);
5657 }
5658 path.pop();
5659 path.push_key("customData");
5660 if let Some(value) = &self.custom_data {
5661 Validate::validate_at(value, path, out);
5662 }
5663 path.pop();
5664 }
5665}
5666
5667impl Sealed for RequestStartTransactionRequest {}
5668impl Request for RequestStartTransactionRequest {
5669 type Action = Action;
5670 const ACTION: Action = Action::RequestStartTransaction;
5671 const KIND: MessageKind = MessageKind::Call;
5672 const ORIGIN: Origin = Origin::Csms;
5673 type Response = RequestStartTransactionResponse;
5674}
5675
5676impl Confirmed for RequestStartTransactionRequest {}
5677
5678#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5680pub struct RequestStartTransactionResponse {
5681 pub status: RequestStartStopStatus,
5683 #[serde(rename = "statusInfo")]
5685 #[serde(default, skip_serializing_if = "Option::is_none")]
5686 pub status_info: Option<StatusInfo>,
5687 #[serde(rename = "transactionId")]
5689 #[serde(default, skip_serializing_if = "Option::is_none")]
5690 pub transaction_id: Option<String>,
5691 #[serde(rename = "customData")]
5693 #[serde(default, skip_serializing_if = "Option::is_none")]
5694 pub custom_data: Option<crate::types::CustomData>,
5695}
5696
5697impl RequestStartTransactionResponse {
5698 #[must_use]
5700 pub fn new(status: RequestStartStopStatus) -> Self {
5701 Self {
5702 status,
5703 status_info: None,
5704 transaction_id: None,
5705 custom_data: None,
5706 }
5707 }
5708
5709 #[must_use]
5711 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
5712 self.status_info = Some(value);
5713 self
5714 }
5715
5716 #[must_use]
5718 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
5719 self.transaction_id = Some(value.into());
5720 self
5721 }
5722
5723 #[must_use]
5725 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5726 self.custom_data = Some(value);
5727 self
5728 }
5729}
5730
5731impl Validate for RequestStartTransactionResponse {
5732 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5733 path.push_key("status");
5734 Validate::validate_at(&self.status, path, out);
5735 path.pop();
5736 path.push_key("statusInfo");
5737 if let Some(value) = &self.status_info {
5738 Validate::validate_at(value, path, out);
5739 }
5740 path.pop();
5741 path.push_key("transactionId");
5742 if let Some(value) = &self.transaction_id {
5743 validate::string(value.as_str(), None, Some(36), path, out);
5744 }
5745 path.pop();
5746 path.push_key("customData");
5747 if let Some(value) = &self.custom_data {
5748 Validate::validate_at(value, path, out);
5749 }
5750 path.pop();
5751 }
5752}
5753
5754impl Sealed for RequestStartTransactionResponse {}
5755impl Response for RequestStartTransactionResponse {}
5756
5757#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5759pub struct RequestStopTransactionRequest {
5760 #[serde(rename = "transactionId")]
5762 pub transaction_id: String,
5763 #[serde(rename = "customData")]
5765 #[serde(default, skip_serializing_if = "Option::is_none")]
5766 pub custom_data: Option<crate::types::CustomData>,
5767}
5768
5769impl RequestStopTransactionRequest {
5770 #[must_use]
5772 pub fn new(transaction_id: impl Into<String>) -> Self {
5773 Self {
5774 transaction_id: transaction_id.into(),
5775 custom_data: None,
5776 }
5777 }
5778
5779 #[must_use]
5781 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5782 self.custom_data = Some(value);
5783 self
5784 }
5785}
5786
5787impl Validate for RequestStopTransactionRequest {
5788 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5789 path.push_key("transactionId");
5790 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
5791 path.pop();
5792 path.push_key("customData");
5793 if let Some(value) = &self.custom_data {
5794 Validate::validate_at(value, path, out);
5795 }
5796 path.pop();
5797 }
5798}
5799
5800impl Sealed for RequestStopTransactionRequest {}
5801impl Request for RequestStopTransactionRequest {
5802 type Action = Action;
5803 const ACTION: Action = Action::RequestStopTransaction;
5804 const KIND: MessageKind = MessageKind::Call;
5805 const ORIGIN: Origin = Origin::Csms;
5806 type Response = RequestStopTransactionResponse;
5807}
5808
5809impl Confirmed for RequestStopTransactionRequest {}
5810
5811#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5813pub struct RequestStopTransactionResponse {
5814 pub status: RequestStartStopStatus,
5816 #[serde(rename = "statusInfo")]
5818 #[serde(default, skip_serializing_if = "Option::is_none")]
5819 pub status_info: Option<StatusInfo>,
5820 #[serde(rename = "customData")]
5822 #[serde(default, skip_serializing_if = "Option::is_none")]
5823 pub custom_data: Option<crate::types::CustomData>,
5824}
5825
5826impl RequestStopTransactionResponse {
5827 #[must_use]
5829 pub fn new(status: RequestStartStopStatus) -> Self {
5830 Self {
5831 status,
5832 status_info: None,
5833 custom_data: None,
5834 }
5835 }
5836
5837 #[must_use]
5839 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
5840 self.status_info = Some(value);
5841 self
5842 }
5843
5844 #[must_use]
5846 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5847 self.custom_data = Some(value);
5848 self
5849 }
5850}
5851
5852impl Validate for RequestStopTransactionResponse {
5853 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5854 path.push_key("status");
5855 Validate::validate_at(&self.status, path, out);
5856 path.pop();
5857 path.push_key("statusInfo");
5858 if let Some(value) = &self.status_info {
5859 Validate::validate_at(value, path, out);
5860 }
5861 path.pop();
5862 path.push_key("customData");
5863 if let Some(value) = &self.custom_data {
5864 Validate::validate_at(value, path, out);
5865 }
5866 path.pop();
5867 }
5868}
5869
5870impl Sealed for RequestStopTransactionResponse {}
5871impl Response for RequestStopTransactionResponse {}
5872
5873#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5875pub struct ReservationStatusUpdateRequest {
5876 #[serde(rename = "reservationId")]
5878 #[serde(deserialize_with = "crate::types::integer::one")]
5879 pub reservation_id: i32,
5880 #[serde(rename = "reservationUpdateStatus")]
5882 pub reservation_update_status: ReservationUpdateStatus,
5883 #[serde(rename = "customData")]
5885 #[serde(default, skip_serializing_if = "Option::is_none")]
5886 pub custom_data: Option<crate::types::CustomData>,
5887}
5888
5889impl ReservationStatusUpdateRequest {
5890 #[must_use]
5892 pub fn new(reservation_id: i32, reservation_update_status: ReservationUpdateStatus) -> Self {
5893 Self {
5894 reservation_id,
5895 reservation_update_status,
5896 custom_data: None,
5897 }
5898 }
5899
5900 #[must_use]
5902 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5903 self.custom_data = Some(value);
5904 self
5905 }
5906}
5907
5908impl Validate for ReservationStatusUpdateRequest {
5909 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5910 path.push_key("reservationUpdateStatus");
5911 Validate::validate_at(&self.reservation_update_status, path, out);
5912 path.pop();
5913 path.push_key("customData");
5914 if let Some(value) = &self.custom_data {
5915 Validate::validate_at(value, path, out);
5916 }
5917 path.pop();
5918 }
5919}
5920
5921impl Sealed for ReservationStatusUpdateRequest {}
5922impl Request for ReservationStatusUpdateRequest {
5923 type Action = Action;
5924 const ACTION: Action = Action::ReservationStatusUpdate;
5925 const KIND: MessageKind = MessageKind::Call;
5926 const ORIGIN: Origin = Origin::ChargingStation;
5927 type Response = ReservationStatusUpdateResponse;
5928}
5929
5930impl Confirmed for ReservationStatusUpdateRequest {}
5931
5932#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5934pub struct ReservationStatusUpdateResponse {
5935 #[serde(rename = "customData")]
5937 #[serde(default, skip_serializing_if = "Option::is_none")]
5938 pub custom_data: Option<crate::types::CustomData>,
5939}
5940
5941impl ReservationStatusUpdateResponse {
5942 #[must_use]
5944 pub fn new() -> Self {
5945 Self::default()
5946 }
5947
5948 #[must_use]
5950 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5951 self.custom_data = Some(value);
5952 self
5953 }
5954}
5955
5956impl Validate for ReservationStatusUpdateResponse {
5957 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5958 path.push_key("customData");
5959 if let Some(value) = &self.custom_data {
5960 Validate::validate_at(value, path, out);
5961 }
5962 path.pop();
5963 }
5964}
5965
5966impl Sealed for ReservationStatusUpdateResponse {}
5967impl Response for ReservationStatusUpdateResponse {}
5968
5969#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5971pub struct ReserveNowRequest {
5972 #[serde(deserialize_with = "crate::types::integer::one")]
5974 pub id: i32,
5975 #[serde(rename = "expiryDateTime")]
5977 pub expiry_date_time: crate::types::DateTime,
5978 #[serde(rename = "idToken")]
5980 pub id_token: IdToken,
5981 #[serde(rename = "connectorType")]
5983 #[serde(default, skip_serializing_if = "Option::is_none")]
5984 pub connector_type: Option<Connector>,
5985 #[serde(rename = "evseId")]
5987 #[serde(default, skip_serializing_if = "Option::is_none")]
5988 #[serde(deserialize_with = "crate::types::integer::option")]
5989 pub evse_id: Option<i32>,
5990 #[serde(rename = "groupIdToken")]
5992 #[serde(default, skip_serializing_if = "Option::is_none")]
5993 pub group_id_token: Option<IdToken>,
5994 #[serde(rename = "customData")]
5996 #[serde(default, skip_serializing_if = "Option::is_none")]
5997 pub custom_data: Option<crate::types::CustomData>,
5998}
5999
6000impl ReserveNowRequest {
6001 #[must_use]
6003 pub fn new(
6004 id: i32,
6005 expiry_date_time: impl Into<crate::types::DateTime>,
6006 id_token: IdToken,
6007 ) -> Self {
6008 Self {
6009 id,
6010 expiry_date_time: expiry_date_time.into(),
6011 id_token,
6012 connector_type: None,
6013 evse_id: None,
6014 group_id_token: None,
6015 custom_data: None,
6016 }
6017 }
6018
6019 #[must_use]
6021 pub fn with_connector_type(mut self, value: Connector) -> Self {
6022 self.connector_type = Some(value);
6023 self
6024 }
6025
6026 #[must_use]
6028 pub fn with_evse_id(mut self, value: i32) -> Self {
6029 self.evse_id = Some(value);
6030 self
6031 }
6032
6033 #[must_use]
6035 pub fn with_group_id_token(mut self, value: IdToken) -> Self {
6036 self.group_id_token = Some(value);
6037 self
6038 }
6039
6040 #[must_use]
6042 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6043 self.custom_data = Some(value);
6044 self
6045 }
6046}
6047
6048impl Validate for ReserveNowRequest {
6049 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6050 path.push_key("idToken");
6051 Validate::validate_at(&self.id_token, path, out);
6052 path.pop();
6053 path.push_key("connectorType");
6054 if let Some(value) = &self.connector_type {
6055 Validate::validate_at(value, path, out);
6056 }
6057 path.pop();
6058 path.push_key("groupIdToken");
6059 if let Some(value) = &self.group_id_token {
6060 Validate::validate_at(value, path, out);
6061 }
6062 path.pop();
6063 path.push_key("customData");
6064 if let Some(value) = &self.custom_data {
6065 Validate::validate_at(value, path, out);
6066 }
6067 path.pop();
6068 }
6069}
6070
6071impl Sealed for ReserveNowRequest {}
6072impl Request for ReserveNowRequest {
6073 type Action = Action;
6074 const ACTION: Action = Action::ReserveNow;
6075 const KIND: MessageKind = MessageKind::Call;
6076 const ORIGIN: Origin = Origin::Csms;
6077 type Response = ReserveNowResponse;
6078}
6079
6080impl Confirmed for ReserveNowRequest {}
6081
6082#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6084pub struct ReserveNowResponse {
6085 pub status: ReserveNowStatus,
6087 #[serde(rename = "statusInfo")]
6089 #[serde(default, skip_serializing_if = "Option::is_none")]
6090 pub status_info: Option<StatusInfo>,
6091 #[serde(rename = "customData")]
6093 #[serde(default, skip_serializing_if = "Option::is_none")]
6094 pub custom_data: Option<crate::types::CustomData>,
6095}
6096
6097impl ReserveNowResponse {
6098 #[must_use]
6100 pub fn new(status: ReserveNowStatus) -> Self {
6101 Self {
6102 status,
6103 status_info: None,
6104 custom_data: None,
6105 }
6106 }
6107
6108 #[must_use]
6110 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6111 self.status_info = Some(value);
6112 self
6113 }
6114
6115 #[must_use]
6117 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6118 self.custom_data = Some(value);
6119 self
6120 }
6121}
6122
6123impl Validate for ReserveNowResponse {
6124 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6125 path.push_key("status");
6126 Validate::validate_at(&self.status, path, out);
6127 path.pop();
6128 path.push_key("statusInfo");
6129 if let Some(value) = &self.status_info {
6130 Validate::validate_at(value, path, out);
6131 }
6132 path.pop();
6133 path.push_key("customData");
6134 if let Some(value) = &self.custom_data {
6135 Validate::validate_at(value, path, out);
6136 }
6137 path.pop();
6138 }
6139}
6140
6141impl Sealed for ReserveNowResponse {}
6142impl Response for ReserveNowResponse {}
6143
6144#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6146pub struct ResetRequest {
6147 pub r#type: ResetEnum,
6149 #[serde(rename = "evseId")]
6151 #[serde(default, skip_serializing_if = "Option::is_none")]
6152 #[serde(deserialize_with = "crate::types::integer::option")]
6153 pub evse_id: Option<i32>,
6154 #[serde(rename = "customData")]
6156 #[serde(default, skip_serializing_if = "Option::is_none")]
6157 pub custom_data: Option<crate::types::CustomData>,
6158}
6159
6160impl ResetRequest {
6161 #[must_use]
6163 pub fn new(r#type: ResetEnum) -> Self {
6164 Self {
6165 r#type,
6166 evse_id: None,
6167 custom_data: None,
6168 }
6169 }
6170
6171 #[must_use]
6173 pub fn with_evse_id(mut self, value: i32) -> Self {
6174 self.evse_id = Some(value);
6175 self
6176 }
6177
6178 #[must_use]
6180 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6181 self.custom_data = Some(value);
6182 self
6183 }
6184}
6185
6186impl Validate for ResetRequest {
6187 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6188 path.push_key("type");
6189 Validate::validate_at(&self.r#type, path, out);
6190 path.pop();
6191 path.push_key("customData");
6192 if let Some(value) = &self.custom_data {
6193 Validate::validate_at(value, path, out);
6194 }
6195 path.pop();
6196 }
6197}
6198
6199impl Sealed for ResetRequest {}
6200impl Request for ResetRequest {
6201 type Action = Action;
6202 const ACTION: Action = Action::Reset;
6203 const KIND: MessageKind = MessageKind::Call;
6204 const ORIGIN: Origin = Origin::Csms;
6205 type Response = ResetResponse;
6206}
6207
6208impl Confirmed for ResetRequest {}
6209
6210#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6212pub struct ResetResponse {
6213 pub status: ResetStatus,
6215 #[serde(rename = "statusInfo")]
6217 #[serde(default, skip_serializing_if = "Option::is_none")]
6218 pub status_info: Option<StatusInfo>,
6219 #[serde(rename = "customData")]
6221 #[serde(default, skip_serializing_if = "Option::is_none")]
6222 pub custom_data: Option<crate::types::CustomData>,
6223}
6224
6225impl ResetResponse {
6226 #[must_use]
6228 pub fn new(status: ResetStatus) -> Self {
6229 Self {
6230 status,
6231 status_info: None,
6232 custom_data: None,
6233 }
6234 }
6235
6236 #[must_use]
6238 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6239 self.status_info = Some(value);
6240 self
6241 }
6242
6243 #[must_use]
6245 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6246 self.custom_data = Some(value);
6247 self
6248 }
6249}
6250
6251impl Validate for ResetResponse {
6252 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6253 path.push_key("status");
6254 Validate::validate_at(&self.status, path, out);
6255 path.pop();
6256 path.push_key("statusInfo");
6257 if let Some(value) = &self.status_info {
6258 Validate::validate_at(value, path, out);
6259 }
6260 path.pop();
6261 path.push_key("customData");
6262 if let Some(value) = &self.custom_data {
6263 Validate::validate_at(value, path, out);
6264 }
6265 path.pop();
6266 }
6267}
6268
6269impl Sealed for ResetResponse {}
6270impl Response for ResetResponse {}
6271
6272#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6274pub struct SecurityEventNotificationRequest {
6275 pub r#type: String,
6277 pub timestamp: crate::types::DateTime,
6279 #[serde(rename = "techInfo")]
6281 #[serde(default, skip_serializing_if = "Option::is_none")]
6282 pub tech_info: Option<String>,
6283 #[serde(rename = "customData")]
6285 #[serde(default, skip_serializing_if = "Option::is_none")]
6286 pub custom_data: Option<crate::types::CustomData>,
6287}
6288
6289impl SecurityEventNotificationRequest {
6290 #[must_use]
6292 pub fn new(r#type: impl Into<String>, timestamp: impl Into<crate::types::DateTime>) -> Self {
6293 Self {
6294 r#type: r#type.into(),
6295 timestamp: timestamp.into(),
6296 tech_info: None,
6297 custom_data: None,
6298 }
6299 }
6300
6301 #[must_use]
6303 pub fn with_tech_info(mut self, value: impl Into<String>) -> Self {
6304 self.tech_info = Some(value.into());
6305 self
6306 }
6307
6308 #[must_use]
6310 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6311 self.custom_data = Some(value);
6312 self
6313 }
6314}
6315
6316impl Validate for SecurityEventNotificationRequest {
6317 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6318 path.push_key("type");
6319 validate::string(self.r#type.as_str(), None, Some(50), path, out);
6320 path.pop();
6321 path.push_key("techInfo");
6322 if let Some(value) = &self.tech_info {
6323 validate::string(value.as_str(), None, Some(255), path, out);
6324 }
6325 path.pop();
6326 path.push_key("customData");
6327 if let Some(value) = &self.custom_data {
6328 Validate::validate_at(value, path, out);
6329 }
6330 path.pop();
6331 }
6332}
6333
6334impl Sealed for SecurityEventNotificationRequest {}
6335impl Request for SecurityEventNotificationRequest {
6336 type Action = Action;
6337 const ACTION: Action = Action::SecurityEventNotification;
6338 const KIND: MessageKind = MessageKind::Call;
6339 const ORIGIN: Origin = Origin::ChargingStation;
6340 type Response = SecurityEventNotificationResponse;
6341}
6342
6343impl Confirmed for SecurityEventNotificationRequest {}
6344
6345#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
6347pub struct SecurityEventNotificationResponse {
6348 #[serde(rename = "customData")]
6350 #[serde(default, skip_serializing_if = "Option::is_none")]
6351 pub custom_data: Option<crate::types::CustomData>,
6352}
6353
6354impl SecurityEventNotificationResponse {
6355 #[must_use]
6357 pub fn new() -> Self {
6358 Self::default()
6359 }
6360
6361 #[must_use]
6363 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6364 self.custom_data = Some(value);
6365 self
6366 }
6367}
6368
6369impl Validate for SecurityEventNotificationResponse {
6370 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6371 path.push_key("customData");
6372 if let Some(value) = &self.custom_data {
6373 Validate::validate_at(value, path, out);
6374 }
6375 path.pop();
6376 }
6377}
6378
6379impl Sealed for SecurityEventNotificationResponse {}
6380impl Response for SecurityEventNotificationResponse {}
6381
6382#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6384pub struct SendLocalListRequest {
6385 #[serde(rename = "versionNumber")]
6387 #[serde(deserialize_with = "crate::types::integer::one")]
6388 pub version_number: i32,
6389 #[serde(rename = "updateType")]
6391 pub update_type: Update,
6392 #[serde(rename = "localAuthorizationList")]
6394 #[serde(default, skip_serializing_if = "Option::is_none")]
6395 pub local_authorization_list: Option<Vec<AuthorizationData>>,
6396 #[serde(rename = "customData")]
6398 #[serde(default, skip_serializing_if = "Option::is_none")]
6399 pub custom_data: Option<crate::types::CustomData>,
6400}
6401
6402impl SendLocalListRequest {
6403 #[must_use]
6405 pub fn new(version_number: i32, update_type: Update) -> Self {
6406 Self {
6407 version_number,
6408 update_type,
6409 local_authorization_list: None,
6410 custom_data: None,
6411 }
6412 }
6413
6414 #[must_use]
6416 pub fn with_local_authorization_list(mut self, value: Vec<AuthorizationData>) -> Self {
6417 self.local_authorization_list = Some(value);
6418 self
6419 }
6420
6421 #[must_use]
6423 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6424 self.custom_data = Some(value);
6425 self
6426 }
6427}
6428
6429impl Validate for SendLocalListRequest {
6430 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6431 path.push_key("updateType");
6432 Validate::validate_at(&self.update_type, path, out);
6433 path.pop();
6434 path.push_key("localAuthorizationList");
6435 if let Some(value) = &self.local_authorization_list {
6436 validate::list_len(value.len(), Some(1), None, path, out);
6437 for (index, item) in value.iter().enumerate() {
6438 path.push_index(index);
6439 Validate::validate_at(item, path, out);
6440 path.pop();
6441 }
6442 }
6443 path.pop();
6444 path.push_key("customData");
6445 if let Some(value) = &self.custom_data {
6446 Validate::validate_at(value, path, out);
6447 }
6448 path.pop();
6449 }
6450}
6451
6452impl Sealed for SendLocalListRequest {}
6453impl Request for SendLocalListRequest {
6454 type Action = Action;
6455 const ACTION: Action = Action::SendLocalList;
6456 const KIND: MessageKind = MessageKind::Call;
6457 const ORIGIN: Origin = Origin::Csms;
6458 type Response = SendLocalListResponse;
6459}
6460
6461impl Confirmed for SendLocalListRequest {}
6462
6463#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6465pub struct SendLocalListResponse {
6466 pub status: SendLocalListStatus,
6468 #[serde(rename = "statusInfo")]
6470 #[serde(default, skip_serializing_if = "Option::is_none")]
6471 pub status_info: Option<StatusInfo>,
6472 #[serde(rename = "customData")]
6474 #[serde(default, skip_serializing_if = "Option::is_none")]
6475 pub custom_data: Option<crate::types::CustomData>,
6476}
6477
6478impl SendLocalListResponse {
6479 #[must_use]
6481 pub fn new(status: SendLocalListStatus) -> Self {
6482 Self {
6483 status,
6484 status_info: None,
6485 custom_data: None,
6486 }
6487 }
6488
6489 #[must_use]
6491 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6492 self.status_info = Some(value);
6493 self
6494 }
6495
6496 #[must_use]
6498 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6499 self.custom_data = Some(value);
6500 self
6501 }
6502}
6503
6504impl Validate for SendLocalListResponse {
6505 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6506 path.push_key("status");
6507 Validate::validate_at(&self.status, path, out);
6508 path.pop();
6509 path.push_key("statusInfo");
6510 if let Some(value) = &self.status_info {
6511 Validate::validate_at(value, path, out);
6512 }
6513 path.pop();
6514 path.push_key("customData");
6515 if let Some(value) = &self.custom_data {
6516 Validate::validate_at(value, path, out);
6517 }
6518 path.pop();
6519 }
6520}
6521
6522impl Sealed for SendLocalListResponse {}
6523impl Response for SendLocalListResponse {}
6524
6525#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6527pub struct SetChargingProfileRequest {
6528 #[serde(rename = "evseId")]
6530 #[serde(deserialize_with = "crate::types::integer::one")]
6531 pub evse_id: i32,
6532 #[serde(rename = "chargingProfile")]
6534 pub charging_profile: ChargingProfile,
6535 #[serde(rename = "customData")]
6537 #[serde(default, skip_serializing_if = "Option::is_none")]
6538 pub custom_data: Option<crate::types::CustomData>,
6539}
6540
6541impl SetChargingProfileRequest {
6542 #[must_use]
6544 pub fn new(evse_id: i32, charging_profile: ChargingProfile) -> Self {
6545 Self {
6546 evse_id,
6547 charging_profile,
6548 custom_data: None,
6549 }
6550 }
6551
6552 #[must_use]
6554 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6555 self.custom_data = Some(value);
6556 self
6557 }
6558}
6559
6560impl Validate for SetChargingProfileRequest {
6561 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6562 path.push_key("chargingProfile");
6563 Validate::validate_at(&self.charging_profile, path, out);
6564 path.pop();
6565 path.push_key("customData");
6566 if let Some(value) = &self.custom_data {
6567 Validate::validate_at(value, path, out);
6568 }
6569 path.pop();
6570 }
6571}
6572
6573impl Sealed for SetChargingProfileRequest {}
6574impl Request for SetChargingProfileRequest {
6575 type Action = Action;
6576 const ACTION: Action = Action::SetChargingProfile;
6577 const KIND: MessageKind = MessageKind::Call;
6578 const ORIGIN: Origin = Origin::Csms;
6579 type Response = SetChargingProfileResponse;
6580}
6581
6582impl Confirmed for SetChargingProfileRequest {}
6583
6584#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6586pub struct SetChargingProfileResponse {
6587 pub status: ChargingProfileStatus,
6589 #[serde(rename = "statusInfo")]
6591 #[serde(default, skip_serializing_if = "Option::is_none")]
6592 pub status_info: Option<StatusInfo>,
6593 #[serde(rename = "customData")]
6595 #[serde(default, skip_serializing_if = "Option::is_none")]
6596 pub custom_data: Option<crate::types::CustomData>,
6597}
6598
6599impl SetChargingProfileResponse {
6600 #[must_use]
6602 pub fn new(status: ChargingProfileStatus) -> Self {
6603 Self {
6604 status,
6605 status_info: None,
6606 custom_data: None,
6607 }
6608 }
6609
6610 #[must_use]
6612 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6613 self.status_info = Some(value);
6614 self
6615 }
6616
6617 #[must_use]
6619 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6620 self.custom_data = Some(value);
6621 self
6622 }
6623}
6624
6625impl Validate for SetChargingProfileResponse {
6626 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6627 path.push_key("status");
6628 Validate::validate_at(&self.status, path, out);
6629 path.pop();
6630 path.push_key("statusInfo");
6631 if let Some(value) = &self.status_info {
6632 Validate::validate_at(value, path, out);
6633 }
6634 path.pop();
6635 path.push_key("customData");
6636 if let Some(value) = &self.custom_data {
6637 Validate::validate_at(value, path, out);
6638 }
6639 path.pop();
6640 }
6641}
6642
6643impl Sealed for SetChargingProfileResponse {}
6644impl Response for SetChargingProfileResponse {}
6645
6646#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6648pub struct SetDisplayMessageRequest {
6649 pub message: MessageInfo,
6651 #[serde(rename = "customData")]
6653 #[serde(default, skip_serializing_if = "Option::is_none")]
6654 pub custom_data: Option<crate::types::CustomData>,
6655}
6656
6657impl SetDisplayMessageRequest {
6658 #[must_use]
6660 pub fn new(message: MessageInfo) -> Self {
6661 Self {
6662 message,
6663 custom_data: None,
6664 }
6665 }
6666
6667 #[must_use]
6669 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6670 self.custom_data = Some(value);
6671 self
6672 }
6673}
6674
6675impl Validate for SetDisplayMessageRequest {
6676 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6677 path.push_key("message");
6678 Validate::validate_at(&self.message, path, out);
6679 path.pop();
6680 path.push_key("customData");
6681 if let Some(value) = &self.custom_data {
6682 Validate::validate_at(value, path, out);
6683 }
6684 path.pop();
6685 }
6686}
6687
6688impl Sealed for SetDisplayMessageRequest {}
6689impl Request for SetDisplayMessageRequest {
6690 type Action = Action;
6691 const ACTION: Action = Action::SetDisplayMessage;
6692 const KIND: MessageKind = MessageKind::Call;
6693 const ORIGIN: Origin = Origin::Csms;
6694 type Response = SetDisplayMessageResponse;
6695}
6696
6697impl Confirmed for SetDisplayMessageRequest {}
6698
6699#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6701pub struct SetDisplayMessageResponse {
6702 pub status: DisplayMessageStatus,
6704 #[serde(rename = "statusInfo")]
6706 #[serde(default, skip_serializing_if = "Option::is_none")]
6707 pub status_info: Option<StatusInfo>,
6708 #[serde(rename = "customData")]
6710 #[serde(default, skip_serializing_if = "Option::is_none")]
6711 pub custom_data: Option<crate::types::CustomData>,
6712}
6713
6714impl SetDisplayMessageResponse {
6715 #[must_use]
6717 pub fn new(status: DisplayMessageStatus) -> Self {
6718 Self {
6719 status,
6720 status_info: None,
6721 custom_data: None,
6722 }
6723 }
6724
6725 #[must_use]
6727 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6728 self.status_info = Some(value);
6729 self
6730 }
6731
6732 #[must_use]
6734 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6735 self.custom_data = Some(value);
6736 self
6737 }
6738}
6739
6740impl Validate for SetDisplayMessageResponse {
6741 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6742 path.push_key("status");
6743 Validate::validate_at(&self.status, path, out);
6744 path.pop();
6745 path.push_key("statusInfo");
6746 if let Some(value) = &self.status_info {
6747 Validate::validate_at(value, path, out);
6748 }
6749 path.pop();
6750 path.push_key("customData");
6751 if let Some(value) = &self.custom_data {
6752 Validate::validate_at(value, path, out);
6753 }
6754 path.pop();
6755 }
6756}
6757
6758impl Sealed for SetDisplayMessageResponse {}
6759impl Response for SetDisplayMessageResponse {}
6760
6761#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6763pub struct SetMonitoringBaseRequest {
6764 #[serde(rename = "monitoringBase")]
6766 pub monitoring_base: MonitoringBase,
6767 #[serde(rename = "customData")]
6769 #[serde(default, skip_serializing_if = "Option::is_none")]
6770 pub custom_data: Option<crate::types::CustomData>,
6771}
6772
6773impl SetMonitoringBaseRequest {
6774 #[must_use]
6776 pub fn new(monitoring_base: MonitoringBase) -> Self {
6777 Self {
6778 monitoring_base,
6779 custom_data: None,
6780 }
6781 }
6782
6783 #[must_use]
6785 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6786 self.custom_data = Some(value);
6787 self
6788 }
6789}
6790
6791impl Validate for SetMonitoringBaseRequest {
6792 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6793 path.push_key("monitoringBase");
6794 Validate::validate_at(&self.monitoring_base, path, out);
6795 path.pop();
6796 path.push_key("customData");
6797 if let Some(value) = &self.custom_data {
6798 Validate::validate_at(value, path, out);
6799 }
6800 path.pop();
6801 }
6802}
6803
6804impl Sealed for SetMonitoringBaseRequest {}
6805impl Request for SetMonitoringBaseRequest {
6806 type Action = Action;
6807 const ACTION: Action = Action::SetMonitoringBase;
6808 const KIND: MessageKind = MessageKind::Call;
6809 const ORIGIN: Origin = Origin::Csms;
6810 type Response = SetMonitoringBaseResponse;
6811}
6812
6813impl Confirmed for SetMonitoringBaseRequest {}
6814
6815#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6817pub struct SetMonitoringBaseResponse {
6818 pub status: GenericDeviceModelStatus,
6820 #[serde(rename = "statusInfo")]
6822 #[serde(default, skip_serializing_if = "Option::is_none")]
6823 pub status_info: Option<StatusInfo>,
6824 #[serde(rename = "customData")]
6826 #[serde(default, skip_serializing_if = "Option::is_none")]
6827 pub custom_data: Option<crate::types::CustomData>,
6828}
6829
6830impl SetMonitoringBaseResponse {
6831 #[must_use]
6833 pub fn new(status: GenericDeviceModelStatus) -> Self {
6834 Self {
6835 status,
6836 status_info: None,
6837 custom_data: None,
6838 }
6839 }
6840
6841 #[must_use]
6843 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6844 self.status_info = Some(value);
6845 self
6846 }
6847
6848 #[must_use]
6850 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6851 self.custom_data = Some(value);
6852 self
6853 }
6854}
6855
6856impl Validate for SetMonitoringBaseResponse {
6857 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6858 path.push_key("status");
6859 Validate::validate_at(&self.status, path, out);
6860 path.pop();
6861 path.push_key("statusInfo");
6862 if let Some(value) = &self.status_info {
6863 Validate::validate_at(value, path, out);
6864 }
6865 path.pop();
6866 path.push_key("customData");
6867 if let Some(value) = &self.custom_data {
6868 Validate::validate_at(value, path, out);
6869 }
6870 path.pop();
6871 }
6872}
6873
6874impl Sealed for SetMonitoringBaseResponse {}
6875impl Response for SetMonitoringBaseResponse {}
6876
6877#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6879pub struct SetMonitoringLevelRequest {
6880 #[serde(deserialize_with = "crate::types::integer::one")]
6905 pub severity: i32,
6906 #[serde(rename = "customData")]
6908 #[serde(default, skip_serializing_if = "Option::is_none")]
6909 pub custom_data: Option<crate::types::CustomData>,
6910}
6911
6912impl SetMonitoringLevelRequest {
6913 #[must_use]
6915 pub fn new(severity: i32) -> Self {
6916 Self {
6917 severity,
6918 custom_data: None,
6919 }
6920 }
6921
6922 #[must_use]
6924 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6925 self.custom_data = Some(value);
6926 self
6927 }
6928}
6929
6930impl Validate for SetMonitoringLevelRequest {
6931 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6932 path.push_key("customData");
6933 if let Some(value) = &self.custom_data {
6934 Validate::validate_at(value, path, out);
6935 }
6936 path.pop();
6937 }
6938}
6939
6940impl Sealed for SetMonitoringLevelRequest {}
6941impl Request for SetMonitoringLevelRequest {
6942 type Action = Action;
6943 const ACTION: Action = Action::SetMonitoringLevel;
6944 const KIND: MessageKind = MessageKind::Call;
6945 const ORIGIN: Origin = Origin::Csms;
6946 type Response = SetMonitoringLevelResponse;
6947}
6948
6949impl Confirmed for SetMonitoringLevelRequest {}
6950
6951#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6953pub struct SetMonitoringLevelResponse {
6954 pub status: GenericStatus,
6956 #[serde(rename = "statusInfo")]
6958 #[serde(default, skip_serializing_if = "Option::is_none")]
6959 pub status_info: Option<StatusInfo>,
6960 #[serde(rename = "customData")]
6962 #[serde(default, skip_serializing_if = "Option::is_none")]
6963 pub custom_data: Option<crate::types::CustomData>,
6964}
6965
6966impl SetMonitoringLevelResponse {
6967 #[must_use]
6969 pub fn new(status: GenericStatus) -> Self {
6970 Self {
6971 status,
6972 status_info: None,
6973 custom_data: None,
6974 }
6975 }
6976
6977 #[must_use]
6979 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6980 self.status_info = Some(value);
6981 self
6982 }
6983
6984 #[must_use]
6986 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6987 self.custom_data = Some(value);
6988 self
6989 }
6990}
6991
6992impl Validate for SetMonitoringLevelResponse {
6993 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6994 path.push_key("status");
6995 Validate::validate_at(&self.status, path, out);
6996 path.pop();
6997 path.push_key("statusInfo");
6998 if let Some(value) = &self.status_info {
6999 Validate::validate_at(value, path, out);
7000 }
7001 path.pop();
7002 path.push_key("customData");
7003 if let Some(value) = &self.custom_data {
7004 Validate::validate_at(value, path, out);
7005 }
7006 path.pop();
7007 }
7008}
7009
7010impl Sealed for SetMonitoringLevelResponse {}
7011impl Response for SetMonitoringLevelResponse {}
7012
7013#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7015pub struct SetNetworkProfileRequest {
7016 #[serde(rename = "configurationSlot")]
7018 #[serde(deserialize_with = "crate::types::integer::one")]
7019 pub configuration_slot: i32,
7020 #[serde(rename = "connectionData")]
7022 pub connection_data: NetworkConnectionProfile,
7023 #[serde(rename = "customData")]
7025 #[serde(default, skip_serializing_if = "Option::is_none")]
7026 pub custom_data: Option<crate::types::CustomData>,
7027}
7028
7029impl SetNetworkProfileRequest {
7030 #[must_use]
7032 pub fn new(configuration_slot: i32, connection_data: NetworkConnectionProfile) -> Self {
7033 Self {
7034 configuration_slot,
7035 connection_data,
7036 custom_data: None,
7037 }
7038 }
7039
7040 #[must_use]
7042 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7043 self.custom_data = Some(value);
7044 self
7045 }
7046}
7047
7048impl Validate for SetNetworkProfileRequest {
7049 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7050 path.push_key("connectionData");
7051 Validate::validate_at(&self.connection_data, path, out);
7052 path.pop();
7053 path.push_key("customData");
7054 if let Some(value) = &self.custom_data {
7055 Validate::validate_at(value, path, out);
7056 }
7057 path.pop();
7058 }
7059}
7060
7061impl Sealed for SetNetworkProfileRequest {}
7062impl Request for SetNetworkProfileRequest {
7063 type Action = Action;
7064 const ACTION: Action = Action::SetNetworkProfile;
7065 const KIND: MessageKind = MessageKind::Call;
7066 const ORIGIN: Origin = Origin::Csms;
7067 type Response = SetNetworkProfileResponse;
7068}
7069
7070impl Confirmed for SetNetworkProfileRequest {}
7071
7072#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7074pub struct SetNetworkProfileResponse {
7075 pub status: SetNetworkProfileStatus,
7077 #[serde(rename = "statusInfo")]
7079 #[serde(default, skip_serializing_if = "Option::is_none")]
7080 pub status_info: Option<StatusInfo>,
7081 #[serde(rename = "customData")]
7083 #[serde(default, skip_serializing_if = "Option::is_none")]
7084 pub custom_data: Option<crate::types::CustomData>,
7085}
7086
7087impl SetNetworkProfileResponse {
7088 #[must_use]
7090 pub fn new(status: SetNetworkProfileStatus) -> Self {
7091 Self {
7092 status,
7093 status_info: None,
7094 custom_data: None,
7095 }
7096 }
7097
7098 #[must_use]
7100 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
7101 self.status_info = Some(value);
7102 self
7103 }
7104
7105 #[must_use]
7107 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7108 self.custom_data = Some(value);
7109 self
7110 }
7111}
7112
7113impl Validate for SetNetworkProfileResponse {
7114 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7115 path.push_key("status");
7116 Validate::validate_at(&self.status, path, out);
7117 path.pop();
7118 path.push_key("statusInfo");
7119 if let Some(value) = &self.status_info {
7120 Validate::validate_at(value, path, out);
7121 }
7122 path.pop();
7123 path.push_key("customData");
7124 if let Some(value) = &self.custom_data {
7125 Validate::validate_at(value, path, out);
7126 }
7127 path.pop();
7128 }
7129}
7130
7131impl Sealed for SetNetworkProfileResponse {}
7132impl Response for SetNetworkProfileResponse {}
7133
7134#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7136pub struct SetVariableMonitoringRequest {
7137 #[serde(rename = "setMonitoringData")]
7139 pub set_monitoring_data: Vec<SetMonitoringData>,
7140 #[serde(rename = "customData")]
7142 #[serde(default, skip_serializing_if = "Option::is_none")]
7143 pub custom_data: Option<crate::types::CustomData>,
7144}
7145
7146impl SetVariableMonitoringRequest {
7147 #[must_use]
7149 pub fn new(set_monitoring_data: Vec<SetMonitoringData>) -> Self {
7150 Self {
7151 set_monitoring_data,
7152 custom_data: None,
7153 }
7154 }
7155
7156 #[must_use]
7158 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7159 self.custom_data = Some(value);
7160 self
7161 }
7162}
7163
7164impl Validate for SetVariableMonitoringRequest {
7165 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7166 path.push_key("setMonitoringData");
7167 validate::list_len(self.set_monitoring_data.len(), Some(1), None, path, out);
7168 for (index, item) in self.set_monitoring_data.iter().enumerate() {
7169 path.push_index(index);
7170 Validate::validate_at(item, path, out);
7171 path.pop();
7172 }
7173 path.pop();
7174 path.push_key("customData");
7175 if let Some(value) = &self.custom_data {
7176 Validate::validate_at(value, path, out);
7177 }
7178 path.pop();
7179 }
7180}
7181
7182impl Sealed for SetVariableMonitoringRequest {}
7183impl Request for SetVariableMonitoringRequest {
7184 type Action = Action;
7185 const ACTION: Action = Action::SetVariableMonitoring;
7186 const KIND: MessageKind = MessageKind::Call;
7187 const ORIGIN: Origin = Origin::Csms;
7188 type Response = SetVariableMonitoringResponse;
7189}
7190
7191impl Confirmed for SetVariableMonitoringRequest {}
7192
7193#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7195pub struct SetVariableMonitoringResponse {
7196 #[serde(rename = "setMonitoringResult")]
7198 pub set_monitoring_result: Vec<SetMonitoringResult>,
7199 #[serde(rename = "customData")]
7201 #[serde(default, skip_serializing_if = "Option::is_none")]
7202 pub custom_data: Option<crate::types::CustomData>,
7203}
7204
7205impl SetVariableMonitoringResponse {
7206 #[must_use]
7208 pub fn new(set_monitoring_result: Vec<SetMonitoringResult>) -> Self {
7209 Self {
7210 set_monitoring_result,
7211 custom_data: None,
7212 }
7213 }
7214
7215 #[must_use]
7217 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7218 self.custom_data = Some(value);
7219 self
7220 }
7221}
7222
7223impl Validate for SetVariableMonitoringResponse {
7224 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7225 path.push_key("setMonitoringResult");
7226 validate::list_len(self.set_monitoring_result.len(), Some(1), None, path, out);
7227 for (index, item) in self.set_monitoring_result.iter().enumerate() {
7228 path.push_index(index);
7229 Validate::validate_at(item, path, out);
7230 path.pop();
7231 }
7232 path.pop();
7233 path.push_key("customData");
7234 if let Some(value) = &self.custom_data {
7235 Validate::validate_at(value, path, out);
7236 }
7237 path.pop();
7238 }
7239}
7240
7241impl Sealed for SetVariableMonitoringResponse {}
7242impl Response for SetVariableMonitoringResponse {}
7243
7244#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7246pub struct SetVariablesRequest {
7247 #[serde(rename = "setVariableData")]
7249 pub set_variable_data: Vec<SetVariableData>,
7250 #[serde(rename = "customData")]
7252 #[serde(default, skip_serializing_if = "Option::is_none")]
7253 pub custom_data: Option<crate::types::CustomData>,
7254}
7255
7256impl SetVariablesRequest {
7257 #[must_use]
7259 pub fn new(set_variable_data: Vec<SetVariableData>) -> Self {
7260 Self {
7261 set_variable_data,
7262 custom_data: None,
7263 }
7264 }
7265
7266 #[must_use]
7268 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7269 self.custom_data = Some(value);
7270 self
7271 }
7272}
7273
7274impl Validate for SetVariablesRequest {
7275 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7276 path.push_key("setVariableData");
7277 validate::list_len(self.set_variable_data.len(), Some(1), None, path, out);
7278 for (index, item) in self.set_variable_data.iter().enumerate() {
7279 path.push_index(index);
7280 Validate::validate_at(item, path, out);
7281 path.pop();
7282 }
7283 path.pop();
7284 path.push_key("customData");
7285 if let Some(value) = &self.custom_data {
7286 Validate::validate_at(value, path, out);
7287 }
7288 path.pop();
7289 }
7290}
7291
7292impl Sealed for SetVariablesRequest {}
7293impl Request for SetVariablesRequest {
7294 type Action = Action;
7295 const ACTION: Action = Action::SetVariables;
7296 const KIND: MessageKind = MessageKind::Call;
7297 const ORIGIN: Origin = Origin::Csms;
7298 type Response = SetVariablesResponse;
7299}
7300
7301impl Confirmed for SetVariablesRequest {}
7302
7303#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7305pub struct SetVariablesResponse {
7306 #[serde(rename = "setVariableResult")]
7308 pub set_variable_result: Vec<SetVariableResult>,
7309 #[serde(rename = "customData")]
7311 #[serde(default, skip_serializing_if = "Option::is_none")]
7312 pub custom_data: Option<crate::types::CustomData>,
7313}
7314
7315impl SetVariablesResponse {
7316 #[must_use]
7318 pub fn new(set_variable_result: Vec<SetVariableResult>) -> Self {
7319 Self {
7320 set_variable_result,
7321 custom_data: None,
7322 }
7323 }
7324
7325 #[must_use]
7327 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7328 self.custom_data = Some(value);
7329 self
7330 }
7331}
7332
7333impl Validate for SetVariablesResponse {
7334 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7335 path.push_key("setVariableResult");
7336 validate::list_len(self.set_variable_result.len(), Some(1), None, path, out);
7337 for (index, item) in self.set_variable_result.iter().enumerate() {
7338 path.push_index(index);
7339 Validate::validate_at(item, path, out);
7340 path.pop();
7341 }
7342 path.pop();
7343 path.push_key("customData");
7344 if let Some(value) = &self.custom_data {
7345 Validate::validate_at(value, path, out);
7346 }
7347 path.pop();
7348 }
7349}
7350
7351impl Sealed for SetVariablesResponse {}
7352impl Response for SetVariablesResponse {}
7353
7354#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7356pub struct SignCertificateRequest {
7357 pub csr: String,
7359 #[serde(rename = "certificateType")]
7361 #[serde(default, skip_serializing_if = "Option::is_none")]
7362 pub certificate_type: Option<CertificateSigningUse>,
7363 #[serde(rename = "customData")]
7365 #[serde(default, skip_serializing_if = "Option::is_none")]
7366 pub custom_data: Option<crate::types::CustomData>,
7367}
7368
7369impl SignCertificateRequest {
7370 #[must_use]
7372 pub fn new(csr: impl Into<String>) -> Self {
7373 Self {
7374 csr: csr.into(),
7375 certificate_type: None,
7376 custom_data: None,
7377 }
7378 }
7379
7380 #[must_use]
7382 pub fn with_certificate_type(mut self, value: CertificateSigningUse) -> Self {
7383 self.certificate_type = Some(value);
7384 self
7385 }
7386
7387 #[must_use]
7389 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7390 self.custom_data = Some(value);
7391 self
7392 }
7393}
7394
7395impl Validate for SignCertificateRequest {
7396 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7397 path.push_key("csr");
7398 validate::string(self.csr.as_str(), None, Some(5500), path, out);
7399 path.pop();
7400 path.push_key("certificateType");
7401 if let Some(value) = &self.certificate_type {
7402 Validate::validate_at(value, path, out);
7403 }
7404 path.pop();
7405 path.push_key("customData");
7406 if let Some(value) = &self.custom_data {
7407 Validate::validate_at(value, path, out);
7408 }
7409 path.pop();
7410 }
7411}
7412
7413impl Sealed for SignCertificateRequest {}
7414impl Request for SignCertificateRequest {
7415 type Action = Action;
7416 const ACTION: Action = Action::SignCertificate;
7417 const KIND: MessageKind = MessageKind::Call;
7418 const ORIGIN: Origin = Origin::ChargingStation;
7419 type Response = SignCertificateResponse;
7420}
7421
7422impl Confirmed for SignCertificateRequest {}
7423
7424#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7426pub struct SignCertificateResponse {
7427 pub status: GenericStatus,
7429 #[serde(rename = "statusInfo")]
7431 #[serde(default, skip_serializing_if = "Option::is_none")]
7432 pub status_info: Option<StatusInfo>,
7433 #[serde(rename = "customData")]
7435 #[serde(default, skip_serializing_if = "Option::is_none")]
7436 pub custom_data: Option<crate::types::CustomData>,
7437}
7438
7439impl SignCertificateResponse {
7440 #[must_use]
7442 pub fn new(status: GenericStatus) -> Self {
7443 Self {
7444 status,
7445 status_info: None,
7446 custom_data: None,
7447 }
7448 }
7449
7450 #[must_use]
7452 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
7453 self.status_info = Some(value);
7454 self
7455 }
7456
7457 #[must_use]
7459 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7460 self.custom_data = Some(value);
7461 self
7462 }
7463}
7464
7465impl Validate for SignCertificateResponse {
7466 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7467 path.push_key("status");
7468 Validate::validate_at(&self.status, path, out);
7469 path.pop();
7470 path.push_key("statusInfo");
7471 if let Some(value) = &self.status_info {
7472 Validate::validate_at(value, path, out);
7473 }
7474 path.pop();
7475 path.push_key("customData");
7476 if let Some(value) = &self.custom_data {
7477 Validate::validate_at(value, path, out);
7478 }
7479 path.pop();
7480 }
7481}
7482
7483impl Sealed for SignCertificateResponse {}
7484impl Response for SignCertificateResponse {}
7485
7486#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7488pub struct StatusNotificationRequest {
7489 pub timestamp: crate::types::DateTime,
7491 #[serde(rename = "connectorStatus")]
7493 pub connector_status: ConnectorStatus,
7494 #[serde(rename = "evseId")]
7496 #[serde(deserialize_with = "crate::types::integer::one")]
7497 pub evse_id: i32,
7498 #[serde(rename = "connectorId")]
7500 #[serde(deserialize_with = "crate::types::integer::one")]
7501 pub connector_id: i32,
7502 #[serde(rename = "customData")]
7504 #[serde(default, skip_serializing_if = "Option::is_none")]
7505 pub custom_data: Option<crate::types::CustomData>,
7506}
7507
7508impl StatusNotificationRequest {
7509 #[must_use]
7511 pub fn new(
7512 timestamp: impl Into<crate::types::DateTime>,
7513 connector_status: ConnectorStatus,
7514 evse_id: i32,
7515 connector_id: i32,
7516 ) -> Self {
7517 Self {
7518 timestamp: timestamp.into(),
7519 connector_status,
7520 evse_id,
7521 connector_id,
7522 custom_data: None,
7523 }
7524 }
7525
7526 #[must_use]
7528 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7529 self.custom_data = Some(value);
7530 self
7531 }
7532}
7533
7534impl Validate for StatusNotificationRequest {
7535 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7536 path.push_key("connectorStatus");
7537 Validate::validate_at(&self.connector_status, path, out);
7538 path.pop();
7539 path.push_key("customData");
7540 if let Some(value) = &self.custom_data {
7541 Validate::validate_at(value, path, out);
7542 }
7543 path.pop();
7544 }
7545}
7546
7547impl Sealed for StatusNotificationRequest {}
7548impl Request for StatusNotificationRequest {
7549 type Action = Action;
7550 const ACTION: Action = Action::StatusNotification;
7551 const KIND: MessageKind = MessageKind::Call;
7552 const ORIGIN: Origin = Origin::ChargingStation;
7553 type Response = StatusNotificationResponse;
7554}
7555
7556impl Confirmed for StatusNotificationRequest {}
7557
7558#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7560pub struct StatusNotificationResponse {
7561 #[serde(rename = "customData")]
7563 #[serde(default, skip_serializing_if = "Option::is_none")]
7564 pub custom_data: Option<crate::types::CustomData>,
7565}
7566
7567impl StatusNotificationResponse {
7568 #[must_use]
7570 pub fn new() -> Self {
7571 Self::default()
7572 }
7573
7574 #[must_use]
7576 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7577 self.custom_data = Some(value);
7578 self
7579 }
7580}
7581
7582impl Validate for StatusNotificationResponse {
7583 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7584 path.push_key("customData");
7585 if let Some(value) = &self.custom_data {
7586 Validate::validate_at(value, path, out);
7587 }
7588 path.pop();
7589 }
7590}
7591
7592impl Sealed for StatusNotificationResponse {}
7593impl Response for StatusNotificationResponse {}
7594
7595#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7597pub struct TransactionEventRequest {
7598 #[serde(rename = "eventType")]
7600 pub event_type: TransactionEventEnum,
7601 pub timestamp: crate::types::DateTime,
7603 #[serde(rename = "triggerReason")]
7605 pub trigger_reason: TriggerReason,
7606 #[serde(rename = "seqNo")]
7608 #[serde(deserialize_with = "crate::types::integer::one")]
7609 pub seq_no: i32,
7610 #[serde(rename = "transactionInfo")]
7612 pub transaction_info: Transaction,
7613 #[serde(rename = "meterValue")]
7615 #[serde(default, skip_serializing_if = "Option::is_none")]
7616 pub meter_value: Option<Vec<MeterValue>>,
7617 #[serde(default, skip_serializing_if = "Option::is_none")]
7620 pub offline: Option<bool>,
7621 #[serde(rename = "numberOfPhasesUsed")]
7623 #[serde(default, skip_serializing_if = "Option::is_none")]
7624 #[serde(deserialize_with = "crate::types::integer::option")]
7625 pub number_of_phases_used: Option<i32>,
7626 #[serde(rename = "cableMaxCurrent")]
7628 #[serde(default, skip_serializing_if = "Option::is_none")]
7629 #[serde(deserialize_with = "crate::types::integer::option")]
7630 pub cable_max_current: Option<i32>,
7631 #[serde(rename = "reservationId")]
7633 #[serde(default, skip_serializing_if = "Option::is_none")]
7634 #[serde(deserialize_with = "crate::types::integer::option")]
7635 pub reservation_id: Option<i32>,
7636 #[serde(default, skip_serializing_if = "Option::is_none")]
7638 pub evse: Option<EVSE>,
7639 #[serde(rename = "idToken")]
7641 #[serde(default, skip_serializing_if = "Option::is_none")]
7642 pub id_token: Option<IdToken>,
7643 #[serde(rename = "customData")]
7645 #[serde(default, skip_serializing_if = "Option::is_none")]
7646 pub custom_data: Option<crate::types::CustomData>,
7647}
7648
7649impl TransactionEventRequest {
7650 #[must_use]
7652 pub fn new(
7653 event_type: TransactionEventEnum,
7654 timestamp: impl Into<crate::types::DateTime>,
7655 trigger_reason: TriggerReason,
7656 seq_no: i32,
7657 transaction_info: Transaction,
7658 ) -> Self {
7659 Self {
7660 event_type,
7661 timestamp: timestamp.into(),
7662 trigger_reason,
7663 seq_no,
7664 transaction_info,
7665 meter_value: None,
7666 offline: None,
7667 number_of_phases_used: None,
7668 cable_max_current: None,
7669 reservation_id: None,
7670 evse: None,
7671 id_token: None,
7672 custom_data: None,
7673 }
7674 }
7675
7676 #[must_use]
7678 pub fn with_meter_value(mut self, value: Vec<MeterValue>) -> Self {
7679 self.meter_value = Some(value);
7680 self
7681 }
7682
7683 #[must_use]
7685 pub fn with_offline(mut self, value: bool) -> Self {
7686 self.offline = Some(value);
7687 self
7688 }
7689
7690 #[must_use]
7692 pub fn with_number_of_phases_used(mut self, value: i32) -> Self {
7693 self.number_of_phases_used = Some(value);
7694 self
7695 }
7696
7697 #[must_use]
7699 pub fn with_cable_max_current(mut self, value: i32) -> Self {
7700 self.cable_max_current = Some(value);
7701 self
7702 }
7703
7704 #[must_use]
7706 pub fn with_reservation_id(mut self, value: i32) -> Self {
7707 self.reservation_id = Some(value);
7708 self
7709 }
7710
7711 #[must_use]
7713 pub fn with_evse(mut self, value: EVSE) -> Self {
7714 self.evse = Some(value);
7715 self
7716 }
7717
7718 #[must_use]
7720 pub fn with_id_token(mut self, value: IdToken) -> Self {
7721 self.id_token = Some(value);
7722 self
7723 }
7724
7725 #[must_use]
7727 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7728 self.custom_data = Some(value);
7729 self
7730 }
7731}
7732
7733impl Validate for TransactionEventRequest {
7734 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7735 path.push_key("eventType");
7736 Validate::validate_at(&self.event_type, path, out);
7737 path.pop();
7738 path.push_key("triggerReason");
7739 Validate::validate_at(&self.trigger_reason, path, out);
7740 path.pop();
7741 path.push_key("transactionInfo");
7742 Validate::validate_at(&self.transaction_info, path, out);
7743 path.pop();
7744 path.push_key("meterValue");
7745 if let Some(value) = &self.meter_value {
7746 validate::list_len(value.len(), Some(1), None, path, out);
7747 for (index, item) in value.iter().enumerate() {
7748 path.push_index(index);
7749 Validate::validate_at(item, path, out);
7750 path.pop();
7751 }
7752 }
7753 path.pop();
7754 path.push_key("evse");
7755 if let Some(value) = &self.evse {
7756 Validate::validate_at(value, path, out);
7757 }
7758 path.pop();
7759 path.push_key("idToken");
7760 if let Some(value) = &self.id_token {
7761 Validate::validate_at(value, path, out);
7762 }
7763 path.pop();
7764 path.push_key("customData");
7765 if let Some(value) = &self.custom_data {
7766 Validate::validate_at(value, path, out);
7767 }
7768 path.pop();
7769 }
7770}
7771
7772impl Sealed for TransactionEventRequest {}
7773impl Request for TransactionEventRequest {
7774 type Action = Action;
7775 const ACTION: Action = Action::TransactionEvent;
7776 const KIND: MessageKind = MessageKind::Call;
7777 const ORIGIN: Origin = Origin::ChargingStation;
7778 type Response = TransactionEventResponse;
7779}
7780
7781impl Confirmed for TransactionEventRequest {}
7782
7783#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7785pub struct TransactionEventResponse {
7786 #[serde(rename = "totalCost")]
7788 #[serde(default, skip_serializing_if = "Option::is_none")]
7789 pub total_cost: Option<crate::types::Decimal>,
7790 #[serde(rename = "chargingPriority")]
7792 #[serde(default, skip_serializing_if = "Option::is_none")]
7793 #[serde(deserialize_with = "crate::types::integer::option")]
7794 pub charging_priority: Option<i32>,
7795 #[serde(rename = "idTokenInfo")]
7797 #[serde(default, skip_serializing_if = "Option::is_none")]
7798 pub id_token_info: Option<IdTokenInfo>,
7799 #[serde(rename = "updatedPersonalMessage")]
7801 #[serde(default, skip_serializing_if = "Option::is_none")]
7802 pub updated_personal_message: Option<MessageContent>,
7803 #[serde(rename = "customData")]
7805 #[serde(default, skip_serializing_if = "Option::is_none")]
7806 pub custom_data: Option<crate::types::CustomData>,
7807}
7808
7809impl TransactionEventResponse {
7810 #[must_use]
7812 pub fn new() -> Self {
7813 Self::default()
7814 }
7815
7816 #[must_use]
7818 pub fn with_total_cost(mut self, value: impl Into<crate::types::Decimal>) -> Self {
7819 self.total_cost = Some(value.into());
7820 self
7821 }
7822
7823 #[must_use]
7825 pub fn with_charging_priority(mut self, value: i32) -> Self {
7826 self.charging_priority = Some(value);
7827 self
7828 }
7829
7830 #[must_use]
7832 pub fn with_id_token_info(mut self, value: IdTokenInfo) -> Self {
7833 self.id_token_info = Some(value);
7834 self
7835 }
7836
7837 #[must_use]
7839 pub fn with_updated_personal_message(mut self, value: MessageContent) -> Self {
7840 self.updated_personal_message = Some(value);
7841 self
7842 }
7843
7844 #[must_use]
7846 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7847 self.custom_data = Some(value);
7848 self
7849 }
7850}
7851
7852impl Validate for TransactionEventResponse {
7853 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7854 path.push_key("idTokenInfo");
7855 if let Some(value) = &self.id_token_info {
7856 Validate::validate_at(value, path, out);
7857 }
7858 path.pop();
7859 path.push_key("updatedPersonalMessage");
7860 if let Some(value) = &self.updated_personal_message {
7861 Validate::validate_at(value, path, out);
7862 }
7863 path.pop();
7864 path.push_key("customData");
7865 if let Some(value) = &self.custom_data {
7866 Validate::validate_at(value, path, out);
7867 }
7868 path.pop();
7869 }
7870}
7871
7872impl Sealed for TransactionEventResponse {}
7873impl Response for TransactionEventResponse {}
7874
7875#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7877pub struct TriggerMessageRequest {
7878 #[serde(rename = "requestedMessage")]
7880 pub requested_message: MessageTrigger,
7881 #[serde(default, skip_serializing_if = "Option::is_none")]
7883 pub evse: Option<EVSE>,
7884 #[serde(rename = "customData")]
7886 #[serde(default, skip_serializing_if = "Option::is_none")]
7887 pub custom_data: Option<crate::types::CustomData>,
7888}
7889
7890impl TriggerMessageRequest {
7891 #[must_use]
7893 pub fn new(requested_message: MessageTrigger) -> Self {
7894 Self {
7895 requested_message,
7896 evse: None,
7897 custom_data: None,
7898 }
7899 }
7900
7901 #[must_use]
7903 pub fn with_evse(mut self, value: EVSE) -> Self {
7904 self.evse = Some(value);
7905 self
7906 }
7907
7908 #[must_use]
7910 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7911 self.custom_data = Some(value);
7912 self
7913 }
7914}
7915
7916impl Validate for TriggerMessageRequest {
7917 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7918 path.push_key("requestedMessage");
7919 Validate::validate_at(&self.requested_message, path, out);
7920 path.pop();
7921 path.push_key("evse");
7922 if let Some(value) = &self.evse {
7923 Validate::validate_at(value, path, out);
7924 }
7925 path.pop();
7926 path.push_key("customData");
7927 if let Some(value) = &self.custom_data {
7928 Validate::validate_at(value, path, out);
7929 }
7930 path.pop();
7931 }
7932}
7933
7934impl Sealed for TriggerMessageRequest {}
7935impl Request for TriggerMessageRequest {
7936 type Action = Action;
7937 const ACTION: Action = Action::TriggerMessage;
7938 const KIND: MessageKind = MessageKind::Call;
7939 const ORIGIN: Origin = Origin::Csms;
7940 type Response = TriggerMessageResponse;
7941}
7942
7943impl Confirmed for TriggerMessageRequest {}
7944
7945#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7947pub struct TriggerMessageResponse {
7948 pub status: TriggerMessageStatus,
7950 #[serde(rename = "statusInfo")]
7952 #[serde(default, skip_serializing_if = "Option::is_none")]
7953 pub status_info: Option<StatusInfo>,
7954 #[serde(rename = "customData")]
7956 #[serde(default, skip_serializing_if = "Option::is_none")]
7957 pub custom_data: Option<crate::types::CustomData>,
7958}
7959
7960impl TriggerMessageResponse {
7961 #[must_use]
7963 pub fn new(status: TriggerMessageStatus) -> Self {
7964 Self {
7965 status,
7966 status_info: None,
7967 custom_data: None,
7968 }
7969 }
7970
7971 #[must_use]
7973 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
7974 self.status_info = Some(value);
7975 self
7976 }
7977
7978 #[must_use]
7980 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7981 self.custom_data = Some(value);
7982 self
7983 }
7984}
7985
7986impl Validate for TriggerMessageResponse {
7987 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7988 path.push_key("status");
7989 Validate::validate_at(&self.status, path, out);
7990 path.pop();
7991 path.push_key("statusInfo");
7992 if let Some(value) = &self.status_info {
7993 Validate::validate_at(value, path, out);
7994 }
7995 path.pop();
7996 path.push_key("customData");
7997 if let Some(value) = &self.custom_data {
7998 Validate::validate_at(value, path, out);
7999 }
8000 path.pop();
8001 }
8002}
8003
8004impl Sealed for TriggerMessageResponse {}
8005impl Response for TriggerMessageResponse {}
8006
8007#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8009pub struct UnlockConnectorRequest {
8010 #[serde(rename = "evseId")]
8012 #[serde(deserialize_with = "crate::types::integer::one")]
8013 pub evse_id: i32,
8014 #[serde(rename = "connectorId")]
8016 #[serde(deserialize_with = "crate::types::integer::one")]
8017 pub connector_id: i32,
8018 #[serde(rename = "customData")]
8020 #[serde(default, skip_serializing_if = "Option::is_none")]
8021 pub custom_data: Option<crate::types::CustomData>,
8022}
8023
8024impl UnlockConnectorRequest {
8025 #[must_use]
8027 pub fn new(evse_id: i32, connector_id: i32) -> Self {
8028 Self {
8029 evse_id,
8030 connector_id,
8031 custom_data: None,
8032 }
8033 }
8034
8035 #[must_use]
8037 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8038 self.custom_data = Some(value);
8039 self
8040 }
8041}
8042
8043impl Validate for UnlockConnectorRequest {
8044 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8045 path.push_key("customData");
8046 if let Some(value) = &self.custom_data {
8047 Validate::validate_at(value, path, out);
8048 }
8049 path.pop();
8050 }
8051}
8052
8053impl Sealed for UnlockConnectorRequest {}
8054impl Request for UnlockConnectorRequest {
8055 type Action = Action;
8056 const ACTION: Action = Action::UnlockConnector;
8057 const KIND: MessageKind = MessageKind::Call;
8058 const ORIGIN: Origin = Origin::Csms;
8059 type Response = UnlockConnectorResponse;
8060}
8061
8062impl Confirmed for UnlockConnectorRequest {}
8063
8064#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8066pub struct UnlockConnectorResponse {
8067 pub status: UnlockStatus,
8069 #[serde(rename = "statusInfo")]
8071 #[serde(default, skip_serializing_if = "Option::is_none")]
8072 pub status_info: Option<StatusInfo>,
8073 #[serde(rename = "customData")]
8075 #[serde(default, skip_serializing_if = "Option::is_none")]
8076 pub custom_data: Option<crate::types::CustomData>,
8077}
8078
8079impl UnlockConnectorResponse {
8080 #[must_use]
8082 pub fn new(status: UnlockStatus) -> Self {
8083 Self {
8084 status,
8085 status_info: None,
8086 custom_data: None,
8087 }
8088 }
8089
8090 #[must_use]
8092 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
8093 self.status_info = Some(value);
8094 self
8095 }
8096
8097 #[must_use]
8099 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8100 self.custom_data = Some(value);
8101 self
8102 }
8103}
8104
8105impl Validate for UnlockConnectorResponse {
8106 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8107 path.push_key("status");
8108 Validate::validate_at(&self.status, path, out);
8109 path.pop();
8110 path.push_key("statusInfo");
8111 if let Some(value) = &self.status_info {
8112 Validate::validate_at(value, path, out);
8113 }
8114 path.pop();
8115 path.push_key("customData");
8116 if let Some(value) = &self.custom_data {
8117 Validate::validate_at(value, path, out);
8118 }
8119 path.pop();
8120 }
8121}
8122
8123impl Sealed for UnlockConnectorResponse {}
8124impl Response for UnlockConnectorResponse {}
8125
8126#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8128pub struct UnpublishFirmwareRequest {
8129 pub checksum: String,
8131 #[serde(rename = "customData")]
8133 #[serde(default, skip_serializing_if = "Option::is_none")]
8134 pub custom_data: Option<crate::types::CustomData>,
8135}
8136
8137impl UnpublishFirmwareRequest {
8138 #[must_use]
8140 pub fn new(checksum: impl Into<String>) -> Self {
8141 Self {
8142 checksum: checksum.into(),
8143 custom_data: None,
8144 }
8145 }
8146
8147 #[must_use]
8149 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8150 self.custom_data = Some(value);
8151 self
8152 }
8153}
8154
8155impl Validate for UnpublishFirmwareRequest {
8156 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8157 path.push_key("checksum");
8158 validate::string(self.checksum.as_str(), None, Some(32), path, out);
8159 path.pop();
8160 path.push_key("customData");
8161 if let Some(value) = &self.custom_data {
8162 Validate::validate_at(value, path, out);
8163 }
8164 path.pop();
8165 }
8166}
8167
8168impl Sealed for UnpublishFirmwareRequest {}
8169impl Request for UnpublishFirmwareRequest {
8170 type Action = Action;
8171 const ACTION: Action = Action::UnpublishFirmware;
8172 const KIND: MessageKind = MessageKind::Call;
8173 const ORIGIN: Origin = Origin::Csms;
8174 type Response = UnpublishFirmwareResponse;
8175}
8176
8177impl Confirmed for UnpublishFirmwareRequest {}
8178
8179#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8181pub struct UnpublishFirmwareResponse {
8182 pub status: UnpublishFirmwareStatus,
8184 #[serde(rename = "customData")]
8186 #[serde(default, skip_serializing_if = "Option::is_none")]
8187 pub custom_data: Option<crate::types::CustomData>,
8188}
8189
8190impl UnpublishFirmwareResponse {
8191 #[must_use]
8193 pub fn new(status: UnpublishFirmwareStatus) -> Self {
8194 Self {
8195 status,
8196 custom_data: None,
8197 }
8198 }
8199
8200 #[must_use]
8202 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8203 self.custom_data = Some(value);
8204 self
8205 }
8206}
8207
8208impl Validate for UnpublishFirmwareResponse {
8209 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8210 path.push_key("status");
8211 Validate::validate_at(&self.status, path, out);
8212 path.pop();
8213 path.push_key("customData");
8214 if let Some(value) = &self.custom_data {
8215 Validate::validate_at(value, path, out);
8216 }
8217 path.pop();
8218 }
8219}
8220
8221impl Sealed for UnpublishFirmwareResponse {}
8222impl Response for UnpublishFirmwareResponse {}
8223
8224#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8226pub struct UpdateFirmwareRequest {
8227 #[serde(rename = "requestId")]
8229 #[serde(deserialize_with = "crate::types::integer::one")]
8230 pub request_id: i32,
8231 pub firmware: Firmware,
8233 #[serde(default, skip_serializing_if = "Option::is_none")]
8235 #[serde(deserialize_with = "crate::types::integer::option")]
8236 pub retries: Option<i32>,
8237 #[serde(rename = "retryInterval")]
8239 #[serde(default, skip_serializing_if = "Option::is_none")]
8240 #[serde(deserialize_with = "crate::types::integer::option")]
8241 pub retry_interval: Option<i32>,
8242 #[serde(rename = "customData")]
8244 #[serde(default, skip_serializing_if = "Option::is_none")]
8245 pub custom_data: Option<crate::types::CustomData>,
8246}
8247
8248impl UpdateFirmwareRequest {
8249 #[must_use]
8251 pub fn new(request_id: i32, firmware: Firmware) -> Self {
8252 Self {
8253 request_id,
8254 firmware,
8255 retries: None,
8256 retry_interval: None,
8257 custom_data: None,
8258 }
8259 }
8260
8261 #[must_use]
8263 pub fn with_retries(mut self, value: i32) -> Self {
8264 self.retries = Some(value);
8265 self
8266 }
8267
8268 #[must_use]
8270 pub fn with_retry_interval(mut self, value: i32) -> Self {
8271 self.retry_interval = Some(value);
8272 self
8273 }
8274
8275 #[must_use]
8277 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8278 self.custom_data = Some(value);
8279 self
8280 }
8281}
8282
8283impl Validate for UpdateFirmwareRequest {
8284 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8285 path.push_key("firmware");
8286 Validate::validate_at(&self.firmware, path, out);
8287 path.pop();
8288 path.push_key("customData");
8289 if let Some(value) = &self.custom_data {
8290 Validate::validate_at(value, path, out);
8291 }
8292 path.pop();
8293 }
8294}
8295
8296impl Sealed for UpdateFirmwareRequest {}
8297impl Request for UpdateFirmwareRequest {
8298 type Action = Action;
8299 const ACTION: Action = Action::UpdateFirmware;
8300 const KIND: MessageKind = MessageKind::Call;
8301 const ORIGIN: Origin = Origin::Csms;
8302 type Response = UpdateFirmwareResponse;
8303}
8304
8305impl Confirmed for UpdateFirmwareRequest {}
8306
8307#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8309pub struct UpdateFirmwareResponse {
8310 pub status: UpdateFirmwareStatus,
8312 #[serde(rename = "statusInfo")]
8314 #[serde(default, skip_serializing_if = "Option::is_none")]
8315 pub status_info: Option<StatusInfo>,
8316 #[serde(rename = "customData")]
8318 #[serde(default, skip_serializing_if = "Option::is_none")]
8319 pub custom_data: Option<crate::types::CustomData>,
8320}
8321
8322impl UpdateFirmwareResponse {
8323 #[must_use]
8325 pub fn new(status: UpdateFirmwareStatus) -> Self {
8326 Self {
8327 status,
8328 status_info: None,
8329 custom_data: None,
8330 }
8331 }
8332
8333 #[must_use]
8335 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
8336 self.status_info = Some(value);
8337 self
8338 }
8339
8340 #[must_use]
8342 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8343 self.custom_data = Some(value);
8344 self
8345 }
8346}
8347
8348impl Validate for UpdateFirmwareResponse {
8349 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8350 path.push_key("status");
8351 Validate::validate_at(&self.status, path, out);
8352 path.pop();
8353 path.push_key("statusInfo");
8354 if let Some(value) = &self.status_info {
8355 Validate::validate_at(value, path, out);
8356 }
8357 path.pop();
8358 path.push_key("customData");
8359 if let Some(value) = &self.custom_data {
8360 Validate::validate_at(value, path, out);
8361 }
8362 path.pop();
8363 }
8364}
8365
8366impl Sealed for UpdateFirmwareResponse {}
8367impl Response for UpdateFirmwareResponse {}