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 pub interval: i32,
248 pub status: RegistrationStatus,
250 #[serde(rename = "statusInfo")]
252 #[serde(default, skip_serializing_if = "Option::is_none")]
253 pub status_info: Option<StatusInfo>,
254 #[serde(rename = "customData")]
256 #[serde(default, skip_serializing_if = "Option::is_none")]
257 pub custom_data: Option<crate::types::CustomData>,
258}
259
260impl BootNotificationResponse {
261 #[must_use]
263 pub fn new(
264 current_time: impl Into<crate::types::DateTime>,
265 interval: i32,
266 status: RegistrationStatus,
267 ) -> Self {
268 Self {
269 current_time: current_time.into(),
270 interval,
271 status,
272 status_info: None,
273 custom_data: None,
274 }
275 }
276
277 #[must_use]
279 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
280 self.status_info = Some(value);
281 self
282 }
283
284 #[must_use]
286 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
287 self.custom_data = Some(value);
288 self
289 }
290}
291
292impl Validate for BootNotificationResponse {
293 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
294 path.push_key("status");
295 Validate::validate_at(&self.status, path, out);
296 path.pop();
297 path.push_key("statusInfo");
298 if let Some(value) = &self.status_info {
299 Validate::validate_at(value, path, out);
300 }
301 path.pop();
302 path.push_key("customData");
303 if let Some(value) = &self.custom_data {
304 Validate::validate_at(value, path, out);
305 }
306 path.pop();
307 }
308}
309
310impl Sealed for BootNotificationResponse {}
311impl Response for BootNotificationResponse {}
312
313#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
315pub struct CancelReservationRequest {
316 #[serde(rename = "reservationId")]
318 pub reservation_id: i32,
319 #[serde(rename = "customData")]
321 #[serde(default, skip_serializing_if = "Option::is_none")]
322 pub custom_data: Option<crate::types::CustomData>,
323}
324
325impl CancelReservationRequest {
326 #[must_use]
328 pub fn new(reservation_id: i32) -> Self {
329 Self {
330 reservation_id,
331 custom_data: None,
332 }
333 }
334
335 #[must_use]
337 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
338 self.custom_data = Some(value);
339 self
340 }
341}
342
343impl Validate for CancelReservationRequest {
344 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
345 path.push_key("customData");
346 if let Some(value) = &self.custom_data {
347 Validate::validate_at(value, path, out);
348 }
349 path.pop();
350 }
351}
352
353impl Sealed for CancelReservationRequest {}
354impl Request for CancelReservationRequest {
355 type Action = Action;
356 const ACTION: Action = Action::CancelReservation;
357 const KIND: MessageKind = MessageKind::Call;
358 const ORIGIN: Origin = Origin::Csms;
359 type Response = CancelReservationResponse;
360}
361
362impl Confirmed for CancelReservationRequest {}
363
364#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
366pub struct CancelReservationResponse {
367 pub status: CancelReservationStatus,
369 #[serde(rename = "statusInfo")]
371 #[serde(default, skip_serializing_if = "Option::is_none")]
372 pub status_info: Option<StatusInfo>,
373 #[serde(rename = "customData")]
375 #[serde(default, skip_serializing_if = "Option::is_none")]
376 pub custom_data: Option<crate::types::CustomData>,
377}
378
379impl CancelReservationResponse {
380 #[must_use]
382 pub fn new(status: CancelReservationStatus) -> Self {
383 Self {
384 status,
385 status_info: None,
386 custom_data: None,
387 }
388 }
389
390 #[must_use]
392 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
393 self.status_info = Some(value);
394 self
395 }
396
397 #[must_use]
399 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
400 self.custom_data = Some(value);
401 self
402 }
403}
404
405impl Validate for CancelReservationResponse {
406 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
407 path.push_key("status");
408 Validate::validate_at(&self.status, path, out);
409 path.pop();
410 path.push_key("statusInfo");
411 if let Some(value) = &self.status_info {
412 Validate::validate_at(value, path, out);
413 }
414 path.pop();
415 path.push_key("customData");
416 if let Some(value) = &self.custom_data {
417 Validate::validate_at(value, path, out);
418 }
419 path.pop();
420 }
421}
422
423impl Sealed for CancelReservationResponse {}
424impl Response for CancelReservationResponse {}
425
426#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
428pub struct CertificateSignedRequest {
429 #[serde(rename = "certificateChain")]
433 pub certificate_chain: String,
434 #[serde(rename = "certificateType")]
436 #[serde(default, skip_serializing_if = "Option::is_none")]
437 pub certificate_type: Option<CertificateSigningUse>,
438 #[serde(rename = "customData")]
440 #[serde(default, skip_serializing_if = "Option::is_none")]
441 pub custom_data: Option<crate::types::CustomData>,
442}
443
444impl CertificateSignedRequest {
445 #[must_use]
447 pub fn new(certificate_chain: impl Into<String>) -> Self {
448 Self {
449 certificate_chain: certificate_chain.into(),
450 certificate_type: None,
451 custom_data: None,
452 }
453 }
454
455 #[must_use]
457 pub fn with_certificate_type(mut self, value: CertificateSigningUse) -> Self {
458 self.certificate_type = Some(value);
459 self
460 }
461
462 #[must_use]
464 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
465 self.custom_data = Some(value);
466 self
467 }
468}
469
470impl Validate for CertificateSignedRequest {
471 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
472 path.push_key("certificateChain");
473 validate::string(
474 self.certificate_chain.as_str(),
475 None,
476 Some(10000),
477 path,
478 out,
479 );
480 path.pop();
481 path.push_key("certificateType");
482 if let Some(value) = &self.certificate_type {
483 Validate::validate_at(value, path, out);
484 }
485 path.pop();
486 path.push_key("customData");
487 if let Some(value) = &self.custom_data {
488 Validate::validate_at(value, path, out);
489 }
490 path.pop();
491 }
492}
493
494impl Sealed for CertificateSignedRequest {}
495impl Request for CertificateSignedRequest {
496 type Action = Action;
497 const ACTION: Action = Action::CertificateSigned;
498 const KIND: MessageKind = MessageKind::Call;
499 const ORIGIN: Origin = Origin::Csms;
500 type Response = CertificateSignedResponse;
501}
502
503impl Confirmed for CertificateSignedRequest {}
504
505#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
507pub struct CertificateSignedResponse {
508 pub status: CertificateSignedStatus,
510 #[serde(rename = "statusInfo")]
512 #[serde(default, skip_serializing_if = "Option::is_none")]
513 pub status_info: Option<StatusInfo>,
514 #[serde(rename = "customData")]
516 #[serde(default, skip_serializing_if = "Option::is_none")]
517 pub custom_data: Option<crate::types::CustomData>,
518}
519
520impl CertificateSignedResponse {
521 #[must_use]
523 pub fn new(status: CertificateSignedStatus) -> Self {
524 Self {
525 status,
526 status_info: None,
527 custom_data: None,
528 }
529 }
530
531 #[must_use]
533 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
534 self.status_info = Some(value);
535 self
536 }
537
538 #[must_use]
540 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
541 self.custom_data = Some(value);
542 self
543 }
544}
545
546impl Validate for CertificateSignedResponse {
547 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
548 path.push_key("status");
549 Validate::validate_at(&self.status, path, out);
550 path.pop();
551 path.push_key("statusInfo");
552 if let Some(value) = &self.status_info {
553 Validate::validate_at(value, path, out);
554 }
555 path.pop();
556 path.push_key("customData");
557 if let Some(value) = &self.custom_data {
558 Validate::validate_at(value, path, out);
559 }
560 path.pop();
561 }
562}
563
564impl Sealed for CertificateSignedResponse {}
565impl Response for CertificateSignedResponse {}
566
567#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
569pub struct ChangeAvailabilityRequest {
570 #[serde(rename = "operationalStatus")]
572 pub operational_status: OperationalStatus,
573 #[serde(default, skip_serializing_if = "Option::is_none")]
575 pub evse: Option<EVSE>,
576 #[serde(rename = "customData")]
578 #[serde(default, skip_serializing_if = "Option::is_none")]
579 pub custom_data: Option<crate::types::CustomData>,
580}
581
582impl ChangeAvailabilityRequest {
583 #[must_use]
585 pub fn new(operational_status: OperationalStatus) -> Self {
586 Self {
587 operational_status,
588 evse: None,
589 custom_data: None,
590 }
591 }
592
593 #[must_use]
595 pub fn with_evse(mut self, value: EVSE) -> Self {
596 self.evse = Some(value);
597 self
598 }
599
600 #[must_use]
602 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
603 self.custom_data = Some(value);
604 self
605 }
606}
607
608impl Validate for ChangeAvailabilityRequest {
609 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
610 path.push_key("operationalStatus");
611 Validate::validate_at(&self.operational_status, path, out);
612 path.pop();
613 path.push_key("evse");
614 if let Some(value) = &self.evse {
615 Validate::validate_at(value, path, out);
616 }
617 path.pop();
618 path.push_key("customData");
619 if let Some(value) = &self.custom_data {
620 Validate::validate_at(value, path, out);
621 }
622 path.pop();
623 }
624}
625
626impl Sealed for ChangeAvailabilityRequest {}
627impl Request for ChangeAvailabilityRequest {
628 type Action = Action;
629 const ACTION: Action = Action::ChangeAvailability;
630 const KIND: MessageKind = MessageKind::Call;
631 const ORIGIN: Origin = Origin::Csms;
632 type Response = ChangeAvailabilityResponse;
633}
634
635impl Confirmed for ChangeAvailabilityRequest {}
636
637#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
639pub struct ChangeAvailabilityResponse {
640 pub status: ChangeAvailabilityStatus,
642 #[serde(rename = "statusInfo")]
644 #[serde(default, skip_serializing_if = "Option::is_none")]
645 pub status_info: Option<StatusInfo>,
646 #[serde(rename = "customData")]
648 #[serde(default, skip_serializing_if = "Option::is_none")]
649 pub custom_data: Option<crate::types::CustomData>,
650}
651
652impl ChangeAvailabilityResponse {
653 #[must_use]
655 pub fn new(status: ChangeAvailabilityStatus) -> Self {
656 Self {
657 status,
658 status_info: None,
659 custom_data: None,
660 }
661 }
662
663 #[must_use]
665 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
666 self.status_info = Some(value);
667 self
668 }
669
670 #[must_use]
672 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
673 self.custom_data = Some(value);
674 self
675 }
676}
677
678impl Validate for ChangeAvailabilityResponse {
679 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
680 path.push_key("status");
681 Validate::validate_at(&self.status, path, out);
682 path.pop();
683 path.push_key("statusInfo");
684 if let Some(value) = &self.status_info {
685 Validate::validate_at(value, path, out);
686 }
687 path.pop();
688 path.push_key("customData");
689 if let Some(value) = &self.custom_data {
690 Validate::validate_at(value, path, out);
691 }
692 path.pop();
693 }
694}
695
696impl Sealed for ChangeAvailabilityResponse {}
697impl Response for ChangeAvailabilityResponse {}
698
699#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
701pub struct ClearCacheRequest {
702 #[serde(rename = "customData")]
704 #[serde(default, skip_serializing_if = "Option::is_none")]
705 pub custom_data: Option<crate::types::CustomData>,
706}
707
708impl ClearCacheRequest {
709 #[must_use]
711 pub fn new() -> Self {
712 Self::default()
713 }
714
715 #[must_use]
717 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
718 self.custom_data = Some(value);
719 self
720 }
721}
722
723impl Validate for ClearCacheRequest {
724 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
725 path.push_key("customData");
726 if let Some(value) = &self.custom_data {
727 Validate::validate_at(value, path, out);
728 }
729 path.pop();
730 }
731}
732
733impl Sealed for ClearCacheRequest {}
734impl Request for ClearCacheRequest {
735 type Action = Action;
736 const ACTION: Action = Action::ClearCache;
737 const KIND: MessageKind = MessageKind::Call;
738 const ORIGIN: Origin = Origin::Csms;
739 type Response = ClearCacheResponse;
740}
741
742impl Confirmed for ClearCacheRequest {}
743
744#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
746pub struct ClearCacheResponse {
747 pub status: ClearCacheStatus,
749 #[serde(rename = "statusInfo")]
751 #[serde(default, skip_serializing_if = "Option::is_none")]
752 pub status_info: Option<StatusInfo>,
753 #[serde(rename = "customData")]
755 #[serde(default, skip_serializing_if = "Option::is_none")]
756 pub custom_data: Option<crate::types::CustomData>,
757}
758
759impl ClearCacheResponse {
760 #[must_use]
762 pub fn new(status: ClearCacheStatus) -> Self {
763 Self {
764 status,
765 status_info: None,
766 custom_data: None,
767 }
768 }
769
770 #[must_use]
772 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
773 self.status_info = Some(value);
774 self
775 }
776
777 #[must_use]
779 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
780 self.custom_data = Some(value);
781 self
782 }
783}
784
785impl Validate for ClearCacheResponse {
786 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
787 path.push_key("status");
788 Validate::validate_at(&self.status, path, out);
789 path.pop();
790 path.push_key("statusInfo");
791 if let Some(value) = &self.status_info {
792 Validate::validate_at(value, path, out);
793 }
794 path.pop();
795 path.push_key("customData");
796 if let Some(value) = &self.custom_data {
797 Validate::validate_at(value, path, out);
798 }
799 path.pop();
800 }
801}
802
803impl Sealed for ClearCacheResponse {}
804impl Response for ClearCacheResponse {}
805
806#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
808pub struct ClearChargingProfileRequest {
809 #[serde(rename = "chargingProfileId")]
811 #[serde(default, skip_serializing_if = "Option::is_none")]
812 pub charging_profile_id: Option<i32>,
813 #[serde(rename = "chargingProfileCriteria")]
815 #[serde(default, skip_serializing_if = "Option::is_none")]
816 pub charging_profile_criteria: Option<ClearChargingProfile>,
817 #[serde(rename = "customData")]
819 #[serde(default, skip_serializing_if = "Option::is_none")]
820 pub custom_data: Option<crate::types::CustomData>,
821}
822
823impl ClearChargingProfileRequest {
824 #[must_use]
826 pub fn new() -> Self {
827 Self::default()
828 }
829
830 #[must_use]
832 pub fn with_charging_profile_id(mut self, value: i32) -> Self {
833 self.charging_profile_id = Some(value);
834 self
835 }
836
837 #[must_use]
839 pub fn with_charging_profile_criteria(mut self, value: ClearChargingProfile) -> Self {
840 self.charging_profile_criteria = Some(value);
841 self
842 }
843
844 #[must_use]
846 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
847 self.custom_data = Some(value);
848 self
849 }
850}
851
852impl Validate for ClearChargingProfileRequest {
853 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
854 path.push_key("chargingProfileCriteria");
855 if let Some(value) = &self.charging_profile_criteria {
856 Validate::validate_at(value, path, out);
857 }
858 path.pop();
859 path.push_key("customData");
860 if let Some(value) = &self.custom_data {
861 Validate::validate_at(value, path, out);
862 }
863 path.pop();
864 }
865}
866
867impl Sealed for ClearChargingProfileRequest {}
868impl Request for ClearChargingProfileRequest {
869 type Action = Action;
870 const ACTION: Action = Action::ClearChargingProfile;
871 const KIND: MessageKind = MessageKind::Call;
872 const ORIGIN: Origin = Origin::Csms;
873 type Response = ClearChargingProfileResponse;
874}
875
876impl Confirmed for ClearChargingProfileRequest {}
877
878#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
880pub struct ClearChargingProfileResponse {
881 pub status: ClearChargingProfileStatus,
883 #[serde(rename = "statusInfo")]
885 #[serde(default, skip_serializing_if = "Option::is_none")]
886 pub status_info: Option<StatusInfo>,
887 #[serde(rename = "customData")]
889 #[serde(default, skip_serializing_if = "Option::is_none")]
890 pub custom_data: Option<crate::types::CustomData>,
891}
892
893impl ClearChargingProfileResponse {
894 #[must_use]
896 pub fn new(status: ClearChargingProfileStatus) -> Self {
897 Self {
898 status,
899 status_info: None,
900 custom_data: None,
901 }
902 }
903
904 #[must_use]
906 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
907 self.status_info = Some(value);
908 self
909 }
910
911 #[must_use]
913 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
914 self.custom_data = Some(value);
915 self
916 }
917}
918
919impl Validate for ClearChargingProfileResponse {
920 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
921 path.push_key("status");
922 Validate::validate_at(&self.status, path, out);
923 path.pop();
924 path.push_key("statusInfo");
925 if let Some(value) = &self.status_info {
926 Validate::validate_at(value, path, out);
927 }
928 path.pop();
929 path.push_key("customData");
930 if let Some(value) = &self.custom_data {
931 Validate::validate_at(value, path, out);
932 }
933 path.pop();
934 }
935}
936
937impl Sealed for ClearChargingProfileResponse {}
938impl Response for ClearChargingProfileResponse {}
939
940#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
942pub struct ClearDisplayMessageRequest {
943 pub id: i32,
945 #[serde(rename = "customData")]
947 #[serde(default, skip_serializing_if = "Option::is_none")]
948 pub custom_data: Option<crate::types::CustomData>,
949}
950
951impl ClearDisplayMessageRequest {
952 #[must_use]
954 pub fn new(id: i32) -> Self {
955 Self {
956 id,
957 custom_data: None,
958 }
959 }
960
961 #[must_use]
963 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
964 self.custom_data = Some(value);
965 self
966 }
967}
968
969impl Validate for ClearDisplayMessageRequest {
970 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
971 path.push_key("customData");
972 if let Some(value) = &self.custom_data {
973 Validate::validate_at(value, path, out);
974 }
975 path.pop();
976 }
977}
978
979impl Sealed for ClearDisplayMessageRequest {}
980impl Request for ClearDisplayMessageRequest {
981 type Action = Action;
982 const ACTION: Action = Action::ClearDisplayMessage;
983 const KIND: MessageKind = MessageKind::Call;
984 const ORIGIN: Origin = Origin::Csms;
985 type Response = ClearDisplayMessageResponse;
986}
987
988impl Confirmed for ClearDisplayMessageRequest {}
989
990#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
992pub struct ClearDisplayMessageResponse {
993 pub status: ClearMessageStatus,
995 #[serde(rename = "statusInfo")]
997 #[serde(default, skip_serializing_if = "Option::is_none")]
998 pub status_info: Option<StatusInfo>,
999 #[serde(rename = "customData")]
1001 #[serde(default, skip_serializing_if = "Option::is_none")]
1002 pub custom_data: Option<crate::types::CustomData>,
1003}
1004
1005impl ClearDisplayMessageResponse {
1006 #[must_use]
1008 pub fn new(status: ClearMessageStatus) -> Self {
1009 Self {
1010 status,
1011 status_info: None,
1012 custom_data: None,
1013 }
1014 }
1015
1016 #[must_use]
1018 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1019 self.status_info = Some(value);
1020 self
1021 }
1022
1023 #[must_use]
1025 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1026 self.custom_data = Some(value);
1027 self
1028 }
1029}
1030
1031impl Validate for ClearDisplayMessageResponse {
1032 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1033 path.push_key("status");
1034 Validate::validate_at(&self.status, path, out);
1035 path.pop();
1036 path.push_key("statusInfo");
1037 if let Some(value) = &self.status_info {
1038 Validate::validate_at(value, path, out);
1039 }
1040 path.pop();
1041 path.push_key("customData");
1042 if let Some(value) = &self.custom_data {
1043 Validate::validate_at(value, path, out);
1044 }
1045 path.pop();
1046 }
1047}
1048
1049impl Sealed for ClearDisplayMessageResponse {}
1050impl Response for ClearDisplayMessageResponse {}
1051
1052#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1054pub struct ClearVariableMonitoringRequest {
1055 pub id: Vec<i32>,
1057 #[serde(rename = "customData")]
1059 #[serde(default, skip_serializing_if = "Option::is_none")]
1060 pub custom_data: Option<crate::types::CustomData>,
1061}
1062
1063impl ClearVariableMonitoringRequest {
1064 #[must_use]
1066 pub fn new(id: Vec<i32>) -> Self {
1067 Self {
1068 id,
1069 custom_data: None,
1070 }
1071 }
1072
1073 #[must_use]
1075 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1076 self.custom_data = Some(value);
1077 self
1078 }
1079}
1080
1081impl Validate for ClearVariableMonitoringRequest {
1082 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1083 path.push_key("id");
1084 validate::list_len(self.id.len(), Some(1), None, path, out);
1085 path.pop();
1086 path.push_key("customData");
1087 if let Some(value) = &self.custom_data {
1088 Validate::validate_at(value, path, out);
1089 }
1090 path.pop();
1091 }
1092}
1093
1094impl Sealed for ClearVariableMonitoringRequest {}
1095impl Request for ClearVariableMonitoringRequest {
1096 type Action = Action;
1097 const ACTION: Action = Action::ClearVariableMonitoring;
1098 const KIND: MessageKind = MessageKind::Call;
1099 const ORIGIN: Origin = Origin::Csms;
1100 type Response = ClearVariableMonitoringResponse;
1101}
1102
1103impl Confirmed for ClearVariableMonitoringRequest {}
1104
1105#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1107pub struct ClearVariableMonitoringResponse {
1108 #[serde(rename = "clearMonitoringResult")]
1110 pub clear_monitoring_result: Vec<ClearMonitoringResult>,
1111 #[serde(rename = "customData")]
1113 #[serde(default, skip_serializing_if = "Option::is_none")]
1114 pub custom_data: Option<crate::types::CustomData>,
1115}
1116
1117impl ClearVariableMonitoringResponse {
1118 #[must_use]
1120 pub fn new(clear_monitoring_result: Vec<ClearMonitoringResult>) -> Self {
1121 Self {
1122 clear_monitoring_result,
1123 custom_data: None,
1124 }
1125 }
1126
1127 #[must_use]
1129 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1130 self.custom_data = Some(value);
1131 self
1132 }
1133}
1134
1135impl Validate for ClearVariableMonitoringResponse {
1136 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1137 path.push_key("clearMonitoringResult");
1138 validate::list_len(self.clear_monitoring_result.len(), Some(1), None, path, out);
1139 for (index, item) in self.clear_monitoring_result.iter().enumerate() {
1140 path.push_index(index);
1141 Validate::validate_at(item, path, out);
1142 path.pop();
1143 }
1144 path.pop();
1145 path.push_key("customData");
1146 if let Some(value) = &self.custom_data {
1147 Validate::validate_at(value, path, out);
1148 }
1149 path.pop();
1150 }
1151}
1152
1153impl Sealed for ClearVariableMonitoringResponse {}
1154impl Response for ClearVariableMonitoringResponse {}
1155
1156#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1158pub struct ClearedChargingLimitRequest {
1159 #[serde(rename = "chargingLimitSource")]
1161 pub charging_limit_source: ChargingLimitSource,
1162 #[serde(rename = "evseId")]
1164 #[serde(default, skip_serializing_if = "Option::is_none")]
1165 pub evse_id: Option<i32>,
1166 #[serde(rename = "customData")]
1168 #[serde(default, skip_serializing_if = "Option::is_none")]
1169 pub custom_data: Option<crate::types::CustomData>,
1170}
1171
1172impl ClearedChargingLimitRequest {
1173 #[must_use]
1175 pub fn new(charging_limit_source: ChargingLimitSource) -> Self {
1176 Self {
1177 charging_limit_source,
1178 evse_id: None,
1179 custom_data: None,
1180 }
1181 }
1182
1183 #[must_use]
1185 pub fn with_evse_id(mut self, value: i32) -> Self {
1186 self.evse_id = Some(value);
1187 self
1188 }
1189
1190 #[must_use]
1192 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1193 self.custom_data = Some(value);
1194 self
1195 }
1196}
1197
1198impl Validate for ClearedChargingLimitRequest {
1199 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1200 path.push_key("chargingLimitSource");
1201 Validate::validate_at(&self.charging_limit_source, path, out);
1202 path.pop();
1203 path.push_key("customData");
1204 if let Some(value) = &self.custom_data {
1205 Validate::validate_at(value, path, out);
1206 }
1207 path.pop();
1208 }
1209}
1210
1211impl Sealed for ClearedChargingLimitRequest {}
1212impl Request for ClearedChargingLimitRequest {
1213 type Action = Action;
1214 const ACTION: Action = Action::ClearedChargingLimit;
1215 const KIND: MessageKind = MessageKind::Call;
1216 const ORIGIN: Origin = Origin::ChargingStation;
1217 type Response = ClearedChargingLimitResponse;
1218}
1219
1220impl Confirmed for ClearedChargingLimitRequest {}
1221
1222#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1224pub struct ClearedChargingLimitResponse {
1225 #[serde(rename = "customData")]
1227 #[serde(default, skip_serializing_if = "Option::is_none")]
1228 pub custom_data: Option<crate::types::CustomData>,
1229}
1230
1231impl ClearedChargingLimitResponse {
1232 #[must_use]
1234 pub fn new() -> Self {
1235 Self::default()
1236 }
1237
1238 #[must_use]
1240 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1241 self.custom_data = Some(value);
1242 self
1243 }
1244}
1245
1246impl Validate for ClearedChargingLimitResponse {
1247 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1248 path.push_key("customData");
1249 if let Some(value) = &self.custom_data {
1250 Validate::validate_at(value, path, out);
1251 }
1252 path.pop();
1253 }
1254}
1255
1256impl Sealed for ClearedChargingLimitResponse {}
1257impl Response for ClearedChargingLimitResponse {}
1258
1259#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1261pub struct CostUpdatedRequest {
1262 #[serde(rename = "totalCost")]
1264 pub total_cost: crate::types::Decimal,
1265 #[serde(rename = "transactionId")]
1267 pub transaction_id: String,
1268 #[serde(rename = "customData")]
1270 #[serde(default, skip_serializing_if = "Option::is_none")]
1271 pub custom_data: Option<crate::types::CustomData>,
1272}
1273
1274impl CostUpdatedRequest {
1275 #[must_use]
1277 pub fn new(
1278 total_cost: impl Into<crate::types::Decimal>,
1279 transaction_id: impl Into<String>,
1280 ) -> Self {
1281 Self {
1282 total_cost: total_cost.into(),
1283 transaction_id: transaction_id.into(),
1284 custom_data: None,
1285 }
1286 }
1287
1288 #[must_use]
1290 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1291 self.custom_data = Some(value);
1292 self
1293 }
1294}
1295
1296impl Validate for CostUpdatedRequest {
1297 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1298 path.push_key("transactionId");
1299 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
1300 path.pop();
1301 path.push_key("customData");
1302 if let Some(value) = &self.custom_data {
1303 Validate::validate_at(value, path, out);
1304 }
1305 path.pop();
1306 }
1307}
1308
1309impl Sealed for CostUpdatedRequest {}
1310impl Request for CostUpdatedRequest {
1311 type Action = Action;
1312 const ACTION: Action = Action::CostUpdated;
1313 const KIND: MessageKind = MessageKind::Call;
1314 const ORIGIN: Origin = Origin::Csms;
1315 type Response = CostUpdatedResponse;
1316}
1317
1318impl Confirmed for CostUpdatedRequest {}
1319
1320#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1322pub struct CostUpdatedResponse {
1323 #[serde(rename = "customData")]
1325 #[serde(default, skip_serializing_if = "Option::is_none")]
1326 pub custom_data: Option<crate::types::CustomData>,
1327}
1328
1329impl CostUpdatedResponse {
1330 #[must_use]
1332 pub fn new() -> Self {
1333 Self::default()
1334 }
1335
1336 #[must_use]
1338 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1339 self.custom_data = Some(value);
1340 self
1341 }
1342}
1343
1344impl Validate for CostUpdatedResponse {
1345 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1346 path.push_key("customData");
1347 if let Some(value) = &self.custom_data {
1348 Validate::validate_at(value, path, out);
1349 }
1350 path.pop();
1351 }
1352}
1353
1354impl Sealed for CostUpdatedResponse {}
1355impl Response for CostUpdatedResponse {}
1356
1357#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1359pub struct CustomerInformationRequest {
1360 #[serde(rename = "requestId")]
1362 pub request_id: i32,
1363 pub report: bool,
1365 pub clear: bool,
1367 #[serde(rename = "customerCertificate")]
1369 #[serde(default, skip_serializing_if = "Option::is_none")]
1370 pub customer_certificate: Option<CertificateHashData>,
1371 #[serde(rename = "idToken")]
1373 #[serde(default, skip_serializing_if = "Option::is_none")]
1374 pub id_token: Option<IdToken>,
1375 #[serde(rename = "customerIdentifier")]
1378 #[serde(default, skip_serializing_if = "Option::is_none")]
1379 pub customer_identifier: Option<String>,
1380 #[serde(rename = "customData")]
1382 #[serde(default, skip_serializing_if = "Option::is_none")]
1383 pub custom_data: Option<crate::types::CustomData>,
1384}
1385
1386impl CustomerInformationRequest {
1387 #[must_use]
1389 pub fn new(request_id: i32, report: bool, clear: bool) -> Self {
1390 Self {
1391 request_id,
1392 report,
1393 clear,
1394 customer_certificate: None,
1395 id_token: None,
1396 customer_identifier: None,
1397 custom_data: None,
1398 }
1399 }
1400
1401 #[must_use]
1403 pub fn with_customer_certificate(mut self, value: CertificateHashData) -> Self {
1404 self.customer_certificate = Some(value);
1405 self
1406 }
1407
1408 #[must_use]
1410 pub fn with_id_token(mut self, value: IdToken) -> Self {
1411 self.id_token = Some(value);
1412 self
1413 }
1414
1415 #[must_use]
1417 pub fn with_customer_identifier(mut self, value: impl Into<String>) -> Self {
1418 self.customer_identifier = Some(value.into());
1419 self
1420 }
1421
1422 #[must_use]
1424 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1425 self.custom_data = Some(value);
1426 self
1427 }
1428}
1429
1430impl Validate for CustomerInformationRequest {
1431 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1432 path.push_key("customerCertificate");
1433 if let Some(value) = &self.customer_certificate {
1434 Validate::validate_at(value, path, out);
1435 }
1436 path.pop();
1437 path.push_key("idToken");
1438 if let Some(value) = &self.id_token {
1439 Validate::validate_at(value, path, out);
1440 }
1441 path.pop();
1442 path.push_key("customerIdentifier");
1443 if let Some(value) = &self.customer_identifier {
1444 validate::string(value.as_str(), None, Some(64), path, out);
1445 }
1446 path.pop();
1447 path.push_key("customData");
1448 if let Some(value) = &self.custom_data {
1449 Validate::validate_at(value, path, out);
1450 }
1451 path.pop();
1452 }
1453}
1454
1455impl Sealed for CustomerInformationRequest {}
1456impl Request for CustomerInformationRequest {
1457 type Action = Action;
1458 const ACTION: Action = Action::CustomerInformation;
1459 const KIND: MessageKind = MessageKind::Call;
1460 const ORIGIN: Origin = Origin::Csms;
1461 type Response = CustomerInformationResponse;
1462}
1463
1464impl Confirmed for CustomerInformationRequest {}
1465
1466#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1468pub struct CustomerInformationResponse {
1469 pub status: CustomerInformationStatus,
1471 #[serde(rename = "statusInfo")]
1473 #[serde(default, skip_serializing_if = "Option::is_none")]
1474 pub status_info: Option<StatusInfo>,
1475 #[serde(rename = "customData")]
1477 #[serde(default, skip_serializing_if = "Option::is_none")]
1478 pub custom_data: Option<crate::types::CustomData>,
1479}
1480
1481impl CustomerInformationResponse {
1482 #[must_use]
1484 pub fn new(status: CustomerInformationStatus) -> Self {
1485 Self {
1486 status,
1487 status_info: None,
1488 custom_data: None,
1489 }
1490 }
1491
1492 #[must_use]
1494 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1495 self.status_info = Some(value);
1496 self
1497 }
1498
1499 #[must_use]
1501 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1502 self.custom_data = Some(value);
1503 self
1504 }
1505}
1506
1507impl Validate for CustomerInformationResponse {
1508 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1509 path.push_key("status");
1510 Validate::validate_at(&self.status, path, out);
1511 path.pop();
1512 path.push_key("statusInfo");
1513 if let Some(value) = &self.status_info {
1514 Validate::validate_at(value, path, out);
1515 }
1516 path.pop();
1517 path.push_key("customData");
1518 if let Some(value) = &self.custom_data {
1519 Validate::validate_at(value, path, out);
1520 }
1521 path.pop();
1522 }
1523}
1524
1525impl Sealed for CustomerInformationResponse {}
1526impl Response for CustomerInformationResponse {}
1527
1528#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1530pub struct DataTransferRequest {
1531 #[serde(rename = "vendorId")]
1533 pub vendor_id: String,
1534 #[serde(rename = "messageId")]
1536 #[serde(default, skip_serializing_if = "Option::is_none")]
1537 pub message_id: Option<String>,
1538 #[serde(default, skip_serializing_if = "Option::is_none")]
1540 pub data: Option<serde_json::Value>,
1541 #[serde(rename = "customData")]
1543 #[serde(default, skip_serializing_if = "Option::is_none")]
1544 pub custom_data: Option<crate::types::CustomData>,
1545}
1546
1547impl DataTransferRequest {
1548 #[must_use]
1550 pub fn new(vendor_id: impl Into<String>) -> Self {
1551 Self {
1552 vendor_id: vendor_id.into(),
1553 message_id: None,
1554 data: None,
1555 custom_data: None,
1556 }
1557 }
1558
1559 #[must_use]
1561 pub fn with_message_id(mut self, value: impl Into<String>) -> Self {
1562 self.message_id = Some(value.into());
1563 self
1564 }
1565
1566 #[must_use]
1568 pub fn with_data(mut self, value: serde_json::Value) -> Self {
1569 self.data = Some(value);
1570 self
1571 }
1572
1573 #[must_use]
1575 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1576 self.custom_data = Some(value);
1577 self
1578 }
1579}
1580
1581impl Validate for DataTransferRequest {
1582 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1583 path.push_key("vendorId");
1584 validate::string(self.vendor_id.as_str(), None, Some(255), path, out);
1585 path.pop();
1586 path.push_key("messageId");
1587 if let Some(value) = &self.message_id {
1588 validate::string(value.as_str(), None, Some(50), path, out);
1589 }
1590 path.pop();
1591 path.push_key("customData");
1592 if let Some(value) = &self.custom_data {
1593 Validate::validate_at(value, path, out);
1594 }
1595 path.pop();
1596 }
1597}
1598
1599impl Sealed for DataTransferRequest {}
1600impl Request for DataTransferRequest {
1601 type Action = Action;
1602 const ACTION: Action = Action::DataTransfer;
1603 const KIND: MessageKind = MessageKind::Call;
1604 const ORIGIN: Origin = Origin::Both;
1605 type Response = DataTransferResponse;
1606}
1607
1608impl Confirmed for DataTransferRequest {}
1609
1610#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1612pub struct DataTransferResponse {
1613 pub status: DataTransferStatus,
1615 #[serde(rename = "statusInfo")]
1617 #[serde(default, skip_serializing_if = "Option::is_none")]
1618 pub status_info: Option<StatusInfo>,
1619 #[serde(default, skip_serializing_if = "Option::is_none")]
1621 pub data: Option<serde_json::Value>,
1622 #[serde(rename = "customData")]
1624 #[serde(default, skip_serializing_if = "Option::is_none")]
1625 pub custom_data: Option<crate::types::CustomData>,
1626}
1627
1628impl DataTransferResponse {
1629 #[must_use]
1631 pub fn new(status: DataTransferStatus) -> Self {
1632 Self {
1633 status,
1634 status_info: None,
1635 data: None,
1636 custom_data: None,
1637 }
1638 }
1639
1640 #[must_use]
1642 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1643 self.status_info = Some(value);
1644 self
1645 }
1646
1647 #[must_use]
1649 pub fn with_data(mut self, value: serde_json::Value) -> Self {
1650 self.data = Some(value);
1651 self
1652 }
1653
1654 #[must_use]
1656 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1657 self.custom_data = Some(value);
1658 self
1659 }
1660}
1661
1662impl Validate for DataTransferResponse {
1663 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1664 path.push_key("status");
1665 Validate::validate_at(&self.status, path, out);
1666 path.pop();
1667 path.push_key("statusInfo");
1668 if let Some(value) = &self.status_info {
1669 Validate::validate_at(value, path, out);
1670 }
1671 path.pop();
1672 path.push_key("customData");
1673 if let Some(value) = &self.custom_data {
1674 Validate::validate_at(value, path, out);
1675 }
1676 path.pop();
1677 }
1678}
1679
1680impl Sealed for DataTransferResponse {}
1681impl Response for DataTransferResponse {}
1682
1683#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1685pub struct DeleteCertificateRequest {
1686 #[serde(rename = "certificateHashData")]
1688 pub certificate_hash_data: CertificateHashData,
1689 #[serde(rename = "customData")]
1691 #[serde(default, skip_serializing_if = "Option::is_none")]
1692 pub custom_data: Option<crate::types::CustomData>,
1693}
1694
1695impl DeleteCertificateRequest {
1696 #[must_use]
1698 pub fn new(certificate_hash_data: CertificateHashData) -> Self {
1699 Self {
1700 certificate_hash_data,
1701 custom_data: None,
1702 }
1703 }
1704
1705 #[must_use]
1707 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1708 self.custom_data = Some(value);
1709 self
1710 }
1711}
1712
1713impl Validate for DeleteCertificateRequest {
1714 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1715 path.push_key("certificateHashData");
1716 Validate::validate_at(&self.certificate_hash_data, path, out);
1717 path.pop();
1718 path.push_key("customData");
1719 if let Some(value) = &self.custom_data {
1720 Validate::validate_at(value, path, out);
1721 }
1722 path.pop();
1723 }
1724}
1725
1726impl Sealed for DeleteCertificateRequest {}
1727impl Request for DeleteCertificateRequest {
1728 type Action = Action;
1729 const ACTION: Action = Action::DeleteCertificate;
1730 const KIND: MessageKind = MessageKind::Call;
1731 const ORIGIN: Origin = Origin::Csms;
1732 type Response = DeleteCertificateResponse;
1733}
1734
1735impl Confirmed for DeleteCertificateRequest {}
1736
1737#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1739pub struct DeleteCertificateResponse {
1740 pub status: DeleteCertificateStatus,
1742 #[serde(rename = "statusInfo")]
1744 #[serde(default, skip_serializing_if = "Option::is_none")]
1745 pub status_info: Option<StatusInfo>,
1746 #[serde(rename = "customData")]
1748 #[serde(default, skip_serializing_if = "Option::is_none")]
1749 pub custom_data: Option<crate::types::CustomData>,
1750}
1751
1752impl DeleteCertificateResponse {
1753 #[must_use]
1755 pub fn new(status: DeleteCertificateStatus) -> Self {
1756 Self {
1757 status,
1758 status_info: None,
1759 custom_data: None,
1760 }
1761 }
1762
1763 #[must_use]
1765 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1766 self.status_info = Some(value);
1767 self
1768 }
1769
1770 #[must_use]
1772 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1773 self.custom_data = Some(value);
1774 self
1775 }
1776}
1777
1778impl Validate for DeleteCertificateResponse {
1779 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1780 path.push_key("status");
1781 Validate::validate_at(&self.status, path, out);
1782 path.pop();
1783 path.push_key("statusInfo");
1784 if let Some(value) = &self.status_info {
1785 Validate::validate_at(value, path, out);
1786 }
1787 path.pop();
1788 path.push_key("customData");
1789 if let Some(value) = &self.custom_data {
1790 Validate::validate_at(value, path, out);
1791 }
1792 path.pop();
1793 }
1794}
1795
1796impl Sealed for DeleteCertificateResponse {}
1797impl Response for DeleteCertificateResponse {}
1798
1799#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1801pub struct FirmwareStatusNotificationRequest {
1802 pub status: FirmwareStatus,
1804 #[serde(rename = "requestId")]
1808 #[serde(default, skip_serializing_if = "Option::is_none")]
1809 pub request_id: Option<i32>,
1810 #[serde(rename = "customData")]
1812 #[serde(default, skip_serializing_if = "Option::is_none")]
1813 pub custom_data: Option<crate::types::CustomData>,
1814}
1815
1816impl FirmwareStatusNotificationRequest {
1817 #[must_use]
1819 pub fn new(status: FirmwareStatus) -> Self {
1820 Self {
1821 status,
1822 request_id: None,
1823 custom_data: None,
1824 }
1825 }
1826
1827 #[must_use]
1829 pub fn with_request_id(mut self, value: i32) -> Self {
1830 self.request_id = Some(value);
1831 self
1832 }
1833
1834 #[must_use]
1836 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1837 self.custom_data = Some(value);
1838 self
1839 }
1840}
1841
1842impl Validate for FirmwareStatusNotificationRequest {
1843 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1844 path.push_key("status");
1845 Validate::validate_at(&self.status, path, out);
1846 path.pop();
1847 path.push_key("customData");
1848 if let Some(value) = &self.custom_data {
1849 Validate::validate_at(value, path, out);
1850 }
1851 path.pop();
1852 }
1853}
1854
1855impl Sealed for FirmwareStatusNotificationRequest {}
1856impl Request for FirmwareStatusNotificationRequest {
1857 type Action = Action;
1858 const ACTION: Action = Action::FirmwareStatusNotification;
1859 const KIND: MessageKind = MessageKind::Call;
1860 const ORIGIN: Origin = Origin::ChargingStation;
1861 type Response = FirmwareStatusNotificationResponse;
1862}
1863
1864impl Confirmed for FirmwareStatusNotificationRequest {}
1865
1866#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1868pub struct FirmwareStatusNotificationResponse {
1869 #[serde(rename = "customData")]
1871 #[serde(default, skip_serializing_if = "Option::is_none")]
1872 pub custom_data: Option<crate::types::CustomData>,
1873}
1874
1875impl FirmwareStatusNotificationResponse {
1876 #[must_use]
1878 pub fn new() -> Self {
1879 Self::default()
1880 }
1881
1882 #[must_use]
1884 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1885 self.custom_data = Some(value);
1886 self
1887 }
1888}
1889
1890impl Validate for FirmwareStatusNotificationResponse {
1891 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1892 path.push_key("customData");
1893 if let Some(value) = &self.custom_data {
1894 Validate::validate_at(value, path, out);
1895 }
1896 path.pop();
1897 }
1898}
1899
1900impl Sealed for FirmwareStatusNotificationResponse {}
1901impl Response for FirmwareStatusNotificationResponse {}
1902
1903#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1905pub struct Get15118EVCertificateRequest {
1906 #[serde(rename = "iso15118SchemaVersion")]
1908 pub iso15118_schema_version: String,
1909 pub action: CertificateAction,
1911 #[serde(rename = "exiRequest")]
1913 pub exi_request: String,
1914 #[serde(rename = "customData")]
1916 #[serde(default, skip_serializing_if = "Option::is_none")]
1917 pub custom_data: Option<crate::types::CustomData>,
1918}
1919
1920impl Get15118EVCertificateRequest {
1921 #[must_use]
1923 pub fn new(
1924 iso15118_schema_version: impl Into<String>,
1925 action: CertificateAction,
1926 exi_request: impl Into<String>,
1927 ) -> Self {
1928 Self {
1929 iso15118_schema_version: iso15118_schema_version.into(),
1930 action,
1931 exi_request: exi_request.into(),
1932 custom_data: None,
1933 }
1934 }
1935
1936 #[must_use]
1938 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1939 self.custom_data = Some(value);
1940 self
1941 }
1942}
1943
1944impl Validate for Get15118EVCertificateRequest {
1945 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1946 path.push_key("iso15118SchemaVersion");
1947 validate::string(
1948 self.iso15118_schema_version.as_str(),
1949 None,
1950 Some(50),
1951 path,
1952 out,
1953 );
1954 path.pop();
1955 path.push_key("action");
1956 Validate::validate_at(&self.action, path, out);
1957 path.pop();
1958 path.push_key("exiRequest");
1959 validate::string(self.exi_request.as_str(), None, Some(5600), path, out);
1960 path.pop();
1961 path.push_key("customData");
1962 if let Some(value) = &self.custom_data {
1963 Validate::validate_at(value, path, out);
1964 }
1965 path.pop();
1966 }
1967}
1968
1969impl Sealed for Get15118EVCertificateRequest {}
1970impl Request for Get15118EVCertificateRequest {
1971 type Action = Action;
1972 const ACTION: Action = Action::Get15118EVCertificate;
1973 const KIND: MessageKind = MessageKind::Call;
1974 const ORIGIN: Origin = Origin::ChargingStation;
1975 type Response = Get15118EVCertificateResponse;
1976}
1977
1978impl Confirmed for Get15118EVCertificateRequest {}
1979
1980#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1982pub struct Get15118EVCertificateResponse {
1983 pub status: Iso15118EVCertificateStatus,
1985 #[serde(rename = "exiResponse")]
1987 pub exi_response: String,
1988 #[serde(rename = "statusInfo")]
1990 #[serde(default, skip_serializing_if = "Option::is_none")]
1991 pub status_info: Option<StatusInfo>,
1992 #[serde(rename = "customData")]
1994 #[serde(default, skip_serializing_if = "Option::is_none")]
1995 pub custom_data: Option<crate::types::CustomData>,
1996}
1997
1998impl Get15118EVCertificateResponse {
1999 #[must_use]
2001 pub fn new(status: Iso15118EVCertificateStatus, exi_response: impl Into<String>) -> Self {
2002 Self {
2003 status,
2004 exi_response: exi_response.into(),
2005 status_info: None,
2006 custom_data: None,
2007 }
2008 }
2009
2010 #[must_use]
2012 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2013 self.status_info = Some(value);
2014 self
2015 }
2016
2017 #[must_use]
2019 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2020 self.custom_data = Some(value);
2021 self
2022 }
2023}
2024
2025impl Validate for Get15118EVCertificateResponse {
2026 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2027 path.push_key("status");
2028 Validate::validate_at(&self.status, path, out);
2029 path.pop();
2030 path.push_key("exiResponse");
2031 validate::string(self.exi_response.as_str(), None, Some(7500), path, out);
2032 path.pop();
2033 path.push_key("statusInfo");
2034 if let Some(value) = &self.status_info {
2035 Validate::validate_at(value, path, out);
2036 }
2037 path.pop();
2038 path.push_key("customData");
2039 if let Some(value) = &self.custom_data {
2040 Validate::validate_at(value, path, out);
2041 }
2042 path.pop();
2043 }
2044}
2045
2046impl Sealed for Get15118EVCertificateResponse {}
2047impl Response for Get15118EVCertificateResponse {}
2048
2049#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2051pub struct GetBaseReportRequest {
2052 #[serde(rename = "requestId")]
2054 pub request_id: i32,
2055 #[serde(rename = "reportBase")]
2057 pub report_base: ReportBase,
2058 #[serde(rename = "customData")]
2060 #[serde(default, skip_serializing_if = "Option::is_none")]
2061 pub custom_data: Option<crate::types::CustomData>,
2062}
2063
2064impl GetBaseReportRequest {
2065 #[must_use]
2067 pub fn new(request_id: i32, report_base: ReportBase) -> Self {
2068 Self {
2069 request_id,
2070 report_base,
2071 custom_data: None,
2072 }
2073 }
2074
2075 #[must_use]
2077 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2078 self.custom_data = Some(value);
2079 self
2080 }
2081}
2082
2083impl Validate for GetBaseReportRequest {
2084 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2085 path.push_key("reportBase");
2086 Validate::validate_at(&self.report_base, path, out);
2087 path.pop();
2088 path.push_key("customData");
2089 if let Some(value) = &self.custom_data {
2090 Validate::validate_at(value, path, out);
2091 }
2092 path.pop();
2093 }
2094}
2095
2096impl Sealed for GetBaseReportRequest {}
2097impl Request for GetBaseReportRequest {
2098 type Action = Action;
2099 const ACTION: Action = Action::GetBaseReport;
2100 const KIND: MessageKind = MessageKind::Call;
2101 const ORIGIN: Origin = Origin::Csms;
2102 type Response = GetBaseReportResponse;
2103}
2104
2105impl Confirmed for GetBaseReportRequest {}
2106
2107#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2109pub struct GetBaseReportResponse {
2110 pub status: GenericDeviceModelStatus,
2112 #[serde(rename = "statusInfo")]
2114 #[serde(default, skip_serializing_if = "Option::is_none")]
2115 pub status_info: Option<StatusInfo>,
2116 #[serde(rename = "customData")]
2118 #[serde(default, skip_serializing_if = "Option::is_none")]
2119 pub custom_data: Option<crate::types::CustomData>,
2120}
2121
2122impl GetBaseReportResponse {
2123 #[must_use]
2125 pub fn new(status: GenericDeviceModelStatus) -> Self {
2126 Self {
2127 status,
2128 status_info: None,
2129 custom_data: None,
2130 }
2131 }
2132
2133 #[must_use]
2135 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2136 self.status_info = Some(value);
2137 self
2138 }
2139
2140 #[must_use]
2142 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2143 self.custom_data = Some(value);
2144 self
2145 }
2146}
2147
2148impl Validate for GetBaseReportResponse {
2149 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2150 path.push_key("status");
2151 Validate::validate_at(&self.status, path, out);
2152 path.pop();
2153 path.push_key("statusInfo");
2154 if let Some(value) = &self.status_info {
2155 Validate::validate_at(value, path, out);
2156 }
2157 path.pop();
2158 path.push_key("customData");
2159 if let Some(value) = &self.custom_data {
2160 Validate::validate_at(value, path, out);
2161 }
2162 path.pop();
2163 }
2164}
2165
2166impl Sealed for GetBaseReportResponse {}
2167impl Response for GetBaseReportResponse {}
2168
2169#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2171pub struct GetCertificateStatusRequest {
2172 #[serde(rename = "ocspRequestData")]
2174 pub ocsp_request_data: OCSPRequestData,
2175 #[serde(rename = "customData")]
2177 #[serde(default, skip_serializing_if = "Option::is_none")]
2178 pub custom_data: Option<crate::types::CustomData>,
2179}
2180
2181impl GetCertificateStatusRequest {
2182 #[must_use]
2184 pub fn new(ocsp_request_data: OCSPRequestData) -> Self {
2185 Self {
2186 ocsp_request_data,
2187 custom_data: None,
2188 }
2189 }
2190
2191 #[must_use]
2193 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2194 self.custom_data = Some(value);
2195 self
2196 }
2197}
2198
2199impl Validate for GetCertificateStatusRequest {
2200 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2201 path.push_key("ocspRequestData");
2202 Validate::validate_at(&self.ocsp_request_data, path, out);
2203 path.pop();
2204 path.push_key("customData");
2205 if let Some(value) = &self.custom_data {
2206 Validate::validate_at(value, path, out);
2207 }
2208 path.pop();
2209 }
2210}
2211
2212impl Sealed for GetCertificateStatusRequest {}
2213impl Request for GetCertificateStatusRequest {
2214 type Action = Action;
2215 const ACTION: Action = Action::GetCertificateStatus;
2216 const KIND: MessageKind = MessageKind::Call;
2217 const ORIGIN: Origin = Origin::ChargingStation;
2218 type Response = GetCertificateStatusResponse;
2219}
2220
2221impl Confirmed for GetCertificateStatusRequest {}
2222
2223#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2225pub struct GetCertificateStatusResponse {
2226 pub status: GetCertificateStatusEnum,
2228 #[serde(rename = "statusInfo")]
2230 #[serde(default, skip_serializing_if = "Option::is_none")]
2231 pub status_info: Option<StatusInfo>,
2232 #[serde(rename = "ocspResult")]
2234 #[serde(default, skip_serializing_if = "Option::is_none")]
2235 pub ocsp_result: Option<String>,
2236 #[serde(rename = "customData")]
2238 #[serde(default, skip_serializing_if = "Option::is_none")]
2239 pub custom_data: Option<crate::types::CustomData>,
2240}
2241
2242impl GetCertificateStatusResponse {
2243 #[must_use]
2245 pub fn new(status: GetCertificateStatusEnum) -> Self {
2246 Self {
2247 status,
2248 status_info: None,
2249 ocsp_result: None,
2250 custom_data: None,
2251 }
2252 }
2253
2254 #[must_use]
2256 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2257 self.status_info = Some(value);
2258 self
2259 }
2260
2261 #[must_use]
2263 pub fn with_ocsp_result(mut self, value: impl Into<String>) -> Self {
2264 self.ocsp_result = Some(value.into());
2265 self
2266 }
2267
2268 #[must_use]
2270 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2271 self.custom_data = Some(value);
2272 self
2273 }
2274}
2275
2276impl Validate for GetCertificateStatusResponse {
2277 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2278 path.push_key("status");
2279 Validate::validate_at(&self.status, path, out);
2280 path.pop();
2281 path.push_key("statusInfo");
2282 if let Some(value) = &self.status_info {
2283 Validate::validate_at(value, path, out);
2284 }
2285 path.pop();
2286 path.push_key("ocspResult");
2287 if let Some(value) = &self.ocsp_result {
2288 validate::string(value.as_str(), None, Some(5500), path, out);
2289 }
2290 path.pop();
2291 path.push_key("customData");
2292 if let Some(value) = &self.custom_data {
2293 Validate::validate_at(value, path, out);
2294 }
2295 path.pop();
2296 }
2297}
2298
2299impl Sealed for GetCertificateStatusResponse {}
2300impl Response for GetCertificateStatusResponse {}
2301
2302#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2304pub struct GetChargingProfilesRequest {
2305 #[serde(rename = "requestId")]
2307 pub request_id: i32,
2308 #[serde(rename = "chargingProfile")]
2310 pub charging_profile: ChargingProfileCriterion,
2311 #[serde(rename = "evseId")]
2313 #[serde(default, skip_serializing_if = "Option::is_none")]
2314 pub evse_id: Option<i32>,
2315 #[serde(rename = "customData")]
2317 #[serde(default, skip_serializing_if = "Option::is_none")]
2318 pub custom_data: Option<crate::types::CustomData>,
2319}
2320
2321impl GetChargingProfilesRequest {
2322 #[must_use]
2324 pub fn new(request_id: i32, charging_profile: ChargingProfileCriterion) -> Self {
2325 Self {
2326 request_id,
2327 charging_profile,
2328 evse_id: None,
2329 custom_data: None,
2330 }
2331 }
2332
2333 #[must_use]
2335 pub fn with_evse_id(mut self, value: i32) -> Self {
2336 self.evse_id = Some(value);
2337 self
2338 }
2339
2340 #[must_use]
2342 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2343 self.custom_data = Some(value);
2344 self
2345 }
2346}
2347
2348impl Validate for GetChargingProfilesRequest {
2349 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2350 path.push_key("chargingProfile");
2351 Validate::validate_at(&self.charging_profile, path, out);
2352 path.pop();
2353 path.push_key("customData");
2354 if let Some(value) = &self.custom_data {
2355 Validate::validate_at(value, path, out);
2356 }
2357 path.pop();
2358 }
2359}
2360
2361impl Sealed for GetChargingProfilesRequest {}
2362impl Request for GetChargingProfilesRequest {
2363 type Action = Action;
2364 const ACTION: Action = Action::GetChargingProfiles;
2365 const KIND: MessageKind = MessageKind::Call;
2366 const ORIGIN: Origin = Origin::Csms;
2367 type Response = GetChargingProfilesResponse;
2368}
2369
2370impl Confirmed for GetChargingProfilesRequest {}
2371
2372#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2374pub struct GetChargingProfilesResponse {
2375 pub status: GetChargingProfileStatus,
2377 #[serde(rename = "statusInfo")]
2379 #[serde(default, skip_serializing_if = "Option::is_none")]
2380 pub status_info: Option<StatusInfo>,
2381 #[serde(rename = "customData")]
2383 #[serde(default, skip_serializing_if = "Option::is_none")]
2384 pub custom_data: Option<crate::types::CustomData>,
2385}
2386
2387impl GetChargingProfilesResponse {
2388 #[must_use]
2390 pub fn new(status: GetChargingProfileStatus) -> Self {
2391 Self {
2392 status,
2393 status_info: None,
2394 custom_data: None,
2395 }
2396 }
2397
2398 #[must_use]
2400 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2401 self.status_info = Some(value);
2402 self
2403 }
2404
2405 #[must_use]
2407 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2408 self.custom_data = Some(value);
2409 self
2410 }
2411}
2412
2413impl Validate for GetChargingProfilesResponse {
2414 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2415 path.push_key("status");
2416 Validate::validate_at(&self.status, path, out);
2417 path.pop();
2418 path.push_key("statusInfo");
2419 if let Some(value) = &self.status_info {
2420 Validate::validate_at(value, path, out);
2421 }
2422 path.pop();
2423 path.push_key("customData");
2424 if let Some(value) = &self.custom_data {
2425 Validate::validate_at(value, path, out);
2426 }
2427 path.pop();
2428 }
2429}
2430
2431impl Sealed for GetChargingProfilesResponse {}
2432impl Response for GetChargingProfilesResponse {}
2433
2434#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2436pub struct GetCompositeScheduleRequest {
2437 pub duration: i32,
2439 #[serde(rename = "evseId")]
2441 pub evse_id: i32,
2442 #[serde(rename = "chargingRateUnit")]
2444 #[serde(default, skip_serializing_if = "Option::is_none")]
2445 pub charging_rate_unit: Option<ChargingRateUnit>,
2446 #[serde(rename = "customData")]
2448 #[serde(default, skip_serializing_if = "Option::is_none")]
2449 pub custom_data: Option<crate::types::CustomData>,
2450}
2451
2452impl GetCompositeScheduleRequest {
2453 #[must_use]
2455 pub fn new(duration: i32, evse_id: i32) -> Self {
2456 Self {
2457 duration,
2458 evse_id,
2459 charging_rate_unit: None,
2460 custom_data: None,
2461 }
2462 }
2463
2464 #[must_use]
2466 pub fn with_charging_rate_unit(mut self, value: ChargingRateUnit) -> Self {
2467 self.charging_rate_unit = Some(value);
2468 self
2469 }
2470
2471 #[must_use]
2473 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2474 self.custom_data = Some(value);
2475 self
2476 }
2477}
2478
2479impl Validate for GetCompositeScheduleRequest {
2480 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2481 path.push_key("chargingRateUnit");
2482 if let Some(value) = &self.charging_rate_unit {
2483 Validate::validate_at(value, path, out);
2484 }
2485 path.pop();
2486 path.push_key("customData");
2487 if let Some(value) = &self.custom_data {
2488 Validate::validate_at(value, path, out);
2489 }
2490 path.pop();
2491 }
2492}
2493
2494impl Sealed for GetCompositeScheduleRequest {}
2495impl Request for GetCompositeScheduleRequest {
2496 type Action = Action;
2497 const ACTION: Action = Action::GetCompositeSchedule;
2498 const KIND: MessageKind = MessageKind::Call;
2499 const ORIGIN: Origin = Origin::Csms;
2500 type Response = GetCompositeScheduleResponse;
2501}
2502
2503impl Confirmed for GetCompositeScheduleRequest {}
2504
2505#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2507pub struct GetCompositeScheduleResponse {
2508 pub status: GenericStatus,
2510 #[serde(rename = "statusInfo")]
2512 #[serde(default, skip_serializing_if = "Option::is_none")]
2513 pub status_info: Option<StatusInfo>,
2514 #[serde(default, skip_serializing_if = "Option::is_none")]
2516 pub schedule: Option<CompositeSchedule>,
2517 #[serde(rename = "customData")]
2519 #[serde(default, skip_serializing_if = "Option::is_none")]
2520 pub custom_data: Option<crate::types::CustomData>,
2521}
2522
2523impl GetCompositeScheduleResponse {
2524 #[must_use]
2526 pub fn new(status: GenericStatus) -> Self {
2527 Self {
2528 status,
2529 status_info: None,
2530 schedule: None,
2531 custom_data: None,
2532 }
2533 }
2534
2535 #[must_use]
2537 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2538 self.status_info = Some(value);
2539 self
2540 }
2541
2542 #[must_use]
2544 pub fn with_schedule(mut self, value: CompositeSchedule) -> Self {
2545 self.schedule = Some(value);
2546 self
2547 }
2548
2549 #[must_use]
2551 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2552 self.custom_data = Some(value);
2553 self
2554 }
2555}
2556
2557impl Validate for GetCompositeScheduleResponse {
2558 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2559 path.push_key("status");
2560 Validate::validate_at(&self.status, path, out);
2561 path.pop();
2562 path.push_key("statusInfo");
2563 if let Some(value) = &self.status_info {
2564 Validate::validate_at(value, path, out);
2565 }
2566 path.pop();
2567 path.push_key("schedule");
2568 if let Some(value) = &self.schedule {
2569 Validate::validate_at(value, path, out);
2570 }
2571 path.pop();
2572 path.push_key("customData");
2573 if let Some(value) = &self.custom_data {
2574 Validate::validate_at(value, path, out);
2575 }
2576 path.pop();
2577 }
2578}
2579
2580impl Sealed for GetCompositeScheduleResponse {}
2581impl Response for GetCompositeScheduleResponse {}
2582
2583#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2585pub struct GetDisplayMessagesRequest {
2586 #[serde(rename = "requestId")]
2588 pub request_id: i32,
2589 #[serde(default, skip_serializing_if = "Option::is_none")]
2591 pub id: Option<Vec<i32>>,
2592 #[serde(default, skip_serializing_if = "Option::is_none")]
2594 pub priority: Option<MessagePriority>,
2595 #[serde(default, skip_serializing_if = "Option::is_none")]
2597 pub state: Option<MessageState>,
2598 #[serde(rename = "customData")]
2600 #[serde(default, skip_serializing_if = "Option::is_none")]
2601 pub custom_data: Option<crate::types::CustomData>,
2602}
2603
2604impl GetDisplayMessagesRequest {
2605 #[must_use]
2607 pub fn new(request_id: i32) -> Self {
2608 Self {
2609 request_id,
2610 id: None,
2611 priority: None,
2612 state: None,
2613 custom_data: None,
2614 }
2615 }
2616
2617 #[must_use]
2619 pub fn with_id(mut self, value: Vec<i32>) -> Self {
2620 self.id = Some(value);
2621 self
2622 }
2623
2624 #[must_use]
2626 pub fn with_priority(mut self, value: MessagePriority) -> Self {
2627 self.priority = Some(value);
2628 self
2629 }
2630
2631 #[must_use]
2633 pub fn with_state(mut self, value: MessageState) -> Self {
2634 self.state = Some(value);
2635 self
2636 }
2637
2638 #[must_use]
2640 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2641 self.custom_data = Some(value);
2642 self
2643 }
2644}
2645
2646impl Validate for GetDisplayMessagesRequest {
2647 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2648 path.push_key("id");
2649 if let Some(value) = &self.id {
2650 validate::list_len(value.len(), Some(1), None, path, out);
2651 }
2652 path.pop();
2653 path.push_key("priority");
2654 if let Some(value) = &self.priority {
2655 Validate::validate_at(value, path, out);
2656 }
2657 path.pop();
2658 path.push_key("state");
2659 if let Some(value) = &self.state {
2660 Validate::validate_at(value, path, out);
2661 }
2662 path.pop();
2663 path.push_key("customData");
2664 if let Some(value) = &self.custom_data {
2665 Validate::validate_at(value, path, out);
2666 }
2667 path.pop();
2668 }
2669}
2670
2671impl Sealed for GetDisplayMessagesRequest {}
2672impl Request for GetDisplayMessagesRequest {
2673 type Action = Action;
2674 const ACTION: Action = Action::GetDisplayMessages;
2675 const KIND: MessageKind = MessageKind::Call;
2676 const ORIGIN: Origin = Origin::Csms;
2677 type Response = GetDisplayMessagesResponse;
2678}
2679
2680impl Confirmed for GetDisplayMessagesRequest {}
2681
2682#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2684pub struct GetDisplayMessagesResponse {
2685 pub status: GetDisplayMessagesStatus,
2687 #[serde(rename = "statusInfo")]
2689 #[serde(default, skip_serializing_if = "Option::is_none")]
2690 pub status_info: Option<StatusInfo>,
2691 #[serde(rename = "customData")]
2693 #[serde(default, skip_serializing_if = "Option::is_none")]
2694 pub custom_data: Option<crate::types::CustomData>,
2695}
2696
2697impl GetDisplayMessagesResponse {
2698 #[must_use]
2700 pub fn new(status: GetDisplayMessagesStatus) -> Self {
2701 Self {
2702 status,
2703 status_info: None,
2704 custom_data: None,
2705 }
2706 }
2707
2708 #[must_use]
2710 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2711 self.status_info = Some(value);
2712 self
2713 }
2714
2715 #[must_use]
2717 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2718 self.custom_data = Some(value);
2719 self
2720 }
2721}
2722
2723impl Validate for GetDisplayMessagesResponse {
2724 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2725 path.push_key("status");
2726 Validate::validate_at(&self.status, path, out);
2727 path.pop();
2728 path.push_key("statusInfo");
2729 if let Some(value) = &self.status_info {
2730 Validate::validate_at(value, path, out);
2731 }
2732 path.pop();
2733 path.push_key("customData");
2734 if let Some(value) = &self.custom_data {
2735 Validate::validate_at(value, path, out);
2736 }
2737 path.pop();
2738 }
2739}
2740
2741impl Sealed for GetDisplayMessagesResponse {}
2742impl Response for GetDisplayMessagesResponse {}
2743
2744#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2746pub struct GetInstalledCertificateIdsRequest {
2747 #[serde(rename = "certificateType")]
2749 #[serde(default, skip_serializing_if = "Option::is_none")]
2750 pub certificate_type: Option<Vec<GetCertificateIdUse>>,
2751 #[serde(rename = "customData")]
2753 #[serde(default, skip_serializing_if = "Option::is_none")]
2754 pub custom_data: Option<crate::types::CustomData>,
2755}
2756
2757impl GetInstalledCertificateIdsRequest {
2758 #[must_use]
2760 pub fn new() -> Self {
2761 Self::default()
2762 }
2763
2764 #[must_use]
2766 pub fn with_certificate_type(mut self, value: Vec<GetCertificateIdUse>) -> Self {
2767 self.certificate_type = Some(value);
2768 self
2769 }
2770
2771 #[must_use]
2773 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2774 self.custom_data = Some(value);
2775 self
2776 }
2777}
2778
2779impl Validate for GetInstalledCertificateIdsRequest {
2780 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2781 path.push_key("certificateType");
2782 if let Some(value) = &self.certificate_type {
2783 validate::list_len(value.len(), Some(1), None, path, out);
2784 for (index, item) in value.iter().enumerate() {
2785 path.push_index(index);
2786 Validate::validate_at(item, path, out);
2787 path.pop();
2788 }
2789 }
2790 path.pop();
2791 path.push_key("customData");
2792 if let Some(value) = &self.custom_data {
2793 Validate::validate_at(value, path, out);
2794 }
2795 path.pop();
2796 }
2797}
2798
2799impl Sealed for GetInstalledCertificateIdsRequest {}
2800impl Request for GetInstalledCertificateIdsRequest {
2801 type Action = Action;
2802 const ACTION: Action = Action::GetInstalledCertificateIds;
2803 const KIND: MessageKind = MessageKind::Call;
2804 const ORIGIN: Origin = Origin::Csms;
2805 type Response = GetInstalledCertificateIdsResponse;
2806}
2807
2808impl Confirmed for GetInstalledCertificateIdsRequest {}
2809
2810#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2812pub struct GetInstalledCertificateIdsResponse {
2813 pub status: GetInstalledCertificateStatus,
2815 #[serde(rename = "statusInfo")]
2817 #[serde(default, skip_serializing_if = "Option::is_none")]
2818 pub status_info: Option<StatusInfo>,
2819 #[serde(rename = "certificateHashDataChain")]
2821 #[serde(default, skip_serializing_if = "Option::is_none")]
2822 pub certificate_hash_data_chain: Option<Vec<CertificateHashDataChain>>,
2823 #[serde(rename = "customData")]
2825 #[serde(default, skip_serializing_if = "Option::is_none")]
2826 pub custom_data: Option<crate::types::CustomData>,
2827}
2828
2829impl GetInstalledCertificateIdsResponse {
2830 #[must_use]
2832 pub fn new(status: GetInstalledCertificateStatus) -> Self {
2833 Self {
2834 status,
2835 status_info: None,
2836 certificate_hash_data_chain: None,
2837 custom_data: None,
2838 }
2839 }
2840
2841 #[must_use]
2843 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2844 self.status_info = Some(value);
2845 self
2846 }
2847
2848 #[must_use]
2850 pub fn with_certificate_hash_data_chain(
2851 mut self,
2852 value: Vec<CertificateHashDataChain>,
2853 ) -> Self {
2854 self.certificate_hash_data_chain = Some(value);
2855 self
2856 }
2857
2858 #[must_use]
2860 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2861 self.custom_data = Some(value);
2862 self
2863 }
2864}
2865
2866impl Validate for GetInstalledCertificateIdsResponse {
2867 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2868 path.push_key("status");
2869 Validate::validate_at(&self.status, path, out);
2870 path.pop();
2871 path.push_key("statusInfo");
2872 if let Some(value) = &self.status_info {
2873 Validate::validate_at(value, path, out);
2874 }
2875 path.pop();
2876 path.push_key("certificateHashDataChain");
2877 if let Some(value) = &self.certificate_hash_data_chain {
2878 validate::list_len(value.len(), Some(1), None, path, out);
2879 for (index, item) in value.iter().enumerate() {
2880 path.push_index(index);
2881 Validate::validate_at(item, path, out);
2882 path.pop();
2883 }
2884 }
2885 path.pop();
2886 path.push_key("customData");
2887 if let Some(value) = &self.custom_data {
2888 Validate::validate_at(value, path, out);
2889 }
2890 path.pop();
2891 }
2892}
2893
2894impl Sealed for GetInstalledCertificateIdsResponse {}
2895impl Response for GetInstalledCertificateIdsResponse {}
2896
2897#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2899pub struct GetLocalListVersionRequest {
2900 #[serde(rename = "customData")]
2902 #[serde(default, skip_serializing_if = "Option::is_none")]
2903 pub custom_data: Option<crate::types::CustomData>,
2904}
2905
2906impl GetLocalListVersionRequest {
2907 #[must_use]
2909 pub fn new() -> Self {
2910 Self::default()
2911 }
2912
2913 #[must_use]
2915 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2916 self.custom_data = Some(value);
2917 self
2918 }
2919}
2920
2921impl Validate for GetLocalListVersionRequest {
2922 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2923 path.push_key("customData");
2924 if let Some(value) = &self.custom_data {
2925 Validate::validate_at(value, path, out);
2926 }
2927 path.pop();
2928 }
2929}
2930
2931impl Sealed for GetLocalListVersionRequest {}
2932impl Request for GetLocalListVersionRequest {
2933 type Action = Action;
2934 const ACTION: Action = Action::GetLocalListVersion;
2935 const KIND: MessageKind = MessageKind::Call;
2936 const ORIGIN: Origin = Origin::Csms;
2937 type Response = GetLocalListVersionResponse;
2938}
2939
2940impl Confirmed for GetLocalListVersionRequest {}
2941
2942#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2944pub struct GetLocalListVersionResponse {
2945 #[serde(rename = "versionNumber")]
2947 pub version_number: i32,
2948 #[serde(rename = "customData")]
2950 #[serde(default, skip_serializing_if = "Option::is_none")]
2951 pub custom_data: Option<crate::types::CustomData>,
2952}
2953
2954impl GetLocalListVersionResponse {
2955 #[must_use]
2957 pub fn new(version_number: i32) -> Self {
2958 Self {
2959 version_number,
2960 custom_data: None,
2961 }
2962 }
2963
2964 #[must_use]
2966 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2967 self.custom_data = Some(value);
2968 self
2969 }
2970}
2971
2972impl Validate for GetLocalListVersionResponse {
2973 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2974 path.push_key("customData");
2975 if let Some(value) = &self.custom_data {
2976 Validate::validate_at(value, path, out);
2977 }
2978 path.pop();
2979 }
2980}
2981
2982impl Sealed for GetLocalListVersionResponse {}
2983impl Response for GetLocalListVersionResponse {}
2984
2985#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2987pub struct GetLogRequest {
2988 pub log: LogParameters,
2990 #[serde(rename = "logType")]
2992 pub log_type: Log,
2993 #[serde(rename = "requestId")]
2995 pub request_id: i32,
2996 #[serde(default, skip_serializing_if = "Option::is_none")]
2998 pub retries: Option<i32>,
2999 #[serde(rename = "retryInterval")]
3001 #[serde(default, skip_serializing_if = "Option::is_none")]
3002 pub retry_interval: Option<i32>,
3003 #[serde(rename = "customData")]
3005 #[serde(default, skip_serializing_if = "Option::is_none")]
3006 pub custom_data: Option<crate::types::CustomData>,
3007}
3008
3009impl GetLogRequest {
3010 #[must_use]
3012 pub fn new(log: LogParameters, log_type: Log, request_id: i32) -> Self {
3013 Self {
3014 log,
3015 log_type,
3016 request_id,
3017 retries: None,
3018 retry_interval: None,
3019 custom_data: None,
3020 }
3021 }
3022
3023 #[must_use]
3025 pub fn with_retries(mut self, value: i32) -> Self {
3026 self.retries = Some(value);
3027 self
3028 }
3029
3030 #[must_use]
3032 pub fn with_retry_interval(mut self, value: i32) -> Self {
3033 self.retry_interval = Some(value);
3034 self
3035 }
3036
3037 #[must_use]
3039 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3040 self.custom_data = Some(value);
3041 self
3042 }
3043}
3044
3045impl Validate for GetLogRequest {
3046 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3047 path.push_key("log");
3048 Validate::validate_at(&self.log, path, out);
3049 path.pop();
3050 path.push_key("logType");
3051 Validate::validate_at(&self.log_type, path, out);
3052 path.pop();
3053 path.push_key("customData");
3054 if let Some(value) = &self.custom_data {
3055 Validate::validate_at(value, path, out);
3056 }
3057 path.pop();
3058 }
3059}
3060
3061impl Sealed for GetLogRequest {}
3062impl Request for GetLogRequest {
3063 type Action = Action;
3064 const ACTION: Action = Action::GetLog;
3065 const KIND: MessageKind = MessageKind::Call;
3066 const ORIGIN: Origin = Origin::Csms;
3067 type Response = GetLogResponse;
3068}
3069
3070impl Confirmed for GetLogRequest {}
3071
3072#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3074pub struct GetLogResponse {
3075 pub status: LogStatus,
3077 #[serde(rename = "statusInfo")]
3079 #[serde(default, skip_serializing_if = "Option::is_none")]
3080 pub status_info: Option<StatusInfo>,
3081 #[serde(default, skip_serializing_if = "Option::is_none")]
3083 pub filename: Option<String>,
3084 #[serde(rename = "customData")]
3086 #[serde(default, skip_serializing_if = "Option::is_none")]
3087 pub custom_data: Option<crate::types::CustomData>,
3088}
3089
3090impl GetLogResponse {
3091 #[must_use]
3093 pub fn new(status: LogStatus) -> Self {
3094 Self {
3095 status,
3096 status_info: None,
3097 filename: None,
3098 custom_data: None,
3099 }
3100 }
3101
3102 #[must_use]
3104 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3105 self.status_info = Some(value);
3106 self
3107 }
3108
3109 #[must_use]
3111 pub fn with_filename(mut self, value: impl Into<String>) -> Self {
3112 self.filename = Some(value.into());
3113 self
3114 }
3115
3116 #[must_use]
3118 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3119 self.custom_data = Some(value);
3120 self
3121 }
3122}
3123
3124impl Validate for GetLogResponse {
3125 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3126 path.push_key("status");
3127 Validate::validate_at(&self.status, path, out);
3128 path.pop();
3129 path.push_key("statusInfo");
3130 if let Some(value) = &self.status_info {
3131 Validate::validate_at(value, path, out);
3132 }
3133 path.pop();
3134 path.push_key("filename");
3135 if let Some(value) = &self.filename {
3136 validate::string(value.as_str(), None, Some(255), path, out);
3137 }
3138 path.pop();
3139 path.push_key("customData");
3140 if let Some(value) = &self.custom_data {
3141 Validate::validate_at(value, path, out);
3142 }
3143 path.pop();
3144 }
3145}
3146
3147impl Sealed for GetLogResponse {}
3148impl Response for GetLogResponse {}
3149
3150#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3152pub struct GetMonitoringReportRequest {
3153 #[serde(rename = "requestId")]
3155 pub request_id: i32,
3156 #[serde(rename = "componentVariable")]
3158 #[serde(default, skip_serializing_if = "Option::is_none")]
3159 pub component_variable: Option<Vec<ComponentVariable>>,
3160 #[serde(rename = "monitoringCriteria")]
3162 #[serde(default, skip_serializing_if = "Option::is_none")]
3163 pub monitoring_criteria: Option<Vec<MonitoringCriterion>>,
3164 #[serde(rename = "customData")]
3166 #[serde(default, skip_serializing_if = "Option::is_none")]
3167 pub custom_data: Option<crate::types::CustomData>,
3168}
3169
3170impl GetMonitoringReportRequest {
3171 #[must_use]
3173 pub fn new(request_id: i32) -> Self {
3174 Self {
3175 request_id,
3176 component_variable: None,
3177 monitoring_criteria: None,
3178 custom_data: None,
3179 }
3180 }
3181
3182 #[must_use]
3184 pub fn with_component_variable(mut self, value: Vec<ComponentVariable>) -> Self {
3185 self.component_variable = Some(value);
3186 self
3187 }
3188
3189 #[must_use]
3191 pub fn with_monitoring_criteria(mut self, value: Vec<MonitoringCriterion>) -> Self {
3192 self.monitoring_criteria = Some(value);
3193 self
3194 }
3195
3196 #[must_use]
3198 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3199 self.custom_data = Some(value);
3200 self
3201 }
3202}
3203
3204impl Validate for GetMonitoringReportRequest {
3205 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3206 path.push_key("componentVariable");
3207 if let Some(value) = &self.component_variable {
3208 validate::list_len(value.len(), Some(1), None, path, out);
3209 for (index, item) in value.iter().enumerate() {
3210 path.push_index(index);
3211 Validate::validate_at(item, path, out);
3212 path.pop();
3213 }
3214 }
3215 path.pop();
3216 path.push_key("monitoringCriteria");
3217 if let Some(value) = &self.monitoring_criteria {
3218 validate::list_len(value.len(), Some(1), Some(3), path, out);
3219 for (index, item) in value.iter().enumerate() {
3220 path.push_index(index);
3221 Validate::validate_at(item, path, out);
3222 path.pop();
3223 }
3224 }
3225 path.pop();
3226 path.push_key("customData");
3227 if let Some(value) = &self.custom_data {
3228 Validate::validate_at(value, path, out);
3229 }
3230 path.pop();
3231 }
3232}
3233
3234impl Sealed for GetMonitoringReportRequest {}
3235impl Request for GetMonitoringReportRequest {
3236 type Action = Action;
3237 const ACTION: Action = Action::GetMonitoringReport;
3238 const KIND: MessageKind = MessageKind::Call;
3239 const ORIGIN: Origin = Origin::Csms;
3240 type Response = GetMonitoringReportResponse;
3241}
3242
3243impl Confirmed for GetMonitoringReportRequest {}
3244
3245#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3247pub struct GetMonitoringReportResponse {
3248 pub status: GenericDeviceModelStatus,
3250 #[serde(rename = "statusInfo")]
3252 #[serde(default, skip_serializing_if = "Option::is_none")]
3253 pub status_info: Option<StatusInfo>,
3254 #[serde(rename = "customData")]
3256 #[serde(default, skip_serializing_if = "Option::is_none")]
3257 pub custom_data: Option<crate::types::CustomData>,
3258}
3259
3260impl GetMonitoringReportResponse {
3261 #[must_use]
3263 pub fn new(status: GenericDeviceModelStatus) -> Self {
3264 Self {
3265 status,
3266 status_info: None,
3267 custom_data: None,
3268 }
3269 }
3270
3271 #[must_use]
3273 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3274 self.status_info = Some(value);
3275 self
3276 }
3277
3278 #[must_use]
3280 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3281 self.custom_data = Some(value);
3282 self
3283 }
3284}
3285
3286impl Validate for GetMonitoringReportResponse {
3287 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3288 path.push_key("status");
3289 Validate::validate_at(&self.status, path, out);
3290 path.pop();
3291 path.push_key("statusInfo");
3292 if let Some(value) = &self.status_info {
3293 Validate::validate_at(value, path, out);
3294 }
3295 path.pop();
3296 path.push_key("customData");
3297 if let Some(value) = &self.custom_data {
3298 Validate::validate_at(value, path, out);
3299 }
3300 path.pop();
3301 }
3302}
3303
3304impl Sealed for GetMonitoringReportResponse {}
3305impl Response for GetMonitoringReportResponse {}
3306
3307#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3309pub struct GetReportRequest {
3310 #[serde(rename = "requestId")]
3312 pub request_id: i32,
3313 #[serde(rename = "componentVariable")]
3315 #[serde(default, skip_serializing_if = "Option::is_none")]
3316 pub component_variable: Option<Vec<ComponentVariable>>,
3317 #[serde(rename = "componentCriteria")]
3319 #[serde(default, skip_serializing_if = "Option::is_none")]
3320 pub component_criteria: Option<Vec<ComponentCriterion>>,
3321 #[serde(rename = "customData")]
3323 #[serde(default, skip_serializing_if = "Option::is_none")]
3324 pub custom_data: Option<crate::types::CustomData>,
3325}
3326
3327impl GetReportRequest {
3328 #[must_use]
3330 pub fn new(request_id: i32) -> Self {
3331 Self {
3332 request_id,
3333 component_variable: None,
3334 component_criteria: None,
3335 custom_data: None,
3336 }
3337 }
3338
3339 #[must_use]
3341 pub fn with_component_variable(mut self, value: Vec<ComponentVariable>) -> Self {
3342 self.component_variable = Some(value);
3343 self
3344 }
3345
3346 #[must_use]
3348 pub fn with_component_criteria(mut self, value: Vec<ComponentCriterion>) -> Self {
3349 self.component_criteria = Some(value);
3350 self
3351 }
3352
3353 #[must_use]
3355 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3356 self.custom_data = Some(value);
3357 self
3358 }
3359}
3360
3361impl Validate for GetReportRequest {
3362 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3363 path.push_key("componentVariable");
3364 if let Some(value) = &self.component_variable {
3365 validate::list_len(value.len(), Some(1), None, path, out);
3366 for (index, item) in value.iter().enumerate() {
3367 path.push_index(index);
3368 Validate::validate_at(item, path, out);
3369 path.pop();
3370 }
3371 }
3372 path.pop();
3373 path.push_key("componentCriteria");
3374 if let Some(value) = &self.component_criteria {
3375 validate::list_len(value.len(), Some(1), Some(4), path, out);
3376 for (index, item) in value.iter().enumerate() {
3377 path.push_index(index);
3378 Validate::validate_at(item, path, out);
3379 path.pop();
3380 }
3381 }
3382 path.pop();
3383 path.push_key("customData");
3384 if let Some(value) = &self.custom_data {
3385 Validate::validate_at(value, path, out);
3386 }
3387 path.pop();
3388 }
3389}
3390
3391impl Sealed for GetReportRequest {}
3392impl Request for GetReportRequest {
3393 type Action = Action;
3394 const ACTION: Action = Action::GetReport;
3395 const KIND: MessageKind = MessageKind::Call;
3396 const ORIGIN: Origin = Origin::Csms;
3397 type Response = GetReportResponse;
3398}
3399
3400impl Confirmed for GetReportRequest {}
3401
3402#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3404pub struct GetReportResponse {
3405 pub status: GenericDeviceModelStatus,
3407 #[serde(rename = "statusInfo")]
3409 #[serde(default, skip_serializing_if = "Option::is_none")]
3410 pub status_info: Option<StatusInfo>,
3411 #[serde(rename = "customData")]
3413 #[serde(default, skip_serializing_if = "Option::is_none")]
3414 pub custom_data: Option<crate::types::CustomData>,
3415}
3416
3417impl GetReportResponse {
3418 #[must_use]
3420 pub fn new(status: GenericDeviceModelStatus) -> Self {
3421 Self {
3422 status,
3423 status_info: None,
3424 custom_data: None,
3425 }
3426 }
3427
3428 #[must_use]
3430 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3431 self.status_info = Some(value);
3432 self
3433 }
3434
3435 #[must_use]
3437 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3438 self.custom_data = Some(value);
3439 self
3440 }
3441}
3442
3443impl Validate for GetReportResponse {
3444 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3445 path.push_key("status");
3446 Validate::validate_at(&self.status, path, out);
3447 path.pop();
3448 path.push_key("statusInfo");
3449 if let Some(value) = &self.status_info {
3450 Validate::validate_at(value, path, out);
3451 }
3452 path.pop();
3453 path.push_key("customData");
3454 if let Some(value) = &self.custom_data {
3455 Validate::validate_at(value, path, out);
3456 }
3457 path.pop();
3458 }
3459}
3460
3461impl Sealed for GetReportResponse {}
3462impl Response for GetReportResponse {}
3463
3464#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
3466pub struct GetTransactionStatusRequest {
3467 #[serde(rename = "transactionId")]
3469 #[serde(default, skip_serializing_if = "Option::is_none")]
3470 pub transaction_id: Option<String>,
3471 #[serde(rename = "customData")]
3473 #[serde(default, skip_serializing_if = "Option::is_none")]
3474 pub custom_data: Option<crate::types::CustomData>,
3475}
3476
3477impl GetTransactionStatusRequest {
3478 #[must_use]
3480 pub fn new() -> Self {
3481 Self::default()
3482 }
3483
3484 #[must_use]
3486 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
3487 self.transaction_id = Some(value.into());
3488 self
3489 }
3490
3491 #[must_use]
3493 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3494 self.custom_data = Some(value);
3495 self
3496 }
3497}
3498
3499impl Validate for GetTransactionStatusRequest {
3500 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3501 path.push_key("transactionId");
3502 if let Some(value) = &self.transaction_id {
3503 validate::string(value.as_str(), None, Some(36), path, out);
3504 }
3505 path.pop();
3506 path.push_key("customData");
3507 if let Some(value) = &self.custom_data {
3508 Validate::validate_at(value, path, out);
3509 }
3510 path.pop();
3511 }
3512}
3513
3514impl Sealed for GetTransactionStatusRequest {}
3515impl Request for GetTransactionStatusRequest {
3516 type Action = Action;
3517 const ACTION: Action = Action::GetTransactionStatus;
3518 const KIND: MessageKind = MessageKind::Call;
3519 const ORIGIN: Origin = Origin::Csms;
3520 type Response = GetTransactionStatusResponse;
3521}
3522
3523impl Confirmed for GetTransactionStatusRequest {}
3524
3525#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3527pub struct GetTransactionStatusResponse {
3528 #[serde(rename = "messagesInQueue")]
3530 pub messages_in_queue: bool,
3531 #[serde(rename = "ongoingIndicator")]
3533 #[serde(default, skip_serializing_if = "Option::is_none")]
3534 pub ongoing_indicator: Option<bool>,
3535 #[serde(rename = "customData")]
3537 #[serde(default, skip_serializing_if = "Option::is_none")]
3538 pub custom_data: Option<crate::types::CustomData>,
3539}
3540
3541impl GetTransactionStatusResponse {
3542 #[must_use]
3544 pub fn new(messages_in_queue: bool) -> Self {
3545 Self {
3546 messages_in_queue,
3547 ongoing_indicator: None,
3548 custom_data: None,
3549 }
3550 }
3551
3552 #[must_use]
3554 pub fn with_ongoing_indicator(mut self, value: bool) -> Self {
3555 self.ongoing_indicator = Some(value);
3556 self
3557 }
3558
3559 #[must_use]
3561 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3562 self.custom_data = Some(value);
3563 self
3564 }
3565}
3566
3567impl Validate for GetTransactionStatusResponse {
3568 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3569 path.push_key("customData");
3570 if let Some(value) = &self.custom_data {
3571 Validate::validate_at(value, path, out);
3572 }
3573 path.pop();
3574 }
3575}
3576
3577impl Sealed for GetTransactionStatusResponse {}
3578impl Response for GetTransactionStatusResponse {}
3579
3580#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3582pub struct GetVariablesRequest {
3583 #[serde(rename = "getVariableData")]
3585 pub get_variable_data: Vec<GetVariableData>,
3586 #[serde(rename = "customData")]
3588 #[serde(default, skip_serializing_if = "Option::is_none")]
3589 pub custom_data: Option<crate::types::CustomData>,
3590}
3591
3592impl GetVariablesRequest {
3593 #[must_use]
3595 pub fn new(get_variable_data: Vec<GetVariableData>) -> Self {
3596 Self {
3597 get_variable_data,
3598 custom_data: None,
3599 }
3600 }
3601
3602 #[must_use]
3604 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3605 self.custom_data = Some(value);
3606 self
3607 }
3608}
3609
3610impl Validate for GetVariablesRequest {
3611 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3612 path.push_key("getVariableData");
3613 validate::list_len(self.get_variable_data.len(), Some(1), None, path, out);
3614 for (index, item) in self.get_variable_data.iter().enumerate() {
3615 path.push_index(index);
3616 Validate::validate_at(item, path, out);
3617 path.pop();
3618 }
3619 path.pop();
3620 path.push_key("customData");
3621 if let Some(value) = &self.custom_data {
3622 Validate::validate_at(value, path, out);
3623 }
3624 path.pop();
3625 }
3626}
3627
3628impl Sealed for GetVariablesRequest {}
3629impl Request for GetVariablesRequest {
3630 type Action = Action;
3631 const ACTION: Action = Action::GetVariables;
3632 const KIND: MessageKind = MessageKind::Call;
3633 const ORIGIN: Origin = Origin::Csms;
3634 type Response = GetVariablesResponse;
3635}
3636
3637impl Confirmed for GetVariablesRequest {}
3638
3639#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3641pub struct GetVariablesResponse {
3642 #[serde(rename = "getVariableResult")]
3644 pub get_variable_result: Vec<GetVariableResult>,
3645 #[serde(rename = "customData")]
3647 #[serde(default, skip_serializing_if = "Option::is_none")]
3648 pub custom_data: Option<crate::types::CustomData>,
3649}
3650
3651impl GetVariablesResponse {
3652 #[must_use]
3654 pub fn new(get_variable_result: Vec<GetVariableResult>) -> Self {
3655 Self {
3656 get_variable_result,
3657 custom_data: None,
3658 }
3659 }
3660
3661 #[must_use]
3663 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3664 self.custom_data = Some(value);
3665 self
3666 }
3667}
3668
3669impl Validate for GetVariablesResponse {
3670 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3671 path.push_key("getVariableResult");
3672 validate::list_len(self.get_variable_result.len(), Some(1), None, path, out);
3673 for (index, item) in self.get_variable_result.iter().enumerate() {
3674 path.push_index(index);
3675 Validate::validate_at(item, path, out);
3676 path.pop();
3677 }
3678 path.pop();
3679 path.push_key("customData");
3680 if let Some(value) = &self.custom_data {
3681 Validate::validate_at(value, path, out);
3682 }
3683 path.pop();
3684 }
3685}
3686
3687impl Sealed for GetVariablesResponse {}
3688impl Response for GetVariablesResponse {}
3689
3690#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
3692pub struct HeartbeatRequest {
3693 #[serde(rename = "customData")]
3695 #[serde(default, skip_serializing_if = "Option::is_none")]
3696 pub custom_data: Option<crate::types::CustomData>,
3697}
3698
3699impl HeartbeatRequest {
3700 #[must_use]
3702 pub fn new() -> Self {
3703 Self::default()
3704 }
3705
3706 #[must_use]
3708 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3709 self.custom_data = Some(value);
3710 self
3711 }
3712}
3713
3714impl Validate for HeartbeatRequest {
3715 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3716 path.push_key("customData");
3717 if let Some(value) = &self.custom_data {
3718 Validate::validate_at(value, path, out);
3719 }
3720 path.pop();
3721 }
3722}
3723
3724impl Sealed for HeartbeatRequest {}
3725impl Request for HeartbeatRequest {
3726 type Action = Action;
3727 const ACTION: Action = Action::Heartbeat;
3728 const KIND: MessageKind = MessageKind::Call;
3729 const ORIGIN: Origin = Origin::ChargingStation;
3730 type Response = HeartbeatResponse;
3731}
3732
3733impl Confirmed for HeartbeatRequest {}
3734
3735#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3737pub struct HeartbeatResponse {
3738 #[serde(rename = "currentTime")]
3740 pub current_time: crate::types::DateTime,
3741 #[serde(rename = "customData")]
3743 #[serde(default, skip_serializing_if = "Option::is_none")]
3744 pub custom_data: Option<crate::types::CustomData>,
3745}
3746
3747impl HeartbeatResponse {
3748 #[must_use]
3750 pub fn new(current_time: impl Into<crate::types::DateTime>) -> Self {
3751 Self {
3752 current_time: current_time.into(),
3753 custom_data: None,
3754 }
3755 }
3756
3757 #[must_use]
3759 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3760 self.custom_data = Some(value);
3761 self
3762 }
3763}
3764
3765impl Validate for HeartbeatResponse {
3766 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3767 path.push_key("customData");
3768 if let Some(value) = &self.custom_data {
3769 Validate::validate_at(value, path, out);
3770 }
3771 path.pop();
3772 }
3773}
3774
3775impl Sealed for HeartbeatResponse {}
3776impl Response for HeartbeatResponse {}
3777
3778#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3780pub struct InstallCertificateRequest {
3781 #[serde(rename = "certificateType")]
3783 pub certificate_type: InstallCertificateUse,
3784 pub certificate: String,
3786 #[serde(rename = "customData")]
3788 #[serde(default, skip_serializing_if = "Option::is_none")]
3789 pub custom_data: Option<crate::types::CustomData>,
3790}
3791
3792impl InstallCertificateRequest {
3793 #[must_use]
3795 pub fn new(certificate_type: InstallCertificateUse, certificate: impl Into<String>) -> Self {
3796 Self {
3797 certificate_type,
3798 certificate: certificate.into(),
3799 custom_data: None,
3800 }
3801 }
3802
3803 #[must_use]
3805 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3806 self.custom_data = Some(value);
3807 self
3808 }
3809}
3810
3811impl Validate for InstallCertificateRequest {
3812 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3813 path.push_key("certificateType");
3814 Validate::validate_at(&self.certificate_type, path, out);
3815 path.pop();
3816 path.push_key("certificate");
3817 validate::string(self.certificate.as_str(), None, Some(5500), path, out);
3818 path.pop();
3819 path.push_key("customData");
3820 if let Some(value) = &self.custom_data {
3821 Validate::validate_at(value, path, out);
3822 }
3823 path.pop();
3824 }
3825}
3826
3827impl Sealed for InstallCertificateRequest {}
3828impl Request for InstallCertificateRequest {
3829 type Action = Action;
3830 const ACTION: Action = Action::InstallCertificate;
3831 const KIND: MessageKind = MessageKind::Call;
3832 const ORIGIN: Origin = Origin::Csms;
3833 type Response = InstallCertificateResponse;
3834}
3835
3836impl Confirmed for InstallCertificateRequest {}
3837
3838#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3840pub struct InstallCertificateResponse {
3841 pub status: InstallCertificateStatus,
3843 #[serde(rename = "statusInfo")]
3845 #[serde(default, skip_serializing_if = "Option::is_none")]
3846 pub status_info: Option<StatusInfo>,
3847 #[serde(rename = "customData")]
3849 #[serde(default, skip_serializing_if = "Option::is_none")]
3850 pub custom_data: Option<crate::types::CustomData>,
3851}
3852
3853impl InstallCertificateResponse {
3854 #[must_use]
3856 pub fn new(status: InstallCertificateStatus) -> Self {
3857 Self {
3858 status,
3859 status_info: None,
3860 custom_data: None,
3861 }
3862 }
3863
3864 #[must_use]
3866 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3867 self.status_info = Some(value);
3868 self
3869 }
3870
3871 #[must_use]
3873 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3874 self.custom_data = Some(value);
3875 self
3876 }
3877}
3878
3879impl Validate for InstallCertificateResponse {
3880 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3881 path.push_key("status");
3882 Validate::validate_at(&self.status, path, out);
3883 path.pop();
3884 path.push_key("statusInfo");
3885 if let Some(value) = &self.status_info {
3886 Validate::validate_at(value, path, out);
3887 }
3888 path.pop();
3889 path.push_key("customData");
3890 if let Some(value) = &self.custom_data {
3891 Validate::validate_at(value, path, out);
3892 }
3893 path.pop();
3894 }
3895}
3896
3897impl Sealed for InstallCertificateResponse {}
3898impl Response for InstallCertificateResponse {}
3899
3900#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3902pub struct LogStatusNotificationRequest {
3903 pub status: UploadLogStatus,
3905 #[serde(rename = "requestId")]
3908 #[serde(default, skip_serializing_if = "Option::is_none")]
3909 pub request_id: Option<i32>,
3910 #[serde(rename = "customData")]
3912 #[serde(default, skip_serializing_if = "Option::is_none")]
3913 pub custom_data: Option<crate::types::CustomData>,
3914}
3915
3916impl LogStatusNotificationRequest {
3917 #[must_use]
3919 pub fn new(status: UploadLogStatus) -> Self {
3920 Self {
3921 status,
3922 request_id: None,
3923 custom_data: None,
3924 }
3925 }
3926
3927 #[must_use]
3929 pub fn with_request_id(mut self, value: i32) -> Self {
3930 self.request_id = Some(value);
3931 self
3932 }
3933
3934 #[must_use]
3936 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3937 self.custom_data = Some(value);
3938 self
3939 }
3940}
3941
3942impl Validate for LogStatusNotificationRequest {
3943 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3944 path.push_key("status");
3945 Validate::validate_at(&self.status, path, out);
3946 path.pop();
3947 path.push_key("customData");
3948 if let Some(value) = &self.custom_data {
3949 Validate::validate_at(value, path, out);
3950 }
3951 path.pop();
3952 }
3953}
3954
3955impl Sealed for LogStatusNotificationRequest {}
3956impl Request for LogStatusNotificationRequest {
3957 type Action = Action;
3958 const ACTION: Action = Action::LogStatusNotification;
3959 const KIND: MessageKind = MessageKind::Call;
3960 const ORIGIN: Origin = Origin::ChargingStation;
3961 type Response = LogStatusNotificationResponse;
3962}
3963
3964impl Confirmed for LogStatusNotificationRequest {}
3965
3966#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
3968pub struct LogStatusNotificationResponse {
3969 #[serde(rename = "customData")]
3971 #[serde(default, skip_serializing_if = "Option::is_none")]
3972 pub custom_data: Option<crate::types::CustomData>,
3973}
3974
3975impl LogStatusNotificationResponse {
3976 #[must_use]
3978 pub fn new() -> Self {
3979 Self::default()
3980 }
3981
3982 #[must_use]
3984 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3985 self.custom_data = Some(value);
3986 self
3987 }
3988}
3989
3990impl Validate for LogStatusNotificationResponse {
3991 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3992 path.push_key("customData");
3993 if let Some(value) = &self.custom_data {
3994 Validate::validate_at(value, path, out);
3995 }
3996 path.pop();
3997 }
3998}
3999
4000impl Sealed for LogStatusNotificationResponse {}
4001impl Response for LogStatusNotificationResponse {}
4002
4003#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4008pub struct MeterValuesRequest {
4009 #[serde(rename = "evseId")]
4013 pub evse_id: i32,
4014 #[serde(rename = "meterValue")]
4016 pub meter_value: Vec<MeterValue>,
4017 #[serde(rename = "customData")]
4019 #[serde(default, skip_serializing_if = "Option::is_none")]
4020 pub custom_data: Option<crate::types::CustomData>,
4021}
4022
4023impl MeterValuesRequest {
4024 #[must_use]
4026 pub fn new(evse_id: i32, meter_value: Vec<MeterValue>) -> Self {
4027 Self {
4028 evse_id,
4029 meter_value,
4030 custom_data: None,
4031 }
4032 }
4033
4034 #[must_use]
4036 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4037 self.custom_data = Some(value);
4038 self
4039 }
4040}
4041
4042impl Validate for MeterValuesRequest {
4043 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4044 path.push_key("meterValue");
4045 validate::list_len(self.meter_value.len(), Some(1), None, path, out);
4046 for (index, item) in self.meter_value.iter().enumerate() {
4047 path.push_index(index);
4048 Validate::validate_at(item, path, out);
4049 path.pop();
4050 }
4051 path.pop();
4052 path.push_key("customData");
4053 if let Some(value) = &self.custom_data {
4054 Validate::validate_at(value, path, out);
4055 }
4056 path.pop();
4057 }
4058}
4059
4060impl Sealed for MeterValuesRequest {}
4061impl Request for MeterValuesRequest {
4062 type Action = Action;
4063 const ACTION: Action = Action::MeterValues;
4064 const KIND: MessageKind = MessageKind::Call;
4065 const ORIGIN: Origin = Origin::ChargingStation;
4066 type Response = MeterValuesResponse;
4067}
4068
4069impl Confirmed for MeterValuesRequest {}
4070
4071#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4073pub struct MeterValuesResponse {
4074 #[serde(rename = "customData")]
4076 #[serde(default, skip_serializing_if = "Option::is_none")]
4077 pub custom_data: Option<crate::types::CustomData>,
4078}
4079
4080impl MeterValuesResponse {
4081 #[must_use]
4083 pub fn new() -> Self {
4084 Self::default()
4085 }
4086
4087 #[must_use]
4089 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4090 self.custom_data = Some(value);
4091 self
4092 }
4093}
4094
4095impl Validate for MeterValuesResponse {
4096 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4097 path.push_key("customData");
4098 if let Some(value) = &self.custom_data {
4099 Validate::validate_at(value, path, out);
4100 }
4101 path.pop();
4102 }
4103}
4104
4105impl Sealed for MeterValuesResponse {}
4106impl Response for MeterValuesResponse {}
4107
4108#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4110pub struct NotifyChargingLimitRequest {
4111 #[serde(rename = "chargingLimit")]
4113 pub charging_limit: ChargingLimit,
4114 #[serde(rename = "chargingSchedule")]
4116 #[serde(default, skip_serializing_if = "Option::is_none")]
4117 pub charging_schedule: Option<Vec<ChargingSchedule>>,
4118 #[serde(rename = "evseId")]
4120 #[serde(default, skip_serializing_if = "Option::is_none")]
4121 pub evse_id: Option<i32>,
4122 #[serde(rename = "customData")]
4124 #[serde(default, skip_serializing_if = "Option::is_none")]
4125 pub custom_data: Option<crate::types::CustomData>,
4126}
4127
4128impl NotifyChargingLimitRequest {
4129 #[must_use]
4131 pub fn new(charging_limit: ChargingLimit) -> Self {
4132 Self {
4133 charging_limit,
4134 charging_schedule: None,
4135 evse_id: None,
4136 custom_data: None,
4137 }
4138 }
4139
4140 #[must_use]
4142 pub fn with_charging_schedule(mut self, value: Vec<ChargingSchedule>) -> Self {
4143 self.charging_schedule = Some(value);
4144 self
4145 }
4146
4147 #[must_use]
4149 pub fn with_evse_id(mut self, value: i32) -> Self {
4150 self.evse_id = Some(value);
4151 self
4152 }
4153
4154 #[must_use]
4156 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4157 self.custom_data = Some(value);
4158 self
4159 }
4160}
4161
4162impl Validate for NotifyChargingLimitRequest {
4163 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4164 path.push_key("chargingLimit");
4165 Validate::validate_at(&self.charging_limit, path, out);
4166 path.pop();
4167 path.push_key("chargingSchedule");
4168 if let Some(value) = &self.charging_schedule {
4169 validate::list_len(value.len(), Some(1), None, path, out);
4170 for (index, item) in value.iter().enumerate() {
4171 path.push_index(index);
4172 Validate::validate_at(item, path, out);
4173 path.pop();
4174 }
4175 }
4176 path.pop();
4177 path.push_key("customData");
4178 if let Some(value) = &self.custom_data {
4179 Validate::validate_at(value, path, out);
4180 }
4181 path.pop();
4182 }
4183}
4184
4185impl Sealed for NotifyChargingLimitRequest {}
4186impl Request for NotifyChargingLimitRequest {
4187 type Action = Action;
4188 const ACTION: Action = Action::NotifyChargingLimit;
4189 const KIND: MessageKind = MessageKind::Call;
4190 const ORIGIN: Origin = Origin::ChargingStation;
4191 type Response = NotifyChargingLimitResponse;
4192}
4193
4194impl Confirmed for NotifyChargingLimitRequest {}
4195
4196#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4198pub struct NotifyChargingLimitResponse {
4199 #[serde(rename = "customData")]
4201 #[serde(default, skip_serializing_if = "Option::is_none")]
4202 pub custom_data: Option<crate::types::CustomData>,
4203}
4204
4205impl NotifyChargingLimitResponse {
4206 #[must_use]
4208 pub fn new() -> Self {
4209 Self::default()
4210 }
4211
4212 #[must_use]
4214 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4215 self.custom_data = Some(value);
4216 self
4217 }
4218}
4219
4220impl Validate for NotifyChargingLimitResponse {
4221 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4222 path.push_key("customData");
4223 if let Some(value) = &self.custom_data {
4224 Validate::validate_at(value, path, out);
4225 }
4226 path.pop();
4227 }
4228}
4229
4230impl Sealed for NotifyChargingLimitResponse {}
4231impl Response for NotifyChargingLimitResponse {}
4232
4233#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4235pub struct NotifyCustomerInformationRequest {
4236 pub data: String,
4238 #[serde(rename = "seqNo")]
4240 pub seq_no: i32,
4241 #[serde(rename = "generatedAt")]
4243 pub generated_at: crate::types::DateTime,
4244 #[serde(rename = "requestId")]
4246 pub request_id: i32,
4247 #[serde(default, skip_serializing_if = "Option::is_none")]
4250 pub tbc: Option<bool>,
4251 #[serde(rename = "customData")]
4253 #[serde(default, skip_serializing_if = "Option::is_none")]
4254 pub custom_data: Option<crate::types::CustomData>,
4255}
4256
4257impl NotifyCustomerInformationRequest {
4258 #[must_use]
4260 pub fn new(
4261 data: impl Into<String>,
4262 seq_no: i32,
4263 generated_at: impl Into<crate::types::DateTime>,
4264 request_id: i32,
4265 ) -> Self {
4266 Self {
4267 data: data.into(),
4268 seq_no,
4269 generated_at: generated_at.into(),
4270 request_id,
4271 tbc: None,
4272 custom_data: None,
4273 }
4274 }
4275
4276 #[must_use]
4278 pub fn with_tbc(mut self, value: bool) -> Self {
4279 self.tbc = Some(value);
4280 self
4281 }
4282
4283 #[must_use]
4285 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4286 self.custom_data = Some(value);
4287 self
4288 }
4289}
4290
4291impl Validate for NotifyCustomerInformationRequest {
4292 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4293 path.push_key("data");
4294 validate::string(self.data.as_str(), None, Some(512), path, out);
4295 path.pop();
4296 path.push_key("customData");
4297 if let Some(value) = &self.custom_data {
4298 Validate::validate_at(value, path, out);
4299 }
4300 path.pop();
4301 }
4302}
4303
4304impl Sealed for NotifyCustomerInformationRequest {}
4305impl Request for NotifyCustomerInformationRequest {
4306 type Action = Action;
4307 const ACTION: Action = Action::NotifyCustomerInformation;
4308 const KIND: MessageKind = MessageKind::Call;
4309 const ORIGIN: Origin = Origin::ChargingStation;
4310 type Response = NotifyCustomerInformationResponse;
4311}
4312
4313impl Confirmed for NotifyCustomerInformationRequest {}
4314
4315#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4317pub struct NotifyCustomerInformationResponse {
4318 #[serde(rename = "customData")]
4320 #[serde(default, skip_serializing_if = "Option::is_none")]
4321 pub custom_data: Option<crate::types::CustomData>,
4322}
4323
4324impl NotifyCustomerInformationResponse {
4325 #[must_use]
4327 pub fn new() -> Self {
4328 Self::default()
4329 }
4330
4331 #[must_use]
4333 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4334 self.custom_data = Some(value);
4335 self
4336 }
4337}
4338
4339impl Validate for NotifyCustomerInformationResponse {
4340 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4341 path.push_key("customData");
4342 if let Some(value) = &self.custom_data {
4343 Validate::validate_at(value, path, out);
4344 }
4345 path.pop();
4346 }
4347}
4348
4349impl Sealed for NotifyCustomerInformationResponse {}
4350impl Response for NotifyCustomerInformationResponse {}
4351
4352#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4354pub struct NotifyDisplayMessagesRequest {
4355 #[serde(rename = "requestId")]
4357 pub request_id: i32,
4358 #[serde(rename = "messageInfo")]
4360 #[serde(default, skip_serializing_if = "Option::is_none")]
4361 pub message_info: Option<Vec<MessageInfo>>,
4362 #[serde(default, skip_serializing_if = "Option::is_none")]
4365 pub tbc: Option<bool>,
4366 #[serde(rename = "customData")]
4368 #[serde(default, skip_serializing_if = "Option::is_none")]
4369 pub custom_data: Option<crate::types::CustomData>,
4370}
4371
4372impl NotifyDisplayMessagesRequest {
4373 #[must_use]
4375 pub fn new(request_id: i32) -> Self {
4376 Self {
4377 request_id,
4378 message_info: None,
4379 tbc: None,
4380 custom_data: None,
4381 }
4382 }
4383
4384 #[must_use]
4386 pub fn with_message_info(mut self, value: Vec<MessageInfo>) -> Self {
4387 self.message_info = Some(value);
4388 self
4389 }
4390
4391 #[must_use]
4393 pub fn with_tbc(mut self, value: bool) -> Self {
4394 self.tbc = Some(value);
4395 self
4396 }
4397
4398 #[must_use]
4400 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4401 self.custom_data = Some(value);
4402 self
4403 }
4404}
4405
4406impl Validate for NotifyDisplayMessagesRequest {
4407 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4408 path.push_key("messageInfo");
4409 if let Some(value) = &self.message_info {
4410 validate::list_len(value.len(), Some(1), None, path, out);
4411 for (index, item) in value.iter().enumerate() {
4412 path.push_index(index);
4413 Validate::validate_at(item, path, out);
4414 path.pop();
4415 }
4416 }
4417 path.pop();
4418 path.push_key("customData");
4419 if let Some(value) = &self.custom_data {
4420 Validate::validate_at(value, path, out);
4421 }
4422 path.pop();
4423 }
4424}
4425
4426impl Sealed for NotifyDisplayMessagesRequest {}
4427impl Request for NotifyDisplayMessagesRequest {
4428 type Action = Action;
4429 const ACTION: Action = Action::NotifyDisplayMessages;
4430 const KIND: MessageKind = MessageKind::Call;
4431 const ORIGIN: Origin = Origin::ChargingStation;
4432 type Response = NotifyDisplayMessagesResponse;
4433}
4434
4435impl Confirmed for NotifyDisplayMessagesRequest {}
4436
4437#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4439pub struct NotifyDisplayMessagesResponse {
4440 #[serde(rename = "customData")]
4442 #[serde(default, skip_serializing_if = "Option::is_none")]
4443 pub custom_data: Option<crate::types::CustomData>,
4444}
4445
4446impl NotifyDisplayMessagesResponse {
4447 #[must_use]
4449 pub fn new() -> Self {
4450 Self::default()
4451 }
4452
4453 #[must_use]
4455 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4456 self.custom_data = Some(value);
4457 self
4458 }
4459}
4460
4461impl Validate for NotifyDisplayMessagesResponse {
4462 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4463 path.push_key("customData");
4464 if let Some(value) = &self.custom_data {
4465 Validate::validate_at(value, path, out);
4466 }
4467 path.pop();
4468 }
4469}
4470
4471impl Sealed for NotifyDisplayMessagesResponse {}
4472impl Response for NotifyDisplayMessagesResponse {}
4473
4474#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4476pub struct NotifyEVChargingNeedsRequest {
4477 #[serde(rename = "chargingNeeds")]
4479 pub charging_needs: ChargingNeeds,
4480 #[serde(rename = "evseId")]
4482 pub evse_id: i32,
4483 #[serde(rename = "maxScheduleTuples")]
4485 #[serde(default, skip_serializing_if = "Option::is_none")]
4486 pub max_schedule_tuples: Option<i32>,
4487 #[serde(rename = "customData")]
4489 #[serde(default, skip_serializing_if = "Option::is_none")]
4490 pub custom_data: Option<crate::types::CustomData>,
4491}
4492
4493impl NotifyEVChargingNeedsRequest {
4494 #[must_use]
4496 pub fn new(charging_needs: ChargingNeeds, evse_id: i32) -> Self {
4497 Self {
4498 charging_needs,
4499 evse_id,
4500 max_schedule_tuples: None,
4501 custom_data: None,
4502 }
4503 }
4504
4505 #[must_use]
4507 pub fn with_max_schedule_tuples(mut self, value: i32) -> Self {
4508 self.max_schedule_tuples = Some(value);
4509 self
4510 }
4511
4512 #[must_use]
4514 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4515 self.custom_data = Some(value);
4516 self
4517 }
4518}
4519
4520impl Validate for NotifyEVChargingNeedsRequest {
4521 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4522 path.push_key("chargingNeeds");
4523 Validate::validate_at(&self.charging_needs, path, out);
4524 path.pop();
4525 path.push_key("customData");
4526 if let Some(value) = &self.custom_data {
4527 Validate::validate_at(value, path, out);
4528 }
4529 path.pop();
4530 }
4531}
4532
4533impl Sealed for NotifyEVChargingNeedsRequest {}
4534impl Request for NotifyEVChargingNeedsRequest {
4535 type Action = Action;
4536 const ACTION: Action = Action::NotifyEVChargingNeeds;
4537 const KIND: MessageKind = MessageKind::Call;
4538 const ORIGIN: Origin = Origin::ChargingStation;
4539 type Response = NotifyEVChargingNeedsResponse;
4540}
4541
4542impl Confirmed for NotifyEVChargingNeedsRequest {}
4543
4544#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4546pub struct NotifyEVChargingNeedsResponse {
4547 pub status: NotifyEVChargingNeedsStatus,
4549 #[serde(rename = "statusInfo")]
4551 #[serde(default, skip_serializing_if = "Option::is_none")]
4552 pub status_info: Option<StatusInfo>,
4553 #[serde(rename = "customData")]
4555 #[serde(default, skip_serializing_if = "Option::is_none")]
4556 pub custom_data: Option<crate::types::CustomData>,
4557}
4558
4559impl NotifyEVChargingNeedsResponse {
4560 #[must_use]
4562 pub fn new(status: NotifyEVChargingNeedsStatus) -> Self {
4563 Self {
4564 status,
4565 status_info: None,
4566 custom_data: None,
4567 }
4568 }
4569
4570 #[must_use]
4572 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
4573 self.status_info = Some(value);
4574 self
4575 }
4576
4577 #[must_use]
4579 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4580 self.custom_data = Some(value);
4581 self
4582 }
4583}
4584
4585impl Validate for NotifyEVChargingNeedsResponse {
4586 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4587 path.push_key("status");
4588 Validate::validate_at(&self.status, path, out);
4589 path.pop();
4590 path.push_key("statusInfo");
4591 if let Some(value) = &self.status_info {
4592 Validate::validate_at(value, path, out);
4593 }
4594 path.pop();
4595 path.push_key("customData");
4596 if let Some(value) = &self.custom_data {
4597 Validate::validate_at(value, path, out);
4598 }
4599 path.pop();
4600 }
4601}
4602
4603impl Sealed for NotifyEVChargingNeedsResponse {}
4604impl Response for NotifyEVChargingNeedsResponse {}
4605
4606#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4608pub struct NotifyEVChargingScheduleRequest {
4609 #[serde(rename = "timeBase")]
4611 pub time_base: crate::types::DateTime,
4612 #[serde(rename = "chargingSchedule")]
4614 pub charging_schedule: ChargingSchedule,
4615 #[serde(rename = "evseId")]
4617 pub evse_id: i32,
4618 #[serde(rename = "customData")]
4620 #[serde(default, skip_serializing_if = "Option::is_none")]
4621 pub custom_data: Option<crate::types::CustomData>,
4622}
4623
4624impl NotifyEVChargingScheduleRequest {
4625 #[must_use]
4627 pub fn new(
4628 time_base: impl Into<crate::types::DateTime>,
4629 charging_schedule: ChargingSchedule,
4630 evse_id: i32,
4631 ) -> Self {
4632 Self {
4633 time_base: time_base.into(),
4634 charging_schedule,
4635 evse_id,
4636 custom_data: None,
4637 }
4638 }
4639
4640 #[must_use]
4642 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4643 self.custom_data = Some(value);
4644 self
4645 }
4646}
4647
4648impl Validate for NotifyEVChargingScheduleRequest {
4649 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4650 path.push_key("chargingSchedule");
4651 Validate::validate_at(&self.charging_schedule, path, out);
4652 path.pop();
4653 path.push_key("customData");
4654 if let Some(value) = &self.custom_data {
4655 Validate::validate_at(value, path, out);
4656 }
4657 path.pop();
4658 }
4659}
4660
4661impl Sealed for NotifyEVChargingScheduleRequest {}
4662impl Request for NotifyEVChargingScheduleRequest {
4663 type Action = Action;
4664 const ACTION: Action = Action::NotifyEVChargingSchedule;
4665 const KIND: MessageKind = MessageKind::Call;
4666 const ORIGIN: Origin = Origin::ChargingStation;
4667 type Response = NotifyEVChargingScheduleResponse;
4668}
4669
4670impl Confirmed for NotifyEVChargingScheduleRequest {}
4671
4672#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4674pub struct NotifyEVChargingScheduleResponse {
4675 pub status: GenericStatus,
4677 #[serde(rename = "statusInfo")]
4679 #[serde(default, skip_serializing_if = "Option::is_none")]
4680 pub status_info: Option<StatusInfo>,
4681 #[serde(rename = "customData")]
4683 #[serde(default, skip_serializing_if = "Option::is_none")]
4684 pub custom_data: Option<crate::types::CustomData>,
4685}
4686
4687impl NotifyEVChargingScheduleResponse {
4688 #[must_use]
4690 pub fn new(status: GenericStatus) -> Self {
4691 Self {
4692 status,
4693 status_info: None,
4694 custom_data: None,
4695 }
4696 }
4697
4698 #[must_use]
4700 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
4701 self.status_info = Some(value);
4702 self
4703 }
4704
4705 #[must_use]
4707 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4708 self.custom_data = Some(value);
4709 self
4710 }
4711}
4712
4713impl Validate for NotifyEVChargingScheduleResponse {
4714 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4715 path.push_key("status");
4716 Validate::validate_at(&self.status, path, out);
4717 path.pop();
4718 path.push_key("statusInfo");
4719 if let Some(value) = &self.status_info {
4720 Validate::validate_at(value, path, out);
4721 }
4722 path.pop();
4723 path.push_key("customData");
4724 if let Some(value) = &self.custom_data {
4725 Validate::validate_at(value, path, out);
4726 }
4727 path.pop();
4728 }
4729}
4730
4731impl Sealed for NotifyEVChargingScheduleResponse {}
4732impl Response for NotifyEVChargingScheduleResponse {}
4733
4734#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4736pub struct NotifyEventRequest {
4737 #[serde(rename = "generatedAt")]
4739 pub generated_at: crate::types::DateTime,
4740 #[serde(rename = "seqNo")]
4742 pub seq_no: i32,
4743 #[serde(rename = "eventData")]
4745 pub event_data: Vec<EventData>,
4746 #[serde(default, skip_serializing_if = "Option::is_none")]
4749 pub tbc: Option<bool>,
4750 #[serde(rename = "customData")]
4752 #[serde(default, skip_serializing_if = "Option::is_none")]
4753 pub custom_data: Option<crate::types::CustomData>,
4754}
4755
4756impl NotifyEventRequest {
4757 #[must_use]
4759 pub fn new(
4760 generated_at: impl Into<crate::types::DateTime>,
4761 seq_no: i32,
4762 event_data: Vec<EventData>,
4763 ) -> Self {
4764 Self {
4765 generated_at: generated_at.into(),
4766 seq_no,
4767 event_data,
4768 tbc: None,
4769 custom_data: None,
4770 }
4771 }
4772
4773 #[must_use]
4775 pub fn with_tbc(mut self, value: bool) -> Self {
4776 self.tbc = Some(value);
4777 self
4778 }
4779
4780 #[must_use]
4782 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4783 self.custom_data = Some(value);
4784 self
4785 }
4786}
4787
4788impl Validate for NotifyEventRequest {
4789 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4790 path.push_key("eventData");
4791 validate::list_len(self.event_data.len(), Some(1), None, path, out);
4792 for (index, item) in self.event_data.iter().enumerate() {
4793 path.push_index(index);
4794 Validate::validate_at(item, path, out);
4795 path.pop();
4796 }
4797 path.pop();
4798 path.push_key("customData");
4799 if let Some(value) = &self.custom_data {
4800 Validate::validate_at(value, path, out);
4801 }
4802 path.pop();
4803 }
4804}
4805
4806impl Sealed for NotifyEventRequest {}
4807impl Request for NotifyEventRequest {
4808 type Action = Action;
4809 const ACTION: Action = Action::NotifyEvent;
4810 const KIND: MessageKind = MessageKind::Call;
4811 const ORIGIN: Origin = Origin::ChargingStation;
4812 type Response = NotifyEventResponse;
4813}
4814
4815impl Confirmed for NotifyEventRequest {}
4816
4817#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4819pub struct NotifyEventResponse {
4820 #[serde(rename = "customData")]
4822 #[serde(default, skip_serializing_if = "Option::is_none")]
4823 pub custom_data: Option<crate::types::CustomData>,
4824}
4825
4826impl NotifyEventResponse {
4827 #[must_use]
4829 pub fn new() -> Self {
4830 Self::default()
4831 }
4832
4833 #[must_use]
4835 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4836 self.custom_data = Some(value);
4837 self
4838 }
4839}
4840
4841impl Validate for NotifyEventResponse {
4842 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4843 path.push_key("customData");
4844 if let Some(value) = &self.custom_data {
4845 Validate::validate_at(value, path, out);
4846 }
4847 path.pop();
4848 }
4849}
4850
4851impl Sealed for NotifyEventResponse {}
4852impl Response for NotifyEventResponse {}
4853
4854#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4856pub struct NotifyMonitoringReportRequest {
4857 #[serde(rename = "requestId")]
4859 pub request_id: i32,
4860 #[serde(rename = "seqNo")]
4862 pub seq_no: i32,
4863 #[serde(rename = "generatedAt")]
4865 pub generated_at: crate::types::DateTime,
4866 #[serde(default, skip_serializing_if = "Option::is_none")]
4868 pub monitor: Option<Vec<MonitoringData>>,
4869 #[serde(default, skip_serializing_if = "Option::is_none")]
4872 pub tbc: Option<bool>,
4873 #[serde(rename = "customData")]
4875 #[serde(default, skip_serializing_if = "Option::is_none")]
4876 pub custom_data: Option<crate::types::CustomData>,
4877}
4878
4879impl NotifyMonitoringReportRequest {
4880 #[must_use]
4882 pub fn new(
4883 request_id: i32,
4884 seq_no: i32,
4885 generated_at: impl Into<crate::types::DateTime>,
4886 ) -> Self {
4887 Self {
4888 request_id,
4889 seq_no,
4890 generated_at: generated_at.into(),
4891 monitor: None,
4892 tbc: None,
4893 custom_data: None,
4894 }
4895 }
4896
4897 #[must_use]
4899 pub fn with_monitor(mut self, value: Vec<MonitoringData>) -> Self {
4900 self.monitor = Some(value);
4901 self
4902 }
4903
4904 #[must_use]
4906 pub fn with_tbc(mut self, value: bool) -> Self {
4907 self.tbc = Some(value);
4908 self
4909 }
4910
4911 #[must_use]
4913 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4914 self.custom_data = Some(value);
4915 self
4916 }
4917}
4918
4919impl Validate for NotifyMonitoringReportRequest {
4920 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4921 path.push_key("monitor");
4922 if let Some(value) = &self.monitor {
4923 validate::list_len(value.len(), Some(1), None, path, out);
4924 for (index, item) in value.iter().enumerate() {
4925 path.push_index(index);
4926 Validate::validate_at(item, path, out);
4927 path.pop();
4928 }
4929 }
4930 path.pop();
4931 path.push_key("customData");
4932 if let Some(value) = &self.custom_data {
4933 Validate::validate_at(value, path, out);
4934 }
4935 path.pop();
4936 }
4937}
4938
4939impl Sealed for NotifyMonitoringReportRequest {}
4940impl Request for NotifyMonitoringReportRequest {
4941 type Action = Action;
4942 const ACTION: Action = Action::NotifyMonitoringReport;
4943 const KIND: MessageKind = MessageKind::Call;
4944 const ORIGIN: Origin = Origin::ChargingStation;
4945 type Response = NotifyMonitoringReportResponse;
4946}
4947
4948impl Confirmed for NotifyMonitoringReportRequest {}
4949
4950#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4952pub struct NotifyMonitoringReportResponse {
4953 #[serde(rename = "customData")]
4955 #[serde(default, skip_serializing_if = "Option::is_none")]
4956 pub custom_data: Option<crate::types::CustomData>,
4957}
4958
4959impl NotifyMonitoringReportResponse {
4960 #[must_use]
4962 pub fn new() -> Self {
4963 Self::default()
4964 }
4965
4966 #[must_use]
4968 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4969 self.custom_data = Some(value);
4970 self
4971 }
4972}
4973
4974impl Validate for NotifyMonitoringReportResponse {
4975 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4976 path.push_key("customData");
4977 if let Some(value) = &self.custom_data {
4978 Validate::validate_at(value, path, out);
4979 }
4980 path.pop();
4981 }
4982}
4983
4984impl Sealed for NotifyMonitoringReportResponse {}
4985impl Response for NotifyMonitoringReportResponse {}
4986
4987#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4989pub struct NotifyReportRequest {
4990 #[serde(rename = "requestId")]
4992 pub request_id: i32,
4993 #[serde(rename = "generatedAt")]
4995 pub generated_at: crate::types::DateTime,
4996 #[serde(rename = "seqNo")]
4998 pub seq_no: i32,
4999 #[serde(rename = "reportData")]
5001 #[serde(default, skip_serializing_if = "Option::is_none")]
5002 pub report_data: Option<Vec<ReportData>>,
5003 #[serde(default, skip_serializing_if = "Option::is_none")]
5006 pub tbc: Option<bool>,
5007 #[serde(rename = "customData")]
5009 #[serde(default, skip_serializing_if = "Option::is_none")]
5010 pub custom_data: Option<crate::types::CustomData>,
5011}
5012
5013impl NotifyReportRequest {
5014 #[must_use]
5016 pub fn new(
5017 request_id: i32,
5018 generated_at: impl Into<crate::types::DateTime>,
5019 seq_no: i32,
5020 ) -> Self {
5021 Self {
5022 request_id,
5023 generated_at: generated_at.into(),
5024 seq_no,
5025 report_data: None,
5026 tbc: None,
5027 custom_data: None,
5028 }
5029 }
5030
5031 #[must_use]
5033 pub fn with_report_data(mut self, value: Vec<ReportData>) -> Self {
5034 self.report_data = Some(value);
5035 self
5036 }
5037
5038 #[must_use]
5040 pub fn with_tbc(mut self, value: bool) -> Self {
5041 self.tbc = Some(value);
5042 self
5043 }
5044
5045 #[must_use]
5047 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5048 self.custom_data = Some(value);
5049 self
5050 }
5051}
5052
5053impl Validate for NotifyReportRequest {
5054 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5055 path.push_key("reportData");
5056 if let Some(value) = &self.report_data {
5057 validate::list_len(value.len(), Some(1), None, path, out);
5058 for (index, item) in value.iter().enumerate() {
5059 path.push_index(index);
5060 Validate::validate_at(item, path, out);
5061 path.pop();
5062 }
5063 }
5064 path.pop();
5065 path.push_key("customData");
5066 if let Some(value) = &self.custom_data {
5067 Validate::validate_at(value, path, out);
5068 }
5069 path.pop();
5070 }
5071}
5072
5073impl Sealed for NotifyReportRequest {}
5074impl Request for NotifyReportRequest {
5075 type Action = Action;
5076 const ACTION: Action = Action::NotifyReport;
5077 const KIND: MessageKind = MessageKind::Call;
5078 const ORIGIN: Origin = Origin::ChargingStation;
5079 type Response = NotifyReportResponse;
5080}
5081
5082impl Confirmed for NotifyReportRequest {}
5083
5084#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5086pub struct NotifyReportResponse {
5087 #[serde(rename = "customData")]
5089 #[serde(default, skip_serializing_if = "Option::is_none")]
5090 pub custom_data: Option<crate::types::CustomData>,
5091}
5092
5093impl NotifyReportResponse {
5094 #[must_use]
5096 pub fn new() -> Self {
5097 Self::default()
5098 }
5099
5100 #[must_use]
5102 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5103 self.custom_data = Some(value);
5104 self
5105 }
5106}
5107
5108impl Validate for NotifyReportResponse {
5109 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5110 path.push_key("customData");
5111 if let Some(value) = &self.custom_data {
5112 Validate::validate_at(value, path, out);
5113 }
5114 path.pop();
5115 }
5116}
5117
5118impl Sealed for NotifyReportResponse {}
5119impl Response for NotifyReportResponse {}
5120
5121#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5123pub struct PublishFirmwareRequest {
5124 pub location: String,
5127 pub checksum: String,
5129 #[serde(rename = "requestId")]
5131 pub request_id: i32,
5132 #[serde(default, skip_serializing_if = "Option::is_none")]
5136 pub retries: Option<i32>,
5137 #[serde(rename = "retryInterval")]
5144 #[serde(default, skip_serializing_if = "Option::is_none")]
5145 pub retry_interval: Option<i32>,
5146 #[serde(rename = "customData")]
5148 #[serde(default, skip_serializing_if = "Option::is_none")]
5149 pub custom_data: Option<crate::types::CustomData>,
5150}
5151
5152impl PublishFirmwareRequest {
5153 #[must_use]
5155 pub fn new(location: impl Into<String>, checksum: impl Into<String>, request_id: i32) -> Self {
5156 Self {
5157 location: location.into(),
5158 checksum: checksum.into(),
5159 request_id,
5160 retries: None,
5161 retry_interval: None,
5162 custom_data: None,
5163 }
5164 }
5165
5166 #[must_use]
5168 pub fn with_retries(mut self, value: i32) -> Self {
5169 self.retries = Some(value);
5170 self
5171 }
5172
5173 #[must_use]
5175 pub fn with_retry_interval(mut self, value: i32) -> Self {
5176 self.retry_interval = Some(value);
5177 self
5178 }
5179
5180 #[must_use]
5182 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5183 self.custom_data = Some(value);
5184 self
5185 }
5186}
5187
5188impl Validate for PublishFirmwareRequest {
5189 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5190 path.push_key("location");
5191 validate::string(self.location.as_str(), None, Some(512), path, out);
5192 path.pop();
5193 path.push_key("checksum");
5194 validate::string(self.checksum.as_str(), None, Some(32), path, out);
5195 path.pop();
5196 path.push_key("customData");
5197 if let Some(value) = &self.custom_data {
5198 Validate::validate_at(value, path, out);
5199 }
5200 path.pop();
5201 }
5202}
5203
5204impl Sealed for PublishFirmwareRequest {}
5205impl Request for PublishFirmwareRequest {
5206 type Action = Action;
5207 const ACTION: Action = Action::PublishFirmware;
5208 const KIND: MessageKind = MessageKind::Call;
5209 const ORIGIN: Origin = Origin::Csms;
5210 type Response = PublishFirmwareResponse;
5211}
5212
5213impl Confirmed for PublishFirmwareRequest {}
5214
5215#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5217pub struct PublishFirmwareResponse {
5218 pub status: GenericStatus,
5220 #[serde(rename = "statusInfo")]
5222 #[serde(default, skip_serializing_if = "Option::is_none")]
5223 pub status_info: Option<StatusInfo>,
5224 #[serde(rename = "customData")]
5226 #[serde(default, skip_serializing_if = "Option::is_none")]
5227 pub custom_data: Option<crate::types::CustomData>,
5228}
5229
5230impl PublishFirmwareResponse {
5231 #[must_use]
5233 pub fn new(status: GenericStatus) -> Self {
5234 Self {
5235 status,
5236 status_info: None,
5237 custom_data: None,
5238 }
5239 }
5240
5241 #[must_use]
5243 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
5244 self.status_info = Some(value);
5245 self
5246 }
5247
5248 #[must_use]
5250 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5251 self.custom_data = Some(value);
5252 self
5253 }
5254}
5255
5256impl Validate for PublishFirmwareResponse {
5257 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5258 path.push_key("status");
5259 Validate::validate_at(&self.status, path, out);
5260 path.pop();
5261 path.push_key("statusInfo");
5262 if let Some(value) = &self.status_info {
5263 Validate::validate_at(value, path, out);
5264 }
5265 path.pop();
5266 path.push_key("customData");
5267 if let Some(value) = &self.custom_data {
5268 Validate::validate_at(value, path, out);
5269 }
5270 path.pop();
5271 }
5272}
5273
5274impl Sealed for PublishFirmwareResponse {}
5275impl Response for PublishFirmwareResponse {}
5276
5277#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5279pub struct PublishFirmwareStatusNotificationRequest {
5280 pub status: PublishFirmwareStatus,
5282 #[serde(default, skip_serializing_if = "Option::is_none")]
5284 pub location: Option<Vec<String>>,
5285 #[serde(rename = "requestId")]
5290 #[serde(default, skip_serializing_if = "Option::is_none")]
5291 pub request_id: Option<i32>,
5292 #[serde(rename = "customData")]
5294 #[serde(default, skip_serializing_if = "Option::is_none")]
5295 pub custom_data: Option<crate::types::CustomData>,
5296}
5297
5298impl PublishFirmwareStatusNotificationRequest {
5299 #[must_use]
5301 pub fn new(status: PublishFirmwareStatus) -> Self {
5302 Self {
5303 status,
5304 location: None,
5305 request_id: None,
5306 custom_data: None,
5307 }
5308 }
5309
5310 #[must_use]
5312 pub fn with_location(mut self, value: impl IntoIterator<Item = impl Into<String>>) -> Self {
5313 self.location = Some(value.into_iter().map(Into::into).collect());
5314 self
5315 }
5316
5317 #[must_use]
5319 pub fn with_request_id(mut self, value: i32) -> Self {
5320 self.request_id = Some(value);
5321 self
5322 }
5323
5324 #[must_use]
5326 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5327 self.custom_data = Some(value);
5328 self
5329 }
5330}
5331
5332impl Validate for PublishFirmwareStatusNotificationRequest {
5333 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5334 path.push_key("status");
5335 Validate::validate_at(&self.status, path, out);
5336 path.pop();
5337 path.push_key("location");
5338 if let Some(value) = &self.location {
5339 validate::list_len(value.len(), Some(1), None, path, out);
5340 for (index, item) in value.iter().enumerate() {
5341 path.push_index(index);
5342 validate::string(item.as_str(), None, Some(512), path, out);
5343 path.pop();
5344 }
5345 }
5346 path.pop();
5347 path.push_key("customData");
5348 if let Some(value) = &self.custom_data {
5349 Validate::validate_at(value, path, out);
5350 }
5351 path.pop();
5352 }
5353}
5354
5355impl Sealed for PublishFirmwareStatusNotificationRequest {}
5356impl Request for PublishFirmwareStatusNotificationRequest {
5357 type Action = Action;
5358 const ACTION: Action = Action::PublishFirmwareStatusNotification;
5359 const KIND: MessageKind = MessageKind::Call;
5360 const ORIGIN: Origin = Origin::ChargingStation;
5361 type Response = PublishFirmwareStatusNotificationResponse;
5362}
5363
5364impl Confirmed for PublishFirmwareStatusNotificationRequest {}
5365
5366#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5368pub struct PublishFirmwareStatusNotificationResponse {
5369 #[serde(rename = "customData")]
5371 #[serde(default, skip_serializing_if = "Option::is_none")]
5372 pub custom_data: Option<crate::types::CustomData>,
5373}
5374
5375impl PublishFirmwareStatusNotificationResponse {
5376 #[must_use]
5378 pub fn new() -> Self {
5379 Self::default()
5380 }
5381
5382 #[must_use]
5384 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5385 self.custom_data = Some(value);
5386 self
5387 }
5388}
5389
5390impl Validate for PublishFirmwareStatusNotificationResponse {
5391 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5392 path.push_key("customData");
5393 if let Some(value) = &self.custom_data {
5394 Validate::validate_at(value, path, out);
5395 }
5396 path.pop();
5397 }
5398}
5399
5400impl Sealed for PublishFirmwareStatusNotificationResponse {}
5401impl Response for PublishFirmwareStatusNotificationResponse {}
5402
5403#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5405pub struct ReportChargingProfilesRequest {
5406 #[serde(rename = "requestId")]
5408 pub request_id: i32,
5409 #[serde(rename = "chargingLimitSource")]
5411 pub charging_limit_source: ChargingLimitSource,
5412 #[serde(rename = "chargingProfile")]
5414 pub charging_profile: Vec<ChargingProfile>,
5415 #[serde(rename = "evseId")]
5417 pub evse_id: i32,
5418 #[serde(default, skip_serializing_if = "Option::is_none")]
5421 pub tbc: Option<bool>,
5422 #[serde(rename = "customData")]
5424 #[serde(default, skip_serializing_if = "Option::is_none")]
5425 pub custom_data: Option<crate::types::CustomData>,
5426}
5427
5428impl ReportChargingProfilesRequest {
5429 #[must_use]
5431 pub fn new(
5432 request_id: i32,
5433 charging_limit_source: ChargingLimitSource,
5434 charging_profile: Vec<ChargingProfile>,
5435 evse_id: i32,
5436 ) -> Self {
5437 Self {
5438 request_id,
5439 charging_limit_source,
5440 charging_profile,
5441 evse_id,
5442 tbc: None,
5443 custom_data: None,
5444 }
5445 }
5446
5447 #[must_use]
5449 pub fn with_tbc(mut self, value: bool) -> Self {
5450 self.tbc = Some(value);
5451 self
5452 }
5453
5454 #[must_use]
5456 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5457 self.custom_data = Some(value);
5458 self
5459 }
5460}
5461
5462impl Validate for ReportChargingProfilesRequest {
5463 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5464 path.push_key("chargingLimitSource");
5465 Validate::validate_at(&self.charging_limit_source, path, out);
5466 path.pop();
5467 path.push_key("chargingProfile");
5468 validate::list_len(self.charging_profile.len(), Some(1), None, path, out);
5469 for (index, item) in self.charging_profile.iter().enumerate() {
5470 path.push_index(index);
5471 Validate::validate_at(item, path, out);
5472 path.pop();
5473 }
5474 path.pop();
5475 path.push_key("customData");
5476 if let Some(value) = &self.custom_data {
5477 Validate::validate_at(value, path, out);
5478 }
5479 path.pop();
5480 }
5481}
5482
5483impl Sealed for ReportChargingProfilesRequest {}
5484impl Request for ReportChargingProfilesRequest {
5485 type Action = Action;
5486 const ACTION: Action = Action::ReportChargingProfiles;
5487 const KIND: MessageKind = MessageKind::Call;
5488 const ORIGIN: Origin = Origin::ChargingStation;
5489 type Response = ReportChargingProfilesResponse;
5490}
5491
5492impl Confirmed for ReportChargingProfilesRequest {}
5493
5494#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5496pub struct ReportChargingProfilesResponse {
5497 #[serde(rename = "customData")]
5499 #[serde(default, skip_serializing_if = "Option::is_none")]
5500 pub custom_data: Option<crate::types::CustomData>,
5501}
5502
5503impl ReportChargingProfilesResponse {
5504 #[must_use]
5506 pub fn new() -> Self {
5507 Self::default()
5508 }
5509
5510 #[must_use]
5512 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5513 self.custom_data = Some(value);
5514 self
5515 }
5516}
5517
5518impl Validate for ReportChargingProfilesResponse {
5519 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5520 path.push_key("customData");
5521 if let Some(value) = &self.custom_data {
5522 Validate::validate_at(value, path, out);
5523 }
5524 path.pop();
5525 }
5526}
5527
5528impl Sealed for ReportChargingProfilesResponse {}
5529impl Response for ReportChargingProfilesResponse {}
5530
5531#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5533pub struct RequestStartTransactionRequest {
5534 #[serde(rename = "idToken")]
5536 pub id_token: IdToken,
5537 #[serde(rename = "remoteStartId")]
5539 pub remote_start_id: i32,
5540 #[serde(rename = "evseId")]
5542 #[serde(default, skip_serializing_if = "Option::is_none")]
5543 pub evse_id: Option<i32>,
5544 #[serde(rename = "groupIdToken")]
5546 #[serde(default, skip_serializing_if = "Option::is_none")]
5547 pub group_id_token: Option<IdToken>,
5548 #[serde(rename = "chargingProfile")]
5550 #[serde(default, skip_serializing_if = "Option::is_none")]
5551 pub charging_profile: Option<ChargingProfile>,
5552 #[serde(rename = "customData")]
5554 #[serde(default, skip_serializing_if = "Option::is_none")]
5555 pub custom_data: Option<crate::types::CustomData>,
5556}
5557
5558impl RequestStartTransactionRequest {
5559 #[must_use]
5561 pub fn new(id_token: IdToken, remote_start_id: i32) -> Self {
5562 Self {
5563 id_token,
5564 remote_start_id,
5565 evse_id: None,
5566 group_id_token: None,
5567 charging_profile: None,
5568 custom_data: None,
5569 }
5570 }
5571
5572 #[must_use]
5574 pub fn with_evse_id(mut self, value: i32) -> Self {
5575 self.evse_id = Some(value);
5576 self
5577 }
5578
5579 #[must_use]
5581 pub fn with_group_id_token(mut self, value: IdToken) -> Self {
5582 self.group_id_token = Some(value);
5583 self
5584 }
5585
5586 #[must_use]
5588 pub fn with_charging_profile(mut self, value: ChargingProfile) -> Self {
5589 self.charging_profile = Some(value);
5590 self
5591 }
5592
5593 #[must_use]
5595 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5596 self.custom_data = Some(value);
5597 self
5598 }
5599}
5600
5601impl Validate for RequestStartTransactionRequest {
5602 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5603 path.push_key("idToken");
5604 Validate::validate_at(&self.id_token, path, out);
5605 path.pop();
5606 path.push_key("groupIdToken");
5607 if let Some(value) = &self.group_id_token {
5608 Validate::validate_at(value, path, out);
5609 }
5610 path.pop();
5611 path.push_key("chargingProfile");
5612 if let Some(value) = &self.charging_profile {
5613 Validate::validate_at(value, path, out);
5614 }
5615 path.pop();
5616 path.push_key("customData");
5617 if let Some(value) = &self.custom_data {
5618 Validate::validate_at(value, path, out);
5619 }
5620 path.pop();
5621 }
5622}
5623
5624impl Sealed for RequestStartTransactionRequest {}
5625impl Request for RequestStartTransactionRequest {
5626 type Action = Action;
5627 const ACTION: Action = Action::RequestStartTransaction;
5628 const KIND: MessageKind = MessageKind::Call;
5629 const ORIGIN: Origin = Origin::Csms;
5630 type Response = RequestStartTransactionResponse;
5631}
5632
5633impl Confirmed for RequestStartTransactionRequest {}
5634
5635#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5637pub struct RequestStartTransactionResponse {
5638 pub status: RequestStartStopStatus,
5640 #[serde(rename = "statusInfo")]
5642 #[serde(default, skip_serializing_if = "Option::is_none")]
5643 pub status_info: Option<StatusInfo>,
5644 #[serde(rename = "transactionId")]
5646 #[serde(default, skip_serializing_if = "Option::is_none")]
5647 pub transaction_id: Option<String>,
5648 #[serde(rename = "customData")]
5650 #[serde(default, skip_serializing_if = "Option::is_none")]
5651 pub custom_data: Option<crate::types::CustomData>,
5652}
5653
5654impl RequestStartTransactionResponse {
5655 #[must_use]
5657 pub fn new(status: RequestStartStopStatus) -> Self {
5658 Self {
5659 status,
5660 status_info: None,
5661 transaction_id: None,
5662 custom_data: None,
5663 }
5664 }
5665
5666 #[must_use]
5668 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
5669 self.status_info = Some(value);
5670 self
5671 }
5672
5673 #[must_use]
5675 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
5676 self.transaction_id = Some(value.into());
5677 self
5678 }
5679
5680 #[must_use]
5682 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5683 self.custom_data = Some(value);
5684 self
5685 }
5686}
5687
5688impl Validate for RequestStartTransactionResponse {
5689 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5690 path.push_key("status");
5691 Validate::validate_at(&self.status, path, out);
5692 path.pop();
5693 path.push_key("statusInfo");
5694 if let Some(value) = &self.status_info {
5695 Validate::validate_at(value, path, out);
5696 }
5697 path.pop();
5698 path.push_key("transactionId");
5699 if let Some(value) = &self.transaction_id {
5700 validate::string(value.as_str(), None, Some(36), path, out);
5701 }
5702 path.pop();
5703 path.push_key("customData");
5704 if let Some(value) = &self.custom_data {
5705 Validate::validate_at(value, path, out);
5706 }
5707 path.pop();
5708 }
5709}
5710
5711impl Sealed for RequestStartTransactionResponse {}
5712impl Response for RequestStartTransactionResponse {}
5713
5714#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5716pub struct RequestStopTransactionRequest {
5717 #[serde(rename = "transactionId")]
5719 pub transaction_id: String,
5720 #[serde(rename = "customData")]
5722 #[serde(default, skip_serializing_if = "Option::is_none")]
5723 pub custom_data: Option<crate::types::CustomData>,
5724}
5725
5726impl RequestStopTransactionRequest {
5727 #[must_use]
5729 pub fn new(transaction_id: impl Into<String>) -> Self {
5730 Self {
5731 transaction_id: transaction_id.into(),
5732 custom_data: None,
5733 }
5734 }
5735
5736 #[must_use]
5738 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5739 self.custom_data = Some(value);
5740 self
5741 }
5742}
5743
5744impl Validate for RequestStopTransactionRequest {
5745 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5746 path.push_key("transactionId");
5747 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
5748 path.pop();
5749 path.push_key("customData");
5750 if let Some(value) = &self.custom_data {
5751 Validate::validate_at(value, path, out);
5752 }
5753 path.pop();
5754 }
5755}
5756
5757impl Sealed for RequestStopTransactionRequest {}
5758impl Request for RequestStopTransactionRequest {
5759 type Action = Action;
5760 const ACTION: Action = Action::RequestStopTransaction;
5761 const KIND: MessageKind = MessageKind::Call;
5762 const ORIGIN: Origin = Origin::Csms;
5763 type Response = RequestStopTransactionResponse;
5764}
5765
5766impl Confirmed for RequestStopTransactionRequest {}
5767
5768#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5770pub struct RequestStopTransactionResponse {
5771 pub status: RequestStartStopStatus,
5773 #[serde(rename = "statusInfo")]
5775 #[serde(default, skip_serializing_if = "Option::is_none")]
5776 pub status_info: Option<StatusInfo>,
5777 #[serde(rename = "customData")]
5779 #[serde(default, skip_serializing_if = "Option::is_none")]
5780 pub custom_data: Option<crate::types::CustomData>,
5781}
5782
5783impl RequestStopTransactionResponse {
5784 #[must_use]
5786 pub fn new(status: RequestStartStopStatus) -> Self {
5787 Self {
5788 status,
5789 status_info: None,
5790 custom_data: None,
5791 }
5792 }
5793
5794 #[must_use]
5796 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
5797 self.status_info = Some(value);
5798 self
5799 }
5800
5801 #[must_use]
5803 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5804 self.custom_data = Some(value);
5805 self
5806 }
5807}
5808
5809impl Validate for RequestStopTransactionResponse {
5810 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5811 path.push_key("status");
5812 Validate::validate_at(&self.status, path, out);
5813 path.pop();
5814 path.push_key("statusInfo");
5815 if let Some(value) = &self.status_info {
5816 Validate::validate_at(value, path, out);
5817 }
5818 path.pop();
5819 path.push_key("customData");
5820 if let Some(value) = &self.custom_data {
5821 Validate::validate_at(value, path, out);
5822 }
5823 path.pop();
5824 }
5825}
5826
5827impl Sealed for RequestStopTransactionResponse {}
5828impl Response for RequestStopTransactionResponse {}
5829
5830#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5832pub struct ReservationStatusUpdateRequest {
5833 #[serde(rename = "reservationId")]
5835 pub reservation_id: i32,
5836 #[serde(rename = "reservationUpdateStatus")]
5838 pub reservation_update_status: ReservationUpdateStatus,
5839 #[serde(rename = "customData")]
5841 #[serde(default, skip_serializing_if = "Option::is_none")]
5842 pub custom_data: Option<crate::types::CustomData>,
5843}
5844
5845impl ReservationStatusUpdateRequest {
5846 #[must_use]
5848 pub fn new(reservation_id: i32, reservation_update_status: ReservationUpdateStatus) -> Self {
5849 Self {
5850 reservation_id,
5851 reservation_update_status,
5852 custom_data: None,
5853 }
5854 }
5855
5856 #[must_use]
5858 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5859 self.custom_data = Some(value);
5860 self
5861 }
5862}
5863
5864impl Validate for ReservationStatusUpdateRequest {
5865 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5866 path.push_key("reservationUpdateStatus");
5867 Validate::validate_at(&self.reservation_update_status, path, out);
5868 path.pop();
5869 path.push_key("customData");
5870 if let Some(value) = &self.custom_data {
5871 Validate::validate_at(value, path, out);
5872 }
5873 path.pop();
5874 }
5875}
5876
5877impl Sealed for ReservationStatusUpdateRequest {}
5878impl Request for ReservationStatusUpdateRequest {
5879 type Action = Action;
5880 const ACTION: Action = Action::ReservationStatusUpdate;
5881 const KIND: MessageKind = MessageKind::Call;
5882 const ORIGIN: Origin = Origin::ChargingStation;
5883 type Response = ReservationStatusUpdateResponse;
5884}
5885
5886impl Confirmed for ReservationStatusUpdateRequest {}
5887
5888#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5890pub struct ReservationStatusUpdateResponse {
5891 #[serde(rename = "customData")]
5893 #[serde(default, skip_serializing_if = "Option::is_none")]
5894 pub custom_data: Option<crate::types::CustomData>,
5895}
5896
5897impl ReservationStatusUpdateResponse {
5898 #[must_use]
5900 pub fn new() -> Self {
5901 Self::default()
5902 }
5903
5904 #[must_use]
5906 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5907 self.custom_data = Some(value);
5908 self
5909 }
5910}
5911
5912impl Validate for ReservationStatusUpdateResponse {
5913 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5914 path.push_key("customData");
5915 if let Some(value) = &self.custom_data {
5916 Validate::validate_at(value, path, out);
5917 }
5918 path.pop();
5919 }
5920}
5921
5922impl Sealed for ReservationStatusUpdateResponse {}
5923impl Response for ReservationStatusUpdateResponse {}
5924
5925#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5927pub struct ReserveNowRequest {
5928 pub id: i32,
5930 #[serde(rename = "expiryDateTime")]
5932 pub expiry_date_time: crate::types::DateTime,
5933 #[serde(rename = "idToken")]
5935 pub id_token: IdToken,
5936 #[serde(rename = "connectorType")]
5938 #[serde(default, skip_serializing_if = "Option::is_none")]
5939 pub connector_type: Option<Connector>,
5940 #[serde(rename = "evseId")]
5942 #[serde(default, skip_serializing_if = "Option::is_none")]
5943 pub evse_id: Option<i32>,
5944 #[serde(rename = "groupIdToken")]
5946 #[serde(default, skip_serializing_if = "Option::is_none")]
5947 pub group_id_token: Option<IdToken>,
5948 #[serde(rename = "customData")]
5950 #[serde(default, skip_serializing_if = "Option::is_none")]
5951 pub custom_data: Option<crate::types::CustomData>,
5952}
5953
5954impl ReserveNowRequest {
5955 #[must_use]
5957 pub fn new(
5958 id: i32,
5959 expiry_date_time: impl Into<crate::types::DateTime>,
5960 id_token: IdToken,
5961 ) -> Self {
5962 Self {
5963 id,
5964 expiry_date_time: expiry_date_time.into(),
5965 id_token,
5966 connector_type: None,
5967 evse_id: None,
5968 group_id_token: None,
5969 custom_data: None,
5970 }
5971 }
5972
5973 #[must_use]
5975 pub fn with_connector_type(mut self, value: Connector) -> Self {
5976 self.connector_type = Some(value);
5977 self
5978 }
5979
5980 #[must_use]
5982 pub fn with_evse_id(mut self, value: i32) -> Self {
5983 self.evse_id = Some(value);
5984 self
5985 }
5986
5987 #[must_use]
5989 pub fn with_group_id_token(mut self, value: IdToken) -> Self {
5990 self.group_id_token = Some(value);
5991 self
5992 }
5993
5994 #[must_use]
5996 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5997 self.custom_data = Some(value);
5998 self
5999 }
6000}
6001
6002impl Validate for ReserveNowRequest {
6003 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6004 path.push_key("idToken");
6005 Validate::validate_at(&self.id_token, path, out);
6006 path.pop();
6007 path.push_key("connectorType");
6008 if let Some(value) = &self.connector_type {
6009 Validate::validate_at(value, path, out);
6010 }
6011 path.pop();
6012 path.push_key("groupIdToken");
6013 if let Some(value) = &self.group_id_token {
6014 Validate::validate_at(value, path, out);
6015 }
6016 path.pop();
6017 path.push_key("customData");
6018 if let Some(value) = &self.custom_data {
6019 Validate::validate_at(value, path, out);
6020 }
6021 path.pop();
6022 }
6023}
6024
6025impl Sealed for ReserveNowRequest {}
6026impl Request for ReserveNowRequest {
6027 type Action = Action;
6028 const ACTION: Action = Action::ReserveNow;
6029 const KIND: MessageKind = MessageKind::Call;
6030 const ORIGIN: Origin = Origin::Csms;
6031 type Response = ReserveNowResponse;
6032}
6033
6034impl Confirmed for ReserveNowRequest {}
6035
6036#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6038pub struct ReserveNowResponse {
6039 pub status: ReserveNowStatus,
6041 #[serde(rename = "statusInfo")]
6043 #[serde(default, skip_serializing_if = "Option::is_none")]
6044 pub status_info: Option<StatusInfo>,
6045 #[serde(rename = "customData")]
6047 #[serde(default, skip_serializing_if = "Option::is_none")]
6048 pub custom_data: Option<crate::types::CustomData>,
6049}
6050
6051impl ReserveNowResponse {
6052 #[must_use]
6054 pub fn new(status: ReserveNowStatus) -> Self {
6055 Self {
6056 status,
6057 status_info: None,
6058 custom_data: None,
6059 }
6060 }
6061
6062 #[must_use]
6064 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6065 self.status_info = Some(value);
6066 self
6067 }
6068
6069 #[must_use]
6071 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6072 self.custom_data = Some(value);
6073 self
6074 }
6075}
6076
6077impl Validate for ReserveNowResponse {
6078 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6079 path.push_key("status");
6080 Validate::validate_at(&self.status, path, out);
6081 path.pop();
6082 path.push_key("statusInfo");
6083 if let Some(value) = &self.status_info {
6084 Validate::validate_at(value, path, out);
6085 }
6086 path.pop();
6087 path.push_key("customData");
6088 if let Some(value) = &self.custom_data {
6089 Validate::validate_at(value, path, out);
6090 }
6091 path.pop();
6092 }
6093}
6094
6095impl Sealed for ReserveNowResponse {}
6096impl Response for ReserveNowResponse {}
6097
6098#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6100pub struct ResetRequest {
6101 pub r#type: ResetEnum,
6103 #[serde(rename = "evseId")]
6105 #[serde(default, skip_serializing_if = "Option::is_none")]
6106 pub evse_id: Option<i32>,
6107 #[serde(rename = "customData")]
6109 #[serde(default, skip_serializing_if = "Option::is_none")]
6110 pub custom_data: Option<crate::types::CustomData>,
6111}
6112
6113impl ResetRequest {
6114 #[must_use]
6116 pub fn new(r#type: ResetEnum) -> Self {
6117 Self {
6118 r#type,
6119 evse_id: None,
6120 custom_data: None,
6121 }
6122 }
6123
6124 #[must_use]
6126 pub fn with_evse_id(mut self, value: i32) -> Self {
6127 self.evse_id = Some(value);
6128 self
6129 }
6130
6131 #[must_use]
6133 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6134 self.custom_data = Some(value);
6135 self
6136 }
6137}
6138
6139impl Validate for ResetRequest {
6140 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6141 path.push_key("type");
6142 Validate::validate_at(&self.r#type, path, out);
6143 path.pop();
6144 path.push_key("customData");
6145 if let Some(value) = &self.custom_data {
6146 Validate::validate_at(value, path, out);
6147 }
6148 path.pop();
6149 }
6150}
6151
6152impl Sealed for ResetRequest {}
6153impl Request for ResetRequest {
6154 type Action = Action;
6155 const ACTION: Action = Action::Reset;
6156 const KIND: MessageKind = MessageKind::Call;
6157 const ORIGIN: Origin = Origin::Csms;
6158 type Response = ResetResponse;
6159}
6160
6161impl Confirmed for ResetRequest {}
6162
6163#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6165pub struct ResetResponse {
6166 pub status: ResetStatus,
6168 #[serde(rename = "statusInfo")]
6170 #[serde(default, skip_serializing_if = "Option::is_none")]
6171 pub status_info: Option<StatusInfo>,
6172 #[serde(rename = "customData")]
6174 #[serde(default, skip_serializing_if = "Option::is_none")]
6175 pub custom_data: Option<crate::types::CustomData>,
6176}
6177
6178impl ResetResponse {
6179 #[must_use]
6181 pub fn new(status: ResetStatus) -> Self {
6182 Self {
6183 status,
6184 status_info: None,
6185 custom_data: None,
6186 }
6187 }
6188
6189 #[must_use]
6191 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6192 self.status_info = Some(value);
6193 self
6194 }
6195
6196 #[must_use]
6198 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6199 self.custom_data = Some(value);
6200 self
6201 }
6202}
6203
6204impl Validate for ResetResponse {
6205 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6206 path.push_key("status");
6207 Validate::validate_at(&self.status, path, out);
6208 path.pop();
6209 path.push_key("statusInfo");
6210 if let Some(value) = &self.status_info {
6211 Validate::validate_at(value, path, out);
6212 }
6213 path.pop();
6214 path.push_key("customData");
6215 if let Some(value) = &self.custom_data {
6216 Validate::validate_at(value, path, out);
6217 }
6218 path.pop();
6219 }
6220}
6221
6222impl Sealed for ResetResponse {}
6223impl Response for ResetResponse {}
6224
6225#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6227pub struct SecurityEventNotificationRequest {
6228 pub r#type: String,
6230 pub timestamp: crate::types::DateTime,
6232 #[serde(rename = "techInfo")]
6234 #[serde(default, skip_serializing_if = "Option::is_none")]
6235 pub tech_info: Option<String>,
6236 #[serde(rename = "customData")]
6238 #[serde(default, skip_serializing_if = "Option::is_none")]
6239 pub custom_data: Option<crate::types::CustomData>,
6240}
6241
6242impl SecurityEventNotificationRequest {
6243 #[must_use]
6245 pub fn new(r#type: impl Into<String>, timestamp: impl Into<crate::types::DateTime>) -> Self {
6246 Self {
6247 r#type: r#type.into(),
6248 timestamp: timestamp.into(),
6249 tech_info: None,
6250 custom_data: None,
6251 }
6252 }
6253
6254 #[must_use]
6256 pub fn with_tech_info(mut self, value: impl Into<String>) -> Self {
6257 self.tech_info = Some(value.into());
6258 self
6259 }
6260
6261 #[must_use]
6263 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6264 self.custom_data = Some(value);
6265 self
6266 }
6267}
6268
6269impl Validate for SecurityEventNotificationRequest {
6270 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6271 path.push_key("type");
6272 validate::string(self.r#type.as_str(), None, Some(50), path, out);
6273 path.pop();
6274 path.push_key("techInfo");
6275 if let Some(value) = &self.tech_info {
6276 validate::string(value.as_str(), None, Some(255), path, out);
6277 }
6278 path.pop();
6279 path.push_key("customData");
6280 if let Some(value) = &self.custom_data {
6281 Validate::validate_at(value, path, out);
6282 }
6283 path.pop();
6284 }
6285}
6286
6287impl Sealed for SecurityEventNotificationRequest {}
6288impl Request for SecurityEventNotificationRequest {
6289 type Action = Action;
6290 const ACTION: Action = Action::SecurityEventNotification;
6291 const KIND: MessageKind = MessageKind::Call;
6292 const ORIGIN: Origin = Origin::ChargingStation;
6293 type Response = SecurityEventNotificationResponse;
6294}
6295
6296impl Confirmed for SecurityEventNotificationRequest {}
6297
6298#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
6300pub struct SecurityEventNotificationResponse {
6301 #[serde(rename = "customData")]
6303 #[serde(default, skip_serializing_if = "Option::is_none")]
6304 pub custom_data: Option<crate::types::CustomData>,
6305}
6306
6307impl SecurityEventNotificationResponse {
6308 #[must_use]
6310 pub fn new() -> Self {
6311 Self::default()
6312 }
6313
6314 #[must_use]
6316 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6317 self.custom_data = Some(value);
6318 self
6319 }
6320}
6321
6322impl Validate for SecurityEventNotificationResponse {
6323 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6324 path.push_key("customData");
6325 if let Some(value) = &self.custom_data {
6326 Validate::validate_at(value, path, out);
6327 }
6328 path.pop();
6329 }
6330}
6331
6332impl Sealed for SecurityEventNotificationResponse {}
6333impl Response for SecurityEventNotificationResponse {}
6334
6335#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6337pub struct SendLocalListRequest {
6338 #[serde(rename = "versionNumber")]
6340 pub version_number: i32,
6341 #[serde(rename = "updateType")]
6343 pub update_type: Update,
6344 #[serde(rename = "localAuthorizationList")]
6346 #[serde(default, skip_serializing_if = "Option::is_none")]
6347 pub local_authorization_list: Option<Vec<AuthorizationData>>,
6348 #[serde(rename = "customData")]
6350 #[serde(default, skip_serializing_if = "Option::is_none")]
6351 pub custom_data: Option<crate::types::CustomData>,
6352}
6353
6354impl SendLocalListRequest {
6355 #[must_use]
6357 pub fn new(version_number: i32, update_type: Update) -> Self {
6358 Self {
6359 version_number,
6360 update_type,
6361 local_authorization_list: None,
6362 custom_data: None,
6363 }
6364 }
6365
6366 #[must_use]
6368 pub fn with_local_authorization_list(mut self, value: Vec<AuthorizationData>) -> Self {
6369 self.local_authorization_list = Some(value);
6370 self
6371 }
6372
6373 #[must_use]
6375 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6376 self.custom_data = Some(value);
6377 self
6378 }
6379}
6380
6381impl Validate for SendLocalListRequest {
6382 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6383 path.push_key("updateType");
6384 Validate::validate_at(&self.update_type, path, out);
6385 path.pop();
6386 path.push_key("localAuthorizationList");
6387 if let Some(value) = &self.local_authorization_list {
6388 validate::list_len(value.len(), Some(1), None, path, out);
6389 for (index, item) in value.iter().enumerate() {
6390 path.push_index(index);
6391 Validate::validate_at(item, path, out);
6392 path.pop();
6393 }
6394 }
6395 path.pop();
6396 path.push_key("customData");
6397 if let Some(value) = &self.custom_data {
6398 Validate::validate_at(value, path, out);
6399 }
6400 path.pop();
6401 }
6402}
6403
6404impl Sealed for SendLocalListRequest {}
6405impl Request for SendLocalListRequest {
6406 type Action = Action;
6407 const ACTION: Action = Action::SendLocalList;
6408 const KIND: MessageKind = MessageKind::Call;
6409 const ORIGIN: Origin = Origin::Csms;
6410 type Response = SendLocalListResponse;
6411}
6412
6413impl Confirmed for SendLocalListRequest {}
6414
6415#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6417pub struct SendLocalListResponse {
6418 pub status: SendLocalListStatus,
6420 #[serde(rename = "statusInfo")]
6422 #[serde(default, skip_serializing_if = "Option::is_none")]
6423 pub status_info: Option<StatusInfo>,
6424 #[serde(rename = "customData")]
6426 #[serde(default, skip_serializing_if = "Option::is_none")]
6427 pub custom_data: Option<crate::types::CustomData>,
6428}
6429
6430impl SendLocalListResponse {
6431 #[must_use]
6433 pub fn new(status: SendLocalListStatus) -> Self {
6434 Self {
6435 status,
6436 status_info: None,
6437 custom_data: None,
6438 }
6439 }
6440
6441 #[must_use]
6443 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6444 self.status_info = Some(value);
6445 self
6446 }
6447
6448 #[must_use]
6450 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6451 self.custom_data = Some(value);
6452 self
6453 }
6454}
6455
6456impl Validate for SendLocalListResponse {
6457 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6458 path.push_key("status");
6459 Validate::validate_at(&self.status, path, out);
6460 path.pop();
6461 path.push_key("statusInfo");
6462 if let Some(value) = &self.status_info {
6463 Validate::validate_at(value, path, out);
6464 }
6465 path.pop();
6466 path.push_key("customData");
6467 if let Some(value) = &self.custom_data {
6468 Validate::validate_at(value, path, out);
6469 }
6470 path.pop();
6471 }
6472}
6473
6474impl Sealed for SendLocalListResponse {}
6475impl Response for SendLocalListResponse {}
6476
6477#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6479pub struct SetChargingProfileRequest {
6480 #[serde(rename = "evseId")]
6482 pub evse_id: i32,
6483 #[serde(rename = "chargingProfile")]
6485 pub charging_profile: ChargingProfile,
6486 #[serde(rename = "customData")]
6488 #[serde(default, skip_serializing_if = "Option::is_none")]
6489 pub custom_data: Option<crate::types::CustomData>,
6490}
6491
6492impl SetChargingProfileRequest {
6493 #[must_use]
6495 pub fn new(evse_id: i32, charging_profile: ChargingProfile) -> Self {
6496 Self {
6497 evse_id,
6498 charging_profile,
6499 custom_data: None,
6500 }
6501 }
6502
6503 #[must_use]
6505 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6506 self.custom_data = Some(value);
6507 self
6508 }
6509}
6510
6511impl Validate for SetChargingProfileRequest {
6512 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6513 path.push_key("chargingProfile");
6514 Validate::validate_at(&self.charging_profile, path, out);
6515 path.pop();
6516 path.push_key("customData");
6517 if let Some(value) = &self.custom_data {
6518 Validate::validate_at(value, path, out);
6519 }
6520 path.pop();
6521 }
6522}
6523
6524impl Sealed for SetChargingProfileRequest {}
6525impl Request for SetChargingProfileRequest {
6526 type Action = Action;
6527 const ACTION: Action = Action::SetChargingProfile;
6528 const KIND: MessageKind = MessageKind::Call;
6529 const ORIGIN: Origin = Origin::Csms;
6530 type Response = SetChargingProfileResponse;
6531}
6532
6533impl Confirmed for SetChargingProfileRequest {}
6534
6535#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6537pub struct SetChargingProfileResponse {
6538 pub status: ChargingProfileStatus,
6540 #[serde(rename = "statusInfo")]
6542 #[serde(default, skip_serializing_if = "Option::is_none")]
6543 pub status_info: Option<StatusInfo>,
6544 #[serde(rename = "customData")]
6546 #[serde(default, skip_serializing_if = "Option::is_none")]
6547 pub custom_data: Option<crate::types::CustomData>,
6548}
6549
6550impl SetChargingProfileResponse {
6551 #[must_use]
6553 pub fn new(status: ChargingProfileStatus) -> Self {
6554 Self {
6555 status,
6556 status_info: None,
6557 custom_data: None,
6558 }
6559 }
6560
6561 #[must_use]
6563 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6564 self.status_info = Some(value);
6565 self
6566 }
6567
6568 #[must_use]
6570 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6571 self.custom_data = Some(value);
6572 self
6573 }
6574}
6575
6576impl Validate for SetChargingProfileResponse {
6577 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6578 path.push_key("status");
6579 Validate::validate_at(&self.status, path, out);
6580 path.pop();
6581 path.push_key("statusInfo");
6582 if let Some(value) = &self.status_info {
6583 Validate::validate_at(value, path, out);
6584 }
6585 path.pop();
6586 path.push_key("customData");
6587 if let Some(value) = &self.custom_data {
6588 Validate::validate_at(value, path, out);
6589 }
6590 path.pop();
6591 }
6592}
6593
6594impl Sealed for SetChargingProfileResponse {}
6595impl Response for SetChargingProfileResponse {}
6596
6597#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6599pub struct SetDisplayMessageRequest {
6600 pub message: MessageInfo,
6602 #[serde(rename = "customData")]
6604 #[serde(default, skip_serializing_if = "Option::is_none")]
6605 pub custom_data: Option<crate::types::CustomData>,
6606}
6607
6608impl SetDisplayMessageRequest {
6609 #[must_use]
6611 pub fn new(message: MessageInfo) -> Self {
6612 Self {
6613 message,
6614 custom_data: None,
6615 }
6616 }
6617
6618 #[must_use]
6620 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6621 self.custom_data = Some(value);
6622 self
6623 }
6624}
6625
6626impl Validate for SetDisplayMessageRequest {
6627 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6628 path.push_key("message");
6629 Validate::validate_at(&self.message, path, out);
6630 path.pop();
6631 path.push_key("customData");
6632 if let Some(value) = &self.custom_data {
6633 Validate::validate_at(value, path, out);
6634 }
6635 path.pop();
6636 }
6637}
6638
6639impl Sealed for SetDisplayMessageRequest {}
6640impl Request for SetDisplayMessageRequest {
6641 type Action = Action;
6642 const ACTION: Action = Action::SetDisplayMessage;
6643 const KIND: MessageKind = MessageKind::Call;
6644 const ORIGIN: Origin = Origin::Csms;
6645 type Response = SetDisplayMessageResponse;
6646}
6647
6648impl Confirmed for SetDisplayMessageRequest {}
6649
6650#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6652pub struct SetDisplayMessageResponse {
6653 pub status: DisplayMessageStatus,
6655 #[serde(rename = "statusInfo")]
6657 #[serde(default, skip_serializing_if = "Option::is_none")]
6658 pub status_info: Option<StatusInfo>,
6659 #[serde(rename = "customData")]
6661 #[serde(default, skip_serializing_if = "Option::is_none")]
6662 pub custom_data: Option<crate::types::CustomData>,
6663}
6664
6665impl SetDisplayMessageResponse {
6666 #[must_use]
6668 pub fn new(status: DisplayMessageStatus) -> Self {
6669 Self {
6670 status,
6671 status_info: None,
6672 custom_data: None,
6673 }
6674 }
6675
6676 #[must_use]
6678 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6679 self.status_info = Some(value);
6680 self
6681 }
6682
6683 #[must_use]
6685 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6686 self.custom_data = Some(value);
6687 self
6688 }
6689}
6690
6691impl Validate for SetDisplayMessageResponse {
6692 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6693 path.push_key("status");
6694 Validate::validate_at(&self.status, path, out);
6695 path.pop();
6696 path.push_key("statusInfo");
6697 if let Some(value) = &self.status_info {
6698 Validate::validate_at(value, path, out);
6699 }
6700 path.pop();
6701 path.push_key("customData");
6702 if let Some(value) = &self.custom_data {
6703 Validate::validate_at(value, path, out);
6704 }
6705 path.pop();
6706 }
6707}
6708
6709impl Sealed for SetDisplayMessageResponse {}
6710impl Response for SetDisplayMessageResponse {}
6711
6712#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6714pub struct SetMonitoringBaseRequest {
6715 #[serde(rename = "monitoringBase")]
6717 pub monitoring_base: MonitoringBase,
6718 #[serde(rename = "customData")]
6720 #[serde(default, skip_serializing_if = "Option::is_none")]
6721 pub custom_data: Option<crate::types::CustomData>,
6722}
6723
6724impl SetMonitoringBaseRequest {
6725 #[must_use]
6727 pub fn new(monitoring_base: MonitoringBase) -> Self {
6728 Self {
6729 monitoring_base,
6730 custom_data: None,
6731 }
6732 }
6733
6734 #[must_use]
6736 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6737 self.custom_data = Some(value);
6738 self
6739 }
6740}
6741
6742impl Validate for SetMonitoringBaseRequest {
6743 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6744 path.push_key("monitoringBase");
6745 Validate::validate_at(&self.monitoring_base, path, out);
6746 path.pop();
6747 path.push_key("customData");
6748 if let Some(value) = &self.custom_data {
6749 Validate::validate_at(value, path, out);
6750 }
6751 path.pop();
6752 }
6753}
6754
6755impl Sealed for SetMonitoringBaseRequest {}
6756impl Request for SetMonitoringBaseRequest {
6757 type Action = Action;
6758 const ACTION: Action = Action::SetMonitoringBase;
6759 const KIND: MessageKind = MessageKind::Call;
6760 const ORIGIN: Origin = Origin::Csms;
6761 type Response = SetMonitoringBaseResponse;
6762}
6763
6764impl Confirmed for SetMonitoringBaseRequest {}
6765
6766#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6768pub struct SetMonitoringBaseResponse {
6769 pub status: GenericDeviceModelStatus,
6771 #[serde(rename = "statusInfo")]
6773 #[serde(default, skip_serializing_if = "Option::is_none")]
6774 pub status_info: Option<StatusInfo>,
6775 #[serde(rename = "customData")]
6777 #[serde(default, skip_serializing_if = "Option::is_none")]
6778 pub custom_data: Option<crate::types::CustomData>,
6779}
6780
6781impl SetMonitoringBaseResponse {
6782 #[must_use]
6784 pub fn new(status: GenericDeviceModelStatus) -> Self {
6785 Self {
6786 status,
6787 status_info: None,
6788 custom_data: None,
6789 }
6790 }
6791
6792 #[must_use]
6794 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6795 self.status_info = Some(value);
6796 self
6797 }
6798
6799 #[must_use]
6801 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6802 self.custom_data = Some(value);
6803 self
6804 }
6805}
6806
6807impl Validate for SetMonitoringBaseResponse {
6808 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6809 path.push_key("status");
6810 Validate::validate_at(&self.status, path, out);
6811 path.pop();
6812 path.push_key("statusInfo");
6813 if let Some(value) = &self.status_info {
6814 Validate::validate_at(value, path, out);
6815 }
6816 path.pop();
6817 path.push_key("customData");
6818 if let Some(value) = &self.custom_data {
6819 Validate::validate_at(value, path, out);
6820 }
6821 path.pop();
6822 }
6823}
6824
6825impl Sealed for SetMonitoringBaseResponse {}
6826impl Response for SetMonitoringBaseResponse {}
6827
6828#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6830pub struct SetMonitoringLevelRequest {
6831 pub severity: i32,
6856 #[serde(rename = "customData")]
6858 #[serde(default, skip_serializing_if = "Option::is_none")]
6859 pub custom_data: Option<crate::types::CustomData>,
6860}
6861
6862impl SetMonitoringLevelRequest {
6863 #[must_use]
6865 pub fn new(severity: i32) -> Self {
6866 Self {
6867 severity,
6868 custom_data: None,
6869 }
6870 }
6871
6872 #[must_use]
6874 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6875 self.custom_data = Some(value);
6876 self
6877 }
6878}
6879
6880impl Validate for SetMonitoringLevelRequest {
6881 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6882 path.push_key("customData");
6883 if let Some(value) = &self.custom_data {
6884 Validate::validate_at(value, path, out);
6885 }
6886 path.pop();
6887 }
6888}
6889
6890impl Sealed for SetMonitoringLevelRequest {}
6891impl Request for SetMonitoringLevelRequest {
6892 type Action = Action;
6893 const ACTION: Action = Action::SetMonitoringLevel;
6894 const KIND: MessageKind = MessageKind::Call;
6895 const ORIGIN: Origin = Origin::Csms;
6896 type Response = SetMonitoringLevelResponse;
6897}
6898
6899impl Confirmed for SetMonitoringLevelRequest {}
6900
6901#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6903pub struct SetMonitoringLevelResponse {
6904 pub status: GenericStatus,
6906 #[serde(rename = "statusInfo")]
6908 #[serde(default, skip_serializing_if = "Option::is_none")]
6909 pub status_info: Option<StatusInfo>,
6910 #[serde(rename = "customData")]
6912 #[serde(default, skip_serializing_if = "Option::is_none")]
6913 pub custom_data: Option<crate::types::CustomData>,
6914}
6915
6916impl SetMonitoringLevelResponse {
6917 #[must_use]
6919 pub fn new(status: GenericStatus) -> Self {
6920 Self {
6921 status,
6922 status_info: None,
6923 custom_data: None,
6924 }
6925 }
6926
6927 #[must_use]
6929 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6930 self.status_info = Some(value);
6931 self
6932 }
6933
6934 #[must_use]
6936 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6937 self.custom_data = Some(value);
6938 self
6939 }
6940}
6941
6942impl Validate for SetMonitoringLevelResponse {
6943 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6944 path.push_key("status");
6945 Validate::validate_at(&self.status, path, out);
6946 path.pop();
6947 path.push_key("statusInfo");
6948 if let Some(value) = &self.status_info {
6949 Validate::validate_at(value, path, out);
6950 }
6951 path.pop();
6952 path.push_key("customData");
6953 if let Some(value) = &self.custom_data {
6954 Validate::validate_at(value, path, out);
6955 }
6956 path.pop();
6957 }
6958}
6959
6960impl Sealed for SetMonitoringLevelResponse {}
6961impl Response for SetMonitoringLevelResponse {}
6962
6963#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6965pub struct SetNetworkProfileRequest {
6966 #[serde(rename = "configurationSlot")]
6968 pub configuration_slot: i32,
6969 #[serde(rename = "connectionData")]
6971 pub connection_data: NetworkConnectionProfile,
6972 #[serde(rename = "customData")]
6974 #[serde(default, skip_serializing_if = "Option::is_none")]
6975 pub custom_data: Option<crate::types::CustomData>,
6976}
6977
6978impl SetNetworkProfileRequest {
6979 #[must_use]
6981 pub fn new(configuration_slot: i32, connection_data: NetworkConnectionProfile) -> Self {
6982 Self {
6983 configuration_slot,
6984 connection_data,
6985 custom_data: None,
6986 }
6987 }
6988
6989 #[must_use]
6991 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6992 self.custom_data = Some(value);
6993 self
6994 }
6995}
6996
6997impl Validate for SetNetworkProfileRequest {
6998 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6999 path.push_key("connectionData");
7000 Validate::validate_at(&self.connection_data, path, out);
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 SetNetworkProfileRequest {}
7011impl Request for SetNetworkProfileRequest {
7012 type Action = Action;
7013 const ACTION: Action = Action::SetNetworkProfile;
7014 const KIND: MessageKind = MessageKind::Call;
7015 const ORIGIN: Origin = Origin::Csms;
7016 type Response = SetNetworkProfileResponse;
7017}
7018
7019impl Confirmed for SetNetworkProfileRequest {}
7020
7021#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7023pub struct SetNetworkProfileResponse {
7024 pub status: SetNetworkProfileStatus,
7026 #[serde(rename = "statusInfo")]
7028 #[serde(default, skip_serializing_if = "Option::is_none")]
7029 pub status_info: Option<StatusInfo>,
7030 #[serde(rename = "customData")]
7032 #[serde(default, skip_serializing_if = "Option::is_none")]
7033 pub custom_data: Option<crate::types::CustomData>,
7034}
7035
7036impl SetNetworkProfileResponse {
7037 #[must_use]
7039 pub fn new(status: SetNetworkProfileStatus) -> Self {
7040 Self {
7041 status,
7042 status_info: None,
7043 custom_data: None,
7044 }
7045 }
7046
7047 #[must_use]
7049 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
7050 self.status_info = Some(value);
7051 self
7052 }
7053
7054 #[must_use]
7056 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7057 self.custom_data = Some(value);
7058 self
7059 }
7060}
7061
7062impl Validate for SetNetworkProfileResponse {
7063 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7064 path.push_key("status");
7065 Validate::validate_at(&self.status, path, out);
7066 path.pop();
7067 path.push_key("statusInfo");
7068 if let Some(value) = &self.status_info {
7069 Validate::validate_at(value, path, out);
7070 }
7071 path.pop();
7072 path.push_key("customData");
7073 if let Some(value) = &self.custom_data {
7074 Validate::validate_at(value, path, out);
7075 }
7076 path.pop();
7077 }
7078}
7079
7080impl Sealed for SetNetworkProfileResponse {}
7081impl Response for SetNetworkProfileResponse {}
7082
7083#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7085pub struct SetVariableMonitoringRequest {
7086 #[serde(rename = "setMonitoringData")]
7088 pub set_monitoring_data: Vec<SetMonitoringData>,
7089 #[serde(rename = "customData")]
7091 #[serde(default, skip_serializing_if = "Option::is_none")]
7092 pub custom_data: Option<crate::types::CustomData>,
7093}
7094
7095impl SetVariableMonitoringRequest {
7096 #[must_use]
7098 pub fn new(set_monitoring_data: Vec<SetMonitoringData>) -> Self {
7099 Self {
7100 set_monitoring_data,
7101 custom_data: None,
7102 }
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 SetVariableMonitoringRequest {
7114 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7115 path.push_key("setMonitoringData");
7116 validate::list_len(self.set_monitoring_data.len(), Some(1), None, path, out);
7117 for (index, item) in self.set_monitoring_data.iter().enumerate() {
7118 path.push_index(index);
7119 Validate::validate_at(item, path, out);
7120 path.pop();
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 SetVariableMonitoringRequest {}
7132impl Request for SetVariableMonitoringRequest {
7133 type Action = Action;
7134 const ACTION: Action = Action::SetVariableMonitoring;
7135 const KIND: MessageKind = MessageKind::Call;
7136 const ORIGIN: Origin = Origin::Csms;
7137 type Response = SetVariableMonitoringResponse;
7138}
7139
7140impl Confirmed for SetVariableMonitoringRequest {}
7141
7142#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7144pub struct SetVariableMonitoringResponse {
7145 #[serde(rename = "setMonitoringResult")]
7147 pub set_monitoring_result: Vec<SetMonitoringResult>,
7148 #[serde(rename = "customData")]
7150 #[serde(default, skip_serializing_if = "Option::is_none")]
7151 pub custom_data: Option<crate::types::CustomData>,
7152}
7153
7154impl SetVariableMonitoringResponse {
7155 #[must_use]
7157 pub fn new(set_monitoring_result: Vec<SetMonitoringResult>) -> Self {
7158 Self {
7159 set_monitoring_result,
7160 custom_data: None,
7161 }
7162 }
7163
7164 #[must_use]
7166 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7167 self.custom_data = Some(value);
7168 self
7169 }
7170}
7171
7172impl Validate for SetVariableMonitoringResponse {
7173 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7174 path.push_key("setMonitoringResult");
7175 validate::list_len(self.set_monitoring_result.len(), Some(1), None, path, out);
7176 for (index, item) in self.set_monitoring_result.iter().enumerate() {
7177 path.push_index(index);
7178 Validate::validate_at(item, path, out);
7179 path.pop();
7180 }
7181 path.pop();
7182 path.push_key("customData");
7183 if let Some(value) = &self.custom_data {
7184 Validate::validate_at(value, path, out);
7185 }
7186 path.pop();
7187 }
7188}
7189
7190impl Sealed for SetVariableMonitoringResponse {}
7191impl Response for SetVariableMonitoringResponse {}
7192
7193#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7195pub struct SetVariablesRequest {
7196 #[serde(rename = "setVariableData")]
7198 pub set_variable_data: Vec<SetVariableData>,
7199 #[serde(rename = "customData")]
7201 #[serde(default, skip_serializing_if = "Option::is_none")]
7202 pub custom_data: Option<crate::types::CustomData>,
7203}
7204
7205impl SetVariablesRequest {
7206 #[must_use]
7208 pub fn new(set_variable_data: Vec<SetVariableData>) -> Self {
7209 Self {
7210 set_variable_data,
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 SetVariablesRequest {
7224 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7225 path.push_key("setVariableData");
7226 validate::list_len(self.set_variable_data.len(), Some(1), None, path, out);
7227 for (index, item) in self.set_variable_data.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 SetVariablesRequest {}
7242impl Request for SetVariablesRequest {
7243 type Action = Action;
7244 const ACTION: Action = Action::SetVariables;
7245 const KIND: MessageKind = MessageKind::Call;
7246 const ORIGIN: Origin = Origin::Csms;
7247 type Response = SetVariablesResponse;
7248}
7249
7250impl Confirmed for SetVariablesRequest {}
7251
7252#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7254pub struct SetVariablesResponse {
7255 #[serde(rename = "setVariableResult")]
7257 pub set_variable_result: Vec<SetVariableResult>,
7258 #[serde(rename = "customData")]
7260 #[serde(default, skip_serializing_if = "Option::is_none")]
7261 pub custom_data: Option<crate::types::CustomData>,
7262}
7263
7264impl SetVariablesResponse {
7265 #[must_use]
7267 pub fn new(set_variable_result: Vec<SetVariableResult>) -> Self {
7268 Self {
7269 set_variable_result,
7270 custom_data: None,
7271 }
7272 }
7273
7274 #[must_use]
7276 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7277 self.custom_data = Some(value);
7278 self
7279 }
7280}
7281
7282impl Validate for SetVariablesResponse {
7283 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7284 path.push_key("setVariableResult");
7285 validate::list_len(self.set_variable_result.len(), Some(1), None, path, out);
7286 for (index, item) in self.set_variable_result.iter().enumerate() {
7287 path.push_index(index);
7288 Validate::validate_at(item, path, out);
7289 path.pop();
7290 }
7291 path.pop();
7292 path.push_key("customData");
7293 if let Some(value) = &self.custom_data {
7294 Validate::validate_at(value, path, out);
7295 }
7296 path.pop();
7297 }
7298}
7299
7300impl Sealed for SetVariablesResponse {}
7301impl Response for SetVariablesResponse {}
7302
7303#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7305pub struct SignCertificateRequest {
7306 pub csr: String,
7308 #[serde(rename = "certificateType")]
7310 #[serde(default, skip_serializing_if = "Option::is_none")]
7311 pub certificate_type: Option<CertificateSigningUse>,
7312 #[serde(rename = "customData")]
7314 #[serde(default, skip_serializing_if = "Option::is_none")]
7315 pub custom_data: Option<crate::types::CustomData>,
7316}
7317
7318impl SignCertificateRequest {
7319 #[must_use]
7321 pub fn new(csr: impl Into<String>) -> Self {
7322 Self {
7323 csr: csr.into(),
7324 certificate_type: None,
7325 custom_data: None,
7326 }
7327 }
7328
7329 #[must_use]
7331 pub fn with_certificate_type(mut self, value: CertificateSigningUse) -> Self {
7332 self.certificate_type = Some(value);
7333 self
7334 }
7335
7336 #[must_use]
7338 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7339 self.custom_data = Some(value);
7340 self
7341 }
7342}
7343
7344impl Validate for SignCertificateRequest {
7345 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7346 path.push_key("csr");
7347 validate::string(self.csr.as_str(), None, Some(5500), path, out);
7348 path.pop();
7349 path.push_key("certificateType");
7350 if let Some(value) = &self.certificate_type {
7351 Validate::validate_at(value, path, out);
7352 }
7353 path.pop();
7354 path.push_key("customData");
7355 if let Some(value) = &self.custom_data {
7356 Validate::validate_at(value, path, out);
7357 }
7358 path.pop();
7359 }
7360}
7361
7362impl Sealed for SignCertificateRequest {}
7363impl Request for SignCertificateRequest {
7364 type Action = Action;
7365 const ACTION: Action = Action::SignCertificate;
7366 const KIND: MessageKind = MessageKind::Call;
7367 const ORIGIN: Origin = Origin::ChargingStation;
7368 type Response = SignCertificateResponse;
7369}
7370
7371impl Confirmed for SignCertificateRequest {}
7372
7373#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7375pub struct SignCertificateResponse {
7376 pub status: GenericStatus,
7378 #[serde(rename = "statusInfo")]
7380 #[serde(default, skip_serializing_if = "Option::is_none")]
7381 pub status_info: Option<StatusInfo>,
7382 #[serde(rename = "customData")]
7384 #[serde(default, skip_serializing_if = "Option::is_none")]
7385 pub custom_data: Option<crate::types::CustomData>,
7386}
7387
7388impl SignCertificateResponse {
7389 #[must_use]
7391 pub fn new(status: GenericStatus) -> Self {
7392 Self {
7393 status,
7394 status_info: None,
7395 custom_data: None,
7396 }
7397 }
7398
7399 #[must_use]
7401 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
7402 self.status_info = Some(value);
7403 self
7404 }
7405
7406 #[must_use]
7408 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7409 self.custom_data = Some(value);
7410 self
7411 }
7412}
7413
7414impl Validate for SignCertificateResponse {
7415 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7416 path.push_key("status");
7417 Validate::validate_at(&self.status, path, out);
7418 path.pop();
7419 path.push_key("statusInfo");
7420 if let Some(value) = &self.status_info {
7421 Validate::validate_at(value, path, out);
7422 }
7423 path.pop();
7424 path.push_key("customData");
7425 if let Some(value) = &self.custom_data {
7426 Validate::validate_at(value, path, out);
7427 }
7428 path.pop();
7429 }
7430}
7431
7432impl Sealed for SignCertificateResponse {}
7433impl Response for SignCertificateResponse {}
7434
7435#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7437pub struct StatusNotificationRequest {
7438 pub timestamp: crate::types::DateTime,
7440 #[serde(rename = "connectorStatus")]
7442 pub connector_status: ConnectorStatus,
7443 #[serde(rename = "evseId")]
7445 pub evse_id: i32,
7446 #[serde(rename = "connectorId")]
7448 pub connector_id: i32,
7449 #[serde(rename = "customData")]
7451 #[serde(default, skip_serializing_if = "Option::is_none")]
7452 pub custom_data: Option<crate::types::CustomData>,
7453}
7454
7455impl StatusNotificationRequest {
7456 #[must_use]
7458 pub fn new(
7459 timestamp: impl Into<crate::types::DateTime>,
7460 connector_status: ConnectorStatus,
7461 evse_id: i32,
7462 connector_id: i32,
7463 ) -> Self {
7464 Self {
7465 timestamp: timestamp.into(),
7466 connector_status,
7467 evse_id,
7468 connector_id,
7469 custom_data: None,
7470 }
7471 }
7472
7473 #[must_use]
7475 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7476 self.custom_data = Some(value);
7477 self
7478 }
7479}
7480
7481impl Validate for StatusNotificationRequest {
7482 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7483 path.push_key("connectorStatus");
7484 Validate::validate_at(&self.connector_status, path, out);
7485 path.pop();
7486 path.push_key("customData");
7487 if let Some(value) = &self.custom_data {
7488 Validate::validate_at(value, path, out);
7489 }
7490 path.pop();
7491 }
7492}
7493
7494impl Sealed for StatusNotificationRequest {}
7495impl Request for StatusNotificationRequest {
7496 type Action = Action;
7497 const ACTION: Action = Action::StatusNotification;
7498 const KIND: MessageKind = MessageKind::Call;
7499 const ORIGIN: Origin = Origin::ChargingStation;
7500 type Response = StatusNotificationResponse;
7501}
7502
7503impl Confirmed for StatusNotificationRequest {}
7504
7505#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7507pub struct StatusNotificationResponse {
7508 #[serde(rename = "customData")]
7510 #[serde(default, skip_serializing_if = "Option::is_none")]
7511 pub custom_data: Option<crate::types::CustomData>,
7512}
7513
7514impl StatusNotificationResponse {
7515 #[must_use]
7517 pub fn new() -> Self {
7518 Self::default()
7519 }
7520
7521 #[must_use]
7523 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7524 self.custom_data = Some(value);
7525 self
7526 }
7527}
7528
7529impl Validate for StatusNotificationResponse {
7530 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7531 path.push_key("customData");
7532 if let Some(value) = &self.custom_data {
7533 Validate::validate_at(value, path, out);
7534 }
7535 path.pop();
7536 }
7537}
7538
7539impl Sealed for StatusNotificationResponse {}
7540impl Response for StatusNotificationResponse {}
7541
7542#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7544pub struct TransactionEventRequest {
7545 #[serde(rename = "eventType")]
7547 pub event_type: TransactionEventEnum,
7548 pub timestamp: crate::types::DateTime,
7550 #[serde(rename = "triggerReason")]
7552 pub trigger_reason: TriggerReason,
7553 #[serde(rename = "seqNo")]
7555 pub seq_no: i32,
7556 #[serde(rename = "transactionInfo")]
7558 pub transaction_info: Transaction,
7559 #[serde(rename = "meterValue")]
7561 #[serde(default, skip_serializing_if = "Option::is_none")]
7562 pub meter_value: Option<Vec<MeterValue>>,
7563 #[serde(default, skip_serializing_if = "Option::is_none")]
7566 pub offline: Option<bool>,
7567 #[serde(rename = "numberOfPhasesUsed")]
7569 #[serde(default, skip_serializing_if = "Option::is_none")]
7570 pub number_of_phases_used: Option<i32>,
7571 #[serde(rename = "cableMaxCurrent")]
7573 #[serde(default, skip_serializing_if = "Option::is_none")]
7574 pub cable_max_current: Option<i32>,
7575 #[serde(rename = "reservationId")]
7577 #[serde(default, skip_serializing_if = "Option::is_none")]
7578 pub reservation_id: Option<i32>,
7579 #[serde(default, skip_serializing_if = "Option::is_none")]
7581 pub evse: Option<EVSE>,
7582 #[serde(rename = "idToken")]
7584 #[serde(default, skip_serializing_if = "Option::is_none")]
7585 pub id_token: Option<IdToken>,
7586 #[serde(rename = "customData")]
7588 #[serde(default, skip_serializing_if = "Option::is_none")]
7589 pub custom_data: Option<crate::types::CustomData>,
7590}
7591
7592impl TransactionEventRequest {
7593 #[must_use]
7595 pub fn new(
7596 event_type: TransactionEventEnum,
7597 timestamp: impl Into<crate::types::DateTime>,
7598 trigger_reason: TriggerReason,
7599 seq_no: i32,
7600 transaction_info: Transaction,
7601 ) -> Self {
7602 Self {
7603 event_type,
7604 timestamp: timestamp.into(),
7605 trigger_reason,
7606 seq_no,
7607 transaction_info,
7608 meter_value: None,
7609 offline: None,
7610 number_of_phases_used: None,
7611 cable_max_current: None,
7612 reservation_id: None,
7613 evse: None,
7614 id_token: None,
7615 custom_data: None,
7616 }
7617 }
7618
7619 #[must_use]
7621 pub fn with_meter_value(mut self, value: Vec<MeterValue>) -> Self {
7622 self.meter_value = Some(value);
7623 self
7624 }
7625
7626 #[must_use]
7628 pub fn with_offline(mut self, value: bool) -> Self {
7629 self.offline = Some(value);
7630 self
7631 }
7632
7633 #[must_use]
7635 pub fn with_number_of_phases_used(mut self, value: i32) -> Self {
7636 self.number_of_phases_used = Some(value);
7637 self
7638 }
7639
7640 #[must_use]
7642 pub fn with_cable_max_current(mut self, value: i32) -> Self {
7643 self.cable_max_current = Some(value);
7644 self
7645 }
7646
7647 #[must_use]
7649 pub fn with_reservation_id(mut self, value: i32) -> Self {
7650 self.reservation_id = Some(value);
7651 self
7652 }
7653
7654 #[must_use]
7656 pub fn with_evse(mut self, value: EVSE) -> Self {
7657 self.evse = Some(value);
7658 self
7659 }
7660
7661 #[must_use]
7663 pub fn with_id_token(mut self, value: IdToken) -> Self {
7664 self.id_token = Some(value);
7665 self
7666 }
7667
7668 #[must_use]
7670 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7671 self.custom_data = Some(value);
7672 self
7673 }
7674}
7675
7676impl Validate for TransactionEventRequest {
7677 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7678 path.push_key("eventType");
7679 Validate::validate_at(&self.event_type, path, out);
7680 path.pop();
7681 path.push_key("triggerReason");
7682 Validate::validate_at(&self.trigger_reason, path, out);
7683 path.pop();
7684 path.push_key("transactionInfo");
7685 Validate::validate_at(&self.transaction_info, path, out);
7686 path.pop();
7687 path.push_key("meterValue");
7688 if let Some(value) = &self.meter_value {
7689 validate::list_len(value.len(), Some(1), None, path, out);
7690 for (index, item) in value.iter().enumerate() {
7691 path.push_index(index);
7692 Validate::validate_at(item, path, out);
7693 path.pop();
7694 }
7695 }
7696 path.pop();
7697 path.push_key("evse");
7698 if let Some(value) = &self.evse {
7699 Validate::validate_at(value, path, out);
7700 }
7701 path.pop();
7702 path.push_key("idToken");
7703 if let Some(value) = &self.id_token {
7704 Validate::validate_at(value, path, out);
7705 }
7706 path.pop();
7707 path.push_key("customData");
7708 if let Some(value) = &self.custom_data {
7709 Validate::validate_at(value, path, out);
7710 }
7711 path.pop();
7712 }
7713}
7714
7715impl Sealed for TransactionEventRequest {}
7716impl Request for TransactionEventRequest {
7717 type Action = Action;
7718 const ACTION: Action = Action::TransactionEvent;
7719 const KIND: MessageKind = MessageKind::Call;
7720 const ORIGIN: Origin = Origin::ChargingStation;
7721 type Response = TransactionEventResponse;
7722}
7723
7724impl Confirmed for TransactionEventRequest {}
7725
7726#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7728pub struct TransactionEventResponse {
7729 #[serde(rename = "totalCost")]
7731 #[serde(default, skip_serializing_if = "Option::is_none")]
7732 pub total_cost: Option<crate::types::Decimal>,
7733 #[serde(rename = "chargingPriority")]
7735 #[serde(default, skip_serializing_if = "Option::is_none")]
7736 pub charging_priority: Option<i32>,
7737 #[serde(rename = "idTokenInfo")]
7739 #[serde(default, skip_serializing_if = "Option::is_none")]
7740 pub id_token_info: Option<IdTokenInfo>,
7741 #[serde(rename = "updatedPersonalMessage")]
7743 #[serde(default, skip_serializing_if = "Option::is_none")]
7744 pub updated_personal_message: Option<MessageContent>,
7745 #[serde(rename = "customData")]
7747 #[serde(default, skip_serializing_if = "Option::is_none")]
7748 pub custom_data: Option<crate::types::CustomData>,
7749}
7750
7751impl TransactionEventResponse {
7752 #[must_use]
7754 pub fn new() -> Self {
7755 Self::default()
7756 }
7757
7758 #[must_use]
7760 pub fn with_total_cost(mut self, value: impl Into<crate::types::Decimal>) -> Self {
7761 self.total_cost = Some(value.into());
7762 self
7763 }
7764
7765 #[must_use]
7767 pub fn with_charging_priority(mut self, value: i32) -> Self {
7768 self.charging_priority = Some(value);
7769 self
7770 }
7771
7772 #[must_use]
7774 pub fn with_id_token_info(mut self, value: IdTokenInfo) -> Self {
7775 self.id_token_info = Some(value);
7776 self
7777 }
7778
7779 #[must_use]
7781 pub fn with_updated_personal_message(mut self, value: MessageContent) -> Self {
7782 self.updated_personal_message = Some(value);
7783 self
7784 }
7785
7786 #[must_use]
7788 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7789 self.custom_data = Some(value);
7790 self
7791 }
7792}
7793
7794impl Validate for TransactionEventResponse {
7795 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7796 path.push_key("idTokenInfo");
7797 if let Some(value) = &self.id_token_info {
7798 Validate::validate_at(value, path, out);
7799 }
7800 path.pop();
7801 path.push_key("updatedPersonalMessage");
7802 if let Some(value) = &self.updated_personal_message {
7803 Validate::validate_at(value, path, out);
7804 }
7805 path.pop();
7806 path.push_key("customData");
7807 if let Some(value) = &self.custom_data {
7808 Validate::validate_at(value, path, out);
7809 }
7810 path.pop();
7811 }
7812}
7813
7814impl Sealed for TransactionEventResponse {}
7815impl Response for TransactionEventResponse {}
7816
7817#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7819pub struct TriggerMessageRequest {
7820 #[serde(rename = "requestedMessage")]
7822 pub requested_message: MessageTrigger,
7823 #[serde(default, skip_serializing_if = "Option::is_none")]
7825 pub evse: Option<EVSE>,
7826 #[serde(rename = "customData")]
7828 #[serde(default, skip_serializing_if = "Option::is_none")]
7829 pub custom_data: Option<crate::types::CustomData>,
7830}
7831
7832impl TriggerMessageRequest {
7833 #[must_use]
7835 pub fn new(requested_message: MessageTrigger) -> Self {
7836 Self {
7837 requested_message,
7838 evse: None,
7839 custom_data: None,
7840 }
7841 }
7842
7843 #[must_use]
7845 pub fn with_evse(mut self, value: EVSE) -> Self {
7846 self.evse = Some(value);
7847 self
7848 }
7849
7850 #[must_use]
7852 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7853 self.custom_data = Some(value);
7854 self
7855 }
7856}
7857
7858impl Validate for TriggerMessageRequest {
7859 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7860 path.push_key("requestedMessage");
7861 Validate::validate_at(&self.requested_message, path, out);
7862 path.pop();
7863 path.push_key("evse");
7864 if let Some(value) = &self.evse {
7865 Validate::validate_at(value, path, out);
7866 }
7867 path.pop();
7868 path.push_key("customData");
7869 if let Some(value) = &self.custom_data {
7870 Validate::validate_at(value, path, out);
7871 }
7872 path.pop();
7873 }
7874}
7875
7876impl Sealed for TriggerMessageRequest {}
7877impl Request for TriggerMessageRequest {
7878 type Action = Action;
7879 const ACTION: Action = Action::TriggerMessage;
7880 const KIND: MessageKind = MessageKind::Call;
7881 const ORIGIN: Origin = Origin::Csms;
7882 type Response = TriggerMessageResponse;
7883}
7884
7885impl Confirmed for TriggerMessageRequest {}
7886
7887#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7889pub struct TriggerMessageResponse {
7890 pub status: TriggerMessageStatus,
7892 #[serde(rename = "statusInfo")]
7894 #[serde(default, skip_serializing_if = "Option::is_none")]
7895 pub status_info: Option<StatusInfo>,
7896 #[serde(rename = "customData")]
7898 #[serde(default, skip_serializing_if = "Option::is_none")]
7899 pub custom_data: Option<crate::types::CustomData>,
7900}
7901
7902impl TriggerMessageResponse {
7903 #[must_use]
7905 pub fn new(status: TriggerMessageStatus) -> Self {
7906 Self {
7907 status,
7908 status_info: None,
7909 custom_data: None,
7910 }
7911 }
7912
7913 #[must_use]
7915 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
7916 self.status_info = Some(value);
7917 self
7918 }
7919
7920 #[must_use]
7922 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7923 self.custom_data = Some(value);
7924 self
7925 }
7926}
7927
7928impl Validate for TriggerMessageResponse {
7929 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7930 path.push_key("status");
7931 Validate::validate_at(&self.status, path, out);
7932 path.pop();
7933 path.push_key("statusInfo");
7934 if let Some(value) = &self.status_info {
7935 Validate::validate_at(value, path, out);
7936 }
7937 path.pop();
7938 path.push_key("customData");
7939 if let Some(value) = &self.custom_data {
7940 Validate::validate_at(value, path, out);
7941 }
7942 path.pop();
7943 }
7944}
7945
7946impl Sealed for TriggerMessageResponse {}
7947impl Response for TriggerMessageResponse {}
7948
7949#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7951pub struct UnlockConnectorRequest {
7952 #[serde(rename = "evseId")]
7954 pub evse_id: i32,
7955 #[serde(rename = "connectorId")]
7957 pub connector_id: i32,
7958 #[serde(rename = "customData")]
7960 #[serde(default, skip_serializing_if = "Option::is_none")]
7961 pub custom_data: Option<crate::types::CustomData>,
7962}
7963
7964impl UnlockConnectorRequest {
7965 #[must_use]
7967 pub fn new(evse_id: i32, connector_id: i32) -> Self {
7968 Self {
7969 evse_id,
7970 connector_id,
7971 custom_data: None,
7972 }
7973 }
7974
7975 #[must_use]
7977 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7978 self.custom_data = Some(value);
7979 self
7980 }
7981}
7982
7983impl Validate for UnlockConnectorRequest {
7984 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7985 path.push_key("customData");
7986 if let Some(value) = &self.custom_data {
7987 Validate::validate_at(value, path, out);
7988 }
7989 path.pop();
7990 }
7991}
7992
7993impl Sealed for UnlockConnectorRequest {}
7994impl Request for UnlockConnectorRequest {
7995 type Action = Action;
7996 const ACTION: Action = Action::UnlockConnector;
7997 const KIND: MessageKind = MessageKind::Call;
7998 const ORIGIN: Origin = Origin::Csms;
7999 type Response = UnlockConnectorResponse;
8000}
8001
8002impl Confirmed for UnlockConnectorRequest {}
8003
8004#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8006pub struct UnlockConnectorResponse {
8007 pub status: UnlockStatus,
8009 #[serde(rename = "statusInfo")]
8011 #[serde(default, skip_serializing_if = "Option::is_none")]
8012 pub status_info: Option<StatusInfo>,
8013 #[serde(rename = "customData")]
8015 #[serde(default, skip_serializing_if = "Option::is_none")]
8016 pub custom_data: Option<crate::types::CustomData>,
8017}
8018
8019impl UnlockConnectorResponse {
8020 #[must_use]
8022 pub fn new(status: UnlockStatus) -> Self {
8023 Self {
8024 status,
8025 status_info: None,
8026 custom_data: None,
8027 }
8028 }
8029
8030 #[must_use]
8032 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
8033 self.status_info = Some(value);
8034 self
8035 }
8036
8037 #[must_use]
8039 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8040 self.custom_data = Some(value);
8041 self
8042 }
8043}
8044
8045impl Validate for UnlockConnectorResponse {
8046 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8047 path.push_key("status");
8048 Validate::validate_at(&self.status, path, out);
8049 path.pop();
8050 path.push_key("statusInfo");
8051 if let Some(value) = &self.status_info {
8052 Validate::validate_at(value, path, out);
8053 }
8054 path.pop();
8055 path.push_key("customData");
8056 if let Some(value) = &self.custom_data {
8057 Validate::validate_at(value, path, out);
8058 }
8059 path.pop();
8060 }
8061}
8062
8063impl Sealed for UnlockConnectorResponse {}
8064impl Response for UnlockConnectorResponse {}
8065
8066#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8068pub struct UnpublishFirmwareRequest {
8069 pub checksum: String,
8071 #[serde(rename = "customData")]
8073 #[serde(default, skip_serializing_if = "Option::is_none")]
8074 pub custom_data: Option<crate::types::CustomData>,
8075}
8076
8077impl UnpublishFirmwareRequest {
8078 #[must_use]
8080 pub fn new(checksum: impl Into<String>) -> Self {
8081 Self {
8082 checksum: checksum.into(),
8083 custom_data: None,
8084 }
8085 }
8086
8087 #[must_use]
8089 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8090 self.custom_data = Some(value);
8091 self
8092 }
8093}
8094
8095impl Validate for UnpublishFirmwareRequest {
8096 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8097 path.push_key("checksum");
8098 validate::string(self.checksum.as_str(), None, Some(32), path, out);
8099 path.pop();
8100 path.push_key("customData");
8101 if let Some(value) = &self.custom_data {
8102 Validate::validate_at(value, path, out);
8103 }
8104 path.pop();
8105 }
8106}
8107
8108impl Sealed for UnpublishFirmwareRequest {}
8109impl Request for UnpublishFirmwareRequest {
8110 type Action = Action;
8111 const ACTION: Action = Action::UnpublishFirmware;
8112 const KIND: MessageKind = MessageKind::Call;
8113 const ORIGIN: Origin = Origin::Csms;
8114 type Response = UnpublishFirmwareResponse;
8115}
8116
8117impl Confirmed for UnpublishFirmwareRequest {}
8118
8119#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8121pub struct UnpublishFirmwareResponse {
8122 pub status: UnpublishFirmwareStatus,
8124 #[serde(rename = "customData")]
8126 #[serde(default, skip_serializing_if = "Option::is_none")]
8127 pub custom_data: Option<crate::types::CustomData>,
8128}
8129
8130impl UnpublishFirmwareResponse {
8131 #[must_use]
8133 pub fn new(status: UnpublishFirmwareStatus) -> Self {
8134 Self {
8135 status,
8136 custom_data: None,
8137 }
8138 }
8139
8140 #[must_use]
8142 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8143 self.custom_data = Some(value);
8144 self
8145 }
8146}
8147
8148impl Validate for UnpublishFirmwareResponse {
8149 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8150 path.push_key("status");
8151 Validate::validate_at(&self.status, path, out);
8152 path.pop();
8153 path.push_key("customData");
8154 if let Some(value) = &self.custom_data {
8155 Validate::validate_at(value, path, out);
8156 }
8157 path.pop();
8158 }
8159}
8160
8161impl Sealed for UnpublishFirmwareResponse {}
8162impl Response for UnpublishFirmwareResponse {}
8163
8164#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8166pub struct UpdateFirmwareRequest {
8167 #[serde(rename = "requestId")]
8169 pub request_id: i32,
8170 pub firmware: Firmware,
8172 #[serde(default, skip_serializing_if = "Option::is_none")]
8174 pub retries: Option<i32>,
8175 #[serde(rename = "retryInterval")]
8177 #[serde(default, skip_serializing_if = "Option::is_none")]
8178 pub retry_interval: Option<i32>,
8179 #[serde(rename = "customData")]
8181 #[serde(default, skip_serializing_if = "Option::is_none")]
8182 pub custom_data: Option<crate::types::CustomData>,
8183}
8184
8185impl UpdateFirmwareRequest {
8186 #[must_use]
8188 pub fn new(request_id: i32, firmware: Firmware) -> Self {
8189 Self {
8190 request_id,
8191 firmware,
8192 retries: None,
8193 retry_interval: None,
8194 custom_data: None,
8195 }
8196 }
8197
8198 #[must_use]
8200 pub fn with_retries(mut self, value: i32) -> Self {
8201 self.retries = Some(value);
8202 self
8203 }
8204
8205 #[must_use]
8207 pub fn with_retry_interval(mut self, value: i32) -> Self {
8208 self.retry_interval = Some(value);
8209 self
8210 }
8211
8212 #[must_use]
8214 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8215 self.custom_data = Some(value);
8216 self
8217 }
8218}
8219
8220impl Validate for UpdateFirmwareRequest {
8221 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8222 path.push_key("firmware");
8223 Validate::validate_at(&self.firmware, path, out);
8224 path.pop();
8225 path.push_key("customData");
8226 if let Some(value) = &self.custom_data {
8227 Validate::validate_at(value, path, out);
8228 }
8229 path.pop();
8230 }
8231}
8232
8233impl Sealed for UpdateFirmwareRequest {}
8234impl Request for UpdateFirmwareRequest {
8235 type Action = Action;
8236 const ACTION: Action = Action::UpdateFirmware;
8237 const KIND: MessageKind = MessageKind::Call;
8238 const ORIGIN: Origin = Origin::Csms;
8239 type Response = UpdateFirmwareResponse;
8240}
8241
8242impl Confirmed for UpdateFirmwareRequest {}
8243
8244#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8246pub struct UpdateFirmwareResponse {
8247 pub status: UpdateFirmwareStatus,
8249 #[serde(rename = "statusInfo")]
8251 #[serde(default, skip_serializing_if = "Option::is_none")]
8252 pub status_info: Option<StatusInfo>,
8253 #[serde(rename = "customData")]
8255 #[serde(default, skip_serializing_if = "Option::is_none")]
8256 pub custom_data: Option<crate::types::CustomData>,
8257}
8258
8259impl UpdateFirmwareResponse {
8260 #[must_use]
8262 pub fn new(status: UpdateFirmwareStatus) -> Self {
8263 Self {
8264 status,
8265 status_info: None,
8266 custom_data: None,
8267 }
8268 }
8269
8270 #[must_use]
8272 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
8273 self.status_info = Some(value);
8274 self
8275 }
8276
8277 #[must_use]
8279 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8280 self.custom_data = Some(value);
8281 self
8282 }
8283}
8284
8285impl Validate for UpdateFirmwareResponse {
8286 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8287 path.push_key("status");
8288 Validate::validate_at(&self.status, path, out);
8289 path.pop();
8290 path.push_key("statusInfo");
8291 if let Some(value) = &self.status_info {
8292 Validate::validate_at(value, path, out);
8293 }
8294 path.pop();
8295 path.push_key("customData");
8296 if let Some(value) = &self.custom_data {
8297 Validate::validate_at(value, path, out);
8298 }
8299 path.pop();
8300 }
8301}
8302
8303impl Sealed for UpdateFirmwareResponse {}
8304impl Response for UpdateFirmwareResponse {}