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 = "idTag")]
30 pub id_tag: String,
31}
32
33impl AuthorizeRequest {
34 #[must_use]
36 pub fn new(id_tag: impl Into<String>) -> Self {
37 Self {
38 id_tag: id_tag.into(),
39 }
40 }
41}
42
43impl Validate for AuthorizeRequest {
44 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
45 path.push_key("idTag");
46 validate::string(self.id_tag.as_str(), None, Some(20), path, out);
47 path.pop();
48 }
49}
50
51impl Sealed for AuthorizeRequest {}
52impl Request for AuthorizeRequest {
53 type Action = Action;
54 const ACTION: Action = Action::Authorize;
55 const KIND: MessageKind = MessageKind::Call;
56 const ORIGIN: Origin = Origin::ChargingStation;
57 type Response = AuthorizeResponse;
58}
59
60impl Confirmed for AuthorizeRequest {}
61
62#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
64pub struct AuthorizeResponse {
65 #[serde(rename = "idTagInfo")]
67 pub id_tag_info: IdTagInfo,
68}
69
70impl AuthorizeResponse {
71 #[must_use]
73 pub fn new(id_tag_info: IdTagInfo) -> Self {
74 Self { id_tag_info }
75 }
76}
77
78impl Validate for AuthorizeResponse {
79 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
80 path.push_key("idTagInfo");
81 Validate::validate_at(&self.id_tag_info, path, out);
82 path.pop();
83 }
84}
85
86impl Sealed for AuthorizeResponse {}
87impl Response for AuthorizeResponse {}
88
89#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
91pub struct BootNotificationRequest {
92 #[serde(rename = "chargePointVendor")]
94 pub charge_point_vendor: String,
95 #[serde(rename = "chargePointModel")]
97 pub charge_point_model: String,
98 #[serde(rename = "chargePointSerialNumber")]
100 #[serde(default, skip_serializing_if = "Option::is_none")]
101 pub charge_point_serial_number: Option<String>,
102 #[serde(rename = "chargeBoxSerialNumber")]
104 #[serde(default, skip_serializing_if = "Option::is_none")]
105 pub charge_box_serial_number: Option<String>,
106 #[serde(rename = "firmwareVersion")]
108 #[serde(default, skip_serializing_if = "Option::is_none")]
109 pub firmware_version: Option<String>,
110 #[serde(default, skip_serializing_if = "Option::is_none")]
112 pub iccid: Option<String>,
113 #[serde(default, skip_serializing_if = "Option::is_none")]
115 pub imsi: Option<String>,
116 #[serde(rename = "meterType")]
118 #[serde(default, skip_serializing_if = "Option::is_none")]
119 pub meter_type: Option<String>,
120 #[serde(rename = "meterSerialNumber")]
122 #[serde(default, skip_serializing_if = "Option::is_none")]
123 pub meter_serial_number: Option<String>,
124}
125
126impl BootNotificationRequest {
127 #[must_use]
129 pub fn new(
130 charge_point_vendor: impl Into<String>,
131 charge_point_model: impl Into<String>,
132 ) -> Self {
133 Self {
134 charge_point_vendor: charge_point_vendor.into(),
135 charge_point_model: charge_point_model.into(),
136 charge_point_serial_number: None,
137 charge_box_serial_number: None,
138 firmware_version: None,
139 iccid: None,
140 imsi: None,
141 meter_type: None,
142 meter_serial_number: None,
143 }
144 }
145
146 #[must_use]
148 pub fn with_charge_point_serial_number(mut self, value: impl Into<String>) -> Self {
149 self.charge_point_serial_number = Some(value.into());
150 self
151 }
152
153 #[must_use]
155 pub fn with_charge_box_serial_number(mut self, value: impl Into<String>) -> Self {
156 self.charge_box_serial_number = Some(value.into());
157 self
158 }
159
160 #[must_use]
162 pub fn with_firmware_version(mut self, value: impl Into<String>) -> Self {
163 self.firmware_version = Some(value.into());
164 self
165 }
166
167 #[must_use]
169 pub fn with_iccid(mut self, value: impl Into<String>) -> Self {
170 self.iccid = Some(value.into());
171 self
172 }
173
174 #[must_use]
176 pub fn with_imsi(mut self, value: impl Into<String>) -> Self {
177 self.imsi = Some(value.into());
178 self
179 }
180
181 #[must_use]
183 pub fn with_meter_type(mut self, value: impl Into<String>) -> Self {
184 self.meter_type = Some(value.into());
185 self
186 }
187
188 #[must_use]
190 pub fn with_meter_serial_number(mut self, value: impl Into<String>) -> Self {
191 self.meter_serial_number = Some(value.into());
192 self
193 }
194}
195
196impl Validate for BootNotificationRequest {
197 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
198 path.push_key("chargePointVendor");
199 validate::string(self.charge_point_vendor.as_str(), None, Some(20), path, out);
200 path.pop();
201 path.push_key("chargePointModel");
202 validate::string(self.charge_point_model.as_str(), None, Some(20), path, out);
203 path.pop();
204 path.push_key("chargePointSerialNumber");
205 if let Some(value) = &self.charge_point_serial_number {
206 validate::string(value.as_str(), None, Some(25), path, out);
207 }
208 path.pop();
209 path.push_key("chargeBoxSerialNumber");
210 if let Some(value) = &self.charge_box_serial_number {
211 validate::string(value.as_str(), None, Some(25), path, out);
212 }
213 path.pop();
214 path.push_key("firmwareVersion");
215 if let Some(value) = &self.firmware_version {
216 validate::string(value.as_str(), None, Some(50), path, out);
217 }
218 path.pop();
219 path.push_key("iccid");
220 if let Some(value) = &self.iccid {
221 validate::string(value.as_str(), None, Some(20), path, out);
222 }
223 path.pop();
224 path.push_key("imsi");
225 if let Some(value) = &self.imsi {
226 validate::string(value.as_str(), None, Some(20), path, out);
227 }
228 path.pop();
229 path.push_key("meterType");
230 if let Some(value) = &self.meter_type {
231 validate::string(value.as_str(), None, Some(25), path, out);
232 }
233 path.pop();
234 path.push_key("meterSerialNumber");
235 if let Some(value) = &self.meter_serial_number {
236 validate::string(value.as_str(), None, Some(25), path, out);
237 }
238 path.pop();
239 }
240}
241
242impl Sealed for BootNotificationRequest {}
243impl Request for BootNotificationRequest {
244 type Action = Action;
245 const ACTION: Action = Action::BootNotification;
246 const KIND: MessageKind = MessageKind::Call;
247 const ORIGIN: Origin = Origin::ChargingStation;
248 type Response = BootNotificationResponse;
249}
250
251impl Confirmed for BootNotificationRequest {}
252
253#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
255pub struct BootNotificationResponse {
256 pub status: RegistrationStatus,
258 #[serde(rename = "currentTime")]
260 pub current_time: crate::types::DateTime,
261 pub interval: i32,
263}
264
265impl BootNotificationResponse {
266 #[must_use]
268 pub fn new(
269 status: RegistrationStatus,
270 current_time: impl Into<crate::types::DateTime>,
271 interval: i32,
272 ) -> Self {
273 Self {
274 status,
275 current_time: current_time.into(),
276 interval,
277 }
278 }
279}
280
281impl Validate for BootNotificationResponse {
282 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
283 path.push_key("status");
284 Validate::validate_at(&self.status, path, out);
285 path.pop();
286 }
287}
288
289impl Sealed for BootNotificationResponse {}
290impl Response for BootNotificationResponse {}
291
292#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
294pub struct CancelReservationRequest {
295 #[serde(rename = "reservationId")]
297 pub reservation_id: i32,
298}
299
300impl CancelReservationRequest {
301 #[must_use]
303 pub fn new(reservation_id: i32) -> Self {
304 Self { reservation_id }
305 }
306}
307
308impl Validate for CancelReservationRequest {
309 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
310}
311
312impl Sealed for CancelReservationRequest {}
313impl Request for CancelReservationRequest {
314 type Action = Action;
315 const ACTION: Action = Action::CancelReservation;
316 const KIND: MessageKind = MessageKind::Call;
317 const ORIGIN: Origin = Origin::Csms;
318 type Response = CancelReservationResponse;
319}
320
321impl Confirmed for CancelReservationRequest {}
322
323#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
325pub struct CancelReservationResponse {
326 pub status: CancelReservationStatus,
328}
329
330impl CancelReservationResponse {
331 #[must_use]
333 pub fn new(status: CancelReservationStatus) -> Self {
334 Self { status }
335 }
336}
337
338impl Validate for CancelReservationResponse {
339 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
340 path.push_key("status");
341 Validate::validate_at(&self.status, path, out);
342 path.pop();
343 }
344}
345
346impl Sealed for CancelReservationResponse {}
347impl Response for CancelReservationResponse {}
348
349#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
351pub struct CertificateSignedRequest {
352 #[serde(rename = "certificateChain")]
354 pub certificate_chain: String,
355}
356
357impl CertificateSignedRequest {
358 #[must_use]
360 pub fn new(certificate_chain: impl Into<String>) -> Self {
361 Self {
362 certificate_chain: certificate_chain.into(),
363 }
364 }
365}
366
367impl Validate for CertificateSignedRequest {
368 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
369 path.push_key("certificateChain");
370 validate::string(
371 self.certificate_chain.as_str(),
372 None,
373 Some(10000),
374 path,
375 out,
376 );
377 path.pop();
378 }
379}
380
381impl Sealed for CertificateSignedRequest {}
382impl Request for CertificateSignedRequest {
383 type Action = Action;
384 const ACTION: Action = Action::CertificateSigned;
385 const KIND: MessageKind = MessageKind::Call;
386 const ORIGIN: Origin = Origin::Csms;
387 type Response = CertificateSignedResponse;
388}
389
390impl Confirmed for CertificateSignedRequest {}
391
392#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
394pub struct CertificateSignedResponse {
395 pub status: CertificateSignedStatus,
397}
398
399impl CertificateSignedResponse {
400 #[must_use]
402 pub fn new(status: CertificateSignedStatus) -> Self {
403 Self { status }
404 }
405}
406
407impl Validate for CertificateSignedResponse {
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 }
413}
414
415impl Sealed for CertificateSignedResponse {}
416impl Response for CertificateSignedResponse {}
417
418#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
420pub struct ChangeAvailabilityRequest {
421 #[serde(rename = "connectorId")]
423 pub connector_id: i32,
424 pub r#type: AvailabilityType,
426}
427
428impl ChangeAvailabilityRequest {
429 #[must_use]
431 pub fn new(connector_id: i32, r#type: AvailabilityType) -> Self {
432 Self {
433 connector_id,
434 r#type,
435 }
436 }
437}
438
439impl Validate for ChangeAvailabilityRequest {
440 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
441 path.push_key("type");
442 Validate::validate_at(&self.r#type, path, out);
443 path.pop();
444 }
445}
446
447impl Sealed for ChangeAvailabilityRequest {}
448impl Request for ChangeAvailabilityRequest {
449 type Action = Action;
450 const ACTION: Action = Action::ChangeAvailability;
451 const KIND: MessageKind = MessageKind::Call;
452 const ORIGIN: Origin = Origin::Csms;
453 type Response = ChangeAvailabilityResponse;
454}
455
456impl Confirmed for ChangeAvailabilityRequest {}
457
458#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
460pub struct ChangeAvailabilityResponse {
461 pub status: AvailabilityStatus,
463}
464
465impl ChangeAvailabilityResponse {
466 #[must_use]
468 pub fn new(status: AvailabilityStatus) -> Self {
469 Self { status }
470 }
471}
472
473impl Validate for ChangeAvailabilityResponse {
474 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
475 path.push_key("status");
476 Validate::validate_at(&self.status, path, out);
477 path.pop();
478 }
479}
480
481impl Sealed for ChangeAvailabilityResponse {}
482impl Response for ChangeAvailabilityResponse {}
483
484#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
486pub struct ChangeConfigurationRequest {
487 pub key: String,
489 pub value: String,
491}
492
493impl ChangeConfigurationRequest {
494 #[must_use]
496 pub fn new(key: impl Into<String>, value: impl Into<String>) -> Self {
497 Self {
498 key: key.into(),
499 value: value.into(),
500 }
501 }
502}
503
504impl Validate for ChangeConfigurationRequest {
505 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
506 path.push_key("key");
507 validate::string(self.key.as_str(), None, Some(50), path, out);
508 path.pop();
509 path.push_key("value");
510 validate::string(self.value.as_str(), None, Some(500), path, out);
511 path.pop();
512 }
513}
514
515impl Sealed for ChangeConfigurationRequest {}
516impl Request for ChangeConfigurationRequest {
517 type Action = Action;
518 const ACTION: Action = Action::ChangeConfiguration;
519 const KIND: MessageKind = MessageKind::Call;
520 const ORIGIN: Origin = Origin::Csms;
521 type Response = ChangeConfigurationResponse;
522}
523
524impl Confirmed for ChangeConfigurationRequest {}
525
526#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
528pub struct ChangeConfigurationResponse {
529 pub status: ConfigurationStatus,
531}
532
533impl ChangeConfigurationResponse {
534 #[must_use]
536 pub fn new(status: ConfigurationStatus) -> Self {
537 Self { status }
538 }
539}
540
541impl Validate for ChangeConfigurationResponse {
542 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
543 path.push_key("status");
544 Validate::validate_at(&self.status, path, out);
545 path.pop();
546 }
547}
548
549impl Sealed for ChangeConfigurationResponse {}
550impl Response for ChangeConfigurationResponse {}
551
552#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
554pub struct ClearCacheRequest {}
555
556impl ClearCacheRequest {
557 #[must_use]
559 pub fn new() -> Self {
560 Self::default()
561 }
562}
563
564impl Validate for ClearCacheRequest {
565 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
566}
567
568impl Sealed for ClearCacheRequest {}
569impl Request for ClearCacheRequest {
570 type Action = Action;
571 const ACTION: Action = Action::ClearCache;
572 const KIND: MessageKind = MessageKind::Call;
573 const ORIGIN: Origin = Origin::Csms;
574 type Response = ClearCacheResponse;
575}
576
577impl Confirmed for ClearCacheRequest {}
578
579#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
581pub struct ClearCacheResponse {
582 pub status: ClearCacheStatus,
584}
585
586impl ClearCacheResponse {
587 #[must_use]
589 pub fn new(status: ClearCacheStatus) -> Self {
590 Self { status }
591 }
592}
593
594impl Validate for ClearCacheResponse {
595 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
596 path.push_key("status");
597 Validate::validate_at(&self.status, path, out);
598 path.pop();
599 }
600}
601
602impl Sealed for ClearCacheResponse {}
603impl Response for ClearCacheResponse {}
604
605#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
607pub struct ClearChargingProfileRequest {
608 #[serde(default, skip_serializing_if = "Option::is_none")]
610 pub id: Option<i32>,
611 #[serde(rename = "connectorId")]
613 #[serde(default, skip_serializing_if = "Option::is_none")]
614 pub connector_id: Option<i32>,
615 #[serde(rename = "chargingProfilePurpose")]
617 #[serde(default, skip_serializing_if = "Option::is_none")]
618 pub charging_profile_purpose: Option<ChargingProfilePurpose>,
619 #[serde(rename = "stackLevel")]
621 #[serde(default, skip_serializing_if = "Option::is_none")]
622 pub stack_level: Option<i32>,
623}
624
625impl ClearChargingProfileRequest {
626 #[must_use]
628 pub fn new() -> Self {
629 Self::default()
630 }
631
632 #[must_use]
634 pub fn with_id(mut self, value: i32) -> Self {
635 self.id = Some(value);
636 self
637 }
638
639 #[must_use]
641 pub fn with_connector_id(mut self, value: i32) -> Self {
642 self.connector_id = Some(value);
643 self
644 }
645
646 #[must_use]
648 pub fn with_charging_profile_purpose(mut self, value: ChargingProfilePurpose) -> Self {
649 self.charging_profile_purpose = Some(value);
650 self
651 }
652
653 #[must_use]
655 pub fn with_stack_level(mut self, value: i32) -> Self {
656 self.stack_level = Some(value);
657 self
658 }
659}
660
661impl Validate for ClearChargingProfileRequest {
662 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
663 path.push_key("chargingProfilePurpose");
664 if let Some(value) = &self.charging_profile_purpose {
665 Validate::validate_at(value, path, out);
666 }
667 path.pop();
668 }
669}
670
671impl Sealed for ClearChargingProfileRequest {}
672impl Request for ClearChargingProfileRequest {
673 type Action = Action;
674 const ACTION: Action = Action::ClearChargingProfile;
675 const KIND: MessageKind = MessageKind::Call;
676 const ORIGIN: Origin = Origin::Csms;
677 type Response = ClearChargingProfileResponse;
678}
679
680impl Confirmed for ClearChargingProfileRequest {}
681
682#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
684pub struct ClearChargingProfileResponse {
685 pub status: ClearChargingProfileStatus,
687}
688
689impl ClearChargingProfileResponse {
690 #[must_use]
692 pub fn new(status: ClearChargingProfileStatus) -> Self {
693 Self { status }
694 }
695}
696
697impl Validate for ClearChargingProfileResponse {
698 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
699 path.push_key("status");
700 Validate::validate_at(&self.status, path, out);
701 path.pop();
702 }
703}
704
705impl Sealed for ClearChargingProfileResponse {}
706impl Response for ClearChargingProfileResponse {}
707
708#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
710pub struct DataTransferRequest {
711 #[serde(rename = "vendorId")]
713 pub vendor_id: String,
714 #[serde(rename = "messageId")]
716 #[serde(default, skip_serializing_if = "Option::is_none")]
717 pub message_id: Option<String>,
718 #[serde(default, skip_serializing_if = "Option::is_none")]
720 pub data: Option<String>,
721}
722
723impl DataTransferRequest {
724 #[must_use]
726 pub fn new(vendor_id: impl Into<String>) -> Self {
727 Self {
728 vendor_id: vendor_id.into(),
729 message_id: None,
730 data: None,
731 }
732 }
733
734 #[must_use]
736 pub fn with_message_id(mut self, value: impl Into<String>) -> Self {
737 self.message_id = Some(value.into());
738 self
739 }
740
741 #[must_use]
743 pub fn with_data(mut self, value: impl Into<String>) -> Self {
744 self.data = Some(value.into());
745 self
746 }
747}
748
749impl Validate for DataTransferRequest {
750 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
751 path.push_key("vendorId");
752 validate::string(self.vendor_id.as_str(), None, Some(255), path, out);
753 path.pop();
754 path.push_key("messageId");
755 if let Some(value) = &self.message_id {
756 validate::string(value.as_str(), None, Some(50), path, out);
757 }
758 path.pop();
759 }
760}
761
762impl Sealed for DataTransferRequest {}
763impl Request for DataTransferRequest {
764 type Action = Action;
765 const ACTION: Action = Action::DataTransfer;
766 const KIND: MessageKind = MessageKind::Call;
767 const ORIGIN: Origin = Origin::Both;
768 type Response = DataTransferResponse;
769}
770
771impl Confirmed for DataTransferRequest {}
772
773#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
775pub struct DataTransferResponse {
776 pub status: DataTransferStatus,
778 #[serde(default, skip_serializing_if = "Option::is_none")]
780 pub data: Option<String>,
781}
782
783impl DataTransferResponse {
784 #[must_use]
786 pub fn new(status: DataTransferStatus) -> Self {
787 Self { status, data: None }
788 }
789
790 #[must_use]
792 pub fn with_data(mut self, value: impl Into<String>) -> Self {
793 self.data = Some(value.into());
794 self
795 }
796}
797
798impl Validate for DataTransferResponse {
799 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
800 path.push_key("status");
801 Validate::validate_at(&self.status, path, out);
802 path.pop();
803 }
804}
805
806impl Sealed for DataTransferResponse {}
807impl Response for DataTransferResponse {}
808
809#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
811pub struct DeleteCertificateRequest {
812 #[serde(rename = "certificateHashData")]
814 pub certificate_hash_data: CertificateHashData,
815}
816
817impl DeleteCertificateRequest {
818 #[must_use]
820 pub fn new(certificate_hash_data: CertificateHashData) -> Self {
821 Self {
822 certificate_hash_data,
823 }
824 }
825}
826
827impl Validate for DeleteCertificateRequest {
828 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
829 path.push_key("certificateHashData");
830 Validate::validate_at(&self.certificate_hash_data, path, out);
831 path.pop();
832 }
833}
834
835impl Sealed for DeleteCertificateRequest {}
836impl Request for DeleteCertificateRequest {
837 type Action = Action;
838 const ACTION: Action = Action::DeleteCertificate;
839 const KIND: MessageKind = MessageKind::Call;
840 const ORIGIN: Origin = Origin::Csms;
841 type Response = DeleteCertificateResponse;
842}
843
844impl Confirmed for DeleteCertificateRequest {}
845
846#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
848pub struct DeleteCertificateResponse {
849 pub status: DeleteCertificateStatus,
851}
852
853impl DeleteCertificateResponse {
854 #[must_use]
856 pub fn new(status: DeleteCertificateStatus) -> Self {
857 Self { status }
858 }
859}
860
861impl Validate for DeleteCertificateResponse {
862 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
863 path.push_key("status");
864 Validate::validate_at(&self.status, path, out);
865 path.pop();
866 }
867}
868
869impl Sealed for DeleteCertificateResponse {}
870impl Response for DeleteCertificateResponse {}
871
872#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
874pub struct DiagnosticsStatusNotificationRequest {
875 pub status: DiagnosticsStatus,
877}
878
879impl DiagnosticsStatusNotificationRequest {
880 #[must_use]
882 pub fn new(status: DiagnosticsStatus) -> Self {
883 Self { status }
884 }
885}
886
887impl Validate for DiagnosticsStatusNotificationRequest {
888 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
889 path.push_key("status");
890 Validate::validate_at(&self.status, path, out);
891 path.pop();
892 }
893}
894
895impl Sealed for DiagnosticsStatusNotificationRequest {}
896impl Request for DiagnosticsStatusNotificationRequest {
897 type Action = Action;
898 const ACTION: Action = Action::DiagnosticsStatusNotification;
899 const KIND: MessageKind = MessageKind::Call;
900 const ORIGIN: Origin = Origin::ChargingStation;
901 type Response = DiagnosticsStatusNotificationResponse;
902}
903
904impl Confirmed for DiagnosticsStatusNotificationRequest {}
905
906#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
908pub struct DiagnosticsStatusNotificationResponse {}
909
910impl DiagnosticsStatusNotificationResponse {
911 #[must_use]
913 pub fn new() -> Self {
914 Self::default()
915 }
916}
917
918impl Validate for DiagnosticsStatusNotificationResponse {
919 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
920}
921
922impl Sealed for DiagnosticsStatusNotificationResponse {}
923impl Response for DiagnosticsStatusNotificationResponse {}
924
925#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
927pub struct ExtendedTriggerMessageRequest {
928 #[serde(rename = "requestedMessage")]
930 pub requested_message: ExtendedMessageTrigger,
931 #[serde(rename = "connectorId")]
933 #[serde(default, skip_serializing_if = "Option::is_none")]
934 pub connector_id: Option<i32>,
935}
936
937impl ExtendedTriggerMessageRequest {
938 #[must_use]
940 pub fn new(requested_message: ExtendedMessageTrigger) -> Self {
941 Self {
942 requested_message,
943 connector_id: None,
944 }
945 }
946
947 #[must_use]
949 pub fn with_connector_id(mut self, value: i32) -> Self {
950 self.connector_id = Some(value);
951 self
952 }
953}
954
955impl Validate for ExtendedTriggerMessageRequest {
956 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
957 path.push_key("requestedMessage");
958 Validate::validate_at(&self.requested_message, path, out);
959 path.pop();
960 }
961}
962
963impl Sealed for ExtendedTriggerMessageRequest {}
964impl Request for ExtendedTriggerMessageRequest {
965 type Action = Action;
966 const ACTION: Action = Action::ExtendedTriggerMessage;
967 const KIND: MessageKind = MessageKind::Call;
968 const ORIGIN: Origin = Origin::Csms;
969 type Response = ExtendedTriggerMessageResponse;
970}
971
972impl Confirmed for ExtendedTriggerMessageRequest {}
973
974#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
976pub struct ExtendedTriggerMessageResponse {
977 pub status: TriggerMessageStatus,
979}
980
981impl ExtendedTriggerMessageResponse {
982 #[must_use]
984 pub fn new(status: TriggerMessageStatus) -> Self {
985 Self { status }
986 }
987}
988
989impl Validate for ExtendedTriggerMessageResponse {
990 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
991 path.push_key("status");
992 Validate::validate_at(&self.status, path, out);
993 path.pop();
994 }
995}
996
997impl Sealed for ExtendedTriggerMessageResponse {}
998impl Response for ExtendedTriggerMessageResponse {}
999
1000#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1002pub struct FirmwareStatusNotificationRequest {
1003 pub status: FirmwareStatus,
1005}
1006
1007impl FirmwareStatusNotificationRequest {
1008 #[must_use]
1010 pub fn new(status: FirmwareStatus) -> Self {
1011 Self { status }
1012 }
1013}
1014
1015impl Validate for FirmwareStatusNotificationRequest {
1016 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1017 path.push_key("status");
1018 Validate::validate_at(&self.status, path, out);
1019 path.pop();
1020 }
1021}
1022
1023impl Sealed for FirmwareStatusNotificationRequest {}
1024impl Request for FirmwareStatusNotificationRequest {
1025 type Action = Action;
1026 const ACTION: Action = Action::FirmwareStatusNotification;
1027 const KIND: MessageKind = MessageKind::Call;
1028 const ORIGIN: Origin = Origin::ChargingStation;
1029 type Response = FirmwareStatusNotificationResponse;
1030}
1031
1032impl Confirmed for FirmwareStatusNotificationRequest {}
1033
1034#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1036pub struct FirmwareStatusNotificationResponse {}
1037
1038impl FirmwareStatusNotificationResponse {
1039 #[must_use]
1041 pub fn new() -> Self {
1042 Self::default()
1043 }
1044}
1045
1046impl Validate for FirmwareStatusNotificationResponse {
1047 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
1048}
1049
1050impl Sealed for FirmwareStatusNotificationResponse {}
1051impl Response for FirmwareStatusNotificationResponse {}
1052
1053#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1055pub struct GetCompositeScheduleRequest {
1056 #[serde(rename = "connectorId")]
1058 pub connector_id: i32,
1059 pub duration: i32,
1061 #[serde(rename = "chargingRateUnit")]
1063 #[serde(default, skip_serializing_if = "Option::is_none")]
1064 pub charging_rate_unit: Option<ChargingRateUnit>,
1065}
1066
1067impl GetCompositeScheduleRequest {
1068 #[must_use]
1070 pub fn new(connector_id: i32, duration: i32) -> Self {
1071 Self {
1072 connector_id,
1073 duration,
1074 charging_rate_unit: None,
1075 }
1076 }
1077
1078 #[must_use]
1080 pub fn with_charging_rate_unit(mut self, value: ChargingRateUnit) -> Self {
1081 self.charging_rate_unit = Some(value);
1082 self
1083 }
1084}
1085
1086impl Validate for GetCompositeScheduleRequest {
1087 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1088 path.push_key("chargingRateUnit");
1089 if let Some(value) = &self.charging_rate_unit {
1090 Validate::validate_at(value, path, out);
1091 }
1092 path.pop();
1093 }
1094}
1095
1096impl Sealed for GetCompositeScheduleRequest {}
1097impl Request for GetCompositeScheduleRequest {
1098 type Action = Action;
1099 const ACTION: Action = Action::GetCompositeSchedule;
1100 const KIND: MessageKind = MessageKind::Call;
1101 const ORIGIN: Origin = Origin::Csms;
1102 type Response = GetCompositeScheduleResponse;
1103}
1104
1105impl Confirmed for GetCompositeScheduleRequest {}
1106
1107#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1109pub struct GetCompositeScheduleResponse {
1110 pub status: GetCompositeScheduleStatus,
1112 #[serde(rename = "connectorId")]
1114 #[serde(default, skip_serializing_if = "Option::is_none")]
1115 pub connector_id: Option<i32>,
1116 #[serde(rename = "scheduleStart")]
1118 #[serde(default, skip_serializing_if = "Option::is_none")]
1119 pub schedule_start: Option<crate::types::DateTime>,
1120 #[serde(rename = "chargingSchedule")]
1122 #[serde(default, skip_serializing_if = "Option::is_none")]
1123 pub charging_schedule: Option<ChargingSchedule>,
1124}
1125
1126impl GetCompositeScheduleResponse {
1127 #[must_use]
1129 pub fn new(status: GetCompositeScheduleStatus) -> Self {
1130 Self {
1131 status,
1132 connector_id: None,
1133 schedule_start: None,
1134 charging_schedule: None,
1135 }
1136 }
1137
1138 #[must_use]
1140 pub fn with_connector_id(mut self, value: i32) -> Self {
1141 self.connector_id = Some(value);
1142 self
1143 }
1144
1145 #[must_use]
1147 pub fn with_schedule_start(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1148 self.schedule_start = Some(value.into());
1149 self
1150 }
1151
1152 #[must_use]
1154 pub fn with_charging_schedule(mut self, value: ChargingSchedule) -> Self {
1155 self.charging_schedule = Some(value);
1156 self
1157 }
1158}
1159
1160impl Validate for GetCompositeScheduleResponse {
1161 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1162 path.push_key("status");
1163 Validate::validate_at(&self.status, path, out);
1164 path.pop();
1165 path.push_key("chargingSchedule");
1166 if let Some(value) = &self.charging_schedule {
1167 Validate::validate_at(value, path, out);
1168 }
1169 path.pop();
1170 }
1171}
1172
1173impl Sealed for GetCompositeScheduleResponse {}
1174impl Response for GetCompositeScheduleResponse {}
1175
1176#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1178pub struct GetConfigurationRequest {
1179 #[serde(default, skip_serializing_if = "Option::is_none")]
1181 pub key: Option<Vec<String>>,
1182}
1183
1184impl GetConfigurationRequest {
1185 #[must_use]
1187 pub fn new() -> Self {
1188 Self::default()
1189 }
1190
1191 #[must_use]
1193 pub fn with_key(mut self, value: impl IntoIterator<Item = impl Into<String>>) -> Self {
1194 self.key = Some(value.into_iter().map(Into::into).collect());
1195 self
1196 }
1197}
1198
1199impl Validate for GetConfigurationRequest {
1200 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1201 path.push_key("key");
1202 if let Some(value) = &self.key {
1203 for (index, item) in value.iter().enumerate() {
1204 path.push_index(index);
1205 validate::string(item.as_str(), None, Some(50), path, out);
1206 path.pop();
1207 }
1208 }
1209 path.pop();
1210 }
1211}
1212
1213impl Sealed for GetConfigurationRequest {}
1214impl Request for GetConfigurationRequest {
1215 type Action = Action;
1216 const ACTION: Action = Action::GetConfiguration;
1217 const KIND: MessageKind = MessageKind::Call;
1218 const ORIGIN: Origin = Origin::Csms;
1219 type Response = GetConfigurationResponse;
1220}
1221
1222impl Confirmed for GetConfigurationRequest {}
1223
1224#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1226pub struct GetConfigurationResponse {
1227 #[serde(rename = "configurationKey")]
1229 #[serde(default, skip_serializing_if = "Option::is_none")]
1230 pub configuration_key: Option<Vec<KeyValue>>,
1231 #[serde(rename = "unknownKey")]
1233 #[serde(default, skip_serializing_if = "Option::is_none")]
1234 pub unknown_key: Option<Vec<String>>,
1235}
1236
1237impl GetConfigurationResponse {
1238 #[must_use]
1240 pub fn new() -> Self {
1241 Self::default()
1242 }
1243
1244 #[must_use]
1246 pub fn with_configuration_key(mut self, value: Vec<KeyValue>) -> Self {
1247 self.configuration_key = Some(value);
1248 self
1249 }
1250
1251 #[must_use]
1253 pub fn with_unknown_key(mut self, value: impl IntoIterator<Item = impl Into<String>>) -> Self {
1254 self.unknown_key = Some(value.into_iter().map(Into::into).collect());
1255 self
1256 }
1257}
1258
1259impl Validate for GetConfigurationResponse {
1260 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1261 path.push_key("configurationKey");
1262 if let Some(value) = &self.configuration_key {
1263 for (index, item) in value.iter().enumerate() {
1264 path.push_index(index);
1265 Validate::validate_at(item, path, out);
1266 path.pop();
1267 }
1268 }
1269 path.pop();
1270 path.push_key("unknownKey");
1271 if let Some(value) = &self.unknown_key {
1272 for (index, item) in value.iter().enumerate() {
1273 path.push_index(index);
1274 validate::string(item.as_str(), None, Some(50), path, out);
1275 path.pop();
1276 }
1277 }
1278 path.pop();
1279 }
1280}
1281
1282impl Sealed for GetConfigurationResponse {}
1283impl Response for GetConfigurationResponse {}
1284
1285#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1287pub struct GetDiagnosticsRequest {
1288 pub location: String,
1290 #[serde(default, skip_serializing_if = "Option::is_none")]
1292 pub retries: Option<i32>,
1293 #[serde(rename = "retryInterval")]
1295 #[serde(default, skip_serializing_if = "Option::is_none")]
1296 pub retry_interval: Option<i32>,
1297 #[serde(rename = "startTime")]
1299 #[serde(default, skip_serializing_if = "Option::is_none")]
1300 pub start_time: Option<crate::types::DateTime>,
1301 #[serde(rename = "stopTime")]
1303 #[serde(default, skip_serializing_if = "Option::is_none")]
1304 pub stop_time: Option<crate::types::DateTime>,
1305}
1306
1307impl GetDiagnosticsRequest {
1308 #[must_use]
1310 pub fn new(location: impl Into<String>) -> Self {
1311 Self {
1312 location: location.into(),
1313 retries: None,
1314 retry_interval: None,
1315 start_time: None,
1316 stop_time: None,
1317 }
1318 }
1319
1320 #[must_use]
1322 pub fn with_retries(mut self, value: i32) -> Self {
1323 self.retries = Some(value);
1324 self
1325 }
1326
1327 #[must_use]
1329 pub fn with_retry_interval(mut self, value: i32) -> Self {
1330 self.retry_interval = Some(value);
1331 self
1332 }
1333
1334 #[must_use]
1336 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1337 self.start_time = Some(value.into());
1338 self
1339 }
1340
1341 #[must_use]
1343 pub fn with_stop_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1344 self.stop_time = Some(value.into());
1345 self
1346 }
1347}
1348
1349impl Validate for GetDiagnosticsRequest {
1350 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
1351}
1352
1353impl Sealed for GetDiagnosticsRequest {}
1354impl Request for GetDiagnosticsRequest {
1355 type Action = Action;
1356 const ACTION: Action = Action::GetDiagnostics;
1357 const KIND: MessageKind = MessageKind::Call;
1358 const ORIGIN: Origin = Origin::Csms;
1359 type Response = GetDiagnosticsResponse;
1360}
1361
1362impl Confirmed for GetDiagnosticsRequest {}
1363
1364#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1366pub struct GetDiagnosticsResponse {
1367 #[serde(rename = "fileName")]
1369 #[serde(default, skip_serializing_if = "Option::is_none")]
1370 pub file_name: Option<String>,
1371}
1372
1373impl GetDiagnosticsResponse {
1374 #[must_use]
1376 pub fn new() -> Self {
1377 Self::default()
1378 }
1379
1380 #[must_use]
1382 pub fn with_file_name(mut self, value: impl Into<String>) -> Self {
1383 self.file_name = Some(value.into());
1384 self
1385 }
1386}
1387
1388impl Validate for GetDiagnosticsResponse {
1389 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1390 path.push_key("fileName");
1391 if let Some(value) = &self.file_name {
1392 validate::string(value.as_str(), None, Some(255), path, out);
1393 }
1394 path.pop();
1395 }
1396}
1397
1398impl Sealed for GetDiagnosticsResponse {}
1399impl Response for GetDiagnosticsResponse {}
1400
1401#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1403pub struct GetInstalledCertificateIdsRequest {
1404 #[serde(rename = "certificateType")]
1406 pub certificate_type: CertificateUse,
1407}
1408
1409impl GetInstalledCertificateIdsRequest {
1410 #[must_use]
1412 pub fn new(certificate_type: CertificateUse) -> Self {
1413 Self { certificate_type }
1414 }
1415}
1416
1417impl Validate for GetInstalledCertificateIdsRequest {
1418 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1419 path.push_key("certificateType");
1420 Validate::validate_at(&self.certificate_type, path, out);
1421 path.pop();
1422 }
1423}
1424
1425impl Sealed for GetInstalledCertificateIdsRequest {}
1426impl Request for GetInstalledCertificateIdsRequest {
1427 type Action = Action;
1428 const ACTION: Action = Action::GetInstalledCertificateIds;
1429 const KIND: MessageKind = MessageKind::Call;
1430 const ORIGIN: Origin = Origin::Csms;
1431 type Response = GetInstalledCertificateIdsResponse;
1432}
1433
1434impl Confirmed for GetInstalledCertificateIdsRequest {}
1435
1436#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1438pub struct GetInstalledCertificateIdsResponse {
1439 pub status: GetInstalledCertificateStatus,
1441 #[serde(rename = "certificateHashData")]
1443 #[serde(default, skip_serializing_if = "Option::is_none")]
1444 pub certificate_hash_data: Option<Vec<CertificateHashData>>,
1445}
1446
1447impl GetInstalledCertificateIdsResponse {
1448 #[must_use]
1450 pub fn new(status: GetInstalledCertificateStatus) -> Self {
1451 Self {
1452 status,
1453 certificate_hash_data: None,
1454 }
1455 }
1456
1457 #[must_use]
1459 pub fn with_certificate_hash_data(mut self, value: Vec<CertificateHashData>) -> Self {
1460 self.certificate_hash_data = Some(value);
1461 self
1462 }
1463}
1464
1465impl Validate for GetInstalledCertificateIdsResponse {
1466 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1467 path.push_key("status");
1468 Validate::validate_at(&self.status, path, out);
1469 path.pop();
1470 path.push_key("certificateHashData");
1471 if let Some(value) = &self.certificate_hash_data {
1472 validate::list_len(value.len(), Some(1), None, path, out);
1473 for (index, item) in value.iter().enumerate() {
1474 path.push_index(index);
1475 Validate::validate_at(item, path, out);
1476 path.pop();
1477 }
1478 }
1479 path.pop();
1480 }
1481}
1482
1483impl Sealed for GetInstalledCertificateIdsResponse {}
1484impl Response for GetInstalledCertificateIdsResponse {}
1485
1486#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1488pub struct GetLocalListVersionRequest {}
1489
1490impl GetLocalListVersionRequest {
1491 #[must_use]
1493 pub fn new() -> Self {
1494 Self::default()
1495 }
1496}
1497
1498impl Validate for GetLocalListVersionRequest {
1499 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
1500}
1501
1502impl Sealed for GetLocalListVersionRequest {}
1503impl Request for GetLocalListVersionRequest {
1504 type Action = Action;
1505 const ACTION: Action = Action::GetLocalListVersion;
1506 const KIND: MessageKind = MessageKind::Call;
1507 const ORIGIN: Origin = Origin::Csms;
1508 type Response = GetLocalListVersionResponse;
1509}
1510
1511impl Confirmed for GetLocalListVersionRequest {}
1512
1513#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1515pub struct GetLocalListVersionResponse {
1516 #[serde(rename = "listVersion")]
1518 pub list_version: i32,
1519}
1520
1521impl GetLocalListVersionResponse {
1522 #[must_use]
1524 pub fn new(list_version: i32) -> Self {
1525 Self { list_version }
1526 }
1527}
1528
1529impl Validate for GetLocalListVersionResponse {
1530 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
1531}
1532
1533impl Sealed for GetLocalListVersionResponse {}
1534impl Response for GetLocalListVersionResponse {}
1535
1536#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1538pub struct GetLogRequest {
1539 pub log: LogParameters,
1541 #[serde(rename = "logType")]
1543 pub log_type: LogType,
1544 #[serde(rename = "requestId")]
1546 pub request_id: i32,
1547 #[serde(default, skip_serializing_if = "Option::is_none")]
1549 pub retries: Option<i32>,
1550 #[serde(rename = "retryInterval")]
1552 #[serde(default, skip_serializing_if = "Option::is_none")]
1553 pub retry_interval: Option<i32>,
1554}
1555
1556impl GetLogRequest {
1557 #[must_use]
1559 pub fn new(log: LogParameters, log_type: LogType, request_id: i32) -> Self {
1560 Self {
1561 log,
1562 log_type,
1563 request_id,
1564 retries: None,
1565 retry_interval: None,
1566 }
1567 }
1568
1569 #[must_use]
1571 pub fn with_retries(mut self, value: i32) -> Self {
1572 self.retries = Some(value);
1573 self
1574 }
1575
1576 #[must_use]
1578 pub fn with_retry_interval(mut self, value: i32) -> Self {
1579 self.retry_interval = Some(value);
1580 self
1581 }
1582}
1583
1584impl Validate for GetLogRequest {
1585 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1586 path.push_key("log");
1587 Validate::validate_at(&self.log, path, out);
1588 path.pop();
1589 path.push_key("logType");
1590 Validate::validate_at(&self.log_type, path, out);
1591 path.pop();
1592 }
1593}
1594
1595impl Sealed for GetLogRequest {}
1596impl Request for GetLogRequest {
1597 type Action = Action;
1598 const ACTION: Action = Action::GetLog;
1599 const KIND: MessageKind = MessageKind::Call;
1600 const ORIGIN: Origin = Origin::Csms;
1601 type Response = GetLogResponse;
1602}
1603
1604impl Confirmed for GetLogRequest {}
1605
1606#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1608pub struct GetLogResponse {
1609 pub status: LogStatus,
1611 #[serde(default, skip_serializing_if = "Option::is_none")]
1613 pub filename: Option<String>,
1614}
1615
1616impl GetLogResponse {
1617 #[must_use]
1619 pub fn new(status: LogStatus) -> Self {
1620 Self {
1621 status,
1622 filename: None,
1623 }
1624 }
1625
1626 #[must_use]
1628 pub fn with_filename(mut self, value: impl Into<String>) -> Self {
1629 self.filename = Some(value.into());
1630 self
1631 }
1632}
1633
1634impl Validate for GetLogResponse {
1635 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1636 path.push_key("status");
1637 Validate::validate_at(&self.status, path, out);
1638 path.pop();
1639 path.push_key("filename");
1640 if let Some(value) = &self.filename {
1641 validate::string(value.as_str(), None, Some(255), path, out);
1642 }
1643 path.pop();
1644 }
1645}
1646
1647impl Sealed for GetLogResponse {}
1648impl Response for GetLogResponse {}
1649
1650#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1652pub struct HeartbeatRequest {}
1653
1654impl HeartbeatRequest {
1655 #[must_use]
1657 pub fn new() -> Self {
1658 Self::default()
1659 }
1660}
1661
1662impl Validate for HeartbeatRequest {
1663 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
1664}
1665
1666impl Sealed for HeartbeatRequest {}
1667impl Request for HeartbeatRequest {
1668 type Action = Action;
1669 const ACTION: Action = Action::Heartbeat;
1670 const KIND: MessageKind = MessageKind::Call;
1671 const ORIGIN: Origin = Origin::ChargingStation;
1672 type Response = HeartbeatResponse;
1673}
1674
1675impl Confirmed for HeartbeatRequest {}
1676
1677#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1679pub struct HeartbeatResponse {
1680 #[serde(rename = "currentTime")]
1682 pub current_time: crate::types::DateTime,
1683}
1684
1685impl HeartbeatResponse {
1686 #[must_use]
1688 pub fn new(current_time: impl Into<crate::types::DateTime>) -> Self {
1689 Self {
1690 current_time: current_time.into(),
1691 }
1692 }
1693}
1694
1695impl Validate for HeartbeatResponse {
1696 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
1697}
1698
1699impl Sealed for HeartbeatResponse {}
1700impl Response for HeartbeatResponse {}
1701
1702#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1704pub struct InstallCertificateRequest {
1705 #[serde(rename = "certificateType")]
1707 pub certificate_type: CertificateUse,
1708 pub certificate: String,
1710}
1711
1712impl InstallCertificateRequest {
1713 #[must_use]
1715 pub fn new(certificate_type: CertificateUse, certificate: impl Into<String>) -> Self {
1716 Self {
1717 certificate_type,
1718 certificate: certificate.into(),
1719 }
1720 }
1721}
1722
1723impl Validate for InstallCertificateRequest {
1724 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1725 path.push_key("certificateType");
1726 Validate::validate_at(&self.certificate_type, path, out);
1727 path.pop();
1728 path.push_key("certificate");
1729 validate::string(self.certificate.as_str(), None, Some(5500), path, out);
1730 path.pop();
1731 }
1732}
1733
1734impl Sealed for InstallCertificateRequest {}
1735impl Request for InstallCertificateRequest {
1736 type Action = Action;
1737 const ACTION: Action = Action::InstallCertificate;
1738 const KIND: MessageKind = MessageKind::Call;
1739 const ORIGIN: Origin = Origin::Csms;
1740 type Response = InstallCertificateResponse;
1741}
1742
1743impl Confirmed for InstallCertificateRequest {}
1744
1745#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1747pub struct InstallCertificateResponse {
1748 pub status: InstallCertificateStatus,
1750}
1751
1752impl InstallCertificateResponse {
1753 #[must_use]
1755 pub fn new(status: InstallCertificateStatus) -> Self {
1756 Self { status }
1757 }
1758}
1759
1760impl Validate for InstallCertificateResponse {
1761 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1762 path.push_key("status");
1763 Validate::validate_at(&self.status, path, out);
1764 path.pop();
1765 }
1766}
1767
1768impl Sealed for InstallCertificateResponse {}
1769impl Response for InstallCertificateResponse {}
1770
1771#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1773pub struct LogStatusNotificationRequest {
1774 pub status: UploadLogStatus,
1776 #[serde(rename = "requestId")]
1778 #[serde(default, skip_serializing_if = "Option::is_none")]
1779 pub request_id: Option<i32>,
1780}
1781
1782impl LogStatusNotificationRequest {
1783 #[must_use]
1785 pub fn new(status: UploadLogStatus) -> Self {
1786 Self {
1787 status,
1788 request_id: None,
1789 }
1790 }
1791
1792 #[must_use]
1794 pub fn with_request_id(mut self, value: i32) -> Self {
1795 self.request_id = Some(value);
1796 self
1797 }
1798}
1799
1800impl Validate for LogStatusNotificationRequest {
1801 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1802 path.push_key("status");
1803 Validate::validate_at(&self.status, path, out);
1804 path.pop();
1805 }
1806}
1807
1808impl Sealed for LogStatusNotificationRequest {}
1809impl Request for LogStatusNotificationRequest {
1810 type Action = Action;
1811 const ACTION: Action = Action::LogStatusNotification;
1812 const KIND: MessageKind = MessageKind::Call;
1813 const ORIGIN: Origin = Origin::ChargingStation;
1814 type Response = LogStatusNotificationResponse;
1815}
1816
1817impl Confirmed for LogStatusNotificationRequest {}
1818
1819#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1821pub struct LogStatusNotificationResponse {}
1822
1823impl LogStatusNotificationResponse {
1824 #[must_use]
1826 pub fn new() -> Self {
1827 Self::default()
1828 }
1829}
1830
1831impl Validate for LogStatusNotificationResponse {
1832 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
1833}
1834
1835impl Sealed for LogStatusNotificationResponse {}
1836impl Response for LogStatusNotificationResponse {}
1837
1838#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1840pub struct MeterValuesRequest {
1841 #[serde(rename = "connectorId")]
1843 pub connector_id: i32,
1844 #[serde(rename = "meterValue")]
1846 pub meter_value: Vec<MeterValue>,
1847 #[serde(rename = "transactionId")]
1849 #[serde(default, skip_serializing_if = "Option::is_none")]
1850 pub transaction_id: Option<i32>,
1851}
1852
1853impl MeterValuesRequest {
1854 #[must_use]
1856 pub fn new(connector_id: i32, meter_value: Vec<MeterValue>) -> Self {
1857 Self {
1858 connector_id,
1859 meter_value,
1860 transaction_id: None,
1861 }
1862 }
1863
1864 #[must_use]
1866 pub fn with_transaction_id(mut self, value: i32) -> Self {
1867 self.transaction_id = Some(value);
1868 self
1869 }
1870}
1871
1872impl Validate for MeterValuesRequest {
1873 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1874 path.push_key("meterValue");
1875 validate::list_len(self.meter_value.len(), Some(1), None, path, out);
1876 for (index, item) in self.meter_value.iter().enumerate() {
1877 path.push_index(index);
1878 Validate::validate_at(item, path, out);
1879 path.pop();
1880 }
1881 path.pop();
1882 }
1883}
1884
1885impl Sealed for MeterValuesRequest {}
1886impl Request for MeterValuesRequest {
1887 type Action = Action;
1888 const ACTION: Action = Action::MeterValues;
1889 const KIND: MessageKind = MessageKind::Call;
1890 const ORIGIN: Origin = Origin::ChargingStation;
1891 type Response = MeterValuesResponse;
1892}
1893
1894impl Confirmed for MeterValuesRequest {}
1895
1896#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1898pub struct MeterValuesResponse {}
1899
1900impl MeterValuesResponse {
1901 #[must_use]
1903 pub fn new() -> Self {
1904 Self::default()
1905 }
1906}
1907
1908impl Validate for MeterValuesResponse {
1909 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
1910}
1911
1912impl Sealed for MeterValuesResponse {}
1913impl Response for MeterValuesResponse {}
1914
1915#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1917pub struct RemoteStartTransactionRequest {
1918 #[serde(rename = "idTag")]
1920 pub id_tag: String,
1921 #[serde(rename = "connectorId")]
1923 #[serde(default, skip_serializing_if = "Option::is_none")]
1924 pub connector_id: Option<i32>,
1925 #[serde(rename = "chargingProfile")]
1927 #[serde(default, skip_serializing_if = "Option::is_none")]
1928 pub charging_profile: Option<ChargingProfile>,
1929}
1930
1931impl RemoteStartTransactionRequest {
1932 #[must_use]
1934 pub fn new(id_tag: impl Into<String>) -> Self {
1935 Self {
1936 id_tag: id_tag.into(),
1937 connector_id: None,
1938 charging_profile: None,
1939 }
1940 }
1941
1942 #[must_use]
1944 pub fn with_connector_id(mut self, value: i32) -> Self {
1945 self.connector_id = Some(value);
1946 self
1947 }
1948
1949 #[must_use]
1951 pub fn with_charging_profile(mut self, value: ChargingProfile) -> Self {
1952 self.charging_profile = Some(value);
1953 self
1954 }
1955}
1956
1957impl Validate for RemoteStartTransactionRequest {
1958 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1959 path.push_key("idTag");
1960 validate::string(self.id_tag.as_str(), None, Some(20), path, out);
1961 path.pop();
1962 path.push_key("chargingProfile");
1963 if let Some(value) = &self.charging_profile {
1964 Validate::validate_at(value, path, out);
1965 }
1966 path.pop();
1967 }
1968}
1969
1970impl Sealed for RemoteStartTransactionRequest {}
1971impl Request for RemoteStartTransactionRequest {
1972 type Action = Action;
1973 const ACTION: Action = Action::RemoteStartTransaction;
1974 const KIND: MessageKind = MessageKind::Call;
1975 const ORIGIN: Origin = Origin::Csms;
1976 type Response = RemoteStartTransactionResponse;
1977}
1978
1979impl Confirmed for RemoteStartTransactionRequest {}
1980
1981#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1983pub struct RemoteStartTransactionResponse {
1984 pub status: RemoteStartStopStatus,
1986}
1987
1988impl RemoteStartTransactionResponse {
1989 #[must_use]
1991 pub fn new(status: RemoteStartStopStatus) -> Self {
1992 Self { status }
1993 }
1994}
1995
1996impl Validate for RemoteStartTransactionResponse {
1997 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1998 path.push_key("status");
1999 Validate::validate_at(&self.status, path, out);
2000 path.pop();
2001 }
2002}
2003
2004impl Sealed for RemoteStartTransactionResponse {}
2005impl Response for RemoteStartTransactionResponse {}
2006
2007#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2009pub struct RemoteStopTransactionRequest {
2010 #[serde(rename = "transactionId")]
2012 pub transaction_id: i32,
2013}
2014
2015impl RemoteStopTransactionRequest {
2016 #[must_use]
2018 pub fn new(transaction_id: i32) -> Self {
2019 Self { transaction_id }
2020 }
2021}
2022
2023impl Validate for RemoteStopTransactionRequest {
2024 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
2025}
2026
2027impl Sealed for RemoteStopTransactionRequest {}
2028impl Request for RemoteStopTransactionRequest {
2029 type Action = Action;
2030 const ACTION: Action = Action::RemoteStopTransaction;
2031 const KIND: MessageKind = MessageKind::Call;
2032 const ORIGIN: Origin = Origin::Csms;
2033 type Response = RemoteStopTransactionResponse;
2034}
2035
2036impl Confirmed for RemoteStopTransactionRequest {}
2037
2038#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2040pub struct RemoteStopTransactionResponse {
2041 pub status: RemoteStartStopStatus,
2043}
2044
2045impl RemoteStopTransactionResponse {
2046 #[must_use]
2048 pub fn new(status: RemoteStartStopStatus) -> Self {
2049 Self { status }
2050 }
2051}
2052
2053impl Validate for RemoteStopTransactionResponse {
2054 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2055 path.push_key("status");
2056 Validate::validate_at(&self.status, path, out);
2057 path.pop();
2058 }
2059}
2060
2061impl Sealed for RemoteStopTransactionResponse {}
2062impl Response for RemoteStopTransactionResponse {}
2063
2064#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2066pub struct ReserveNowRequest {
2067 #[serde(rename = "connectorId")]
2069 pub connector_id: i32,
2070 #[serde(rename = "expiryDate")]
2072 pub expiry_date: crate::types::DateTime,
2073 #[serde(rename = "idTag")]
2075 pub id_tag: String,
2076 #[serde(rename = "reservationId")]
2078 pub reservation_id: i32,
2079 #[serde(rename = "parentIdTag")]
2081 #[serde(default, skip_serializing_if = "Option::is_none")]
2082 pub parent_id_tag: Option<String>,
2083}
2084
2085impl ReserveNowRequest {
2086 #[must_use]
2088 pub fn new(
2089 connector_id: i32,
2090 expiry_date: impl Into<crate::types::DateTime>,
2091 id_tag: impl Into<String>,
2092 reservation_id: i32,
2093 ) -> Self {
2094 Self {
2095 connector_id,
2096 expiry_date: expiry_date.into(),
2097 id_tag: id_tag.into(),
2098 reservation_id,
2099 parent_id_tag: None,
2100 }
2101 }
2102
2103 #[must_use]
2105 pub fn with_parent_id_tag(mut self, value: impl Into<String>) -> Self {
2106 self.parent_id_tag = Some(value.into());
2107 self
2108 }
2109}
2110
2111impl Validate for ReserveNowRequest {
2112 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2113 path.push_key("idTag");
2114 validate::string(self.id_tag.as_str(), None, Some(20), path, out);
2115 path.pop();
2116 path.push_key("parentIdTag");
2117 if let Some(value) = &self.parent_id_tag {
2118 validate::string(value.as_str(), None, Some(20), path, out);
2119 }
2120 path.pop();
2121 }
2122}
2123
2124impl Sealed for ReserveNowRequest {}
2125impl Request for ReserveNowRequest {
2126 type Action = Action;
2127 const ACTION: Action = Action::ReserveNow;
2128 const KIND: MessageKind = MessageKind::Call;
2129 const ORIGIN: Origin = Origin::Csms;
2130 type Response = ReserveNowResponse;
2131}
2132
2133impl Confirmed for ReserveNowRequest {}
2134
2135#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2137pub struct ReserveNowResponse {
2138 pub status: ReservationStatus,
2140}
2141
2142impl ReserveNowResponse {
2143 #[must_use]
2145 pub fn new(status: ReservationStatus) -> Self {
2146 Self { status }
2147 }
2148}
2149
2150impl Validate for ReserveNowResponse {
2151 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2152 path.push_key("status");
2153 Validate::validate_at(&self.status, path, out);
2154 path.pop();
2155 }
2156}
2157
2158impl Sealed for ReserveNowResponse {}
2159impl Response for ReserveNowResponse {}
2160
2161#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2163pub struct ResetRequest {
2164 pub r#type: ResetType,
2166}
2167
2168impl ResetRequest {
2169 #[must_use]
2171 pub fn new(r#type: ResetType) -> Self {
2172 Self { r#type }
2173 }
2174}
2175
2176impl Validate for ResetRequest {
2177 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2178 path.push_key("type");
2179 Validate::validate_at(&self.r#type, path, out);
2180 path.pop();
2181 }
2182}
2183
2184impl Sealed for ResetRequest {}
2185impl Request for ResetRequest {
2186 type Action = Action;
2187 const ACTION: Action = Action::Reset;
2188 const KIND: MessageKind = MessageKind::Call;
2189 const ORIGIN: Origin = Origin::Csms;
2190 type Response = ResetResponse;
2191}
2192
2193impl Confirmed for ResetRequest {}
2194
2195#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2197pub struct ResetResponse {
2198 pub status: ResetStatus,
2200}
2201
2202impl ResetResponse {
2203 #[must_use]
2205 pub fn new(status: ResetStatus) -> Self {
2206 Self { status }
2207 }
2208}
2209
2210impl Validate for ResetResponse {
2211 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2212 path.push_key("status");
2213 Validate::validate_at(&self.status, path, out);
2214 path.pop();
2215 }
2216}
2217
2218impl Sealed for ResetResponse {}
2219impl Response for ResetResponse {}
2220
2221#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2223pub struct SecurityEventNotificationRequest {
2224 pub r#type: String,
2226 pub timestamp: crate::types::DateTime,
2228 #[serde(rename = "techInfo")]
2230 #[serde(default, skip_serializing_if = "Option::is_none")]
2231 pub tech_info: Option<String>,
2232}
2233
2234impl SecurityEventNotificationRequest {
2235 #[must_use]
2237 pub fn new(r#type: impl Into<String>, timestamp: impl Into<crate::types::DateTime>) -> Self {
2238 Self {
2239 r#type: r#type.into(),
2240 timestamp: timestamp.into(),
2241 tech_info: None,
2242 }
2243 }
2244
2245 #[must_use]
2247 pub fn with_tech_info(mut self, value: impl Into<String>) -> Self {
2248 self.tech_info = Some(value.into());
2249 self
2250 }
2251}
2252
2253impl Validate for SecurityEventNotificationRequest {
2254 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2255 path.push_key("type");
2256 validate::string(self.r#type.as_str(), None, Some(50), path, out);
2257 path.pop();
2258 path.push_key("techInfo");
2259 if let Some(value) = &self.tech_info {
2260 validate::string(value.as_str(), None, Some(255), path, out);
2261 }
2262 path.pop();
2263 }
2264}
2265
2266impl Sealed for SecurityEventNotificationRequest {}
2267impl Request for SecurityEventNotificationRequest {
2268 type Action = Action;
2269 const ACTION: Action = Action::SecurityEventNotification;
2270 const KIND: MessageKind = MessageKind::Call;
2271 const ORIGIN: Origin = Origin::ChargingStation;
2272 type Response = SecurityEventNotificationResponse;
2273}
2274
2275impl Confirmed for SecurityEventNotificationRequest {}
2276
2277#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2279pub struct SecurityEventNotificationResponse {}
2280
2281impl SecurityEventNotificationResponse {
2282 #[must_use]
2284 pub fn new() -> Self {
2285 Self::default()
2286 }
2287}
2288
2289impl Validate for SecurityEventNotificationResponse {
2290 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
2291}
2292
2293impl Sealed for SecurityEventNotificationResponse {}
2294impl Response for SecurityEventNotificationResponse {}
2295
2296#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2298pub struct SendLocalListRequest {
2299 #[serde(rename = "listVersion")]
2301 pub list_version: i32,
2302 #[serde(rename = "updateType")]
2304 pub update_type: UpdateType,
2305 #[serde(rename = "localAuthorizationList")]
2307 #[serde(default, skip_serializing_if = "Option::is_none")]
2308 pub local_authorization_list: Option<Vec<AuthorizationData>>,
2309}
2310
2311impl SendLocalListRequest {
2312 #[must_use]
2314 pub fn new(list_version: i32, update_type: UpdateType) -> Self {
2315 Self {
2316 list_version,
2317 update_type,
2318 local_authorization_list: None,
2319 }
2320 }
2321
2322 #[must_use]
2324 pub fn with_local_authorization_list(mut self, value: Vec<AuthorizationData>) -> Self {
2325 self.local_authorization_list = Some(value);
2326 self
2327 }
2328}
2329
2330impl Validate for SendLocalListRequest {
2331 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2332 path.push_key("updateType");
2333 Validate::validate_at(&self.update_type, path, out);
2334 path.pop();
2335 path.push_key("localAuthorizationList");
2336 if let Some(value) = &self.local_authorization_list {
2337 for (index, item) in value.iter().enumerate() {
2338 path.push_index(index);
2339 Validate::validate_at(item, path, out);
2340 path.pop();
2341 }
2342 }
2343 path.pop();
2344 }
2345}
2346
2347impl Sealed for SendLocalListRequest {}
2348impl Request for SendLocalListRequest {
2349 type Action = Action;
2350 const ACTION: Action = Action::SendLocalList;
2351 const KIND: MessageKind = MessageKind::Call;
2352 const ORIGIN: Origin = Origin::Csms;
2353 type Response = SendLocalListResponse;
2354}
2355
2356impl Confirmed for SendLocalListRequest {}
2357
2358#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2360pub struct SendLocalListResponse {
2361 pub status: UpdateStatus,
2363}
2364
2365impl SendLocalListResponse {
2366 #[must_use]
2368 pub fn new(status: UpdateStatus) -> Self {
2369 Self { status }
2370 }
2371}
2372
2373impl Validate for SendLocalListResponse {
2374 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2375 path.push_key("status");
2376 Validate::validate_at(&self.status, path, out);
2377 path.pop();
2378 }
2379}
2380
2381impl Sealed for SendLocalListResponse {}
2382impl Response for SendLocalListResponse {}
2383
2384#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2386pub struct SetChargingProfileRequest {
2387 #[serde(rename = "connectorId")]
2389 pub connector_id: i32,
2390 #[serde(rename = "csChargingProfiles")]
2392 pub cs_charging_profiles: ChargingProfile,
2393}
2394
2395impl SetChargingProfileRequest {
2396 #[must_use]
2398 pub fn new(connector_id: i32, cs_charging_profiles: ChargingProfile) -> Self {
2399 Self {
2400 connector_id,
2401 cs_charging_profiles,
2402 }
2403 }
2404}
2405
2406impl Validate for SetChargingProfileRequest {
2407 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2408 path.push_key("csChargingProfiles");
2409 Validate::validate_at(&self.cs_charging_profiles, path, out);
2410 path.pop();
2411 }
2412}
2413
2414impl Sealed for SetChargingProfileRequest {}
2415impl Request for SetChargingProfileRequest {
2416 type Action = Action;
2417 const ACTION: Action = Action::SetChargingProfile;
2418 const KIND: MessageKind = MessageKind::Call;
2419 const ORIGIN: Origin = Origin::Csms;
2420 type Response = SetChargingProfileResponse;
2421}
2422
2423impl Confirmed for SetChargingProfileRequest {}
2424
2425#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2427pub struct SetChargingProfileResponse {
2428 pub status: ChargingProfileStatus,
2430}
2431
2432impl SetChargingProfileResponse {
2433 #[must_use]
2435 pub fn new(status: ChargingProfileStatus) -> Self {
2436 Self { status }
2437 }
2438}
2439
2440impl Validate for SetChargingProfileResponse {
2441 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2442 path.push_key("status");
2443 Validate::validate_at(&self.status, path, out);
2444 path.pop();
2445 }
2446}
2447
2448impl Sealed for SetChargingProfileResponse {}
2449impl Response for SetChargingProfileResponse {}
2450
2451#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2453pub struct SignCertificateRequest {
2454 pub csr: String,
2456}
2457
2458impl SignCertificateRequest {
2459 #[must_use]
2461 pub fn new(csr: impl Into<String>) -> Self {
2462 Self { csr: csr.into() }
2463 }
2464}
2465
2466impl Validate for SignCertificateRequest {
2467 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2468 path.push_key("csr");
2469 validate::string(self.csr.as_str(), None, Some(5500), path, out);
2470 path.pop();
2471 }
2472}
2473
2474impl Sealed for SignCertificateRequest {}
2475impl Request for SignCertificateRequest {
2476 type Action = Action;
2477 const ACTION: Action = Action::SignCertificate;
2478 const KIND: MessageKind = MessageKind::Call;
2479 const ORIGIN: Origin = Origin::ChargingStation;
2480 type Response = SignCertificateResponse;
2481}
2482
2483impl Confirmed for SignCertificateRequest {}
2484
2485#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2487pub struct SignCertificateResponse {
2488 pub status: GenericStatus,
2490}
2491
2492impl SignCertificateResponse {
2493 #[must_use]
2495 pub fn new(status: GenericStatus) -> Self {
2496 Self { status }
2497 }
2498}
2499
2500impl Validate for SignCertificateResponse {
2501 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2502 path.push_key("status");
2503 Validate::validate_at(&self.status, path, out);
2504 path.pop();
2505 }
2506}
2507
2508impl Sealed for SignCertificateResponse {}
2509impl Response for SignCertificateResponse {}
2510
2511#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2513pub struct SignedFirmwareStatusNotificationRequest {
2514 pub status: SignedFirmwareStatus,
2516 #[serde(rename = "requestId")]
2518 #[serde(default, skip_serializing_if = "Option::is_none")]
2519 pub request_id: Option<i32>,
2520}
2521
2522impl SignedFirmwareStatusNotificationRequest {
2523 #[must_use]
2525 pub fn new(status: SignedFirmwareStatus) -> Self {
2526 Self {
2527 status,
2528 request_id: None,
2529 }
2530 }
2531
2532 #[must_use]
2534 pub fn with_request_id(mut self, value: i32) -> Self {
2535 self.request_id = Some(value);
2536 self
2537 }
2538}
2539
2540impl Validate for SignedFirmwareStatusNotificationRequest {
2541 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2542 path.push_key("status");
2543 Validate::validate_at(&self.status, path, out);
2544 path.pop();
2545 }
2546}
2547
2548impl Sealed for SignedFirmwareStatusNotificationRequest {}
2549impl Request for SignedFirmwareStatusNotificationRequest {
2550 type Action = Action;
2551 const ACTION: Action = Action::SignedFirmwareStatusNotification;
2552 const KIND: MessageKind = MessageKind::Call;
2553 const ORIGIN: Origin = Origin::ChargingStation;
2554 type Response = SignedFirmwareStatusNotificationResponse;
2555}
2556
2557impl Confirmed for SignedFirmwareStatusNotificationRequest {}
2558
2559#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2561pub struct SignedFirmwareStatusNotificationResponse {}
2562
2563impl SignedFirmwareStatusNotificationResponse {
2564 #[must_use]
2566 pub fn new() -> Self {
2567 Self::default()
2568 }
2569}
2570
2571impl Validate for SignedFirmwareStatusNotificationResponse {
2572 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
2573}
2574
2575impl Sealed for SignedFirmwareStatusNotificationResponse {}
2576impl Response for SignedFirmwareStatusNotificationResponse {}
2577
2578#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2580pub struct SignedUpdateFirmwareRequest {
2581 #[serde(rename = "requestId")]
2583 pub request_id: i32,
2584 pub firmware: Firmware,
2586 #[serde(default, skip_serializing_if = "Option::is_none")]
2588 pub retries: Option<i32>,
2589 #[serde(rename = "retryInterval")]
2591 #[serde(default, skip_serializing_if = "Option::is_none")]
2592 pub retry_interval: Option<i32>,
2593}
2594
2595impl SignedUpdateFirmwareRequest {
2596 #[must_use]
2598 pub fn new(request_id: i32, firmware: Firmware) -> Self {
2599 Self {
2600 request_id,
2601 firmware,
2602 retries: None,
2603 retry_interval: None,
2604 }
2605 }
2606
2607 #[must_use]
2609 pub fn with_retries(mut self, value: i32) -> Self {
2610 self.retries = Some(value);
2611 self
2612 }
2613
2614 #[must_use]
2616 pub fn with_retry_interval(mut self, value: i32) -> Self {
2617 self.retry_interval = Some(value);
2618 self
2619 }
2620}
2621
2622impl Validate for SignedUpdateFirmwareRequest {
2623 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2624 path.push_key("firmware");
2625 Validate::validate_at(&self.firmware, path, out);
2626 path.pop();
2627 }
2628}
2629
2630impl Sealed for SignedUpdateFirmwareRequest {}
2631impl Request for SignedUpdateFirmwareRequest {
2632 type Action = Action;
2633 const ACTION: Action = Action::SignedUpdateFirmware;
2634 const KIND: MessageKind = MessageKind::Call;
2635 const ORIGIN: Origin = Origin::Csms;
2636 type Response = SignedUpdateFirmwareResponse;
2637}
2638
2639impl Confirmed for SignedUpdateFirmwareRequest {}
2640
2641#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2643pub struct SignedUpdateFirmwareResponse {
2644 pub status: UpdateFirmwareStatus,
2646}
2647
2648impl SignedUpdateFirmwareResponse {
2649 #[must_use]
2651 pub fn new(status: UpdateFirmwareStatus) -> Self {
2652 Self { status }
2653 }
2654}
2655
2656impl Validate for SignedUpdateFirmwareResponse {
2657 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2658 path.push_key("status");
2659 Validate::validate_at(&self.status, path, out);
2660 path.pop();
2661 }
2662}
2663
2664impl Sealed for SignedUpdateFirmwareResponse {}
2665impl Response for SignedUpdateFirmwareResponse {}
2666
2667#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2669pub struct StartTransactionRequest {
2670 #[serde(rename = "connectorId")]
2672 pub connector_id: i32,
2673 #[serde(rename = "idTag")]
2675 pub id_tag: String,
2676 #[serde(rename = "meterStart")]
2678 pub meter_start: i32,
2679 pub timestamp: crate::types::DateTime,
2681 #[serde(rename = "reservationId")]
2683 #[serde(default, skip_serializing_if = "Option::is_none")]
2684 pub reservation_id: Option<i32>,
2685}
2686
2687impl StartTransactionRequest {
2688 #[must_use]
2690 pub fn new(
2691 connector_id: i32,
2692 id_tag: impl Into<String>,
2693 meter_start: i32,
2694 timestamp: impl Into<crate::types::DateTime>,
2695 ) -> Self {
2696 Self {
2697 connector_id,
2698 id_tag: id_tag.into(),
2699 meter_start,
2700 timestamp: timestamp.into(),
2701 reservation_id: None,
2702 }
2703 }
2704
2705 #[must_use]
2707 pub fn with_reservation_id(mut self, value: i32) -> Self {
2708 self.reservation_id = Some(value);
2709 self
2710 }
2711}
2712
2713impl Validate for StartTransactionRequest {
2714 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2715 path.push_key("idTag");
2716 validate::string(self.id_tag.as_str(), None, Some(20), path, out);
2717 path.pop();
2718 }
2719}
2720
2721impl Sealed for StartTransactionRequest {}
2722impl Request for StartTransactionRequest {
2723 type Action = Action;
2724 const ACTION: Action = Action::StartTransaction;
2725 const KIND: MessageKind = MessageKind::Call;
2726 const ORIGIN: Origin = Origin::ChargingStation;
2727 type Response = StartTransactionResponse;
2728}
2729
2730impl Confirmed for StartTransactionRequest {}
2731
2732#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2734pub struct StartTransactionResponse {
2735 #[serde(rename = "idTagInfo")]
2737 pub id_tag_info: IdTagInfo,
2738 #[serde(rename = "transactionId")]
2740 pub transaction_id: i32,
2741}
2742
2743impl StartTransactionResponse {
2744 #[must_use]
2746 pub fn new(id_tag_info: IdTagInfo, transaction_id: i32) -> Self {
2747 Self {
2748 id_tag_info,
2749 transaction_id,
2750 }
2751 }
2752}
2753
2754impl Validate for StartTransactionResponse {
2755 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2756 path.push_key("idTagInfo");
2757 Validate::validate_at(&self.id_tag_info, path, out);
2758 path.pop();
2759 }
2760}
2761
2762impl Sealed for StartTransactionResponse {}
2763impl Response for StartTransactionResponse {}
2764
2765#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2767pub struct StatusNotificationRequest {
2768 #[serde(rename = "connectorId")]
2770 pub connector_id: i32,
2771 #[serde(rename = "errorCode")]
2773 pub error_code: ChargePointErrorCode,
2774 pub status: ChargePointStatus,
2776 #[serde(default, skip_serializing_if = "Option::is_none")]
2778 pub info: Option<String>,
2779 #[serde(default, skip_serializing_if = "Option::is_none")]
2781 pub timestamp: Option<crate::types::DateTime>,
2782 #[serde(rename = "vendorId")]
2784 #[serde(default, skip_serializing_if = "Option::is_none")]
2785 pub vendor_id: Option<String>,
2786 #[serde(rename = "vendorErrorCode")]
2788 #[serde(default, skip_serializing_if = "Option::is_none")]
2789 pub vendor_error_code: Option<String>,
2790}
2791
2792impl StatusNotificationRequest {
2793 #[must_use]
2795 pub fn new(
2796 connector_id: i32,
2797 error_code: ChargePointErrorCode,
2798 status: ChargePointStatus,
2799 ) -> Self {
2800 Self {
2801 connector_id,
2802 error_code,
2803 status,
2804 info: None,
2805 timestamp: None,
2806 vendor_id: None,
2807 vendor_error_code: None,
2808 }
2809 }
2810
2811 #[must_use]
2813 pub fn with_info(mut self, value: impl Into<String>) -> Self {
2814 self.info = Some(value.into());
2815 self
2816 }
2817
2818 #[must_use]
2820 pub fn with_timestamp(mut self, value: impl Into<crate::types::DateTime>) -> Self {
2821 self.timestamp = Some(value.into());
2822 self
2823 }
2824
2825 #[must_use]
2827 pub fn with_vendor_id(mut self, value: impl Into<String>) -> Self {
2828 self.vendor_id = Some(value.into());
2829 self
2830 }
2831
2832 #[must_use]
2834 pub fn with_vendor_error_code(mut self, value: impl Into<String>) -> Self {
2835 self.vendor_error_code = Some(value.into());
2836 self
2837 }
2838}
2839
2840impl Validate for StatusNotificationRequest {
2841 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2842 path.push_key("errorCode");
2843 Validate::validate_at(&self.error_code, path, out);
2844 path.pop();
2845 path.push_key("status");
2846 Validate::validate_at(&self.status, path, out);
2847 path.pop();
2848 path.push_key("info");
2849 if let Some(value) = &self.info {
2850 validate::string(value.as_str(), None, Some(50), path, out);
2851 }
2852 path.pop();
2853 path.push_key("vendorId");
2854 if let Some(value) = &self.vendor_id {
2855 validate::string(value.as_str(), None, Some(255), path, out);
2856 }
2857 path.pop();
2858 path.push_key("vendorErrorCode");
2859 if let Some(value) = &self.vendor_error_code {
2860 validate::string(value.as_str(), None, Some(50), path, out);
2861 }
2862 path.pop();
2863 }
2864}
2865
2866impl Sealed for StatusNotificationRequest {}
2867impl Request for StatusNotificationRequest {
2868 type Action = Action;
2869 const ACTION: Action = Action::StatusNotification;
2870 const KIND: MessageKind = MessageKind::Call;
2871 const ORIGIN: Origin = Origin::ChargingStation;
2872 type Response = StatusNotificationResponse;
2873}
2874
2875impl Confirmed for StatusNotificationRequest {}
2876
2877#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2879pub struct StatusNotificationResponse {}
2880
2881impl StatusNotificationResponse {
2882 #[must_use]
2884 pub fn new() -> Self {
2885 Self::default()
2886 }
2887}
2888
2889impl Validate for StatusNotificationResponse {
2890 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
2891}
2892
2893impl Sealed for StatusNotificationResponse {}
2894impl Response for StatusNotificationResponse {}
2895
2896#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2898pub struct StopTransactionRequest {
2899 #[serde(rename = "meterStop")]
2901 pub meter_stop: i32,
2902 pub timestamp: crate::types::DateTime,
2904 #[serde(rename = "transactionId")]
2906 pub transaction_id: i32,
2907 #[serde(rename = "idTag")]
2909 #[serde(default, skip_serializing_if = "Option::is_none")]
2910 pub id_tag: Option<String>,
2911 #[serde(default, skip_serializing_if = "Option::is_none")]
2913 pub reason: Option<Reason>,
2914 #[serde(rename = "transactionData")]
2916 #[serde(default, skip_serializing_if = "Option::is_none")]
2917 pub transaction_data: Option<Vec<MeterValue>>,
2918}
2919
2920impl StopTransactionRequest {
2921 #[must_use]
2923 pub fn new(
2924 meter_stop: i32,
2925 timestamp: impl Into<crate::types::DateTime>,
2926 transaction_id: i32,
2927 ) -> Self {
2928 Self {
2929 meter_stop,
2930 timestamp: timestamp.into(),
2931 transaction_id,
2932 id_tag: None,
2933 reason: None,
2934 transaction_data: None,
2935 }
2936 }
2937
2938 #[must_use]
2940 pub fn with_id_tag(mut self, value: impl Into<String>) -> Self {
2941 self.id_tag = Some(value.into());
2942 self
2943 }
2944
2945 #[must_use]
2947 pub fn with_reason(mut self, value: Reason) -> Self {
2948 self.reason = Some(value);
2949 self
2950 }
2951
2952 #[must_use]
2954 pub fn with_transaction_data(mut self, value: Vec<MeterValue>) -> Self {
2955 self.transaction_data = Some(value);
2956 self
2957 }
2958}
2959
2960impl Validate for StopTransactionRequest {
2961 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2962 path.push_key("idTag");
2963 if let Some(value) = &self.id_tag {
2964 validate::string(value.as_str(), None, Some(20), path, out);
2965 }
2966 path.pop();
2967 path.push_key("reason");
2968 if let Some(value) = &self.reason {
2969 Validate::validate_at(value, path, out);
2970 }
2971 path.pop();
2972 path.push_key("transactionData");
2973 if let Some(value) = &self.transaction_data {
2974 for (index, item) in value.iter().enumerate() {
2975 path.push_index(index);
2976 Validate::validate_at(item, path, out);
2977 path.pop();
2978 }
2979 }
2980 path.pop();
2981 }
2982}
2983
2984impl Sealed for StopTransactionRequest {}
2985impl Request for StopTransactionRequest {
2986 type Action = Action;
2987 const ACTION: Action = Action::StopTransaction;
2988 const KIND: MessageKind = MessageKind::Call;
2989 const ORIGIN: Origin = Origin::ChargingStation;
2990 type Response = StopTransactionResponse;
2991}
2992
2993impl Confirmed for StopTransactionRequest {}
2994
2995#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2997pub struct StopTransactionResponse {
2998 #[serde(rename = "idTagInfo")]
3000 #[serde(default, skip_serializing_if = "Option::is_none")]
3001 pub id_tag_info: Option<IdTagInfo>,
3002}
3003
3004impl StopTransactionResponse {
3005 #[must_use]
3007 pub fn new() -> Self {
3008 Self::default()
3009 }
3010
3011 #[must_use]
3013 pub fn with_id_tag_info(mut self, value: IdTagInfo) -> Self {
3014 self.id_tag_info = Some(value);
3015 self
3016 }
3017}
3018
3019impl Validate for StopTransactionResponse {
3020 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3021 path.push_key("idTagInfo");
3022 if let Some(value) = &self.id_tag_info {
3023 Validate::validate_at(value, path, out);
3024 }
3025 path.pop();
3026 }
3027}
3028
3029impl Sealed for StopTransactionResponse {}
3030impl Response for StopTransactionResponse {}
3031
3032#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3034pub struct TriggerMessageRequest {
3035 #[serde(rename = "requestedMessage")]
3037 pub requested_message: MessageTrigger,
3038 #[serde(rename = "connectorId")]
3040 #[serde(default, skip_serializing_if = "Option::is_none")]
3041 pub connector_id: Option<i32>,
3042}
3043
3044impl TriggerMessageRequest {
3045 #[must_use]
3047 pub fn new(requested_message: MessageTrigger) -> Self {
3048 Self {
3049 requested_message,
3050 connector_id: None,
3051 }
3052 }
3053
3054 #[must_use]
3056 pub fn with_connector_id(mut self, value: i32) -> Self {
3057 self.connector_id = Some(value);
3058 self
3059 }
3060}
3061
3062impl Validate for TriggerMessageRequest {
3063 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3064 path.push_key("requestedMessage");
3065 Validate::validate_at(&self.requested_message, path, out);
3066 path.pop();
3067 }
3068}
3069
3070impl Sealed for TriggerMessageRequest {}
3071impl Request for TriggerMessageRequest {
3072 type Action = Action;
3073 const ACTION: Action = Action::TriggerMessage;
3074 const KIND: MessageKind = MessageKind::Call;
3075 const ORIGIN: Origin = Origin::Csms;
3076 type Response = TriggerMessageResponse;
3077}
3078
3079impl Confirmed for TriggerMessageRequest {}
3080
3081#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3083pub struct TriggerMessageResponse {
3084 pub status: TriggerMessageStatus,
3086}
3087
3088impl TriggerMessageResponse {
3089 #[must_use]
3091 pub fn new(status: TriggerMessageStatus) -> Self {
3092 Self { status }
3093 }
3094}
3095
3096impl Validate for TriggerMessageResponse {
3097 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3098 path.push_key("status");
3099 Validate::validate_at(&self.status, path, out);
3100 path.pop();
3101 }
3102}
3103
3104impl Sealed for TriggerMessageResponse {}
3105impl Response for TriggerMessageResponse {}
3106
3107#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3109pub struct UnlockConnectorRequest {
3110 #[serde(rename = "connectorId")]
3112 pub connector_id: i32,
3113}
3114
3115impl UnlockConnectorRequest {
3116 #[must_use]
3118 pub fn new(connector_id: i32) -> Self {
3119 Self { connector_id }
3120 }
3121}
3122
3123impl Validate for UnlockConnectorRequest {
3124 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
3125}
3126
3127impl Sealed for UnlockConnectorRequest {}
3128impl Request for UnlockConnectorRequest {
3129 type Action = Action;
3130 const ACTION: Action = Action::UnlockConnector;
3131 const KIND: MessageKind = MessageKind::Call;
3132 const ORIGIN: Origin = Origin::Csms;
3133 type Response = UnlockConnectorResponse;
3134}
3135
3136impl Confirmed for UnlockConnectorRequest {}
3137
3138#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3140pub struct UnlockConnectorResponse {
3141 pub status: UnlockStatus,
3143}
3144
3145impl UnlockConnectorResponse {
3146 #[must_use]
3148 pub fn new(status: UnlockStatus) -> Self {
3149 Self { status }
3150 }
3151}
3152
3153impl Validate for UnlockConnectorResponse {
3154 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3155 path.push_key("status");
3156 Validate::validate_at(&self.status, path, out);
3157 path.pop();
3158 }
3159}
3160
3161impl Sealed for UnlockConnectorResponse {}
3162impl Response for UnlockConnectorResponse {}
3163
3164#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3166pub struct UpdateFirmwareRequest {
3167 pub location: String,
3169 #[serde(rename = "retrieveDate")]
3171 pub retrieve_date: crate::types::DateTime,
3172 #[serde(default, skip_serializing_if = "Option::is_none")]
3174 pub retries: Option<i32>,
3175 #[serde(rename = "retryInterval")]
3177 #[serde(default, skip_serializing_if = "Option::is_none")]
3178 pub retry_interval: Option<i32>,
3179}
3180
3181impl UpdateFirmwareRequest {
3182 #[must_use]
3184 pub fn new(
3185 location: impl Into<String>,
3186 retrieve_date: impl Into<crate::types::DateTime>,
3187 ) -> Self {
3188 Self {
3189 location: location.into(),
3190 retrieve_date: retrieve_date.into(),
3191 retries: None,
3192 retry_interval: None,
3193 }
3194 }
3195
3196 #[must_use]
3198 pub fn with_retries(mut self, value: i32) -> Self {
3199 self.retries = Some(value);
3200 self
3201 }
3202
3203 #[must_use]
3205 pub fn with_retry_interval(mut self, value: i32) -> Self {
3206 self.retry_interval = Some(value);
3207 self
3208 }
3209}
3210
3211impl Validate for UpdateFirmwareRequest {
3212 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
3213}
3214
3215impl Sealed for UpdateFirmwareRequest {}
3216impl Request for UpdateFirmwareRequest {
3217 type Action = Action;
3218 const ACTION: Action = Action::UpdateFirmware;
3219 const KIND: MessageKind = MessageKind::Call;
3220 const ORIGIN: Origin = Origin::Csms;
3221 type Response = UpdateFirmwareResponse;
3222}
3223
3224impl Confirmed for UpdateFirmwareRequest {}
3225
3226#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
3228pub struct UpdateFirmwareResponse {}
3229
3230impl UpdateFirmwareResponse {
3231 #[must_use]
3233 pub fn new() -> Self {
3234 Self::default()
3235 }
3236}
3237
3238impl Validate for UpdateFirmwareResponse {
3239 fn validate_at(&self, _path: &mut ValidationPath, _out: &mut Violations) {}
3240}
3241
3242impl Sealed for UpdateFirmwareResponse {}
3243impl Response for UpdateFirmwareResponse {}