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 AFRRSignalRequest {
28 pub timestamp: crate::types::DateTime,
30 #[serde(deserialize_with = "crate::types::integer::one")]
32 pub signal: i32,
33 #[serde(rename = "customData")]
35 #[serde(default, skip_serializing_if = "Option::is_none")]
36 pub custom_data: Option<crate::types::CustomData>,
37}
38
39impl AFRRSignalRequest {
40 #[must_use]
42 pub fn new(timestamp: impl Into<crate::types::DateTime>, signal: i32) -> Self {
43 Self {
44 timestamp: timestamp.into(),
45 signal,
46 custom_data: None,
47 }
48 }
49
50 #[must_use]
52 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
53 self.custom_data = Some(value);
54 self
55 }
56}
57
58impl Validate for AFRRSignalRequest {
59 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
60 path.push_key("customData");
61 if let Some(value) = &self.custom_data {
62 Validate::validate_at(value, path, out);
63 }
64 path.pop();
65 }
66}
67
68impl Sealed for AFRRSignalRequest {}
69impl Request for AFRRSignalRequest {
70 type Action = Action;
71 const ACTION: Action = Action::AFRRSignal;
72 const KIND: MessageKind = MessageKind::Call;
73 const ORIGIN: Origin = Origin::Csms;
74 type Response = AFRRSignalResponse;
75}
76
77impl Confirmed for AFRRSignalRequest {}
78
79#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
81pub struct AFRRSignalResponse {
82 pub status: GenericStatus,
84 #[serde(rename = "statusInfo")]
86 #[serde(default, skip_serializing_if = "Option::is_none")]
87 pub status_info: Option<StatusInfo>,
88 #[serde(rename = "customData")]
90 #[serde(default, skip_serializing_if = "Option::is_none")]
91 pub custom_data: Option<crate::types::CustomData>,
92}
93
94impl AFRRSignalResponse {
95 #[must_use]
97 pub fn new(status: GenericStatus) -> Self {
98 Self {
99 status,
100 status_info: None,
101 custom_data: None,
102 }
103 }
104
105 #[must_use]
107 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
108 self.status_info = Some(value);
109 self
110 }
111
112 #[must_use]
114 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
115 self.custom_data = Some(value);
116 self
117 }
118}
119
120impl Validate for AFRRSignalResponse {
121 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
122 path.push_key("status");
123 Validate::validate_at(&self.status, path, out);
124 path.pop();
125 path.push_key("statusInfo");
126 if let Some(value) = &self.status_info {
127 Validate::validate_at(value, path, out);
128 }
129 path.pop();
130 path.push_key("customData");
131 if let Some(value) = &self.custom_data {
132 Validate::validate_at(value, path, out);
133 }
134 path.pop();
135 }
136}
137
138impl Sealed for AFRRSignalResponse {}
139impl Response for AFRRSignalResponse {}
140
141#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
143pub struct AdjustPeriodicEventStreamRequest {
144 #[serde(deserialize_with = "crate::types::integer::one")]
146 pub id: i32,
147 pub params: PeriodicEventStreamParams,
149 #[serde(rename = "customData")]
151 #[serde(default, skip_serializing_if = "Option::is_none")]
152 pub custom_data: Option<crate::types::CustomData>,
153}
154
155impl AdjustPeriodicEventStreamRequest {
156 #[must_use]
158 pub fn new(id: i32, params: PeriodicEventStreamParams) -> Self {
159 Self {
160 id,
161 params,
162 custom_data: None,
163 }
164 }
165
166 #[must_use]
168 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
169 self.custom_data = Some(value);
170 self
171 }
172}
173
174impl Validate for AdjustPeriodicEventStreamRequest {
175 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
176 path.push_key("id");
177 validate::int_range(i64::from(self.id), Some(0), None, path, out);
178 path.pop();
179 path.push_key("params");
180 Validate::validate_at(&self.params, path, out);
181 path.pop();
182 path.push_key("customData");
183 if let Some(value) = &self.custom_data {
184 Validate::validate_at(value, path, out);
185 }
186 path.pop();
187 }
188}
189
190impl Sealed for AdjustPeriodicEventStreamRequest {}
191impl Request for AdjustPeriodicEventStreamRequest {
192 type Action = Action;
193 const ACTION: Action = Action::AdjustPeriodicEventStream;
194 const KIND: MessageKind = MessageKind::Call;
195 const ORIGIN: Origin = Origin::Csms;
196 type Response = AdjustPeriodicEventStreamResponse;
197}
198
199impl Confirmed for AdjustPeriodicEventStreamRequest {}
200
201#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
203pub struct AdjustPeriodicEventStreamResponse {
204 pub status: GenericStatus,
206 #[serde(rename = "statusInfo")]
208 #[serde(default, skip_serializing_if = "Option::is_none")]
209 pub status_info: Option<StatusInfo>,
210 #[serde(rename = "customData")]
212 #[serde(default, skip_serializing_if = "Option::is_none")]
213 pub custom_data: Option<crate::types::CustomData>,
214}
215
216impl AdjustPeriodicEventStreamResponse {
217 #[must_use]
219 pub fn new(status: GenericStatus) -> Self {
220 Self {
221 status,
222 status_info: None,
223 custom_data: None,
224 }
225 }
226
227 #[must_use]
229 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
230 self.status_info = Some(value);
231 self
232 }
233
234 #[must_use]
236 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
237 self.custom_data = Some(value);
238 self
239 }
240}
241
242impl Validate for AdjustPeriodicEventStreamResponse {
243 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
244 path.push_key("status");
245 Validate::validate_at(&self.status, path, out);
246 path.pop();
247 path.push_key("statusInfo");
248 if let Some(value) = &self.status_info {
249 Validate::validate_at(value, path, out);
250 }
251 path.pop();
252 path.push_key("customData");
253 if let Some(value) = &self.custom_data {
254 Validate::validate_at(value, path, out);
255 }
256 path.pop();
257 }
258}
259
260impl Sealed for AdjustPeriodicEventStreamResponse {}
261impl Response for AdjustPeriodicEventStreamResponse {}
262
263#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
265pub struct AuthorizeRequest {
266 #[serde(rename = "idToken")]
268 pub id_token: IdToken,
269 #[serde(default, skip_serializing_if = "Option::is_none")]
272 pub certificate: Option<String>,
273 #[serde(rename = "iso15118CertificateHashData")]
275 #[serde(default, skip_serializing_if = "Option::is_none")]
276 pub iso15118_certificate_hash_data: Option<Vec<OCSPRequestData>>,
277 #[serde(rename = "customData")]
279 #[serde(default, skip_serializing_if = "Option::is_none")]
280 pub custom_data: Option<crate::types::CustomData>,
281}
282
283impl AuthorizeRequest {
284 #[must_use]
286 pub fn new(id_token: IdToken) -> Self {
287 Self {
288 id_token,
289 certificate: None,
290 iso15118_certificate_hash_data: None,
291 custom_data: None,
292 }
293 }
294
295 #[must_use]
297 pub fn with_certificate(mut self, value: impl Into<String>) -> Self {
298 self.certificate = Some(value.into());
299 self
300 }
301
302 #[must_use]
304 pub fn with_iso15118_certificate_hash_data(mut self, value: Vec<OCSPRequestData>) -> Self {
305 self.iso15118_certificate_hash_data = Some(value);
306 self
307 }
308
309 #[must_use]
311 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
312 self.custom_data = Some(value);
313 self
314 }
315}
316
317impl Validate for AuthorizeRequest {
318 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
319 path.push_key("idToken");
320 Validate::validate_at(&self.id_token, path, out);
321 path.pop();
322 path.push_key("certificate");
323 if let Some(value) = &self.certificate {
324 validate::string(value.as_str(), None, Some(10000), path, out);
325 }
326 path.pop();
327 path.push_key("iso15118CertificateHashData");
328 if let Some(value) = &self.iso15118_certificate_hash_data {
329 validate::list_len(value.len(), Some(1), Some(4), path, out);
330 for (index, item) in value.iter().enumerate() {
331 path.push_index(index);
332 Validate::validate_at(item, path, out);
333 path.pop();
334 }
335 }
336 path.pop();
337 path.push_key("customData");
338 if let Some(value) = &self.custom_data {
339 Validate::validate_at(value, path, out);
340 }
341 path.pop();
342 }
343}
344
345impl Sealed for AuthorizeRequest {}
346impl Request for AuthorizeRequest {
347 type Action = Action;
348 const ACTION: Action = Action::Authorize;
349 const KIND: MessageKind = MessageKind::Call;
350 const ORIGIN: Origin = Origin::ChargingStation;
351 type Response = AuthorizeResponse;
352}
353
354impl Confirmed for AuthorizeRequest {}
355
356#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
358pub struct AuthorizeResponse {
359 #[serde(rename = "idTokenInfo")]
361 pub id_token_info: IdTokenInfo,
362 #[serde(rename = "certificateStatus")]
364 #[serde(default, skip_serializing_if = "Option::is_none")]
365 pub certificate_status: Option<AuthorizeCertificateStatus>,
366 #[serde(rename = "allowedEnergyTransfer")]
368 #[serde(default, skip_serializing_if = "Option::is_none")]
369 pub allowed_energy_transfer: Option<Vec<EnergyTransferMode>>,
370 #[serde(default, skip_serializing_if = "Option::is_none")]
372 pub tariff: Option<Tariff>,
373 #[serde(rename = "customData")]
375 #[serde(default, skip_serializing_if = "Option::is_none")]
376 pub custom_data: Option<crate::types::CustomData>,
377}
378
379impl AuthorizeResponse {
380 #[must_use]
382 pub fn new(id_token_info: IdTokenInfo) -> Self {
383 Self {
384 id_token_info,
385 certificate_status: None,
386 allowed_energy_transfer: None,
387 tariff: None,
388 custom_data: None,
389 }
390 }
391
392 #[must_use]
394 pub fn with_certificate_status(mut self, value: AuthorizeCertificateStatus) -> Self {
395 self.certificate_status = Some(value);
396 self
397 }
398
399 #[must_use]
401 pub fn with_allowed_energy_transfer(mut self, value: Vec<EnergyTransferMode>) -> Self {
402 self.allowed_energy_transfer = Some(value);
403 self
404 }
405
406 #[must_use]
408 pub fn with_tariff(mut self, value: Tariff) -> Self {
409 self.tariff = Some(value);
410 self
411 }
412
413 #[must_use]
415 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
416 self.custom_data = Some(value);
417 self
418 }
419}
420
421impl Validate for AuthorizeResponse {
422 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
423 path.push_key("idTokenInfo");
424 Validate::validate_at(&self.id_token_info, path, out);
425 path.pop();
426 path.push_key("certificateStatus");
427 if let Some(value) = &self.certificate_status {
428 Validate::validate_at(value, path, out);
429 }
430 path.pop();
431 path.push_key("allowedEnergyTransfer");
432 if let Some(value) = &self.allowed_energy_transfer {
433 validate::list_len(value.len(), Some(1), None, path, out);
434 for (index, item) in value.iter().enumerate() {
435 path.push_index(index);
436 Validate::validate_at(item, path, out);
437 path.pop();
438 }
439 }
440 path.pop();
441 path.push_key("tariff");
442 if let Some(value) = &self.tariff {
443 Validate::validate_at(value, path, out);
444 }
445 path.pop();
446 path.push_key("customData");
447 if let Some(value) = &self.custom_data {
448 Validate::validate_at(value, path, out);
449 }
450 path.pop();
451 }
452}
453
454impl Sealed for AuthorizeResponse {}
455impl Response for AuthorizeResponse {}
456
457#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
459pub struct BatterySwapRequest {
460 #[serde(rename = "batteryData")]
462 pub battery_data: Vec<BatteryData>,
463 #[serde(rename = "eventType")]
465 pub event_type: BatterySwapEvent,
466 #[serde(rename = "idToken")]
468 pub id_token: IdToken,
469 #[serde(rename = "requestId")]
471 #[serde(deserialize_with = "crate::types::integer::one")]
472 pub request_id: i32,
473 #[serde(rename = "customData")]
475 #[serde(default, skip_serializing_if = "Option::is_none")]
476 pub custom_data: Option<crate::types::CustomData>,
477}
478
479impl BatterySwapRequest {
480 #[must_use]
482 pub fn new(
483 battery_data: Vec<BatteryData>,
484 event_type: BatterySwapEvent,
485 id_token: IdToken,
486 request_id: i32,
487 ) -> Self {
488 Self {
489 battery_data,
490 event_type,
491 id_token,
492 request_id,
493 custom_data: None,
494 }
495 }
496
497 #[must_use]
499 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
500 self.custom_data = Some(value);
501 self
502 }
503}
504
505impl Validate for BatterySwapRequest {
506 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
507 path.push_key("batteryData");
508 validate::list_len(self.battery_data.len(), Some(1), None, path, out);
509 for (index, item) in self.battery_data.iter().enumerate() {
510 path.push_index(index);
511 Validate::validate_at(item, path, out);
512 path.pop();
513 }
514 path.pop();
515 path.push_key("eventType");
516 Validate::validate_at(&self.event_type, path, out);
517 path.pop();
518 path.push_key("idToken");
519 Validate::validate_at(&self.id_token, path, out);
520 path.pop();
521 path.push_key("customData");
522 if let Some(value) = &self.custom_data {
523 Validate::validate_at(value, path, out);
524 }
525 path.pop();
526 }
527}
528
529impl Sealed for BatterySwapRequest {}
530impl Request for BatterySwapRequest {
531 type Action = Action;
532 const ACTION: Action = Action::BatterySwap;
533 const KIND: MessageKind = MessageKind::Call;
534 const ORIGIN: Origin = Origin::ChargingStation;
535 type Response = BatterySwapResponse;
536}
537
538impl Confirmed for BatterySwapRequest {}
539
540#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
544pub struct BatterySwapResponse {
545 #[serde(rename = "customData")]
547 #[serde(default, skip_serializing_if = "Option::is_none")]
548 pub custom_data: Option<crate::types::CustomData>,
549}
550
551impl BatterySwapResponse {
552 #[must_use]
554 pub fn new() -> Self {
555 Self::default()
556 }
557
558 #[must_use]
560 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
561 self.custom_data = Some(value);
562 self
563 }
564}
565
566impl Validate for BatterySwapResponse {
567 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
568 path.push_key("customData");
569 if let Some(value) = &self.custom_data {
570 Validate::validate_at(value, path, out);
571 }
572 path.pop();
573 }
574}
575
576impl Sealed for BatterySwapResponse {}
577impl Response for BatterySwapResponse {}
578
579#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
581pub struct BootNotificationRequest {
582 #[serde(rename = "chargingStation")]
584 pub charging_station: ChargingStation,
585 pub reason: BootReason,
587 #[serde(rename = "customData")]
589 #[serde(default, skip_serializing_if = "Option::is_none")]
590 pub custom_data: Option<crate::types::CustomData>,
591}
592
593impl BootNotificationRequest {
594 #[must_use]
596 pub fn new(charging_station: ChargingStation, reason: BootReason) -> Self {
597 Self {
598 charging_station,
599 reason,
600 custom_data: None,
601 }
602 }
603
604 #[must_use]
606 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
607 self.custom_data = Some(value);
608 self
609 }
610}
611
612impl Validate for BootNotificationRequest {
613 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
614 path.push_key("chargingStation");
615 Validate::validate_at(&self.charging_station, path, out);
616 path.pop();
617 path.push_key("reason");
618 Validate::validate_at(&self.reason, path, out);
619 path.pop();
620 path.push_key("customData");
621 if let Some(value) = &self.custom_data {
622 Validate::validate_at(value, path, out);
623 }
624 path.pop();
625 }
626}
627
628impl Sealed for BootNotificationRequest {}
629impl Request for BootNotificationRequest {
630 type Action = Action;
631 const ACTION: Action = Action::BootNotification;
632 const KIND: MessageKind = MessageKind::Call;
633 const ORIGIN: Origin = Origin::ChargingStation;
634 type Response = BootNotificationResponse;
635}
636
637impl Confirmed for BootNotificationRequest {}
638
639#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
641pub struct BootNotificationResponse {
642 #[serde(rename = "currentTime")]
644 pub current_time: crate::types::DateTime,
645 #[serde(deserialize_with = "crate::types::integer::one")]
647 pub interval: i32,
648 pub status: RegistrationStatus,
650 #[serde(rename = "statusInfo")]
652 #[serde(default, skip_serializing_if = "Option::is_none")]
653 pub status_info: Option<StatusInfo>,
654 #[serde(rename = "customData")]
656 #[serde(default, skip_serializing_if = "Option::is_none")]
657 pub custom_data: Option<crate::types::CustomData>,
658}
659
660impl BootNotificationResponse {
661 #[must_use]
663 pub fn new(
664 current_time: impl Into<crate::types::DateTime>,
665 interval: i32,
666 status: RegistrationStatus,
667 ) -> Self {
668 Self {
669 current_time: current_time.into(),
670 interval,
671 status,
672 status_info: None,
673 custom_data: None,
674 }
675 }
676
677 #[must_use]
679 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
680 self.status_info = Some(value);
681 self
682 }
683
684 #[must_use]
686 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
687 self.custom_data = Some(value);
688 self
689 }
690}
691
692impl Validate for BootNotificationResponse {
693 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
694 path.push_key("status");
695 Validate::validate_at(&self.status, path, out);
696 path.pop();
697 path.push_key("statusInfo");
698 if let Some(value) = &self.status_info {
699 Validate::validate_at(value, path, out);
700 }
701 path.pop();
702 path.push_key("customData");
703 if let Some(value) = &self.custom_data {
704 Validate::validate_at(value, path, out);
705 }
706 path.pop();
707 }
708}
709
710impl Sealed for BootNotificationResponse {}
711impl Response for BootNotificationResponse {}
712
713#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
715pub struct CancelReservationRequest {
716 #[serde(rename = "reservationId")]
718 #[serde(deserialize_with = "crate::types::integer::one")]
719 pub reservation_id: i32,
720 #[serde(rename = "customData")]
722 #[serde(default, skip_serializing_if = "Option::is_none")]
723 pub custom_data: Option<crate::types::CustomData>,
724}
725
726impl CancelReservationRequest {
727 #[must_use]
729 pub fn new(reservation_id: i32) -> Self {
730 Self {
731 reservation_id,
732 custom_data: None,
733 }
734 }
735
736 #[must_use]
738 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
739 self.custom_data = Some(value);
740 self
741 }
742}
743
744impl Validate for CancelReservationRequest {
745 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
746 path.push_key("reservationId");
747 validate::int_range(i64::from(self.reservation_id), Some(0), None, path, out);
748 path.pop();
749 path.push_key("customData");
750 if let Some(value) = &self.custom_data {
751 Validate::validate_at(value, path, out);
752 }
753 path.pop();
754 }
755}
756
757impl Sealed for CancelReservationRequest {}
758impl Request for CancelReservationRequest {
759 type Action = Action;
760 const ACTION: Action = Action::CancelReservation;
761 const KIND: MessageKind = MessageKind::Call;
762 const ORIGIN: Origin = Origin::Csms;
763 type Response = CancelReservationResponse;
764}
765
766impl Confirmed for CancelReservationRequest {}
767
768#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
770pub struct CancelReservationResponse {
771 pub status: CancelReservationStatus,
773 #[serde(rename = "statusInfo")]
775 #[serde(default, skip_serializing_if = "Option::is_none")]
776 pub status_info: Option<StatusInfo>,
777 #[serde(rename = "customData")]
779 #[serde(default, skip_serializing_if = "Option::is_none")]
780 pub custom_data: Option<crate::types::CustomData>,
781}
782
783impl CancelReservationResponse {
784 #[must_use]
786 pub fn new(status: CancelReservationStatus) -> Self {
787 Self {
788 status,
789 status_info: None,
790 custom_data: None,
791 }
792 }
793
794 #[must_use]
796 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
797 self.status_info = Some(value);
798 self
799 }
800
801 #[must_use]
803 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
804 self.custom_data = Some(value);
805 self
806 }
807}
808
809impl Validate for CancelReservationResponse {
810 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
811 path.push_key("status");
812 Validate::validate_at(&self.status, path, out);
813 path.pop();
814 path.push_key("statusInfo");
815 if let Some(value) = &self.status_info {
816 Validate::validate_at(value, path, out);
817 }
818 path.pop();
819 path.push_key("customData");
820 if let Some(value) = &self.custom_data {
821 Validate::validate_at(value, path, out);
822 }
823 path.pop();
824 }
825}
826
827impl Sealed for CancelReservationResponse {}
828impl Response for CancelReservationResponse {}
829
830#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
832pub struct CertificateSignedRequest {
833 #[serde(rename = "certificateChain")]
837 pub certificate_chain: String,
838 #[serde(rename = "certificateType")]
840 #[serde(default, skip_serializing_if = "Option::is_none")]
841 pub certificate_type: Option<CertificateSigningUse>,
842 #[serde(rename = "requestId")]
844 #[serde(default, skip_serializing_if = "Option::is_none")]
845 #[serde(deserialize_with = "crate::types::integer::option")]
846 pub request_id: Option<i32>,
847 #[serde(rename = "customData")]
849 #[serde(default, skip_serializing_if = "Option::is_none")]
850 pub custom_data: Option<crate::types::CustomData>,
851}
852
853impl CertificateSignedRequest {
854 #[must_use]
856 pub fn new(certificate_chain: impl Into<String>) -> Self {
857 Self {
858 certificate_chain: certificate_chain.into(),
859 certificate_type: None,
860 request_id: None,
861 custom_data: None,
862 }
863 }
864
865 #[must_use]
867 pub fn with_certificate_type(mut self, value: CertificateSigningUse) -> Self {
868 self.certificate_type = Some(value);
869 self
870 }
871
872 #[must_use]
874 pub fn with_request_id(mut self, value: i32) -> Self {
875 self.request_id = Some(value);
876 self
877 }
878
879 #[must_use]
881 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
882 self.custom_data = Some(value);
883 self
884 }
885}
886
887impl Validate for CertificateSignedRequest {
888 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
889 path.push_key("certificateChain");
890 validate::string(
891 self.certificate_chain.as_str(),
892 None,
893 Some(10000),
894 path,
895 out,
896 );
897 path.pop();
898 path.push_key("certificateType");
899 if let Some(value) = &self.certificate_type {
900 Validate::validate_at(value, path, out);
901 }
902 path.pop();
903 path.push_key("customData");
904 if let Some(value) = &self.custom_data {
905 Validate::validate_at(value, path, out);
906 }
907 path.pop();
908 }
909}
910
911impl Sealed for CertificateSignedRequest {}
912impl Request for CertificateSignedRequest {
913 type Action = Action;
914 const ACTION: Action = Action::CertificateSigned;
915 const KIND: MessageKind = MessageKind::Call;
916 const ORIGIN: Origin = Origin::Csms;
917 type Response = CertificateSignedResponse;
918}
919
920impl Confirmed for CertificateSignedRequest {}
921
922#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
924pub struct CertificateSignedResponse {
925 pub status: CertificateSignedStatus,
927 #[serde(rename = "statusInfo")]
929 #[serde(default, skip_serializing_if = "Option::is_none")]
930 pub status_info: Option<StatusInfo>,
931 #[serde(rename = "customData")]
933 #[serde(default, skip_serializing_if = "Option::is_none")]
934 pub custom_data: Option<crate::types::CustomData>,
935}
936
937impl CertificateSignedResponse {
938 #[must_use]
940 pub fn new(status: CertificateSignedStatus) -> Self {
941 Self {
942 status,
943 status_info: None,
944 custom_data: None,
945 }
946 }
947
948 #[must_use]
950 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
951 self.status_info = Some(value);
952 self
953 }
954
955 #[must_use]
957 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
958 self.custom_data = Some(value);
959 self
960 }
961}
962
963impl Validate for CertificateSignedResponse {
964 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
965 path.push_key("status");
966 Validate::validate_at(&self.status, path, out);
967 path.pop();
968 path.push_key("statusInfo");
969 if let Some(value) = &self.status_info {
970 Validate::validate_at(value, path, out);
971 }
972 path.pop();
973 path.push_key("customData");
974 if let Some(value) = &self.custom_data {
975 Validate::validate_at(value, path, out);
976 }
977 path.pop();
978 }
979}
980
981impl Sealed for CertificateSignedResponse {}
982impl Response for CertificateSignedResponse {}
983
984#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
986pub struct ChangeAvailabilityRequest {
987 #[serde(rename = "operationalStatus")]
989 pub operational_status: OperationalStatus,
990 #[serde(default, skip_serializing_if = "Option::is_none")]
992 pub evse: Option<EVSE>,
993 #[serde(rename = "customData")]
995 #[serde(default, skip_serializing_if = "Option::is_none")]
996 pub custom_data: Option<crate::types::CustomData>,
997}
998
999impl ChangeAvailabilityRequest {
1000 #[must_use]
1002 pub fn new(operational_status: OperationalStatus) -> Self {
1003 Self {
1004 operational_status,
1005 evse: None,
1006 custom_data: None,
1007 }
1008 }
1009
1010 #[must_use]
1012 pub fn with_evse(mut self, value: EVSE) -> Self {
1013 self.evse = Some(value);
1014 self
1015 }
1016
1017 #[must_use]
1019 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1020 self.custom_data = Some(value);
1021 self
1022 }
1023}
1024
1025impl Validate for ChangeAvailabilityRequest {
1026 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1027 path.push_key("operationalStatus");
1028 Validate::validate_at(&self.operational_status, path, out);
1029 path.pop();
1030 path.push_key("evse");
1031 if let Some(value) = &self.evse {
1032 Validate::validate_at(value, path, out);
1033 }
1034 path.pop();
1035 path.push_key("customData");
1036 if let Some(value) = &self.custom_data {
1037 Validate::validate_at(value, path, out);
1038 }
1039 path.pop();
1040 }
1041}
1042
1043impl Sealed for ChangeAvailabilityRequest {}
1044impl Request for ChangeAvailabilityRequest {
1045 type Action = Action;
1046 const ACTION: Action = Action::ChangeAvailability;
1047 const KIND: MessageKind = MessageKind::Call;
1048 const ORIGIN: Origin = Origin::Csms;
1049 type Response = ChangeAvailabilityResponse;
1050}
1051
1052impl Confirmed for ChangeAvailabilityRequest {}
1053
1054#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1056pub struct ChangeAvailabilityResponse {
1057 pub status: ChangeAvailabilityStatus,
1059 #[serde(rename = "statusInfo")]
1061 #[serde(default, skip_serializing_if = "Option::is_none")]
1062 pub status_info: Option<StatusInfo>,
1063 #[serde(rename = "customData")]
1065 #[serde(default, skip_serializing_if = "Option::is_none")]
1066 pub custom_data: Option<crate::types::CustomData>,
1067}
1068
1069impl ChangeAvailabilityResponse {
1070 #[must_use]
1072 pub fn new(status: ChangeAvailabilityStatus) -> Self {
1073 Self {
1074 status,
1075 status_info: None,
1076 custom_data: None,
1077 }
1078 }
1079
1080 #[must_use]
1082 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1083 self.status_info = Some(value);
1084 self
1085 }
1086
1087 #[must_use]
1089 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1090 self.custom_data = Some(value);
1091 self
1092 }
1093}
1094
1095impl Validate for ChangeAvailabilityResponse {
1096 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1097 path.push_key("status");
1098 Validate::validate_at(&self.status, path, out);
1099 path.pop();
1100 path.push_key("statusInfo");
1101 if let Some(value) = &self.status_info {
1102 Validate::validate_at(value, path, out);
1103 }
1104 path.pop();
1105 path.push_key("customData");
1106 if let Some(value) = &self.custom_data {
1107 Validate::validate_at(value, path, out);
1108 }
1109 path.pop();
1110 }
1111}
1112
1113impl Sealed for ChangeAvailabilityResponse {}
1114impl Response for ChangeAvailabilityResponse {}
1115
1116#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1118pub struct ChangeTransactionTariffRequest {
1119 pub tariff: Tariff,
1121 #[serde(rename = "transactionId")]
1123 pub transaction_id: String,
1124 #[serde(rename = "customData")]
1126 #[serde(default, skip_serializing_if = "Option::is_none")]
1127 pub custom_data: Option<crate::types::CustomData>,
1128}
1129
1130impl ChangeTransactionTariffRequest {
1131 #[must_use]
1133 pub fn new(tariff: Tariff, transaction_id: impl Into<String>) -> Self {
1134 Self {
1135 tariff,
1136 transaction_id: transaction_id.into(),
1137 custom_data: None,
1138 }
1139 }
1140
1141 #[must_use]
1143 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1144 self.custom_data = Some(value);
1145 self
1146 }
1147}
1148
1149impl Validate for ChangeTransactionTariffRequest {
1150 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1151 path.push_key("tariff");
1152 Validate::validate_at(&self.tariff, path, out);
1153 path.pop();
1154 path.push_key("transactionId");
1155 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
1156 path.pop();
1157 path.push_key("customData");
1158 if let Some(value) = &self.custom_data {
1159 Validate::validate_at(value, path, out);
1160 }
1161 path.pop();
1162 }
1163}
1164
1165impl Sealed for ChangeTransactionTariffRequest {}
1166impl Request for ChangeTransactionTariffRequest {
1167 type Action = Action;
1168 const ACTION: Action = Action::ChangeTransactionTariff;
1169 const KIND: MessageKind = MessageKind::Call;
1170 const ORIGIN: Origin = Origin::Csms;
1171 type Response = ChangeTransactionTariffResponse;
1172}
1173
1174impl Confirmed for ChangeTransactionTariffRequest {}
1175
1176#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1178pub struct ChangeTransactionTariffResponse {
1179 pub status: TariffChangeStatus,
1181 #[serde(rename = "statusInfo")]
1183 #[serde(default, skip_serializing_if = "Option::is_none")]
1184 pub status_info: Option<StatusInfo>,
1185 #[serde(rename = "customData")]
1187 #[serde(default, skip_serializing_if = "Option::is_none")]
1188 pub custom_data: Option<crate::types::CustomData>,
1189}
1190
1191impl ChangeTransactionTariffResponse {
1192 #[must_use]
1194 pub fn new(status: TariffChangeStatus) -> Self {
1195 Self {
1196 status,
1197 status_info: None,
1198 custom_data: None,
1199 }
1200 }
1201
1202 #[must_use]
1204 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1205 self.status_info = Some(value);
1206 self
1207 }
1208
1209 #[must_use]
1211 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1212 self.custom_data = Some(value);
1213 self
1214 }
1215}
1216
1217impl Validate for ChangeTransactionTariffResponse {
1218 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1219 path.push_key("status");
1220 Validate::validate_at(&self.status, path, out);
1221 path.pop();
1222 path.push_key("statusInfo");
1223 if let Some(value) = &self.status_info {
1224 Validate::validate_at(value, path, out);
1225 }
1226 path.pop();
1227 path.push_key("customData");
1228 if let Some(value) = &self.custom_data {
1229 Validate::validate_at(value, path, out);
1230 }
1231 path.pop();
1232 }
1233}
1234
1235impl Sealed for ChangeTransactionTariffResponse {}
1236impl Response for ChangeTransactionTariffResponse {}
1237
1238#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1240pub struct ClearCacheRequest {
1241 #[serde(rename = "customData")]
1243 #[serde(default, skip_serializing_if = "Option::is_none")]
1244 pub custom_data: Option<crate::types::CustomData>,
1245}
1246
1247impl ClearCacheRequest {
1248 #[must_use]
1250 pub fn new() -> Self {
1251 Self::default()
1252 }
1253
1254 #[must_use]
1256 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1257 self.custom_data = Some(value);
1258 self
1259 }
1260}
1261
1262impl Validate for ClearCacheRequest {
1263 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1264 path.push_key("customData");
1265 if let Some(value) = &self.custom_data {
1266 Validate::validate_at(value, path, out);
1267 }
1268 path.pop();
1269 }
1270}
1271
1272impl Sealed for ClearCacheRequest {}
1273impl Request for ClearCacheRequest {
1274 type Action = Action;
1275 const ACTION: Action = Action::ClearCache;
1276 const KIND: MessageKind = MessageKind::Call;
1277 const ORIGIN: Origin = Origin::Csms;
1278 type Response = ClearCacheResponse;
1279}
1280
1281impl Confirmed for ClearCacheRequest {}
1282
1283#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1285pub struct ClearCacheResponse {
1286 pub status: ClearCacheStatus,
1288 #[serde(rename = "statusInfo")]
1290 #[serde(default, skip_serializing_if = "Option::is_none")]
1291 pub status_info: Option<StatusInfo>,
1292 #[serde(rename = "customData")]
1294 #[serde(default, skip_serializing_if = "Option::is_none")]
1295 pub custom_data: Option<crate::types::CustomData>,
1296}
1297
1298impl ClearCacheResponse {
1299 #[must_use]
1301 pub fn new(status: ClearCacheStatus) -> Self {
1302 Self {
1303 status,
1304 status_info: None,
1305 custom_data: None,
1306 }
1307 }
1308
1309 #[must_use]
1311 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1312 self.status_info = Some(value);
1313 self
1314 }
1315
1316 #[must_use]
1318 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1319 self.custom_data = Some(value);
1320 self
1321 }
1322}
1323
1324impl Validate for ClearCacheResponse {
1325 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1326 path.push_key("status");
1327 Validate::validate_at(&self.status, path, out);
1328 path.pop();
1329 path.push_key("statusInfo");
1330 if let Some(value) = &self.status_info {
1331 Validate::validate_at(value, path, out);
1332 }
1333 path.pop();
1334 path.push_key("customData");
1335 if let Some(value) = &self.custom_data {
1336 Validate::validate_at(value, path, out);
1337 }
1338 path.pop();
1339 }
1340}
1341
1342impl Sealed for ClearCacheResponse {}
1343impl Response for ClearCacheResponse {}
1344
1345#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1347pub struct ClearChargingProfileRequest {
1348 #[serde(rename = "chargingProfileId")]
1350 #[serde(default, skip_serializing_if = "Option::is_none")]
1351 #[serde(deserialize_with = "crate::types::integer::option")]
1352 pub charging_profile_id: Option<i32>,
1353 #[serde(rename = "chargingProfileCriteria")]
1355 #[serde(default, skip_serializing_if = "Option::is_none")]
1356 pub charging_profile_criteria: Option<ClearChargingProfile>,
1357 #[serde(rename = "customData")]
1359 #[serde(default, skip_serializing_if = "Option::is_none")]
1360 pub custom_data: Option<crate::types::CustomData>,
1361}
1362
1363impl ClearChargingProfileRequest {
1364 #[must_use]
1366 pub fn new() -> Self {
1367 Self::default()
1368 }
1369
1370 #[must_use]
1372 pub fn with_charging_profile_id(mut self, value: i32) -> Self {
1373 self.charging_profile_id = Some(value);
1374 self
1375 }
1376
1377 #[must_use]
1379 pub fn with_charging_profile_criteria(mut self, value: ClearChargingProfile) -> Self {
1380 self.charging_profile_criteria = Some(value);
1381 self
1382 }
1383
1384 #[must_use]
1386 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1387 self.custom_data = Some(value);
1388 self
1389 }
1390}
1391
1392impl Validate for ClearChargingProfileRequest {
1393 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1394 path.push_key("chargingProfileCriteria");
1395 if let Some(value) = &self.charging_profile_criteria {
1396 Validate::validate_at(value, path, out);
1397 }
1398 path.pop();
1399 path.push_key("customData");
1400 if let Some(value) = &self.custom_data {
1401 Validate::validate_at(value, path, out);
1402 }
1403 path.pop();
1404 }
1405}
1406
1407impl Sealed for ClearChargingProfileRequest {}
1408impl Request for ClearChargingProfileRequest {
1409 type Action = Action;
1410 const ACTION: Action = Action::ClearChargingProfile;
1411 const KIND: MessageKind = MessageKind::Call;
1412 const ORIGIN: Origin = Origin::Csms;
1413 type Response = ClearChargingProfileResponse;
1414}
1415
1416impl Confirmed for ClearChargingProfileRequest {}
1417
1418#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1420pub struct ClearChargingProfileResponse {
1421 pub status: ClearChargingProfileStatus,
1423 #[serde(rename = "statusInfo")]
1425 #[serde(default, skip_serializing_if = "Option::is_none")]
1426 pub status_info: Option<StatusInfo>,
1427 #[serde(rename = "customData")]
1429 #[serde(default, skip_serializing_if = "Option::is_none")]
1430 pub custom_data: Option<crate::types::CustomData>,
1431}
1432
1433impl ClearChargingProfileResponse {
1434 #[must_use]
1436 pub fn new(status: ClearChargingProfileStatus) -> Self {
1437 Self {
1438 status,
1439 status_info: None,
1440 custom_data: None,
1441 }
1442 }
1443
1444 #[must_use]
1446 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1447 self.status_info = Some(value);
1448 self
1449 }
1450
1451 #[must_use]
1453 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1454 self.custom_data = Some(value);
1455 self
1456 }
1457}
1458
1459impl Validate for ClearChargingProfileResponse {
1460 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1461 path.push_key("status");
1462 Validate::validate_at(&self.status, path, out);
1463 path.pop();
1464 path.push_key("statusInfo");
1465 if let Some(value) = &self.status_info {
1466 Validate::validate_at(value, path, out);
1467 }
1468 path.pop();
1469 path.push_key("customData");
1470 if let Some(value) = &self.custom_data {
1471 Validate::validate_at(value, path, out);
1472 }
1473 path.pop();
1474 }
1475}
1476
1477impl Sealed for ClearChargingProfileResponse {}
1478impl Response for ClearChargingProfileResponse {}
1479
1480#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1482pub struct ClearDERControlRequest {
1483 #[serde(rename = "isDefault")]
1485 pub is_default: bool,
1486 #[serde(rename = "controlType")]
1488 #[serde(default, skip_serializing_if = "Option::is_none")]
1489 pub control_type: Option<DERControl>,
1490 #[serde(rename = "controlId")]
1492 #[serde(default, skip_serializing_if = "Option::is_none")]
1493 pub control_id: Option<String>,
1494 #[serde(rename = "customData")]
1496 #[serde(default, skip_serializing_if = "Option::is_none")]
1497 pub custom_data: Option<crate::types::CustomData>,
1498}
1499
1500impl ClearDERControlRequest {
1501 #[must_use]
1503 pub fn new(is_default: bool) -> Self {
1504 Self {
1505 is_default,
1506 control_type: None,
1507 control_id: None,
1508 custom_data: None,
1509 }
1510 }
1511
1512 #[must_use]
1514 pub fn with_control_type(mut self, value: DERControl) -> Self {
1515 self.control_type = Some(value);
1516 self
1517 }
1518
1519 #[must_use]
1521 pub fn with_control_id(mut self, value: impl Into<String>) -> Self {
1522 self.control_id = Some(value.into());
1523 self
1524 }
1525
1526 #[must_use]
1528 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1529 self.custom_data = Some(value);
1530 self
1531 }
1532}
1533
1534impl Validate for ClearDERControlRequest {
1535 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1536 path.push_key("controlType");
1537 if let Some(value) = &self.control_type {
1538 Validate::validate_at(value, path, out);
1539 }
1540 path.pop();
1541 path.push_key("controlId");
1542 if let Some(value) = &self.control_id {
1543 validate::string(value.as_str(), None, Some(36), path, out);
1544 }
1545 path.pop();
1546 path.push_key("customData");
1547 if let Some(value) = &self.custom_data {
1548 Validate::validate_at(value, path, out);
1549 }
1550 path.pop();
1551 }
1552}
1553
1554impl Sealed for ClearDERControlRequest {}
1555impl Request for ClearDERControlRequest {
1556 type Action = Action;
1557 const ACTION: Action = Action::ClearDERControl;
1558 const KIND: MessageKind = MessageKind::Call;
1559 const ORIGIN: Origin = Origin::Csms;
1560 type Response = ClearDERControlResponse;
1561}
1562
1563impl Confirmed for ClearDERControlRequest {}
1564
1565#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1567pub struct ClearDERControlResponse {
1568 pub status: DERControlStatus,
1570 #[serde(rename = "statusInfo")]
1572 #[serde(default, skip_serializing_if = "Option::is_none")]
1573 pub status_info: Option<StatusInfo>,
1574 #[serde(rename = "customData")]
1576 #[serde(default, skip_serializing_if = "Option::is_none")]
1577 pub custom_data: Option<crate::types::CustomData>,
1578}
1579
1580impl ClearDERControlResponse {
1581 #[must_use]
1583 pub fn new(status: DERControlStatus) -> Self {
1584 Self {
1585 status,
1586 status_info: None,
1587 custom_data: None,
1588 }
1589 }
1590
1591 #[must_use]
1593 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1594 self.status_info = Some(value);
1595 self
1596 }
1597
1598 #[must_use]
1600 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1601 self.custom_data = Some(value);
1602 self
1603 }
1604}
1605
1606impl Validate for ClearDERControlResponse {
1607 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1608 path.push_key("status");
1609 Validate::validate_at(&self.status, path, out);
1610 path.pop();
1611 path.push_key("statusInfo");
1612 if let Some(value) = &self.status_info {
1613 Validate::validate_at(value, path, out);
1614 }
1615 path.pop();
1616 path.push_key("customData");
1617 if let Some(value) = &self.custom_data {
1618 Validate::validate_at(value, path, out);
1619 }
1620 path.pop();
1621 }
1622}
1623
1624impl Sealed for ClearDERControlResponse {}
1625impl Response for ClearDERControlResponse {}
1626
1627#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1629pub struct ClearDisplayMessageRequest {
1630 #[serde(deserialize_with = "crate::types::integer::one")]
1632 pub id: i32,
1633 #[serde(rename = "customData")]
1635 #[serde(default, skip_serializing_if = "Option::is_none")]
1636 pub custom_data: Option<crate::types::CustomData>,
1637}
1638
1639impl ClearDisplayMessageRequest {
1640 #[must_use]
1642 pub fn new(id: i32) -> Self {
1643 Self {
1644 id,
1645 custom_data: None,
1646 }
1647 }
1648
1649 #[must_use]
1651 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1652 self.custom_data = Some(value);
1653 self
1654 }
1655}
1656
1657impl Validate for ClearDisplayMessageRequest {
1658 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1659 path.push_key("id");
1660 validate::int_range(i64::from(self.id), Some(0), None, path, out);
1661 path.pop();
1662 path.push_key("customData");
1663 if let Some(value) = &self.custom_data {
1664 Validate::validate_at(value, path, out);
1665 }
1666 path.pop();
1667 }
1668}
1669
1670impl Sealed for ClearDisplayMessageRequest {}
1671impl Request for ClearDisplayMessageRequest {
1672 type Action = Action;
1673 const ACTION: Action = Action::ClearDisplayMessage;
1674 const KIND: MessageKind = MessageKind::Call;
1675 const ORIGIN: Origin = Origin::Csms;
1676 type Response = ClearDisplayMessageResponse;
1677}
1678
1679impl Confirmed for ClearDisplayMessageRequest {}
1680
1681#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1683pub struct ClearDisplayMessageResponse {
1684 pub status: ClearMessageStatus,
1686 #[serde(rename = "statusInfo")]
1688 #[serde(default, skip_serializing_if = "Option::is_none")]
1689 pub status_info: Option<StatusInfo>,
1690 #[serde(rename = "customData")]
1692 #[serde(default, skip_serializing_if = "Option::is_none")]
1693 pub custom_data: Option<crate::types::CustomData>,
1694}
1695
1696impl ClearDisplayMessageResponse {
1697 #[must_use]
1699 pub fn new(status: ClearMessageStatus) -> Self {
1700 Self {
1701 status,
1702 status_info: None,
1703 custom_data: None,
1704 }
1705 }
1706
1707 #[must_use]
1709 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
1710 self.status_info = Some(value);
1711 self
1712 }
1713
1714 #[must_use]
1716 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1717 self.custom_data = Some(value);
1718 self
1719 }
1720}
1721
1722impl Validate for ClearDisplayMessageResponse {
1723 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1724 path.push_key("status");
1725 Validate::validate_at(&self.status, path, out);
1726 path.pop();
1727 path.push_key("statusInfo");
1728 if let Some(value) = &self.status_info {
1729 Validate::validate_at(value, path, out);
1730 }
1731 path.pop();
1732 path.push_key("customData");
1733 if let Some(value) = &self.custom_data {
1734 Validate::validate_at(value, path, out);
1735 }
1736 path.pop();
1737 }
1738}
1739
1740impl Sealed for ClearDisplayMessageResponse {}
1741impl Response for ClearDisplayMessageResponse {}
1742
1743#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1745pub struct ClearTariffsRequest {
1746 #[serde(rename = "tariffIds")]
1748 #[serde(default, skip_serializing_if = "Option::is_none")]
1749 pub tariff_ids: Option<Vec<String>>,
1750 #[serde(rename = "evseId")]
1752 #[serde(default, skip_serializing_if = "Option::is_none")]
1753 #[serde(deserialize_with = "crate::types::integer::option")]
1754 pub evse_id: Option<i32>,
1755 #[serde(rename = "customData")]
1757 #[serde(default, skip_serializing_if = "Option::is_none")]
1758 pub custom_data: Option<crate::types::CustomData>,
1759}
1760
1761impl ClearTariffsRequest {
1762 #[must_use]
1764 pub fn new() -> Self {
1765 Self::default()
1766 }
1767
1768 #[must_use]
1770 pub fn with_tariff_ids(mut self, value: impl IntoIterator<Item = impl Into<String>>) -> Self {
1771 self.tariff_ids = Some(value.into_iter().map(Into::into).collect());
1772 self
1773 }
1774
1775 #[must_use]
1777 pub fn with_evse_id(mut self, value: i32) -> Self {
1778 self.evse_id = Some(value);
1779 self
1780 }
1781
1782 #[must_use]
1784 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1785 self.custom_data = Some(value);
1786 self
1787 }
1788}
1789
1790impl Validate for ClearTariffsRequest {
1791 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1792 path.push_key("tariffIds");
1793 if let Some(value) = &self.tariff_ids {
1794 validate::list_len(value.len(), Some(1), None, path, out);
1795 for (index, item) in value.iter().enumerate() {
1796 path.push_index(index);
1797 validate::string(item.as_str(), None, Some(60), path, out);
1798 path.pop();
1799 }
1800 }
1801 path.pop();
1802 path.push_key("evseId");
1803 if let Some(value) = &self.evse_id {
1804 validate::int_range(i64::from(*value), Some(0), None, path, out);
1805 }
1806 path.pop();
1807 path.push_key("customData");
1808 if let Some(value) = &self.custom_data {
1809 Validate::validate_at(value, path, out);
1810 }
1811 path.pop();
1812 }
1813}
1814
1815impl Sealed for ClearTariffsRequest {}
1816impl Request for ClearTariffsRequest {
1817 type Action = Action;
1818 const ACTION: Action = Action::ClearTariffs;
1819 const KIND: MessageKind = MessageKind::Call;
1820 const ORIGIN: Origin = Origin::Csms;
1821 type Response = ClearTariffsResponse;
1822}
1823
1824impl Confirmed for ClearTariffsRequest {}
1825
1826#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1828pub struct ClearTariffsResponse {
1829 #[serde(rename = "clearTariffsResult")]
1831 pub clear_tariffs_result: Vec<ClearTariffsResult>,
1832 #[serde(rename = "customData")]
1834 #[serde(default, skip_serializing_if = "Option::is_none")]
1835 pub custom_data: Option<crate::types::CustomData>,
1836}
1837
1838impl ClearTariffsResponse {
1839 #[must_use]
1841 pub fn new(clear_tariffs_result: Vec<ClearTariffsResult>) -> Self {
1842 Self {
1843 clear_tariffs_result,
1844 custom_data: None,
1845 }
1846 }
1847
1848 #[must_use]
1850 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1851 self.custom_data = Some(value);
1852 self
1853 }
1854}
1855
1856impl Validate for ClearTariffsResponse {
1857 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1858 path.push_key("clearTariffsResult");
1859 validate::list_len(self.clear_tariffs_result.len(), Some(1), None, path, out);
1860 for (index, item) in self.clear_tariffs_result.iter().enumerate() {
1861 path.push_index(index);
1862 Validate::validate_at(item, path, out);
1863 path.pop();
1864 }
1865 path.pop();
1866 path.push_key("customData");
1867 if let Some(value) = &self.custom_data {
1868 Validate::validate_at(value, path, out);
1869 }
1870 path.pop();
1871 }
1872}
1873
1874impl Sealed for ClearTariffsResponse {}
1875impl Response for ClearTariffsResponse {}
1876
1877#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1879pub struct ClearVariableMonitoringRequest {
1880 #[serde(deserialize_with = "crate::types::integer::list")]
1882 pub id: Vec<i32>,
1883 #[serde(rename = "customData")]
1885 #[serde(default, skip_serializing_if = "Option::is_none")]
1886 pub custom_data: Option<crate::types::CustomData>,
1887}
1888
1889impl ClearVariableMonitoringRequest {
1890 #[must_use]
1892 pub fn new(id: Vec<i32>) -> Self {
1893 Self {
1894 id,
1895 custom_data: None,
1896 }
1897 }
1898
1899 #[must_use]
1901 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1902 self.custom_data = Some(value);
1903 self
1904 }
1905}
1906
1907impl Validate for ClearVariableMonitoringRequest {
1908 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1909 path.push_key("id");
1910 validate::list_len(self.id.len(), Some(1), None, path, out);
1911 for (index, item) in self.id.iter().enumerate() {
1912 path.push_index(index);
1913 validate::int_range(i64::from(*item), Some(0), None, path, out);
1914 path.pop();
1915 }
1916 path.pop();
1917 path.push_key("customData");
1918 if let Some(value) = &self.custom_data {
1919 Validate::validate_at(value, path, out);
1920 }
1921 path.pop();
1922 }
1923}
1924
1925impl Sealed for ClearVariableMonitoringRequest {}
1926impl Request for ClearVariableMonitoringRequest {
1927 type Action = Action;
1928 const ACTION: Action = Action::ClearVariableMonitoring;
1929 const KIND: MessageKind = MessageKind::Call;
1930 const ORIGIN: Origin = Origin::Csms;
1931 type Response = ClearVariableMonitoringResponse;
1932}
1933
1934impl Confirmed for ClearVariableMonitoringRequest {}
1935
1936#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1938pub struct ClearVariableMonitoringResponse {
1939 #[serde(rename = "clearMonitoringResult")]
1941 pub clear_monitoring_result: Vec<ClearMonitoringResult>,
1942 #[serde(rename = "customData")]
1944 #[serde(default, skip_serializing_if = "Option::is_none")]
1945 pub custom_data: Option<crate::types::CustomData>,
1946}
1947
1948impl ClearVariableMonitoringResponse {
1949 #[must_use]
1951 pub fn new(clear_monitoring_result: Vec<ClearMonitoringResult>) -> Self {
1952 Self {
1953 clear_monitoring_result,
1954 custom_data: None,
1955 }
1956 }
1957
1958 #[must_use]
1960 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1961 self.custom_data = Some(value);
1962 self
1963 }
1964}
1965
1966impl Validate for ClearVariableMonitoringResponse {
1967 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1968 path.push_key("clearMonitoringResult");
1969 validate::list_len(self.clear_monitoring_result.len(), Some(1), None, path, out);
1970 for (index, item) in self.clear_monitoring_result.iter().enumerate() {
1971 path.push_index(index);
1972 Validate::validate_at(item, path, out);
1973 path.pop();
1974 }
1975 path.pop();
1976 path.push_key("customData");
1977 if let Some(value) = &self.custom_data {
1978 Validate::validate_at(value, path, out);
1979 }
1980 path.pop();
1981 }
1982}
1983
1984impl Sealed for ClearVariableMonitoringResponse {}
1985impl Response for ClearVariableMonitoringResponse {}
1986
1987#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1989pub struct ClearedChargingLimitRequest {
1990 #[serde(rename = "chargingLimitSource")]
1992 pub charging_limit_source: String,
1993 #[serde(rename = "evseId")]
1995 #[serde(default, skip_serializing_if = "Option::is_none")]
1996 #[serde(deserialize_with = "crate::types::integer::option")]
1997 pub evse_id: Option<i32>,
1998 #[serde(rename = "customData")]
2000 #[serde(default, skip_serializing_if = "Option::is_none")]
2001 pub custom_data: Option<crate::types::CustomData>,
2002}
2003
2004impl ClearedChargingLimitRequest {
2005 #[must_use]
2007 pub fn new(charging_limit_source: impl Into<String>) -> Self {
2008 Self {
2009 charging_limit_source: charging_limit_source.into(),
2010 evse_id: None,
2011 custom_data: None,
2012 }
2013 }
2014
2015 #[must_use]
2017 pub fn with_evse_id(mut self, value: i32) -> Self {
2018 self.evse_id = Some(value);
2019 self
2020 }
2021
2022 #[must_use]
2024 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2025 self.custom_data = Some(value);
2026 self
2027 }
2028}
2029
2030impl Validate for ClearedChargingLimitRequest {
2031 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2032 path.push_key("chargingLimitSource");
2033 validate::string(
2034 self.charging_limit_source.as_str(),
2035 None,
2036 Some(20),
2037 path,
2038 out,
2039 );
2040 path.pop();
2041 path.push_key("evseId");
2042 if let Some(value) = &self.evse_id {
2043 validate::int_range(i64::from(*value), Some(0), None, path, out);
2044 }
2045 path.pop();
2046 path.push_key("customData");
2047 if let Some(value) = &self.custom_data {
2048 Validate::validate_at(value, path, out);
2049 }
2050 path.pop();
2051 }
2052}
2053
2054impl Sealed for ClearedChargingLimitRequest {}
2055impl Request for ClearedChargingLimitRequest {
2056 type Action = Action;
2057 const ACTION: Action = Action::ClearedChargingLimit;
2058 const KIND: MessageKind = MessageKind::Call;
2059 const ORIGIN: Origin = Origin::ChargingStation;
2060 type Response = ClearedChargingLimitResponse;
2061}
2062
2063impl Confirmed for ClearedChargingLimitRequest {}
2064
2065#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2067pub struct ClearedChargingLimitResponse {
2068 #[serde(rename = "customData")]
2070 #[serde(default, skip_serializing_if = "Option::is_none")]
2071 pub custom_data: Option<crate::types::CustomData>,
2072}
2073
2074impl ClearedChargingLimitResponse {
2075 #[must_use]
2077 pub fn new() -> Self {
2078 Self::default()
2079 }
2080
2081 #[must_use]
2083 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2084 self.custom_data = Some(value);
2085 self
2086 }
2087}
2088
2089impl Validate for ClearedChargingLimitResponse {
2090 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2091 path.push_key("customData");
2092 if let Some(value) = &self.custom_data {
2093 Validate::validate_at(value, path, out);
2094 }
2095 path.pop();
2096 }
2097}
2098
2099impl Sealed for ClearedChargingLimitResponse {}
2100impl Response for ClearedChargingLimitResponse {}
2101
2102#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2104pub struct ClosePeriodicEventStreamRequest {
2105 #[serde(deserialize_with = "crate::types::integer::one")]
2107 pub id: i32,
2108 #[serde(rename = "customData")]
2110 #[serde(default, skip_serializing_if = "Option::is_none")]
2111 pub custom_data: Option<crate::types::CustomData>,
2112}
2113
2114impl ClosePeriodicEventStreamRequest {
2115 #[must_use]
2117 pub fn new(id: i32) -> Self {
2118 Self {
2119 id,
2120 custom_data: None,
2121 }
2122 }
2123
2124 #[must_use]
2126 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2127 self.custom_data = Some(value);
2128 self
2129 }
2130}
2131
2132impl Validate for ClosePeriodicEventStreamRequest {
2133 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2134 path.push_key("id");
2135 validate::int_range(i64::from(self.id), Some(0), None, path, out);
2136 path.pop();
2137 path.push_key("customData");
2138 if let Some(value) = &self.custom_data {
2139 Validate::validate_at(value, path, out);
2140 }
2141 path.pop();
2142 }
2143}
2144
2145impl Sealed for ClosePeriodicEventStreamRequest {}
2146impl Request for ClosePeriodicEventStreamRequest {
2147 type Action = Action;
2148 const ACTION: Action = Action::ClosePeriodicEventStream;
2149 const KIND: MessageKind = MessageKind::Call;
2150 const ORIGIN: Origin = Origin::ChargingStation;
2151 type Response = ClosePeriodicEventStreamResponse;
2152}
2153
2154impl Confirmed for ClosePeriodicEventStreamRequest {}
2155
2156#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2158pub struct ClosePeriodicEventStreamResponse {
2159 #[serde(rename = "customData")]
2161 #[serde(default, skip_serializing_if = "Option::is_none")]
2162 pub custom_data: Option<crate::types::CustomData>,
2163}
2164
2165impl ClosePeriodicEventStreamResponse {
2166 #[must_use]
2168 pub fn new() -> Self {
2169 Self::default()
2170 }
2171
2172 #[must_use]
2174 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2175 self.custom_data = Some(value);
2176 self
2177 }
2178}
2179
2180impl Validate for ClosePeriodicEventStreamResponse {
2181 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2182 path.push_key("customData");
2183 if let Some(value) = &self.custom_data {
2184 Validate::validate_at(value, path, out);
2185 }
2186 path.pop();
2187 }
2188}
2189
2190impl Sealed for ClosePeriodicEventStreamResponse {}
2191impl Response for ClosePeriodicEventStreamResponse {}
2192
2193#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2195pub struct CostUpdatedRequest {
2196 #[serde(rename = "totalCost")]
2198 pub total_cost: crate::types::Decimal,
2199 #[serde(rename = "transactionId")]
2201 pub transaction_id: String,
2202 #[serde(rename = "customData")]
2204 #[serde(default, skip_serializing_if = "Option::is_none")]
2205 pub custom_data: Option<crate::types::CustomData>,
2206}
2207
2208impl CostUpdatedRequest {
2209 #[must_use]
2211 pub fn new(
2212 total_cost: impl Into<crate::types::Decimal>,
2213 transaction_id: impl Into<String>,
2214 ) -> Self {
2215 Self {
2216 total_cost: total_cost.into(),
2217 transaction_id: transaction_id.into(),
2218 custom_data: None,
2219 }
2220 }
2221
2222 #[must_use]
2224 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2225 self.custom_data = Some(value);
2226 self
2227 }
2228}
2229
2230impl Validate for CostUpdatedRequest {
2231 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2232 path.push_key("transactionId");
2233 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
2234 path.pop();
2235 path.push_key("customData");
2236 if let Some(value) = &self.custom_data {
2237 Validate::validate_at(value, path, out);
2238 }
2239 path.pop();
2240 }
2241}
2242
2243impl Sealed for CostUpdatedRequest {}
2244impl Request for CostUpdatedRequest {
2245 type Action = Action;
2246 const ACTION: Action = Action::CostUpdated;
2247 const KIND: MessageKind = MessageKind::Call;
2248 const ORIGIN: Origin = Origin::Csms;
2249 type Response = CostUpdatedResponse;
2250}
2251
2252impl Confirmed for CostUpdatedRequest {}
2253
2254#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2256pub struct CostUpdatedResponse {
2257 #[serde(rename = "customData")]
2259 #[serde(default, skip_serializing_if = "Option::is_none")]
2260 pub custom_data: Option<crate::types::CustomData>,
2261}
2262
2263impl CostUpdatedResponse {
2264 #[must_use]
2266 pub fn new() -> Self {
2267 Self::default()
2268 }
2269
2270 #[must_use]
2272 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2273 self.custom_data = Some(value);
2274 self
2275 }
2276}
2277
2278impl Validate for CostUpdatedResponse {
2279 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2280 path.push_key("customData");
2281 if let Some(value) = &self.custom_data {
2282 Validate::validate_at(value, path, out);
2283 }
2284 path.pop();
2285 }
2286}
2287
2288impl Sealed for CostUpdatedResponse {}
2289impl Response for CostUpdatedResponse {}
2290
2291#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2293pub struct CustomerInformationRequest {
2294 #[serde(rename = "requestId")]
2296 #[serde(deserialize_with = "crate::types::integer::one")]
2297 pub request_id: i32,
2298 pub report: bool,
2300 pub clear: bool,
2302 #[serde(rename = "customerCertificate")]
2304 #[serde(default, skip_serializing_if = "Option::is_none")]
2305 pub customer_certificate: Option<CertificateHashData>,
2306 #[serde(rename = "idToken")]
2308 #[serde(default, skip_serializing_if = "Option::is_none")]
2309 pub id_token: Option<IdToken>,
2310 #[serde(rename = "customerIdentifier")]
2313 #[serde(default, skip_serializing_if = "Option::is_none")]
2314 pub customer_identifier: Option<String>,
2315 #[serde(rename = "customData")]
2317 #[serde(default, skip_serializing_if = "Option::is_none")]
2318 pub custom_data: Option<crate::types::CustomData>,
2319}
2320
2321impl CustomerInformationRequest {
2322 #[must_use]
2324 pub fn new(request_id: i32, report: bool, clear: bool) -> Self {
2325 Self {
2326 request_id,
2327 report,
2328 clear,
2329 customer_certificate: None,
2330 id_token: None,
2331 customer_identifier: None,
2332 custom_data: None,
2333 }
2334 }
2335
2336 #[must_use]
2338 pub fn with_customer_certificate(mut self, value: CertificateHashData) -> Self {
2339 self.customer_certificate = Some(value);
2340 self
2341 }
2342
2343 #[must_use]
2345 pub fn with_id_token(mut self, value: IdToken) -> Self {
2346 self.id_token = Some(value);
2347 self
2348 }
2349
2350 #[must_use]
2352 pub fn with_customer_identifier(mut self, value: impl Into<String>) -> Self {
2353 self.customer_identifier = Some(value.into());
2354 self
2355 }
2356
2357 #[must_use]
2359 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2360 self.custom_data = Some(value);
2361 self
2362 }
2363}
2364
2365impl Validate for CustomerInformationRequest {
2366 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2367 path.push_key("requestId");
2368 validate::int_range(i64::from(self.request_id), Some(0), None, path, out);
2369 path.pop();
2370 path.push_key("customerCertificate");
2371 if let Some(value) = &self.customer_certificate {
2372 Validate::validate_at(value, path, out);
2373 }
2374 path.pop();
2375 path.push_key("idToken");
2376 if let Some(value) = &self.id_token {
2377 Validate::validate_at(value, path, out);
2378 }
2379 path.pop();
2380 path.push_key("customerIdentifier");
2381 if let Some(value) = &self.customer_identifier {
2382 validate::string(value.as_str(), None, Some(64), path, out);
2383 }
2384 path.pop();
2385 path.push_key("customData");
2386 if let Some(value) = &self.custom_data {
2387 Validate::validate_at(value, path, out);
2388 }
2389 path.pop();
2390 }
2391}
2392
2393impl Sealed for CustomerInformationRequest {}
2394impl Request for CustomerInformationRequest {
2395 type Action = Action;
2396 const ACTION: Action = Action::CustomerInformation;
2397 const KIND: MessageKind = MessageKind::Call;
2398 const ORIGIN: Origin = Origin::Csms;
2399 type Response = CustomerInformationResponse;
2400}
2401
2402impl Confirmed for CustomerInformationRequest {}
2403
2404#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2406pub struct CustomerInformationResponse {
2407 pub status: CustomerInformationStatus,
2409 #[serde(rename = "statusInfo")]
2411 #[serde(default, skip_serializing_if = "Option::is_none")]
2412 pub status_info: Option<StatusInfo>,
2413 #[serde(rename = "customData")]
2415 #[serde(default, skip_serializing_if = "Option::is_none")]
2416 pub custom_data: Option<crate::types::CustomData>,
2417}
2418
2419impl CustomerInformationResponse {
2420 #[must_use]
2422 pub fn new(status: CustomerInformationStatus) -> Self {
2423 Self {
2424 status,
2425 status_info: None,
2426 custom_data: None,
2427 }
2428 }
2429
2430 #[must_use]
2432 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2433 self.status_info = Some(value);
2434 self
2435 }
2436
2437 #[must_use]
2439 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2440 self.custom_data = Some(value);
2441 self
2442 }
2443}
2444
2445impl Validate for CustomerInformationResponse {
2446 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2447 path.push_key("status");
2448 Validate::validate_at(&self.status, path, out);
2449 path.pop();
2450 path.push_key("statusInfo");
2451 if let Some(value) = &self.status_info {
2452 Validate::validate_at(value, path, out);
2453 }
2454 path.pop();
2455 path.push_key("customData");
2456 if let Some(value) = &self.custom_data {
2457 Validate::validate_at(value, path, out);
2458 }
2459 path.pop();
2460 }
2461}
2462
2463impl Sealed for CustomerInformationResponse {}
2464impl Response for CustomerInformationResponse {}
2465
2466#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2468pub struct DataTransferRequest {
2469 #[serde(rename = "vendorId")]
2471 pub vendor_id: String,
2472 #[serde(rename = "messageId")]
2474 #[serde(default, skip_serializing_if = "Option::is_none")]
2475 pub message_id: Option<String>,
2476 #[serde(default, skip_serializing_if = "Option::is_none")]
2478 pub data: Option<serde_json::Value>,
2479 #[serde(rename = "customData")]
2481 #[serde(default, skip_serializing_if = "Option::is_none")]
2482 pub custom_data: Option<crate::types::CustomData>,
2483}
2484
2485impl DataTransferRequest {
2486 #[must_use]
2488 pub fn new(vendor_id: impl Into<String>) -> Self {
2489 Self {
2490 vendor_id: vendor_id.into(),
2491 message_id: None,
2492 data: None,
2493 custom_data: None,
2494 }
2495 }
2496
2497 #[must_use]
2499 pub fn with_message_id(mut self, value: impl Into<String>) -> Self {
2500 self.message_id = Some(value.into());
2501 self
2502 }
2503
2504 #[must_use]
2506 pub fn with_data(mut self, value: serde_json::Value) -> Self {
2507 self.data = Some(value);
2508 self
2509 }
2510
2511 #[must_use]
2513 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2514 self.custom_data = Some(value);
2515 self
2516 }
2517}
2518
2519impl Validate for DataTransferRequest {
2520 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2521 path.push_key("vendorId");
2522 validate::string(self.vendor_id.as_str(), None, Some(255), path, out);
2523 path.pop();
2524 path.push_key("messageId");
2525 if let Some(value) = &self.message_id {
2526 validate::string(value.as_str(), None, Some(50), path, out);
2527 }
2528 path.pop();
2529 path.push_key("customData");
2530 if let Some(value) = &self.custom_data {
2531 Validate::validate_at(value, path, out);
2532 }
2533 path.pop();
2534 }
2535}
2536
2537impl Sealed for DataTransferRequest {}
2538impl Request for DataTransferRequest {
2539 type Action = Action;
2540 const ACTION: Action = Action::DataTransfer;
2541 const KIND: MessageKind = MessageKind::Call;
2542 const ORIGIN: Origin = Origin::Both;
2543 type Response = DataTransferResponse;
2544}
2545
2546impl Confirmed for DataTransferRequest {}
2547
2548#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2550pub struct DataTransferResponse {
2551 pub status: DataTransferStatus,
2553 #[serde(rename = "statusInfo")]
2555 #[serde(default, skip_serializing_if = "Option::is_none")]
2556 pub status_info: Option<StatusInfo>,
2557 #[serde(default, skip_serializing_if = "Option::is_none")]
2559 pub data: Option<serde_json::Value>,
2560 #[serde(rename = "customData")]
2562 #[serde(default, skip_serializing_if = "Option::is_none")]
2563 pub custom_data: Option<crate::types::CustomData>,
2564}
2565
2566impl DataTransferResponse {
2567 #[must_use]
2569 pub fn new(status: DataTransferStatus) -> Self {
2570 Self {
2571 status,
2572 status_info: None,
2573 data: None,
2574 custom_data: None,
2575 }
2576 }
2577
2578 #[must_use]
2580 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2581 self.status_info = Some(value);
2582 self
2583 }
2584
2585 #[must_use]
2587 pub fn with_data(mut self, value: serde_json::Value) -> Self {
2588 self.data = Some(value);
2589 self
2590 }
2591
2592 #[must_use]
2594 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2595 self.custom_data = Some(value);
2596 self
2597 }
2598}
2599
2600impl Validate for DataTransferResponse {
2601 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2602 path.push_key("status");
2603 Validate::validate_at(&self.status, path, out);
2604 path.pop();
2605 path.push_key("statusInfo");
2606 if let Some(value) = &self.status_info {
2607 Validate::validate_at(value, path, out);
2608 }
2609 path.pop();
2610 path.push_key("customData");
2611 if let Some(value) = &self.custom_data {
2612 Validate::validate_at(value, path, out);
2613 }
2614 path.pop();
2615 }
2616}
2617
2618impl Sealed for DataTransferResponse {}
2619impl Response for DataTransferResponse {}
2620
2621#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2623pub struct DeleteCertificateRequest {
2624 #[serde(rename = "certificateHashData")]
2626 pub certificate_hash_data: CertificateHashData,
2627 #[serde(rename = "customData")]
2629 #[serde(default, skip_serializing_if = "Option::is_none")]
2630 pub custom_data: Option<crate::types::CustomData>,
2631}
2632
2633impl DeleteCertificateRequest {
2634 #[must_use]
2636 pub fn new(certificate_hash_data: CertificateHashData) -> Self {
2637 Self {
2638 certificate_hash_data,
2639 custom_data: None,
2640 }
2641 }
2642
2643 #[must_use]
2645 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2646 self.custom_data = Some(value);
2647 self
2648 }
2649}
2650
2651impl Validate for DeleteCertificateRequest {
2652 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2653 path.push_key("certificateHashData");
2654 Validate::validate_at(&self.certificate_hash_data, path, out);
2655 path.pop();
2656 path.push_key("customData");
2657 if let Some(value) = &self.custom_data {
2658 Validate::validate_at(value, path, out);
2659 }
2660 path.pop();
2661 }
2662}
2663
2664impl Sealed for DeleteCertificateRequest {}
2665impl Request for DeleteCertificateRequest {
2666 type Action = Action;
2667 const ACTION: Action = Action::DeleteCertificate;
2668 const KIND: MessageKind = MessageKind::Call;
2669 const ORIGIN: Origin = Origin::Csms;
2670 type Response = DeleteCertificateResponse;
2671}
2672
2673impl Confirmed for DeleteCertificateRequest {}
2674
2675#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2677pub struct DeleteCertificateResponse {
2678 pub status: DeleteCertificateStatus,
2680 #[serde(rename = "statusInfo")]
2682 #[serde(default, skip_serializing_if = "Option::is_none")]
2683 pub status_info: Option<StatusInfo>,
2684 #[serde(rename = "customData")]
2686 #[serde(default, skip_serializing_if = "Option::is_none")]
2687 pub custom_data: Option<crate::types::CustomData>,
2688}
2689
2690impl DeleteCertificateResponse {
2691 #[must_use]
2693 pub fn new(status: DeleteCertificateStatus) -> Self {
2694 Self {
2695 status,
2696 status_info: None,
2697 custom_data: None,
2698 }
2699 }
2700
2701 #[must_use]
2703 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2704 self.status_info = Some(value);
2705 self
2706 }
2707
2708 #[must_use]
2710 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2711 self.custom_data = Some(value);
2712 self
2713 }
2714}
2715
2716impl Validate for DeleteCertificateResponse {
2717 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2718 path.push_key("status");
2719 Validate::validate_at(&self.status, path, out);
2720 path.pop();
2721 path.push_key("statusInfo");
2722 if let Some(value) = &self.status_info {
2723 Validate::validate_at(value, path, out);
2724 }
2725 path.pop();
2726 path.push_key("customData");
2727 if let Some(value) = &self.custom_data {
2728 Validate::validate_at(value, path, out);
2729 }
2730 path.pop();
2731 }
2732}
2733
2734impl Sealed for DeleteCertificateResponse {}
2735impl Response for DeleteCertificateResponse {}
2736
2737#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2739pub struct FirmwareStatusNotificationRequest {
2740 pub status: FirmwareStatus,
2742 #[serde(rename = "requestId")]
2746 #[serde(default, skip_serializing_if = "Option::is_none")]
2747 #[serde(deserialize_with = "crate::types::integer::option")]
2748 pub request_id: Option<i32>,
2749 #[serde(rename = "statusInfo")]
2751 #[serde(default, skip_serializing_if = "Option::is_none")]
2752 pub status_info: Option<StatusInfo>,
2753 #[serde(rename = "customData")]
2755 #[serde(default, skip_serializing_if = "Option::is_none")]
2756 pub custom_data: Option<crate::types::CustomData>,
2757}
2758
2759impl FirmwareStatusNotificationRequest {
2760 #[must_use]
2762 pub fn new(status: FirmwareStatus) -> Self {
2763 Self {
2764 status,
2765 request_id: None,
2766 status_info: None,
2767 custom_data: None,
2768 }
2769 }
2770
2771 #[must_use]
2773 pub fn with_request_id(mut self, value: i32) -> Self {
2774 self.request_id = Some(value);
2775 self
2776 }
2777
2778 #[must_use]
2780 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2781 self.status_info = Some(value);
2782 self
2783 }
2784
2785 #[must_use]
2787 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2788 self.custom_data = Some(value);
2789 self
2790 }
2791}
2792
2793impl Validate for FirmwareStatusNotificationRequest {
2794 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2795 path.push_key("status");
2796 Validate::validate_at(&self.status, path, out);
2797 path.pop();
2798 path.push_key("statusInfo");
2799 if let Some(value) = &self.status_info {
2800 Validate::validate_at(value, path, out);
2801 }
2802 path.pop();
2803 path.push_key("customData");
2804 if let Some(value) = &self.custom_data {
2805 Validate::validate_at(value, path, out);
2806 }
2807 path.pop();
2808 }
2809}
2810
2811impl Sealed for FirmwareStatusNotificationRequest {}
2812impl Request for FirmwareStatusNotificationRequest {
2813 type Action = Action;
2814 const ACTION: Action = Action::FirmwareStatusNotification;
2815 const KIND: MessageKind = MessageKind::Call;
2816 const ORIGIN: Origin = Origin::ChargingStation;
2817 type Response = FirmwareStatusNotificationResponse;
2818}
2819
2820impl Confirmed for FirmwareStatusNotificationRequest {}
2821
2822#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2824pub struct FirmwareStatusNotificationResponse {
2825 #[serde(rename = "customData")]
2827 #[serde(default, skip_serializing_if = "Option::is_none")]
2828 pub custom_data: Option<crate::types::CustomData>,
2829}
2830
2831impl FirmwareStatusNotificationResponse {
2832 #[must_use]
2834 pub fn new() -> Self {
2835 Self::default()
2836 }
2837
2838 #[must_use]
2840 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2841 self.custom_data = Some(value);
2842 self
2843 }
2844}
2845
2846impl Validate for FirmwareStatusNotificationResponse {
2847 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2848 path.push_key("customData");
2849 if let Some(value) = &self.custom_data {
2850 Validate::validate_at(value, path, out);
2851 }
2852 path.pop();
2853 }
2854}
2855
2856impl Sealed for FirmwareStatusNotificationResponse {}
2857impl Response for FirmwareStatusNotificationResponse {}
2858
2859#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2861pub struct Get15118EVCertificateRequest {
2862 #[serde(rename = "iso15118SchemaVersion")]
2864 pub iso15118_schema_version: String,
2865 pub action: CertificateAction,
2867 #[serde(rename = "exiRequest")]
2870 pub exi_request: String,
2871 #[serde(rename = "maximumContractCertificateChains")]
2874 #[serde(default, skip_serializing_if = "Option::is_none")]
2875 #[serde(deserialize_with = "crate::types::integer::option")]
2876 pub maximum_contract_certificate_chains: Option<i32>,
2877 #[serde(rename = "prioritizedEMAIDs")]
2879 #[serde(default, skip_serializing_if = "Option::is_none")]
2880 pub prioritized_emai_ds: Option<Vec<String>>,
2881 #[serde(rename = "customData")]
2883 #[serde(default, skip_serializing_if = "Option::is_none")]
2884 pub custom_data: Option<crate::types::CustomData>,
2885}
2886
2887impl Get15118EVCertificateRequest {
2888 #[must_use]
2890 pub fn new(
2891 iso15118_schema_version: impl Into<String>,
2892 action: CertificateAction,
2893 exi_request: impl Into<String>,
2894 ) -> Self {
2895 Self {
2896 iso15118_schema_version: iso15118_schema_version.into(),
2897 action,
2898 exi_request: exi_request.into(),
2899 maximum_contract_certificate_chains: None,
2900 prioritized_emai_ds: None,
2901 custom_data: None,
2902 }
2903 }
2904
2905 #[must_use]
2907 pub fn with_maximum_contract_certificate_chains(mut self, value: i32) -> Self {
2908 self.maximum_contract_certificate_chains = Some(value);
2909 self
2910 }
2911
2912 #[must_use]
2914 pub fn with_prioritized_emai_ds(
2915 mut self,
2916 value: impl IntoIterator<Item = impl Into<String>>,
2917 ) -> Self {
2918 self.prioritized_emai_ds = Some(value.into_iter().map(Into::into).collect());
2919 self
2920 }
2921
2922 #[must_use]
2924 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2925 self.custom_data = Some(value);
2926 self
2927 }
2928}
2929
2930impl Validate for Get15118EVCertificateRequest {
2931 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2932 path.push_key("iso15118SchemaVersion");
2933 validate::string(
2934 self.iso15118_schema_version.as_str(),
2935 None,
2936 Some(50),
2937 path,
2938 out,
2939 );
2940 path.pop();
2941 path.push_key("action");
2942 Validate::validate_at(&self.action, path, out);
2943 path.pop();
2944 path.push_key("exiRequest");
2945 validate::string(self.exi_request.as_str(), None, Some(11000), path, out);
2946 path.pop();
2947 path.push_key("maximumContractCertificateChains");
2948 if let Some(value) = &self.maximum_contract_certificate_chains {
2949 validate::int_range(i64::from(*value), Some(0), None, path, out);
2950 }
2951 path.pop();
2952 path.push_key("prioritizedEMAIDs");
2953 if let Some(value) = &self.prioritized_emai_ds {
2954 validate::list_len(value.len(), Some(1), Some(8), path, out);
2955 for (index, item) in value.iter().enumerate() {
2956 path.push_index(index);
2957 validate::string(item.as_str(), None, Some(255), path, out);
2958 path.pop();
2959 }
2960 }
2961 path.pop();
2962 path.push_key("customData");
2963 if let Some(value) = &self.custom_data {
2964 Validate::validate_at(value, path, out);
2965 }
2966 path.pop();
2967 }
2968}
2969
2970impl Sealed for Get15118EVCertificateRequest {}
2971impl Request for Get15118EVCertificateRequest {
2972 type Action = Action;
2973 const ACTION: Action = Action::Get15118EVCertificate;
2974 const KIND: MessageKind = MessageKind::Call;
2975 const ORIGIN: Origin = Origin::ChargingStation;
2976 type Response = Get15118EVCertificateResponse;
2977}
2978
2979impl Confirmed for Get15118EVCertificateRequest {}
2980
2981#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2983pub struct Get15118EVCertificateResponse {
2984 pub status: Iso15118EVCertificateStatus,
2986 #[serde(rename = "exiResponse")]
2989 pub exi_response: String,
2990 #[serde(rename = "statusInfo")]
2992 #[serde(default, skip_serializing_if = "Option::is_none")]
2993 pub status_info: Option<StatusInfo>,
2994 #[serde(rename = "remainingContracts")]
2996 #[serde(default, skip_serializing_if = "Option::is_none")]
2997 #[serde(deserialize_with = "crate::types::integer::option")]
2998 pub remaining_contracts: Option<i32>,
2999 #[serde(rename = "customData")]
3001 #[serde(default, skip_serializing_if = "Option::is_none")]
3002 pub custom_data: Option<crate::types::CustomData>,
3003}
3004
3005impl Get15118EVCertificateResponse {
3006 #[must_use]
3008 pub fn new(status: Iso15118EVCertificateStatus, exi_response: impl Into<String>) -> Self {
3009 Self {
3010 status,
3011 exi_response: exi_response.into(),
3012 status_info: None,
3013 remaining_contracts: None,
3014 custom_data: None,
3015 }
3016 }
3017
3018 #[must_use]
3020 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3021 self.status_info = Some(value);
3022 self
3023 }
3024
3025 #[must_use]
3027 pub fn with_remaining_contracts(mut self, value: i32) -> Self {
3028 self.remaining_contracts = Some(value);
3029 self
3030 }
3031
3032 #[must_use]
3034 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3035 self.custom_data = Some(value);
3036 self
3037 }
3038}
3039
3040impl Validate for Get15118EVCertificateResponse {
3041 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3042 path.push_key("status");
3043 Validate::validate_at(&self.status, path, out);
3044 path.pop();
3045 path.push_key("exiResponse");
3046 validate::string(self.exi_response.as_str(), None, Some(17000), path, out);
3047 path.pop();
3048 path.push_key("statusInfo");
3049 if let Some(value) = &self.status_info {
3050 Validate::validate_at(value, path, out);
3051 }
3052 path.pop();
3053 path.push_key("remainingContracts");
3054 if let Some(value) = &self.remaining_contracts {
3055 validate::int_range(i64::from(*value), Some(0), None, path, out);
3056 }
3057 path.pop();
3058 path.push_key("customData");
3059 if let Some(value) = &self.custom_data {
3060 Validate::validate_at(value, path, out);
3061 }
3062 path.pop();
3063 }
3064}
3065
3066impl Sealed for Get15118EVCertificateResponse {}
3067impl Response for Get15118EVCertificateResponse {}
3068
3069#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3071pub struct GetBaseReportRequest {
3072 #[serde(rename = "requestId")]
3074 #[serde(deserialize_with = "crate::types::integer::one")]
3075 pub request_id: i32,
3076 #[serde(rename = "reportBase")]
3078 pub report_base: ReportBase,
3079 #[serde(rename = "customData")]
3081 #[serde(default, skip_serializing_if = "Option::is_none")]
3082 pub custom_data: Option<crate::types::CustomData>,
3083}
3084
3085impl GetBaseReportRequest {
3086 #[must_use]
3088 pub fn new(request_id: i32, report_base: ReportBase) -> Self {
3089 Self {
3090 request_id,
3091 report_base,
3092 custom_data: None,
3093 }
3094 }
3095
3096 #[must_use]
3098 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3099 self.custom_data = Some(value);
3100 self
3101 }
3102}
3103
3104impl Validate for GetBaseReportRequest {
3105 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3106 path.push_key("reportBase");
3107 Validate::validate_at(&self.report_base, path, out);
3108 path.pop();
3109 path.push_key("customData");
3110 if let Some(value) = &self.custom_data {
3111 Validate::validate_at(value, path, out);
3112 }
3113 path.pop();
3114 }
3115}
3116
3117impl Sealed for GetBaseReportRequest {}
3118impl Request for GetBaseReportRequest {
3119 type Action = Action;
3120 const ACTION: Action = Action::GetBaseReport;
3121 const KIND: MessageKind = MessageKind::Call;
3122 const ORIGIN: Origin = Origin::Csms;
3123 type Response = GetBaseReportResponse;
3124}
3125
3126impl Confirmed for GetBaseReportRequest {}
3127
3128#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3130pub struct GetBaseReportResponse {
3131 pub status: GenericDeviceModelStatus,
3133 #[serde(rename = "statusInfo")]
3135 #[serde(default, skip_serializing_if = "Option::is_none")]
3136 pub status_info: Option<StatusInfo>,
3137 #[serde(rename = "customData")]
3139 #[serde(default, skip_serializing_if = "Option::is_none")]
3140 pub custom_data: Option<crate::types::CustomData>,
3141}
3142
3143impl GetBaseReportResponse {
3144 #[must_use]
3146 pub fn new(status: GenericDeviceModelStatus) -> Self {
3147 Self {
3148 status,
3149 status_info: None,
3150 custom_data: None,
3151 }
3152 }
3153
3154 #[must_use]
3156 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3157 self.status_info = Some(value);
3158 self
3159 }
3160
3161 #[must_use]
3163 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3164 self.custom_data = Some(value);
3165 self
3166 }
3167}
3168
3169impl Validate for GetBaseReportResponse {
3170 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3171 path.push_key("status");
3172 Validate::validate_at(&self.status, path, out);
3173 path.pop();
3174 path.push_key("statusInfo");
3175 if let Some(value) = &self.status_info {
3176 Validate::validate_at(value, path, out);
3177 }
3178 path.pop();
3179 path.push_key("customData");
3180 if let Some(value) = &self.custom_data {
3181 Validate::validate_at(value, path, out);
3182 }
3183 path.pop();
3184 }
3185}
3186
3187impl Sealed for GetBaseReportResponse {}
3188impl Response for GetBaseReportResponse {}
3189
3190#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3192pub struct GetCertificateChainStatusRequest {
3193 #[serde(rename = "certificateStatusRequests")]
3195 pub certificate_status_requests: Vec<CertificateStatusRequestInfo>,
3196 #[serde(rename = "customData")]
3198 #[serde(default, skip_serializing_if = "Option::is_none")]
3199 pub custom_data: Option<crate::types::CustomData>,
3200}
3201
3202impl GetCertificateChainStatusRequest {
3203 #[must_use]
3205 pub fn new(certificate_status_requests: Vec<CertificateStatusRequestInfo>) -> Self {
3206 Self {
3207 certificate_status_requests,
3208 custom_data: None,
3209 }
3210 }
3211
3212 #[must_use]
3214 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3215 self.custom_data = Some(value);
3216 self
3217 }
3218}
3219
3220impl Validate for GetCertificateChainStatusRequest {
3221 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3222 path.push_key("certificateStatusRequests");
3223 validate::list_len(
3224 self.certificate_status_requests.len(),
3225 Some(1),
3226 Some(4),
3227 path,
3228 out,
3229 );
3230 for (index, item) in self.certificate_status_requests.iter().enumerate() {
3231 path.push_index(index);
3232 Validate::validate_at(item, path, out);
3233 path.pop();
3234 }
3235 path.pop();
3236 path.push_key("customData");
3237 if let Some(value) = &self.custom_data {
3238 Validate::validate_at(value, path, out);
3239 }
3240 path.pop();
3241 }
3242}
3243
3244impl Sealed for GetCertificateChainStatusRequest {}
3245impl Request for GetCertificateChainStatusRequest {
3246 type Action = Action;
3247 const ACTION: Action = Action::GetCertificateChainStatus;
3248 const KIND: MessageKind = MessageKind::Call;
3249 const ORIGIN: Origin = Origin::ChargingStation;
3250 type Response = GetCertificateChainStatusResponse;
3251}
3252
3253impl Confirmed for GetCertificateChainStatusRequest {}
3254
3255#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3257pub struct GetCertificateChainStatusResponse {
3258 #[serde(rename = "certificateStatus")]
3260 pub certificate_status: Vec<CertificateStatus>,
3261 #[serde(rename = "customData")]
3263 #[serde(default, skip_serializing_if = "Option::is_none")]
3264 pub custom_data: Option<crate::types::CustomData>,
3265}
3266
3267impl GetCertificateChainStatusResponse {
3268 #[must_use]
3270 pub fn new(certificate_status: Vec<CertificateStatus>) -> Self {
3271 Self {
3272 certificate_status,
3273 custom_data: None,
3274 }
3275 }
3276
3277 #[must_use]
3279 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3280 self.custom_data = Some(value);
3281 self
3282 }
3283}
3284
3285impl Validate for GetCertificateChainStatusResponse {
3286 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3287 path.push_key("certificateStatus");
3288 validate::list_len(self.certificate_status.len(), Some(1), Some(4), path, out);
3289 for (index, item) in self.certificate_status.iter().enumerate() {
3290 path.push_index(index);
3291 Validate::validate_at(item, path, out);
3292 path.pop();
3293 }
3294 path.pop();
3295 path.push_key("customData");
3296 if let Some(value) = &self.custom_data {
3297 Validate::validate_at(value, path, out);
3298 }
3299 path.pop();
3300 }
3301}
3302
3303impl Sealed for GetCertificateChainStatusResponse {}
3304impl Response for GetCertificateChainStatusResponse {}
3305
3306#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3308pub struct GetCertificateStatusRequest {
3309 #[serde(rename = "ocspRequestData")]
3311 pub ocsp_request_data: OCSPRequestData,
3312 #[serde(rename = "customData")]
3314 #[serde(default, skip_serializing_if = "Option::is_none")]
3315 pub custom_data: Option<crate::types::CustomData>,
3316}
3317
3318impl GetCertificateStatusRequest {
3319 #[must_use]
3321 pub fn new(ocsp_request_data: OCSPRequestData) -> Self {
3322 Self {
3323 ocsp_request_data,
3324 custom_data: None,
3325 }
3326 }
3327
3328 #[must_use]
3330 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3331 self.custom_data = Some(value);
3332 self
3333 }
3334}
3335
3336impl Validate for GetCertificateStatusRequest {
3337 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3338 path.push_key("ocspRequestData");
3339 Validate::validate_at(&self.ocsp_request_data, path, out);
3340 path.pop();
3341 path.push_key("customData");
3342 if let Some(value) = &self.custom_data {
3343 Validate::validate_at(value, path, out);
3344 }
3345 path.pop();
3346 }
3347}
3348
3349impl Sealed for GetCertificateStatusRequest {}
3350impl Request for GetCertificateStatusRequest {
3351 type Action = Action;
3352 const ACTION: Action = Action::GetCertificateStatus;
3353 const KIND: MessageKind = MessageKind::Call;
3354 const ORIGIN: Origin = Origin::ChargingStation;
3355 type Response = GetCertificateStatusResponse;
3356}
3357
3358impl Confirmed for GetCertificateStatusRequest {}
3359
3360#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3362pub struct GetCertificateStatusResponse {
3363 pub status: GetCertificateStatusEnum,
3365 #[serde(rename = "statusInfo")]
3367 #[serde(default, skip_serializing_if = "Option::is_none")]
3368 pub status_info: Option<StatusInfo>,
3369 #[serde(rename = "ocspResult")]
3372 #[serde(default, skip_serializing_if = "Option::is_none")]
3373 pub ocsp_result: Option<String>,
3374 #[serde(rename = "customData")]
3376 #[serde(default, skip_serializing_if = "Option::is_none")]
3377 pub custom_data: Option<crate::types::CustomData>,
3378}
3379
3380impl GetCertificateStatusResponse {
3381 #[must_use]
3383 pub fn new(status: GetCertificateStatusEnum) -> Self {
3384 Self {
3385 status,
3386 status_info: None,
3387 ocsp_result: None,
3388 custom_data: None,
3389 }
3390 }
3391
3392 #[must_use]
3394 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3395 self.status_info = Some(value);
3396 self
3397 }
3398
3399 #[must_use]
3401 pub fn with_ocsp_result(mut self, value: impl Into<String>) -> Self {
3402 self.ocsp_result = Some(value.into());
3403 self
3404 }
3405
3406 #[must_use]
3408 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3409 self.custom_data = Some(value);
3410 self
3411 }
3412}
3413
3414impl Validate for GetCertificateStatusResponse {
3415 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3416 path.push_key("status");
3417 Validate::validate_at(&self.status, path, out);
3418 path.pop();
3419 path.push_key("statusInfo");
3420 if let Some(value) = &self.status_info {
3421 Validate::validate_at(value, path, out);
3422 }
3423 path.pop();
3424 path.push_key("ocspResult");
3425 if let Some(value) = &self.ocsp_result {
3426 validate::string(value.as_str(), None, Some(18000), path, out);
3427 }
3428 path.pop();
3429 path.push_key("customData");
3430 if let Some(value) = &self.custom_data {
3431 Validate::validate_at(value, path, out);
3432 }
3433 path.pop();
3434 }
3435}
3436
3437impl Sealed for GetCertificateStatusResponse {}
3438impl Response for GetCertificateStatusResponse {}
3439
3440#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3442pub struct GetChargingProfilesRequest {
3443 #[serde(rename = "requestId")]
3445 #[serde(deserialize_with = "crate::types::integer::one")]
3446 pub request_id: i32,
3447 #[serde(rename = "chargingProfile")]
3449 pub charging_profile: ChargingProfileCriterion,
3450 #[serde(rename = "evseId")]
3453 #[serde(default, skip_serializing_if = "Option::is_none")]
3454 #[serde(deserialize_with = "crate::types::integer::option")]
3455 pub evse_id: Option<i32>,
3456 #[serde(rename = "customData")]
3458 #[serde(default, skip_serializing_if = "Option::is_none")]
3459 pub custom_data: Option<crate::types::CustomData>,
3460}
3461
3462impl GetChargingProfilesRequest {
3463 #[must_use]
3465 pub fn new(request_id: i32, charging_profile: ChargingProfileCriterion) -> Self {
3466 Self {
3467 request_id,
3468 charging_profile,
3469 evse_id: None,
3470 custom_data: None,
3471 }
3472 }
3473
3474 #[must_use]
3476 pub fn with_evse_id(mut self, value: i32) -> Self {
3477 self.evse_id = Some(value);
3478 self
3479 }
3480
3481 #[must_use]
3483 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3484 self.custom_data = Some(value);
3485 self
3486 }
3487}
3488
3489impl Validate for GetChargingProfilesRequest {
3490 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3491 path.push_key("chargingProfile");
3492 Validate::validate_at(&self.charging_profile, path, out);
3493 path.pop();
3494 path.push_key("evseId");
3495 if let Some(value) = &self.evse_id {
3496 validate::int_range(i64::from(*value), Some(0), None, path, out);
3497 }
3498 path.pop();
3499 path.push_key("customData");
3500 if let Some(value) = &self.custom_data {
3501 Validate::validate_at(value, path, out);
3502 }
3503 path.pop();
3504 }
3505}
3506
3507impl Sealed for GetChargingProfilesRequest {}
3508impl Request for GetChargingProfilesRequest {
3509 type Action = Action;
3510 const ACTION: Action = Action::GetChargingProfiles;
3511 const KIND: MessageKind = MessageKind::Call;
3512 const ORIGIN: Origin = Origin::Csms;
3513 type Response = GetChargingProfilesResponse;
3514}
3515
3516impl Confirmed for GetChargingProfilesRequest {}
3517
3518#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3520pub struct GetChargingProfilesResponse {
3521 pub status: GetChargingProfileStatus,
3523 #[serde(rename = "statusInfo")]
3525 #[serde(default, skip_serializing_if = "Option::is_none")]
3526 pub status_info: Option<StatusInfo>,
3527 #[serde(rename = "customData")]
3529 #[serde(default, skip_serializing_if = "Option::is_none")]
3530 pub custom_data: Option<crate::types::CustomData>,
3531}
3532
3533impl GetChargingProfilesResponse {
3534 #[must_use]
3536 pub fn new(status: GetChargingProfileStatus) -> Self {
3537 Self {
3538 status,
3539 status_info: None,
3540 custom_data: None,
3541 }
3542 }
3543
3544 #[must_use]
3546 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3547 self.status_info = Some(value);
3548 self
3549 }
3550
3551 #[must_use]
3553 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3554 self.custom_data = Some(value);
3555 self
3556 }
3557}
3558
3559impl Validate for GetChargingProfilesResponse {
3560 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3561 path.push_key("status");
3562 Validate::validate_at(&self.status, path, out);
3563 path.pop();
3564 path.push_key("statusInfo");
3565 if let Some(value) = &self.status_info {
3566 Validate::validate_at(value, path, out);
3567 }
3568 path.pop();
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 GetChargingProfilesResponse {}
3578impl Response for GetChargingProfilesResponse {}
3579
3580#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3582pub struct GetCompositeScheduleRequest {
3583 #[serde(deserialize_with = "crate::types::integer::one")]
3585 pub duration: i32,
3586 #[serde(rename = "evseId")]
3588 #[serde(deserialize_with = "crate::types::integer::one")]
3589 pub evse_id: i32,
3590 #[serde(rename = "chargingRateUnit")]
3592 #[serde(default, skip_serializing_if = "Option::is_none")]
3593 pub charging_rate_unit: Option<ChargingRateUnit>,
3594 #[serde(rename = "customData")]
3596 #[serde(default, skip_serializing_if = "Option::is_none")]
3597 pub custom_data: Option<crate::types::CustomData>,
3598}
3599
3600impl GetCompositeScheduleRequest {
3601 #[must_use]
3603 pub fn new(duration: i32, evse_id: i32) -> Self {
3604 Self {
3605 duration,
3606 evse_id,
3607 charging_rate_unit: None,
3608 custom_data: None,
3609 }
3610 }
3611
3612 #[must_use]
3614 pub fn with_charging_rate_unit(mut self, value: ChargingRateUnit) -> Self {
3615 self.charging_rate_unit = Some(value);
3616 self
3617 }
3618
3619 #[must_use]
3621 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3622 self.custom_data = Some(value);
3623 self
3624 }
3625}
3626
3627impl Validate for GetCompositeScheduleRequest {
3628 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3629 path.push_key("evseId");
3630 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
3631 path.pop();
3632 path.push_key("chargingRateUnit");
3633 if let Some(value) = &self.charging_rate_unit {
3634 Validate::validate_at(value, path, out);
3635 }
3636 path.pop();
3637 path.push_key("customData");
3638 if let Some(value) = &self.custom_data {
3639 Validate::validate_at(value, path, out);
3640 }
3641 path.pop();
3642 }
3643}
3644
3645impl Sealed for GetCompositeScheduleRequest {}
3646impl Request for GetCompositeScheduleRequest {
3647 type Action = Action;
3648 const ACTION: Action = Action::GetCompositeSchedule;
3649 const KIND: MessageKind = MessageKind::Call;
3650 const ORIGIN: Origin = Origin::Csms;
3651 type Response = GetCompositeScheduleResponse;
3652}
3653
3654impl Confirmed for GetCompositeScheduleRequest {}
3655
3656#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3658pub struct GetCompositeScheduleResponse {
3659 pub status: GenericStatus,
3661 #[serde(rename = "statusInfo")]
3663 #[serde(default, skip_serializing_if = "Option::is_none")]
3664 pub status_info: Option<StatusInfo>,
3665 #[serde(default, skip_serializing_if = "Option::is_none")]
3667 pub schedule: Option<CompositeSchedule>,
3668 #[serde(rename = "customData")]
3670 #[serde(default, skip_serializing_if = "Option::is_none")]
3671 pub custom_data: Option<crate::types::CustomData>,
3672}
3673
3674impl GetCompositeScheduleResponse {
3675 #[must_use]
3677 pub fn new(status: GenericStatus) -> Self {
3678 Self {
3679 status,
3680 status_info: None,
3681 schedule: None,
3682 custom_data: None,
3683 }
3684 }
3685
3686 #[must_use]
3688 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3689 self.status_info = Some(value);
3690 self
3691 }
3692
3693 #[must_use]
3695 pub fn with_schedule(mut self, value: CompositeSchedule) -> Self {
3696 self.schedule = Some(value);
3697 self
3698 }
3699
3700 #[must_use]
3702 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3703 self.custom_data = Some(value);
3704 self
3705 }
3706}
3707
3708impl Validate for GetCompositeScheduleResponse {
3709 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3710 path.push_key("status");
3711 Validate::validate_at(&self.status, path, out);
3712 path.pop();
3713 path.push_key("statusInfo");
3714 if let Some(value) = &self.status_info {
3715 Validate::validate_at(value, path, out);
3716 }
3717 path.pop();
3718 path.push_key("schedule");
3719 if let Some(value) = &self.schedule {
3720 Validate::validate_at(value, path, out);
3721 }
3722 path.pop();
3723 path.push_key("customData");
3724 if let Some(value) = &self.custom_data {
3725 Validate::validate_at(value, path, out);
3726 }
3727 path.pop();
3728 }
3729}
3730
3731impl Sealed for GetCompositeScheduleResponse {}
3732impl Response for GetCompositeScheduleResponse {}
3733
3734#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3736pub struct GetDERControlRequest {
3737 #[serde(rename = "requestId")]
3739 #[serde(deserialize_with = "crate::types::integer::one")]
3740 pub request_id: i32,
3741 #[serde(rename = "isDefault")]
3743 #[serde(default, skip_serializing_if = "Option::is_none")]
3744 pub is_default: Option<bool>,
3745 #[serde(rename = "controlType")]
3747 #[serde(default, skip_serializing_if = "Option::is_none")]
3748 pub control_type: Option<DERControl>,
3749 #[serde(rename = "controlId")]
3751 #[serde(default, skip_serializing_if = "Option::is_none")]
3752 pub control_id: Option<String>,
3753 #[serde(rename = "customData")]
3755 #[serde(default, skip_serializing_if = "Option::is_none")]
3756 pub custom_data: Option<crate::types::CustomData>,
3757}
3758
3759impl GetDERControlRequest {
3760 #[must_use]
3762 pub fn new(request_id: i32) -> Self {
3763 Self {
3764 request_id,
3765 is_default: None,
3766 control_type: None,
3767 control_id: None,
3768 custom_data: None,
3769 }
3770 }
3771
3772 #[must_use]
3774 pub fn with_is_default(mut self, value: bool) -> Self {
3775 self.is_default = Some(value);
3776 self
3777 }
3778
3779 #[must_use]
3781 pub fn with_control_type(mut self, value: DERControl) -> Self {
3782 self.control_type = Some(value);
3783 self
3784 }
3785
3786 #[must_use]
3788 pub fn with_control_id(mut self, value: impl Into<String>) -> Self {
3789 self.control_id = Some(value.into());
3790 self
3791 }
3792
3793 #[must_use]
3795 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3796 self.custom_data = Some(value);
3797 self
3798 }
3799}
3800
3801impl Validate for GetDERControlRequest {
3802 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3803 path.push_key("controlType");
3804 if let Some(value) = &self.control_type {
3805 Validate::validate_at(value, path, out);
3806 }
3807 path.pop();
3808 path.push_key("controlId");
3809 if let Some(value) = &self.control_id {
3810 validate::string(value.as_str(), None, Some(36), path, out);
3811 }
3812 path.pop();
3813 path.push_key("customData");
3814 if let Some(value) = &self.custom_data {
3815 Validate::validate_at(value, path, out);
3816 }
3817 path.pop();
3818 }
3819}
3820
3821impl Sealed for GetDERControlRequest {}
3822impl Request for GetDERControlRequest {
3823 type Action = Action;
3824 const ACTION: Action = Action::GetDERControl;
3825 const KIND: MessageKind = MessageKind::Call;
3826 const ORIGIN: Origin = Origin::Csms;
3827 type Response = GetDERControlResponse;
3828}
3829
3830impl Confirmed for GetDERControlRequest {}
3831
3832#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3834pub struct GetDERControlResponse {
3835 pub status: DERControlStatus,
3837 #[serde(rename = "statusInfo")]
3839 #[serde(default, skip_serializing_if = "Option::is_none")]
3840 pub status_info: Option<StatusInfo>,
3841 #[serde(rename = "customData")]
3843 #[serde(default, skip_serializing_if = "Option::is_none")]
3844 pub custom_data: Option<crate::types::CustomData>,
3845}
3846
3847impl GetDERControlResponse {
3848 #[must_use]
3850 pub fn new(status: DERControlStatus) -> Self {
3851 Self {
3852 status,
3853 status_info: None,
3854 custom_data: None,
3855 }
3856 }
3857
3858 #[must_use]
3860 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
3861 self.status_info = Some(value);
3862 self
3863 }
3864
3865 #[must_use]
3867 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3868 self.custom_data = Some(value);
3869 self
3870 }
3871}
3872
3873impl Validate for GetDERControlResponse {
3874 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3875 path.push_key("status");
3876 Validate::validate_at(&self.status, path, out);
3877 path.pop();
3878 path.push_key("statusInfo");
3879 if let Some(value) = &self.status_info {
3880 Validate::validate_at(value, path, out);
3881 }
3882 path.pop();
3883 path.push_key("customData");
3884 if let Some(value) = &self.custom_data {
3885 Validate::validate_at(value, path, out);
3886 }
3887 path.pop();
3888 }
3889}
3890
3891impl Sealed for GetDERControlResponse {}
3892impl Response for GetDERControlResponse {}
3893
3894#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3896pub struct GetDisplayMessagesRequest {
3897 #[serde(rename = "requestId")]
3899 #[serde(deserialize_with = "crate::types::integer::one")]
3900 pub request_id: i32,
3901 #[serde(default, skip_serializing_if = "Option::is_none")]
3903 #[serde(deserialize_with = "crate::types::integer::option_list")]
3904 pub id: Option<Vec<i32>>,
3905 #[serde(default, skip_serializing_if = "Option::is_none")]
3907 pub priority: Option<MessagePriority>,
3908 #[serde(default, skip_serializing_if = "Option::is_none")]
3910 pub state: Option<MessageState>,
3911 #[serde(rename = "customData")]
3913 #[serde(default, skip_serializing_if = "Option::is_none")]
3914 pub custom_data: Option<crate::types::CustomData>,
3915}
3916
3917impl GetDisplayMessagesRequest {
3918 #[must_use]
3920 pub fn new(request_id: i32) -> Self {
3921 Self {
3922 request_id,
3923 id: None,
3924 priority: None,
3925 state: None,
3926 custom_data: None,
3927 }
3928 }
3929
3930 #[must_use]
3932 pub fn with_id(mut self, value: Vec<i32>) -> Self {
3933 self.id = Some(value);
3934 self
3935 }
3936
3937 #[must_use]
3939 pub fn with_priority(mut self, value: MessagePriority) -> Self {
3940 self.priority = Some(value);
3941 self
3942 }
3943
3944 #[must_use]
3946 pub fn with_state(mut self, value: MessageState) -> Self {
3947 self.state = Some(value);
3948 self
3949 }
3950
3951 #[must_use]
3953 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3954 self.custom_data = Some(value);
3955 self
3956 }
3957}
3958
3959impl Validate for GetDisplayMessagesRequest {
3960 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3961 path.push_key("id");
3962 if let Some(value) = &self.id {
3963 validate::list_len(value.len(), Some(1), None, path, out);
3964 for (index, item) in value.iter().enumerate() {
3965 path.push_index(index);
3966 validate::int_range(i64::from(*item), Some(0), None, path, out);
3967 path.pop();
3968 }
3969 }
3970 path.pop();
3971 path.push_key("priority");
3972 if let Some(value) = &self.priority {
3973 Validate::validate_at(value, path, out);
3974 }
3975 path.pop();
3976 path.push_key("state");
3977 if let Some(value) = &self.state {
3978 Validate::validate_at(value, path, out);
3979 }
3980 path.pop();
3981 path.push_key("customData");
3982 if let Some(value) = &self.custom_data {
3983 Validate::validate_at(value, path, out);
3984 }
3985 path.pop();
3986 }
3987}
3988
3989impl Sealed for GetDisplayMessagesRequest {}
3990impl Request for GetDisplayMessagesRequest {
3991 type Action = Action;
3992 const ACTION: Action = Action::GetDisplayMessages;
3993 const KIND: MessageKind = MessageKind::Call;
3994 const ORIGIN: Origin = Origin::Csms;
3995 type Response = GetDisplayMessagesResponse;
3996}
3997
3998impl Confirmed for GetDisplayMessagesRequest {}
3999
4000#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4002pub struct GetDisplayMessagesResponse {
4003 pub status: GetDisplayMessagesStatus,
4005 #[serde(rename = "statusInfo")]
4007 #[serde(default, skip_serializing_if = "Option::is_none")]
4008 pub status_info: Option<StatusInfo>,
4009 #[serde(rename = "customData")]
4011 #[serde(default, skip_serializing_if = "Option::is_none")]
4012 pub custom_data: Option<crate::types::CustomData>,
4013}
4014
4015impl GetDisplayMessagesResponse {
4016 #[must_use]
4018 pub fn new(status: GetDisplayMessagesStatus) -> Self {
4019 Self {
4020 status,
4021 status_info: None,
4022 custom_data: None,
4023 }
4024 }
4025
4026 #[must_use]
4028 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
4029 self.status_info = Some(value);
4030 self
4031 }
4032
4033 #[must_use]
4035 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4036 self.custom_data = Some(value);
4037 self
4038 }
4039}
4040
4041impl Validate for GetDisplayMessagesResponse {
4042 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4043 path.push_key("status");
4044 Validate::validate_at(&self.status, path, out);
4045 path.pop();
4046 path.push_key("statusInfo");
4047 if let Some(value) = &self.status_info {
4048 Validate::validate_at(value, path, out);
4049 }
4050 path.pop();
4051 path.push_key("customData");
4052 if let Some(value) = &self.custom_data {
4053 Validate::validate_at(value, path, out);
4054 }
4055 path.pop();
4056 }
4057}
4058
4059impl Sealed for GetDisplayMessagesResponse {}
4060impl Response for GetDisplayMessagesResponse {}
4061
4062#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4064pub struct GetInstalledCertificateIdsRequest {
4065 #[serde(rename = "certificateType")]
4067 #[serde(default, skip_serializing_if = "Option::is_none")]
4068 pub certificate_type: Option<Vec<GetCertificateIdUse>>,
4069 #[serde(rename = "customData")]
4071 #[serde(default, skip_serializing_if = "Option::is_none")]
4072 pub custom_data: Option<crate::types::CustomData>,
4073}
4074
4075impl GetInstalledCertificateIdsRequest {
4076 #[must_use]
4078 pub fn new() -> Self {
4079 Self::default()
4080 }
4081
4082 #[must_use]
4084 pub fn with_certificate_type(mut self, value: Vec<GetCertificateIdUse>) -> Self {
4085 self.certificate_type = Some(value);
4086 self
4087 }
4088
4089 #[must_use]
4091 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4092 self.custom_data = Some(value);
4093 self
4094 }
4095}
4096
4097impl Validate for GetInstalledCertificateIdsRequest {
4098 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4099 path.push_key("certificateType");
4100 if let Some(value) = &self.certificate_type {
4101 validate::list_len(value.len(), Some(1), None, path, out);
4102 for (index, item) in value.iter().enumerate() {
4103 path.push_index(index);
4104 Validate::validate_at(item, path, out);
4105 path.pop();
4106 }
4107 }
4108 path.pop();
4109 path.push_key("customData");
4110 if let Some(value) = &self.custom_data {
4111 Validate::validate_at(value, path, out);
4112 }
4113 path.pop();
4114 }
4115}
4116
4117impl Sealed for GetInstalledCertificateIdsRequest {}
4118impl Request for GetInstalledCertificateIdsRequest {
4119 type Action = Action;
4120 const ACTION: Action = Action::GetInstalledCertificateIds;
4121 const KIND: MessageKind = MessageKind::Call;
4122 const ORIGIN: Origin = Origin::Csms;
4123 type Response = GetInstalledCertificateIdsResponse;
4124}
4125
4126impl Confirmed for GetInstalledCertificateIdsRequest {}
4127
4128#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4130pub struct GetInstalledCertificateIdsResponse {
4131 pub status: GetInstalledCertificateStatus,
4133 #[serde(rename = "statusInfo")]
4135 #[serde(default, skip_serializing_if = "Option::is_none")]
4136 pub status_info: Option<StatusInfo>,
4137 #[serde(rename = "certificateHashDataChain")]
4139 #[serde(default, skip_serializing_if = "Option::is_none")]
4140 pub certificate_hash_data_chain: Option<Vec<CertificateHashDataChain>>,
4141 #[serde(rename = "customData")]
4143 #[serde(default, skip_serializing_if = "Option::is_none")]
4144 pub custom_data: Option<crate::types::CustomData>,
4145}
4146
4147impl GetInstalledCertificateIdsResponse {
4148 #[must_use]
4150 pub fn new(status: GetInstalledCertificateStatus) -> Self {
4151 Self {
4152 status,
4153 status_info: None,
4154 certificate_hash_data_chain: None,
4155 custom_data: None,
4156 }
4157 }
4158
4159 #[must_use]
4161 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
4162 self.status_info = Some(value);
4163 self
4164 }
4165
4166 #[must_use]
4168 pub fn with_certificate_hash_data_chain(
4169 mut self,
4170 value: Vec<CertificateHashDataChain>,
4171 ) -> Self {
4172 self.certificate_hash_data_chain = Some(value);
4173 self
4174 }
4175
4176 #[must_use]
4178 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4179 self.custom_data = Some(value);
4180 self
4181 }
4182}
4183
4184impl Validate for GetInstalledCertificateIdsResponse {
4185 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4186 path.push_key("status");
4187 Validate::validate_at(&self.status, path, out);
4188 path.pop();
4189 path.push_key("statusInfo");
4190 if let Some(value) = &self.status_info {
4191 Validate::validate_at(value, path, out);
4192 }
4193 path.pop();
4194 path.push_key("certificateHashDataChain");
4195 if let Some(value) = &self.certificate_hash_data_chain {
4196 validate::list_len(value.len(), Some(1), None, path, out);
4197 for (index, item) in value.iter().enumerate() {
4198 path.push_index(index);
4199 Validate::validate_at(item, path, out);
4200 path.pop();
4201 }
4202 }
4203 path.pop();
4204 path.push_key("customData");
4205 if let Some(value) = &self.custom_data {
4206 Validate::validate_at(value, path, out);
4207 }
4208 path.pop();
4209 }
4210}
4211
4212impl Sealed for GetInstalledCertificateIdsResponse {}
4213impl Response for GetInstalledCertificateIdsResponse {}
4214
4215#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4217pub struct GetLocalListVersionRequest {
4218 #[serde(rename = "customData")]
4220 #[serde(default, skip_serializing_if = "Option::is_none")]
4221 pub custom_data: Option<crate::types::CustomData>,
4222}
4223
4224impl GetLocalListVersionRequest {
4225 #[must_use]
4227 pub fn new() -> Self {
4228 Self::default()
4229 }
4230
4231 #[must_use]
4233 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4234 self.custom_data = Some(value);
4235 self
4236 }
4237}
4238
4239impl Validate for GetLocalListVersionRequest {
4240 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4241 path.push_key("customData");
4242 if let Some(value) = &self.custom_data {
4243 Validate::validate_at(value, path, out);
4244 }
4245 path.pop();
4246 }
4247}
4248
4249impl Sealed for GetLocalListVersionRequest {}
4250impl Request for GetLocalListVersionRequest {
4251 type Action = Action;
4252 const ACTION: Action = Action::GetLocalListVersion;
4253 const KIND: MessageKind = MessageKind::Call;
4254 const ORIGIN: Origin = Origin::Csms;
4255 type Response = GetLocalListVersionResponse;
4256}
4257
4258impl Confirmed for GetLocalListVersionRequest {}
4259
4260#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4262pub struct GetLocalListVersionResponse {
4263 #[serde(rename = "versionNumber")]
4265 #[serde(deserialize_with = "crate::types::integer::one")]
4266 pub version_number: i32,
4267 #[serde(rename = "customData")]
4269 #[serde(default, skip_serializing_if = "Option::is_none")]
4270 pub custom_data: Option<crate::types::CustomData>,
4271}
4272
4273impl GetLocalListVersionResponse {
4274 #[must_use]
4276 pub fn new(version_number: i32) -> Self {
4277 Self {
4278 version_number,
4279 custom_data: None,
4280 }
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 GetLocalListVersionResponse {
4292 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4293 path.push_key("customData");
4294 if let Some(value) = &self.custom_data {
4295 Validate::validate_at(value, path, out);
4296 }
4297 path.pop();
4298 }
4299}
4300
4301impl Sealed for GetLocalListVersionResponse {}
4302impl Response for GetLocalListVersionResponse {}
4303
4304#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4306pub struct GetLogRequest {
4307 pub log: LogParameters,
4309 #[serde(rename = "logType")]
4311 pub log_type: Log,
4312 #[serde(rename = "requestId")]
4314 #[serde(deserialize_with = "crate::types::integer::one")]
4315 pub request_id: i32,
4316 #[serde(default, skip_serializing_if = "Option::is_none")]
4318 #[serde(deserialize_with = "crate::types::integer::option")]
4319 pub retries: Option<i32>,
4320 #[serde(rename = "retryInterval")]
4322 #[serde(default, skip_serializing_if = "Option::is_none")]
4323 #[serde(deserialize_with = "crate::types::integer::option")]
4324 pub retry_interval: Option<i32>,
4325 #[serde(rename = "customData")]
4327 #[serde(default, skip_serializing_if = "Option::is_none")]
4328 pub custom_data: Option<crate::types::CustomData>,
4329}
4330
4331impl GetLogRequest {
4332 #[must_use]
4334 pub fn new(log: LogParameters, log_type: Log, request_id: i32) -> Self {
4335 Self {
4336 log,
4337 log_type,
4338 request_id,
4339 retries: None,
4340 retry_interval: None,
4341 custom_data: None,
4342 }
4343 }
4344
4345 #[must_use]
4347 pub fn with_retries(mut self, value: i32) -> Self {
4348 self.retries = Some(value);
4349 self
4350 }
4351
4352 #[must_use]
4354 pub fn with_retry_interval(mut self, value: i32) -> Self {
4355 self.retry_interval = Some(value);
4356 self
4357 }
4358
4359 #[must_use]
4361 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4362 self.custom_data = Some(value);
4363 self
4364 }
4365}
4366
4367impl Validate for GetLogRequest {
4368 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4369 path.push_key("log");
4370 Validate::validate_at(&self.log, path, out);
4371 path.pop();
4372 path.push_key("logType");
4373 Validate::validate_at(&self.log_type, path, out);
4374 path.pop();
4375 path.push_key("retries");
4376 if let Some(value) = &self.retries {
4377 validate::int_range(i64::from(*value), Some(0), None, path, out);
4378 }
4379 path.pop();
4380 path.push_key("customData");
4381 if let Some(value) = &self.custom_data {
4382 Validate::validate_at(value, path, out);
4383 }
4384 path.pop();
4385 }
4386}
4387
4388impl Sealed for GetLogRequest {}
4389impl Request for GetLogRequest {
4390 type Action = Action;
4391 const ACTION: Action = Action::GetLog;
4392 const KIND: MessageKind = MessageKind::Call;
4393 const ORIGIN: Origin = Origin::Csms;
4394 type Response = GetLogResponse;
4395}
4396
4397impl Confirmed for GetLogRequest {}
4398
4399#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4401pub struct GetLogResponse {
4402 pub status: LogStatus,
4404 #[serde(rename = "statusInfo")]
4406 #[serde(default, skip_serializing_if = "Option::is_none")]
4407 pub status_info: Option<StatusInfo>,
4408 #[serde(default, skip_serializing_if = "Option::is_none")]
4410 pub filename: Option<String>,
4411 #[serde(rename = "customData")]
4413 #[serde(default, skip_serializing_if = "Option::is_none")]
4414 pub custom_data: Option<crate::types::CustomData>,
4415}
4416
4417impl GetLogResponse {
4418 #[must_use]
4420 pub fn new(status: LogStatus) -> Self {
4421 Self {
4422 status,
4423 status_info: None,
4424 filename: None,
4425 custom_data: None,
4426 }
4427 }
4428
4429 #[must_use]
4431 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
4432 self.status_info = Some(value);
4433 self
4434 }
4435
4436 #[must_use]
4438 pub fn with_filename(mut self, value: impl Into<String>) -> Self {
4439 self.filename = Some(value.into());
4440 self
4441 }
4442
4443 #[must_use]
4445 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4446 self.custom_data = Some(value);
4447 self
4448 }
4449}
4450
4451impl Validate for GetLogResponse {
4452 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4453 path.push_key("status");
4454 Validate::validate_at(&self.status, path, out);
4455 path.pop();
4456 path.push_key("statusInfo");
4457 if let Some(value) = &self.status_info {
4458 Validate::validate_at(value, path, out);
4459 }
4460 path.pop();
4461 path.push_key("filename");
4462 if let Some(value) = &self.filename {
4463 validate::string(value.as_str(), None, Some(255), path, out);
4464 }
4465 path.pop();
4466 path.push_key("customData");
4467 if let Some(value) = &self.custom_data {
4468 Validate::validate_at(value, path, out);
4469 }
4470 path.pop();
4471 }
4472}
4473
4474impl Sealed for GetLogResponse {}
4475impl Response for GetLogResponse {}
4476
4477#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4479pub struct GetMonitoringReportRequest {
4480 #[serde(rename = "requestId")]
4482 #[serde(deserialize_with = "crate::types::integer::one")]
4483 pub request_id: i32,
4484 #[serde(rename = "componentVariable")]
4486 #[serde(default, skip_serializing_if = "Option::is_none")]
4487 pub component_variable: Option<Vec<ComponentVariable>>,
4488 #[serde(rename = "monitoringCriteria")]
4490 #[serde(default, skip_serializing_if = "Option::is_none")]
4491 pub monitoring_criteria: Option<Vec<MonitoringCriterion>>,
4492 #[serde(rename = "customData")]
4494 #[serde(default, skip_serializing_if = "Option::is_none")]
4495 pub custom_data: Option<crate::types::CustomData>,
4496}
4497
4498impl GetMonitoringReportRequest {
4499 #[must_use]
4501 pub fn new(request_id: i32) -> Self {
4502 Self {
4503 request_id,
4504 component_variable: None,
4505 monitoring_criteria: None,
4506 custom_data: None,
4507 }
4508 }
4509
4510 #[must_use]
4512 pub fn with_component_variable(mut self, value: Vec<ComponentVariable>) -> Self {
4513 self.component_variable = Some(value);
4514 self
4515 }
4516
4517 #[must_use]
4519 pub fn with_monitoring_criteria(mut self, value: Vec<MonitoringCriterion>) -> Self {
4520 self.monitoring_criteria = Some(value);
4521 self
4522 }
4523
4524 #[must_use]
4526 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4527 self.custom_data = Some(value);
4528 self
4529 }
4530}
4531
4532impl Validate for GetMonitoringReportRequest {
4533 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4534 path.push_key("componentVariable");
4535 if let Some(value) = &self.component_variable {
4536 validate::list_len(value.len(), Some(1), None, path, out);
4537 for (index, item) in value.iter().enumerate() {
4538 path.push_index(index);
4539 Validate::validate_at(item, path, out);
4540 path.pop();
4541 }
4542 }
4543 path.pop();
4544 path.push_key("monitoringCriteria");
4545 if let Some(value) = &self.monitoring_criteria {
4546 validate::list_len(value.len(), Some(1), Some(3), path, out);
4547 for (index, item) in value.iter().enumerate() {
4548 path.push_index(index);
4549 Validate::validate_at(item, path, out);
4550 path.pop();
4551 }
4552 }
4553 path.pop();
4554 path.push_key("customData");
4555 if let Some(value) = &self.custom_data {
4556 Validate::validate_at(value, path, out);
4557 }
4558 path.pop();
4559 }
4560}
4561
4562impl Sealed for GetMonitoringReportRequest {}
4563impl Request for GetMonitoringReportRequest {
4564 type Action = Action;
4565 const ACTION: Action = Action::GetMonitoringReport;
4566 const KIND: MessageKind = MessageKind::Call;
4567 const ORIGIN: Origin = Origin::Csms;
4568 type Response = GetMonitoringReportResponse;
4569}
4570
4571impl Confirmed for GetMonitoringReportRequest {}
4572
4573#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4575pub struct GetMonitoringReportResponse {
4576 pub status: GenericDeviceModelStatus,
4578 #[serde(rename = "statusInfo")]
4580 #[serde(default, skip_serializing_if = "Option::is_none")]
4581 pub status_info: Option<StatusInfo>,
4582 #[serde(rename = "customData")]
4584 #[serde(default, skip_serializing_if = "Option::is_none")]
4585 pub custom_data: Option<crate::types::CustomData>,
4586}
4587
4588impl GetMonitoringReportResponse {
4589 #[must_use]
4591 pub fn new(status: GenericDeviceModelStatus) -> Self {
4592 Self {
4593 status,
4594 status_info: None,
4595 custom_data: None,
4596 }
4597 }
4598
4599 #[must_use]
4601 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
4602 self.status_info = Some(value);
4603 self
4604 }
4605
4606 #[must_use]
4608 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4609 self.custom_data = Some(value);
4610 self
4611 }
4612}
4613
4614impl Validate for GetMonitoringReportResponse {
4615 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4616 path.push_key("status");
4617 Validate::validate_at(&self.status, path, out);
4618 path.pop();
4619 path.push_key("statusInfo");
4620 if let Some(value) = &self.status_info {
4621 Validate::validate_at(value, path, out);
4622 }
4623 path.pop();
4624 path.push_key("customData");
4625 if let Some(value) = &self.custom_data {
4626 Validate::validate_at(value, path, out);
4627 }
4628 path.pop();
4629 }
4630}
4631
4632impl Sealed for GetMonitoringReportResponse {}
4633impl Response for GetMonitoringReportResponse {}
4634
4635#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4639pub struct GetPeriodicEventStreamRequest {
4640 #[serde(rename = "customData")]
4642 #[serde(default, skip_serializing_if = "Option::is_none")]
4643 pub custom_data: Option<crate::types::CustomData>,
4644}
4645
4646impl GetPeriodicEventStreamRequest {
4647 #[must_use]
4649 pub fn new() -> Self {
4650 Self::default()
4651 }
4652
4653 #[must_use]
4655 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4656 self.custom_data = Some(value);
4657 self
4658 }
4659}
4660
4661impl Validate for GetPeriodicEventStreamRequest {
4662 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4663 path.push_key("customData");
4664 if let Some(value) = &self.custom_data {
4665 Validate::validate_at(value, path, out);
4666 }
4667 path.pop();
4668 }
4669}
4670
4671impl Sealed for GetPeriodicEventStreamRequest {}
4672impl Request for GetPeriodicEventStreamRequest {
4673 type Action = Action;
4674 const ACTION: Action = Action::GetPeriodicEventStream;
4675 const KIND: MessageKind = MessageKind::Call;
4676 const ORIGIN: Origin = Origin::Csms;
4677 type Response = GetPeriodicEventStreamResponse;
4678}
4679
4680impl Confirmed for GetPeriodicEventStreamRequest {}
4681
4682#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
4684pub struct GetPeriodicEventStreamResponse {
4685 #[serde(rename = "constantStreamData")]
4687 #[serde(default, skip_serializing_if = "Option::is_none")]
4688 pub constant_stream_data: Option<Vec<ConstantStreamData>>,
4689 #[serde(rename = "customData")]
4691 #[serde(default, skip_serializing_if = "Option::is_none")]
4692 pub custom_data: Option<crate::types::CustomData>,
4693}
4694
4695impl GetPeriodicEventStreamResponse {
4696 #[must_use]
4698 pub fn new() -> Self {
4699 Self::default()
4700 }
4701
4702 #[must_use]
4704 pub fn with_constant_stream_data(mut self, value: Vec<ConstantStreamData>) -> Self {
4705 self.constant_stream_data = Some(value);
4706 self
4707 }
4708
4709 #[must_use]
4711 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4712 self.custom_data = Some(value);
4713 self
4714 }
4715}
4716
4717impl Validate for GetPeriodicEventStreamResponse {
4718 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4719 path.push_key("constantStreamData");
4720 if let Some(value) = &self.constant_stream_data {
4721 validate::list_len(value.len(), Some(1), None, path, out);
4722 for (index, item) in value.iter().enumerate() {
4723 path.push_index(index);
4724 Validate::validate_at(item, path, out);
4725 path.pop();
4726 }
4727 }
4728 path.pop();
4729 path.push_key("customData");
4730 if let Some(value) = &self.custom_data {
4731 Validate::validate_at(value, path, out);
4732 }
4733 path.pop();
4734 }
4735}
4736
4737impl Sealed for GetPeriodicEventStreamResponse {}
4738impl Response for GetPeriodicEventStreamResponse {}
4739
4740#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4742pub struct GetReportRequest {
4743 #[serde(rename = "requestId")]
4745 #[serde(deserialize_with = "crate::types::integer::one")]
4746 pub request_id: i32,
4747 #[serde(rename = "componentVariable")]
4749 #[serde(default, skip_serializing_if = "Option::is_none")]
4750 pub component_variable: Option<Vec<ComponentVariable>>,
4751 #[serde(rename = "componentCriteria")]
4753 #[serde(default, skip_serializing_if = "Option::is_none")]
4754 pub component_criteria: Option<Vec<ComponentCriterion>>,
4755 #[serde(rename = "customData")]
4757 #[serde(default, skip_serializing_if = "Option::is_none")]
4758 pub custom_data: Option<crate::types::CustomData>,
4759}
4760
4761impl GetReportRequest {
4762 #[must_use]
4764 pub fn new(request_id: i32) -> Self {
4765 Self {
4766 request_id,
4767 component_variable: None,
4768 component_criteria: None,
4769 custom_data: None,
4770 }
4771 }
4772
4773 #[must_use]
4775 pub fn with_component_variable(mut self, value: Vec<ComponentVariable>) -> Self {
4776 self.component_variable = Some(value);
4777 self
4778 }
4779
4780 #[must_use]
4782 pub fn with_component_criteria(mut self, value: Vec<ComponentCriterion>) -> Self {
4783 self.component_criteria = Some(value);
4784 self
4785 }
4786
4787 #[must_use]
4789 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4790 self.custom_data = Some(value);
4791 self
4792 }
4793}
4794
4795impl Validate for GetReportRequest {
4796 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4797 path.push_key("componentVariable");
4798 if let Some(value) = &self.component_variable {
4799 validate::list_len(value.len(), Some(1), None, path, out);
4800 for (index, item) in value.iter().enumerate() {
4801 path.push_index(index);
4802 Validate::validate_at(item, path, out);
4803 path.pop();
4804 }
4805 }
4806 path.pop();
4807 path.push_key("componentCriteria");
4808 if let Some(value) = &self.component_criteria {
4809 validate::list_len(value.len(), Some(1), Some(4), path, out);
4810 for (index, item) in value.iter().enumerate() {
4811 path.push_index(index);
4812 Validate::validate_at(item, path, out);
4813 path.pop();
4814 }
4815 }
4816 path.pop();
4817 path.push_key("customData");
4818 if let Some(value) = &self.custom_data {
4819 Validate::validate_at(value, path, out);
4820 }
4821 path.pop();
4822 }
4823}
4824
4825impl Sealed for GetReportRequest {}
4826impl Request for GetReportRequest {
4827 type Action = Action;
4828 const ACTION: Action = Action::GetReport;
4829 const KIND: MessageKind = MessageKind::Call;
4830 const ORIGIN: Origin = Origin::Csms;
4831 type Response = GetReportResponse;
4832}
4833
4834impl Confirmed for GetReportRequest {}
4835
4836#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4838pub struct GetReportResponse {
4839 pub status: GenericDeviceModelStatus,
4841 #[serde(rename = "statusInfo")]
4843 #[serde(default, skip_serializing_if = "Option::is_none")]
4844 pub status_info: Option<StatusInfo>,
4845 #[serde(rename = "customData")]
4847 #[serde(default, skip_serializing_if = "Option::is_none")]
4848 pub custom_data: Option<crate::types::CustomData>,
4849}
4850
4851impl GetReportResponse {
4852 #[must_use]
4854 pub fn new(status: GenericDeviceModelStatus) -> Self {
4855 Self {
4856 status,
4857 status_info: None,
4858 custom_data: None,
4859 }
4860 }
4861
4862 #[must_use]
4864 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
4865 self.status_info = Some(value);
4866 self
4867 }
4868
4869 #[must_use]
4871 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4872 self.custom_data = Some(value);
4873 self
4874 }
4875}
4876
4877impl Validate for GetReportResponse {
4878 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4879 path.push_key("status");
4880 Validate::validate_at(&self.status, path, out);
4881 path.pop();
4882 path.push_key("statusInfo");
4883 if let Some(value) = &self.status_info {
4884 Validate::validate_at(value, path, out);
4885 }
4886 path.pop();
4887 path.push_key("customData");
4888 if let Some(value) = &self.custom_data {
4889 Validate::validate_at(value, path, out);
4890 }
4891 path.pop();
4892 }
4893}
4894
4895impl Sealed for GetReportResponse {}
4896impl Response for GetReportResponse {}
4897
4898#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4900pub struct GetTariffsRequest {
4901 #[serde(rename = "evseId")]
4903 #[serde(deserialize_with = "crate::types::integer::one")]
4904 pub evse_id: i32,
4905 #[serde(rename = "customData")]
4907 #[serde(default, skip_serializing_if = "Option::is_none")]
4908 pub custom_data: Option<crate::types::CustomData>,
4909}
4910
4911impl GetTariffsRequest {
4912 #[must_use]
4914 pub fn new(evse_id: i32) -> Self {
4915 Self {
4916 evse_id,
4917 custom_data: None,
4918 }
4919 }
4920
4921 #[must_use]
4923 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4924 self.custom_data = Some(value);
4925 self
4926 }
4927}
4928
4929impl Validate for GetTariffsRequest {
4930 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4931 path.push_key("evseId");
4932 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
4933 path.pop();
4934 path.push_key("customData");
4935 if let Some(value) = &self.custom_data {
4936 Validate::validate_at(value, path, out);
4937 }
4938 path.pop();
4939 }
4940}
4941
4942impl Sealed for GetTariffsRequest {}
4943impl Request for GetTariffsRequest {
4944 type Action = Action;
4945 const ACTION: Action = Action::GetTariffs;
4946 const KIND: MessageKind = MessageKind::Call;
4947 const ORIGIN: Origin = Origin::Csms;
4948 type Response = GetTariffsResponse;
4949}
4950
4951impl Confirmed for GetTariffsRequest {}
4952
4953#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4955pub struct GetTariffsResponse {
4956 pub status: TariffGetStatus,
4958 #[serde(rename = "statusInfo")]
4960 #[serde(default, skip_serializing_if = "Option::is_none")]
4961 pub status_info: Option<StatusInfo>,
4962 #[serde(rename = "tariffAssignments")]
4964 #[serde(default, skip_serializing_if = "Option::is_none")]
4965 pub tariff_assignments: Option<Vec<TariffAssignment>>,
4966 #[serde(rename = "customData")]
4968 #[serde(default, skip_serializing_if = "Option::is_none")]
4969 pub custom_data: Option<crate::types::CustomData>,
4970}
4971
4972impl GetTariffsResponse {
4973 #[must_use]
4975 pub fn new(status: TariffGetStatus) -> Self {
4976 Self {
4977 status,
4978 status_info: None,
4979 tariff_assignments: None,
4980 custom_data: None,
4981 }
4982 }
4983
4984 #[must_use]
4986 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
4987 self.status_info = Some(value);
4988 self
4989 }
4990
4991 #[must_use]
4993 pub fn with_tariff_assignments(mut self, value: Vec<TariffAssignment>) -> Self {
4994 self.tariff_assignments = Some(value);
4995 self
4996 }
4997
4998 #[must_use]
5000 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5001 self.custom_data = Some(value);
5002 self
5003 }
5004}
5005
5006impl Validate for GetTariffsResponse {
5007 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5008 path.push_key("status");
5009 Validate::validate_at(&self.status, path, out);
5010 path.pop();
5011 path.push_key("statusInfo");
5012 if let Some(value) = &self.status_info {
5013 Validate::validate_at(value, path, out);
5014 }
5015 path.pop();
5016 path.push_key("tariffAssignments");
5017 if let Some(value) = &self.tariff_assignments {
5018 validate::list_len(value.len(), Some(1), None, path, out);
5019 for (index, item) in value.iter().enumerate() {
5020 path.push_index(index);
5021 Validate::validate_at(item, path, out);
5022 path.pop();
5023 }
5024 }
5025 path.pop();
5026 path.push_key("customData");
5027 if let Some(value) = &self.custom_data {
5028 Validate::validate_at(value, path, out);
5029 }
5030 path.pop();
5031 }
5032}
5033
5034impl Sealed for GetTariffsResponse {}
5035impl Response for GetTariffsResponse {}
5036
5037#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5039pub struct GetTransactionStatusRequest {
5040 #[serde(rename = "transactionId")]
5042 #[serde(default, skip_serializing_if = "Option::is_none")]
5043 pub transaction_id: Option<String>,
5044 #[serde(rename = "customData")]
5046 #[serde(default, skip_serializing_if = "Option::is_none")]
5047 pub custom_data: Option<crate::types::CustomData>,
5048}
5049
5050impl GetTransactionStatusRequest {
5051 #[must_use]
5053 pub fn new() -> Self {
5054 Self::default()
5055 }
5056
5057 #[must_use]
5059 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
5060 self.transaction_id = Some(value.into());
5061 self
5062 }
5063
5064 #[must_use]
5066 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5067 self.custom_data = Some(value);
5068 self
5069 }
5070}
5071
5072impl Validate for GetTransactionStatusRequest {
5073 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5074 path.push_key("transactionId");
5075 if let Some(value) = &self.transaction_id {
5076 validate::string(value.as_str(), None, Some(36), path, out);
5077 }
5078 path.pop();
5079 path.push_key("customData");
5080 if let Some(value) = &self.custom_data {
5081 Validate::validate_at(value, path, out);
5082 }
5083 path.pop();
5084 }
5085}
5086
5087impl Sealed for GetTransactionStatusRequest {}
5088impl Request for GetTransactionStatusRequest {
5089 type Action = Action;
5090 const ACTION: Action = Action::GetTransactionStatus;
5091 const KIND: MessageKind = MessageKind::Call;
5092 const ORIGIN: Origin = Origin::Csms;
5093 type Response = GetTransactionStatusResponse;
5094}
5095
5096impl Confirmed for GetTransactionStatusRequest {}
5097
5098#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5100pub struct GetTransactionStatusResponse {
5101 #[serde(rename = "messagesInQueue")]
5103 pub messages_in_queue: bool,
5104 #[serde(rename = "ongoingIndicator")]
5106 #[serde(default, skip_serializing_if = "Option::is_none")]
5107 pub ongoing_indicator: Option<bool>,
5108 #[serde(rename = "customData")]
5110 #[serde(default, skip_serializing_if = "Option::is_none")]
5111 pub custom_data: Option<crate::types::CustomData>,
5112}
5113
5114impl GetTransactionStatusResponse {
5115 #[must_use]
5117 pub fn new(messages_in_queue: bool) -> Self {
5118 Self {
5119 messages_in_queue,
5120 ongoing_indicator: None,
5121 custom_data: None,
5122 }
5123 }
5124
5125 #[must_use]
5127 pub fn with_ongoing_indicator(mut self, value: bool) -> Self {
5128 self.ongoing_indicator = Some(value);
5129 self
5130 }
5131
5132 #[must_use]
5134 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5135 self.custom_data = Some(value);
5136 self
5137 }
5138}
5139
5140impl Validate for GetTransactionStatusResponse {
5141 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5142 path.push_key("customData");
5143 if let Some(value) = &self.custom_data {
5144 Validate::validate_at(value, path, out);
5145 }
5146 path.pop();
5147 }
5148}
5149
5150impl Sealed for GetTransactionStatusResponse {}
5151impl Response for GetTransactionStatusResponse {}
5152
5153#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5155pub struct GetVariablesRequest {
5156 #[serde(rename = "getVariableData")]
5158 pub get_variable_data: Vec<GetVariableData>,
5159 #[serde(rename = "customData")]
5161 #[serde(default, skip_serializing_if = "Option::is_none")]
5162 pub custom_data: Option<crate::types::CustomData>,
5163}
5164
5165impl GetVariablesRequest {
5166 #[must_use]
5168 pub fn new(get_variable_data: Vec<GetVariableData>) -> Self {
5169 Self {
5170 get_variable_data,
5171 custom_data: None,
5172 }
5173 }
5174
5175 #[must_use]
5177 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5178 self.custom_data = Some(value);
5179 self
5180 }
5181}
5182
5183impl Validate for GetVariablesRequest {
5184 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5185 path.push_key("getVariableData");
5186 validate::list_len(self.get_variable_data.len(), Some(1), None, path, out);
5187 for (index, item) in self.get_variable_data.iter().enumerate() {
5188 path.push_index(index);
5189 Validate::validate_at(item, path, out);
5190 path.pop();
5191 }
5192 path.pop();
5193 path.push_key("customData");
5194 if let Some(value) = &self.custom_data {
5195 Validate::validate_at(value, path, out);
5196 }
5197 path.pop();
5198 }
5199}
5200
5201impl Sealed for GetVariablesRequest {}
5202impl Request for GetVariablesRequest {
5203 type Action = Action;
5204 const ACTION: Action = Action::GetVariables;
5205 const KIND: MessageKind = MessageKind::Call;
5206 const ORIGIN: Origin = Origin::Csms;
5207 type Response = GetVariablesResponse;
5208}
5209
5210impl Confirmed for GetVariablesRequest {}
5211
5212#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5214pub struct GetVariablesResponse {
5215 #[serde(rename = "getVariableResult")]
5217 pub get_variable_result: Vec<GetVariableResult>,
5218 #[serde(rename = "customData")]
5220 #[serde(default, skip_serializing_if = "Option::is_none")]
5221 pub custom_data: Option<crate::types::CustomData>,
5222}
5223
5224impl GetVariablesResponse {
5225 #[must_use]
5227 pub fn new(get_variable_result: Vec<GetVariableResult>) -> Self {
5228 Self {
5229 get_variable_result,
5230 custom_data: None,
5231 }
5232 }
5233
5234 #[must_use]
5236 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5237 self.custom_data = Some(value);
5238 self
5239 }
5240}
5241
5242impl Validate for GetVariablesResponse {
5243 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5244 path.push_key("getVariableResult");
5245 validate::list_len(self.get_variable_result.len(), Some(1), None, path, out);
5246 for (index, item) in self.get_variable_result.iter().enumerate() {
5247 path.push_index(index);
5248 Validate::validate_at(item, path, out);
5249 path.pop();
5250 }
5251 path.pop();
5252 path.push_key("customData");
5253 if let Some(value) = &self.custom_data {
5254 Validate::validate_at(value, path, out);
5255 }
5256 path.pop();
5257 }
5258}
5259
5260impl Sealed for GetVariablesResponse {}
5261impl Response for GetVariablesResponse {}
5262
5263#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5265pub struct HeartbeatRequest {
5266 #[serde(rename = "customData")]
5268 #[serde(default, skip_serializing_if = "Option::is_none")]
5269 pub custom_data: Option<crate::types::CustomData>,
5270}
5271
5272impl HeartbeatRequest {
5273 #[must_use]
5275 pub fn new() -> Self {
5276 Self::default()
5277 }
5278
5279 #[must_use]
5281 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5282 self.custom_data = Some(value);
5283 self
5284 }
5285}
5286
5287impl Validate for HeartbeatRequest {
5288 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5289 path.push_key("customData");
5290 if let Some(value) = &self.custom_data {
5291 Validate::validate_at(value, path, out);
5292 }
5293 path.pop();
5294 }
5295}
5296
5297impl Sealed for HeartbeatRequest {}
5298impl Request for HeartbeatRequest {
5299 type Action = Action;
5300 const ACTION: Action = Action::Heartbeat;
5301 const KIND: MessageKind = MessageKind::Call;
5302 const ORIGIN: Origin = Origin::ChargingStation;
5303 type Response = HeartbeatResponse;
5304}
5305
5306impl Confirmed for HeartbeatRequest {}
5307
5308#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5310pub struct HeartbeatResponse {
5311 #[serde(rename = "currentTime")]
5313 pub current_time: crate::types::DateTime,
5314 #[serde(rename = "customData")]
5316 #[serde(default, skip_serializing_if = "Option::is_none")]
5317 pub custom_data: Option<crate::types::CustomData>,
5318}
5319
5320impl HeartbeatResponse {
5321 #[must_use]
5323 pub fn new(current_time: impl Into<crate::types::DateTime>) -> Self {
5324 Self {
5325 current_time: current_time.into(),
5326 custom_data: None,
5327 }
5328 }
5329
5330 #[must_use]
5332 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5333 self.custom_data = Some(value);
5334 self
5335 }
5336}
5337
5338impl Validate for HeartbeatResponse {
5339 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5340 path.push_key("customData");
5341 if let Some(value) = &self.custom_data {
5342 Validate::validate_at(value, path, out);
5343 }
5344 path.pop();
5345 }
5346}
5347
5348impl Sealed for HeartbeatResponse {}
5349impl Response for HeartbeatResponse {}
5350
5351#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5353pub struct InstallCertificateRequest {
5354 #[serde(rename = "certificateType")]
5356 pub certificate_type: InstallCertificateUse,
5357 pub certificate: String,
5359 #[serde(rename = "customData")]
5361 #[serde(default, skip_serializing_if = "Option::is_none")]
5362 pub custom_data: Option<crate::types::CustomData>,
5363}
5364
5365impl InstallCertificateRequest {
5366 #[must_use]
5368 pub fn new(certificate_type: InstallCertificateUse, certificate: impl Into<String>) -> Self {
5369 Self {
5370 certificate_type,
5371 certificate: certificate.into(),
5372 custom_data: None,
5373 }
5374 }
5375
5376 #[must_use]
5378 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5379 self.custom_data = Some(value);
5380 self
5381 }
5382}
5383
5384impl Validate for InstallCertificateRequest {
5385 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5386 path.push_key("certificateType");
5387 Validate::validate_at(&self.certificate_type, path, out);
5388 path.pop();
5389 path.push_key("certificate");
5390 validate::string(self.certificate.as_str(), None, Some(10000), path, out);
5391 path.pop();
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 InstallCertificateRequest {}
5401impl Request for InstallCertificateRequest {
5402 type Action = Action;
5403 const ACTION: Action = Action::InstallCertificate;
5404 const KIND: MessageKind = MessageKind::Call;
5405 const ORIGIN: Origin = Origin::Csms;
5406 type Response = InstallCertificateResponse;
5407}
5408
5409impl Confirmed for InstallCertificateRequest {}
5410
5411#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5413pub struct InstallCertificateResponse {
5414 pub status: InstallCertificateStatus,
5416 #[serde(rename = "statusInfo")]
5418 #[serde(default, skip_serializing_if = "Option::is_none")]
5419 pub status_info: Option<StatusInfo>,
5420 #[serde(rename = "customData")]
5422 #[serde(default, skip_serializing_if = "Option::is_none")]
5423 pub custom_data: Option<crate::types::CustomData>,
5424}
5425
5426impl InstallCertificateResponse {
5427 #[must_use]
5429 pub fn new(status: InstallCertificateStatus) -> Self {
5430 Self {
5431 status,
5432 status_info: None,
5433 custom_data: None,
5434 }
5435 }
5436
5437 #[must_use]
5439 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
5440 self.status_info = Some(value);
5441 self
5442 }
5443
5444 #[must_use]
5446 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5447 self.custom_data = Some(value);
5448 self
5449 }
5450}
5451
5452impl Validate for InstallCertificateResponse {
5453 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5454 path.push_key("status");
5455 Validate::validate_at(&self.status, path, out);
5456 path.pop();
5457 path.push_key("statusInfo");
5458 if let Some(value) = &self.status_info {
5459 Validate::validate_at(value, path, out);
5460 }
5461 path.pop();
5462 path.push_key("customData");
5463 if let Some(value) = &self.custom_data {
5464 Validate::validate_at(value, path, out);
5465 }
5466 path.pop();
5467 }
5468}
5469
5470impl Sealed for InstallCertificateResponse {}
5471impl Response for InstallCertificateResponse {}
5472
5473#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5475pub struct LogStatusNotificationRequest {
5476 pub status: UploadLogStatus,
5478 #[serde(rename = "requestId")]
5481 #[serde(default, skip_serializing_if = "Option::is_none")]
5482 #[serde(deserialize_with = "crate::types::integer::option")]
5483 pub request_id: Option<i32>,
5484 #[serde(rename = "statusInfo")]
5486 #[serde(default, skip_serializing_if = "Option::is_none")]
5487 pub status_info: Option<StatusInfo>,
5488 #[serde(rename = "customData")]
5490 #[serde(default, skip_serializing_if = "Option::is_none")]
5491 pub custom_data: Option<crate::types::CustomData>,
5492}
5493
5494impl LogStatusNotificationRequest {
5495 #[must_use]
5497 pub fn new(status: UploadLogStatus) -> Self {
5498 Self {
5499 status,
5500 request_id: None,
5501 status_info: None,
5502 custom_data: None,
5503 }
5504 }
5505
5506 #[must_use]
5508 pub fn with_request_id(mut self, value: i32) -> Self {
5509 self.request_id = Some(value);
5510 self
5511 }
5512
5513 #[must_use]
5515 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
5516 self.status_info = Some(value);
5517 self
5518 }
5519
5520 #[must_use]
5522 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5523 self.custom_data = Some(value);
5524 self
5525 }
5526}
5527
5528impl Validate for LogStatusNotificationRequest {
5529 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5530 path.push_key("status");
5531 Validate::validate_at(&self.status, path, out);
5532 path.pop();
5533 path.push_key("statusInfo");
5534 if let Some(value) = &self.status_info {
5535 Validate::validate_at(value, path, out);
5536 }
5537 path.pop();
5538 path.push_key("customData");
5539 if let Some(value) = &self.custom_data {
5540 Validate::validate_at(value, path, out);
5541 }
5542 path.pop();
5543 }
5544}
5545
5546impl Sealed for LogStatusNotificationRequest {}
5547impl Request for LogStatusNotificationRequest {
5548 type Action = Action;
5549 const ACTION: Action = Action::LogStatusNotification;
5550 const KIND: MessageKind = MessageKind::Call;
5551 const ORIGIN: Origin = Origin::ChargingStation;
5552 type Response = LogStatusNotificationResponse;
5553}
5554
5555impl Confirmed for LogStatusNotificationRequest {}
5556
5557#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5559pub struct LogStatusNotificationResponse {
5560 #[serde(rename = "customData")]
5562 #[serde(default, skip_serializing_if = "Option::is_none")]
5563 pub custom_data: Option<crate::types::CustomData>,
5564}
5565
5566impl LogStatusNotificationResponse {
5567 #[must_use]
5569 pub fn new() -> Self {
5570 Self::default()
5571 }
5572
5573 #[must_use]
5575 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5576 self.custom_data = Some(value);
5577 self
5578 }
5579}
5580
5581impl Validate for LogStatusNotificationResponse {
5582 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5583 path.push_key("customData");
5584 if let Some(value) = &self.custom_data {
5585 Validate::validate_at(value, path, out);
5586 }
5587 path.pop();
5588 }
5589}
5590
5591impl Sealed for LogStatusNotificationResponse {}
5592impl Response for LogStatusNotificationResponse {}
5593
5594#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5596pub struct MeterValuesRequest {
5597 #[serde(rename = "evseId")]
5599 #[serde(deserialize_with = "crate::types::integer::one")]
5600 pub evse_id: i32,
5601 #[serde(rename = "meterValue")]
5603 pub meter_value: Vec<MeterValue>,
5604 #[serde(rename = "customData")]
5606 #[serde(default, skip_serializing_if = "Option::is_none")]
5607 pub custom_data: Option<crate::types::CustomData>,
5608}
5609
5610impl MeterValuesRequest {
5611 #[must_use]
5613 pub fn new(evse_id: i32, meter_value: Vec<MeterValue>) -> Self {
5614 Self {
5615 evse_id,
5616 meter_value,
5617 custom_data: None,
5618 }
5619 }
5620
5621 #[must_use]
5623 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5624 self.custom_data = Some(value);
5625 self
5626 }
5627}
5628
5629impl Validate for MeterValuesRequest {
5630 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5631 path.push_key("evseId");
5632 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
5633 path.pop();
5634 path.push_key("meterValue");
5635 validate::list_len(self.meter_value.len(), Some(1), None, path, out);
5636 for (index, item) in self.meter_value.iter().enumerate() {
5637 path.push_index(index);
5638 Validate::validate_at(item, path, out);
5639 path.pop();
5640 }
5641 path.pop();
5642 path.push_key("customData");
5643 if let Some(value) = &self.custom_data {
5644 Validate::validate_at(value, path, out);
5645 }
5646 path.pop();
5647 }
5648}
5649
5650impl Sealed for MeterValuesRequest {}
5651impl Request for MeterValuesRequest {
5652 type Action = Action;
5653 const ACTION: Action = Action::MeterValues;
5654 const KIND: MessageKind = MessageKind::Call;
5655 const ORIGIN: Origin = Origin::ChargingStation;
5656 type Response = MeterValuesResponse;
5657}
5658
5659impl Confirmed for MeterValuesRequest {}
5660
5661#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5663pub struct MeterValuesResponse {
5664 #[serde(rename = "customData")]
5666 #[serde(default, skip_serializing_if = "Option::is_none")]
5667 pub custom_data: Option<crate::types::CustomData>,
5668}
5669
5670impl MeterValuesResponse {
5671 #[must_use]
5673 pub fn new() -> Self {
5674 Self::default()
5675 }
5676
5677 #[must_use]
5679 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5680 self.custom_data = Some(value);
5681 self
5682 }
5683}
5684
5685impl Validate for MeterValuesResponse {
5686 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5687 path.push_key("customData");
5688 if let Some(value) = &self.custom_data {
5689 Validate::validate_at(value, path, out);
5690 }
5691 path.pop();
5692 }
5693}
5694
5695impl Sealed for MeterValuesResponse {}
5696impl Response for MeterValuesResponse {}
5697
5698#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5700pub struct NotifyAllowedEnergyTransferRequest {
5701 #[serde(rename = "transactionId")]
5703 pub transaction_id: String,
5704 #[serde(rename = "allowedEnergyTransfer")]
5706 pub allowed_energy_transfer: Vec<EnergyTransferMode>,
5707 #[serde(rename = "customData")]
5709 #[serde(default, skip_serializing_if = "Option::is_none")]
5710 pub custom_data: Option<crate::types::CustomData>,
5711}
5712
5713impl NotifyAllowedEnergyTransferRequest {
5714 #[must_use]
5716 pub fn new(
5717 transaction_id: impl Into<String>,
5718 allowed_energy_transfer: Vec<EnergyTransferMode>,
5719 ) -> Self {
5720 Self {
5721 transaction_id: transaction_id.into(),
5722 allowed_energy_transfer,
5723 custom_data: None,
5724 }
5725 }
5726
5727 #[must_use]
5729 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5730 self.custom_data = Some(value);
5731 self
5732 }
5733}
5734
5735impl Validate for NotifyAllowedEnergyTransferRequest {
5736 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5737 path.push_key("transactionId");
5738 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
5739 path.pop();
5740 path.push_key("allowedEnergyTransfer");
5741 validate::list_len(self.allowed_energy_transfer.len(), Some(1), None, path, out);
5742 for (index, item) in self.allowed_energy_transfer.iter().enumerate() {
5743 path.push_index(index);
5744 Validate::validate_at(item, path, out);
5745 path.pop();
5746 }
5747 path.pop();
5748 path.push_key("customData");
5749 if let Some(value) = &self.custom_data {
5750 Validate::validate_at(value, path, out);
5751 }
5752 path.pop();
5753 }
5754}
5755
5756impl Sealed for NotifyAllowedEnergyTransferRequest {}
5757impl Request for NotifyAllowedEnergyTransferRequest {
5758 type Action = Action;
5759 const ACTION: Action = Action::NotifyAllowedEnergyTransfer;
5760 const KIND: MessageKind = MessageKind::Call;
5761 const ORIGIN: Origin = Origin::Csms;
5762 type Response = NotifyAllowedEnergyTransferResponse;
5763}
5764
5765impl Confirmed for NotifyAllowedEnergyTransferRequest {}
5766
5767#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5769pub struct NotifyAllowedEnergyTransferResponse {
5770 pub status: NotifyAllowedEnergyTransferStatus,
5772 #[serde(rename = "statusInfo")]
5774 #[serde(default, skip_serializing_if = "Option::is_none")]
5775 pub status_info: Option<StatusInfo>,
5776 #[serde(rename = "customData")]
5778 #[serde(default, skip_serializing_if = "Option::is_none")]
5779 pub custom_data: Option<crate::types::CustomData>,
5780}
5781
5782impl NotifyAllowedEnergyTransferResponse {
5783 #[must_use]
5785 pub fn new(status: NotifyAllowedEnergyTransferStatus) -> Self {
5786 Self {
5787 status,
5788 status_info: None,
5789 custom_data: None,
5790 }
5791 }
5792
5793 #[must_use]
5795 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
5796 self.status_info = Some(value);
5797 self
5798 }
5799
5800 #[must_use]
5802 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5803 self.custom_data = Some(value);
5804 self
5805 }
5806}
5807
5808impl Validate for NotifyAllowedEnergyTransferResponse {
5809 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5810 path.push_key("status");
5811 Validate::validate_at(&self.status, path, out);
5812 path.pop();
5813 path.push_key("statusInfo");
5814 if let Some(value) = &self.status_info {
5815 Validate::validate_at(value, path, out);
5816 }
5817 path.pop();
5818 path.push_key("customData");
5819 if let Some(value) = &self.custom_data {
5820 Validate::validate_at(value, path, out);
5821 }
5822 path.pop();
5823 }
5824}
5825
5826impl Sealed for NotifyAllowedEnergyTransferResponse {}
5827impl Response for NotifyAllowedEnergyTransferResponse {}
5828
5829#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5831pub struct NotifyChargingLimitRequest {
5832 #[serde(rename = "chargingLimit")]
5834 pub charging_limit: ChargingLimit,
5835 #[serde(rename = "chargingSchedule")]
5837 #[serde(default, skip_serializing_if = "Option::is_none")]
5838 pub charging_schedule: Option<Vec<ChargingSchedule>>,
5839 #[serde(rename = "evseId")]
5841 #[serde(default, skip_serializing_if = "Option::is_none")]
5842 #[serde(deserialize_with = "crate::types::integer::option")]
5843 pub evse_id: Option<i32>,
5844 #[serde(rename = "customData")]
5846 #[serde(default, skip_serializing_if = "Option::is_none")]
5847 pub custom_data: Option<crate::types::CustomData>,
5848}
5849
5850impl NotifyChargingLimitRequest {
5851 #[must_use]
5853 pub fn new(charging_limit: ChargingLimit) -> Self {
5854 Self {
5855 charging_limit,
5856 charging_schedule: None,
5857 evse_id: None,
5858 custom_data: None,
5859 }
5860 }
5861
5862 #[must_use]
5864 pub fn with_charging_schedule(mut self, value: Vec<ChargingSchedule>) -> Self {
5865 self.charging_schedule = Some(value);
5866 self
5867 }
5868
5869 #[must_use]
5871 pub fn with_evse_id(mut self, value: i32) -> Self {
5872 self.evse_id = Some(value);
5873 self
5874 }
5875
5876 #[must_use]
5878 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5879 self.custom_data = Some(value);
5880 self
5881 }
5882}
5883
5884impl Validate for NotifyChargingLimitRequest {
5885 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5886 path.push_key("chargingLimit");
5887 Validate::validate_at(&self.charging_limit, path, out);
5888 path.pop();
5889 path.push_key("chargingSchedule");
5890 if let Some(value) = &self.charging_schedule {
5891 validate::list_len(value.len(), Some(1), None, path, out);
5892 for (index, item) in value.iter().enumerate() {
5893 path.push_index(index);
5894 Validate::validate_at(item, path, out);
5895 path.pop();
5896 }
5897 }
5898 path.pop();
5899 path.push_key("evseId");
5900 if let Some(value) = &self.evse_id {
5901 validate::int_range(i64::from(*value), Some(0), None, path, out);
5902 }
5903 path.pop();
5904 path.push_key("customData");
5905 if let Some(value) = &self.custom_data {
5906 Validate::validate_at(value, path, out);
5907 }
5908 path.pop();
5909 }
5910}
5911
5912impl Sealed for NotifyChargingLimitRequest {}
5913impl Request for NotifyChargingLimitRequest {
5914 type Action = Action;
5915 const ACTION: Action = Action::NotifyChargingLimit;
5916 const KIND: MessageKind = MessageKind::Call;
5917 const ORIGIN: Origin = Origin::ChargingStation;
5918 type Response = NotifyChargingLimitResponse;
5919}
5920
5921impl Confirmed for NotifyChargingLimitRequest {}
5922
5923#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
5925pub struct NotifyChargingLimitResponse {
5926 #[serde(rename = "customData")]
5928 #[serde(default, skip_serializing_if = "Option::is_none")]
5929 pub custom_data: Option<crate::types::CustomData>,
5930}
5931
5932impl NotifyChargingLimitResponse {
5933 #[must_use]
5935 pub fn new() -> Self {
5936 Self::default()
5937 }
5938
5939 #[must_use]
5941 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5942 self.custom_data = Some(value);
5943 self
5944 }
5945}
5946
5947impl Validate for NotifyChargingLimitResponse {
5948 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5949 path.push_key("customData");
5950 if let Some(value) = &self.custom_data {
5951 Validate::validate_at(value, path, out);
5952 }
5953 path.pop();
5954 }
5955}
5956
5957impl Sealed for NotifyChargingLimitResponse {}
5958impl Response for NotifyChargingLimitResponse {}
5959
5960#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5962pub struct NotifyCustomerInformationRequest {
5963 pub data: String,
5965 #[serde(rename = "seqNo")]
5967 #[serde(deserialize_with = "crate::types::integer::one")]
5968 pub seq_no: i32,
5969 #[serde(rename = "generatedAt")]
5971 pub generated_at: crate::types::DateTime,
5972 #[serde(rename = "requestId")]
5974 #[serde(deserialize_with = "crate::types::integer::one")]
5975 pub request_id: i32,
5976 #[serde(default, skip_serializing_if = "Option::is_none")]
5979 pub tbc: Option<bool>,
5980 #[serde(rename = "customData")]
5982 #[serde(default, skip_serializing_if = "Option::is_none")]
5983 pub custom_data: Option<crate::types::CustomData>,
5984}
5985
5986impl NotifyCustomerInformationRequest {
5987 #[must_use]
5989 pub fn new(
5990 data: impl Into<String>,
5991 seq_no: i32,
5992 generated_at: impl Into<crate::types::DateTime>,
5993 request_id: i32,
5994 ) -> Self {
5995 Self {
5996 data: data.into(),
5997 seq_no,
5998 generated_at: generated_at.into(),
5999 request_id,
6000 tbc: None,
6001 custom_data: None,
6002 }
6003 }
6004
6005 #[must_use]
6007 pub fn with_tbc(mut self, value: bool) -> Self {
6008 self.tbc = Some(value);
6009 self
6010 }
6011
6012 #[must_use]
6014 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6015 self.custom_data = Some(value);
6016 self
6017 }
6018}
6019
6020impl Validate for NotifyCustomerInformationRequest {
6021 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6022 path.push_key("data");
6023 validate::string(self.data.as_str(), None, Some(512), path, out);
6024 path.pop();
6025 path.push_key("seqNo");
6026 validate::int_range(i64::from(self.seq_no), Some(0), None, path, out);
6027 path.pop();
6028 path.push_key("requestId");
6029 validate::int_range(i64::from(self.request_id), Some(0), None, path, out);
6030 path.pop();
6031 path.push_key("customData");
6032 if let Some(value) = &self.custom_data {
6033 Validate::validate_at(value, path, out);
6034 }
6035 path.pop();
6036 }
6037}
6038
6039impl Sealed for NotifyCustomerInformationRequest {}
6040impl Request for NotifyCustomerInformationRequest {
6041 type Action = Action;
6042 const ACTION: Action = Action::NotifyCustomerInformation;
6043 const KIND: MessageKind = MessageKind::Call;
6044 const ORIGIN: Origin = Origin::ChargingStation;
6045 type Response = NotifyCustomerInformationResponse;
6046}
6047
6048impl Confirmed for NotifyCustomerInformationRequest {}
6049
6050#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
6052pub struct NotifyCustomerInformationResponse {
6053 #[serde(rename = "customData")]
6055 #[serde(default, skip_serializing_if = "Option::is_none")]
6056 pub custom_data: Option<crate::types::CustomData>,
6057}
6058
6059impl NotifyCustomerInformationResponse {
6060 #[must_use]
6062 pub fn new() -> Self {
6063 Self::default()
6064 }
6065
6066 #[must_use]
6068 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6069 self.custom_data = Some(value);
6070 self
6071 }
6072}
6073
6074impl Validate for NotifyCustomerInformationResponse {
6075 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6076 path.push_key("customData");
6077 if let Some(value) = &self.custom_data {
6078 Validate::validate_at(value, path, out);
6079 }
6080 path.pop();
6081 }
6082}
6083
6084impl Sealed for NotifyCustomerInformationResponse {}
6085impl Response for NotifyCustomerInformationResponse {}
6086
6087#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6089pub struct NotifyDERAlarmRequest {
6090 #[serde(rename = "controlType")]
6092 pub control_type: DERControl,
6093 pub timestamp: crate::types::DateTime,
6095 #[serde(rename = "gridEventFault")]
6097 #[serde(default, skip_serializing_if = "Option::is_none")]
6098 pub grid_event_fault: Option<GridEventFault>,
6099 #[serde(rename = "alarmEnded")]
6102 #[serde(default, skip_serializing_if = "Option::is_none")]
6103 pub alarm_ended: Option<bool>,
6104 #[serde(rename = "extraInfo")]
6106 #[serde(default, skip_serializing_if = "Option::is_none")]
6107 pub extra_info: Option<String>,
6108 #[serde(rename = "customData")]
6110 #[serde(default, skip_serializing_if = "Option::is_none")]
6111 pub custom_data: Option<crate::types::CustomData>,
6112}
6113
6114impl NotifyDERAlarmRequest {
6115 #[must_use]
6117 pub fn new(control_type: DERControl, timestamp: impl Into<crate::types::DateTime>) -> Self {
6118 Self {
6119 control_type,
6120 timestamp: timestamp.into(),
6121 grid_event_fault: None,
6122 alarm_ended: None,
6123 extra_info: None,
6124 custom_data: None,
6125 }
6126 }
6127
6128 #[must_use]
6130 pub fn with_grid_event_fault(mut self, value: GridEventFault) -> Self {
6131 self.grid_event_fault = Some(value);
6132 self
6133 }
6134
6135 #[must_use]
6137 pub fn with_alarm_ended(mut self, value: bool) -> Self {
6138 self.alarm_ended = Some(value);
6139 self
6140 }
6141
6142 #[must_use]
6144 pub fn with_extra_info(mut self, value: impl Into<String>) -> Self {
6145 self.extra_info = Some(value.into());
6146 self
6147 }
6148
6149 #[must_use]
6151 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6152 self.custom_data = Some(value);
6153 self
6154 }
6155}
6156
6157impl Validate for NotifyDERAlarmRequest {
6158 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6159 path.push_key("controlType");
6160 Validate::validate_at(&self.control_type, path, out);
6161 path.pop();
6162 path.push_key("gridEventFault");
6163 if let Some(value) = &self.grid_event_fault {
6164 Validate::validate_at(value, path, out);
6165 }
6166 path.pop();
6167 path.push_key("extraInfo");
6168 if let Some(value) = &self.extra_info {
6169 validate::string(value.as_str(), None, Some(200), path, out);
6170 }
6171 path.pop();
6172 path.push_key("customData");
6173 if let Some(value) = &self.custom_data {
6174 Validate::validate_at(value, path, out);
6175 }
6176 path.pop();
6177 }
6178}
6179
6180impl Sealed for NotifyDERAlarmRequest {}
6181impl Request for NotifyDERAlarmRequest {
6182 type Action = Action;
6183 const ACTION: Action = Action::NotifyDERAlarm;
6184 const KIND: MessageKind = MessageKind::Call;
6185 const ORIGIN: Origin = Origin::ChargingStation;
6186 type Response = NotifyDERAlarmResponse;
6187}
6188
6189impl Confirmed for NotifyDERAlarmRequest {}
6190
6191#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
6193pub struct NotifyDERAlarmResponse {
6194 #[serde(rename = "customData")]
6196 #[serde(default, skip_serializing_if = "Option::is_none")]
6197 pub custom_data: Option<crate::types::CustomData>,
6198}
6199
6200impl NotifyDERAlarmResponse {
6201 #[must_use]
6203 pub fn new() -> Self {
6204 Self::default()
6205 }
6206
6207 #[must_use]
6209 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6210 self.custom_data = Some(value);
6211 self
6212 }
6213}
6214
6215impl Validate for NotifyDERAlarmResponse {
6216 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6217 path.push_key("customData");
6218 if let Some(value) = &self.custom_data {
6219 Validate::validate_at(value, path, out);
6220 }
6221 path.pop();
6222 }
6223}
6224
6225impl Sealed for NotifyDERAlarmResponse {}
6226impl Response for NotifyDERAlarmResponse {}
6227
6228#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6230pub struct NotifyDERStartStopRequest {
6231 #[serde(rename = "controlId")]
6234 pub control_id: String,
6235 pub started: bool,
6237 pub timestamp: crate::types::DateTime,
6239 #[serde(rename = "supersededIds")]
6241 #[serde(default, skip_serializing_if = "Option::is_none")]
6242 pub superseded_ids: Option<Vec<String>>,
6243 #[serde(rename = "customData")]
6245 #[serde(default, skip_serializing_if = "Option::is_none")]
6246 pub custom_data: Option<crate::types::CustomData>,
6247}
6248
6249impl NotifyDERStartStopRequest {
6250 #[must_use]
6252 pub fn new(
6253 control_id: impl Into<String>,
6254 started: bool,
6255 timestamp: impl Into<crate::types::DateTime>,
6256 ) -> Self {
6257 Self {
6258 control_id: control_id.into(),
6259 started,
6260 timestamp: timestamp.into(),
6261 superseded_ids: None,
6262 custom_data: None,
6263 }
6264 }
6265
6266 #[must_use]
6268 pub fn with_superseded_ids(
6269 mut self,
6270 value: impl IntoIterator<Item = impl Into<String>>,
6271 ) -> Self {
6272 self.superseded_ids = Some(value.into_iter().map(Into::into).collect());
6273 self
6274 }
6275
6276 #[must_use]
6278 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6279 self.custom_data = Some(value);
6280 self
6281 }
6282}
6283
6284impl Validate for NotifyDERStartStopRequest {
6285 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6286 path.push_key("controlId");
6287 validate::string(self.control_id.as_str(), None, Some(36), path, out);
6288 path.pop();
6289 path.push_key("supersededIds");
6290 if let Some(value) = &self.superseded_ids {
6291 validate::list_len(value.len(), Some(1), Some(24), path, out);
6292 for (index, item) in value.iter().enumerate() {
6293 path.push_index(index);
6294 validate::string(item.as_str(), None, Some(36), path, out);
6295 path.pop();
6296 }
6297 }
6298 path.pop();
6299 path.push_key("customData");
6300 if let Some(value) = &self.custom_data {
6301 Validate::validate_at(value, path, out);
6302 }
6303 path.pop();
6304 }
6305}
6306
6307impl Sealed for NotifyDERStartStopRequest {}
6308impl Request for NotifyDERStartStopRequest {
6309 type Action = Action;
6310 const ACTION: Action = Action::NotifyDERStartStop;
6311 const KIND: MessageKind = MessageKind::Call;
6312 const ORIGIN: Origin = Origin::ChargingStation;
6313 type Response = NotifyDERStartStopResponse;
6314}
6315
6316impl Confirmed for NotifyDERStartStopRequest {}
6317
6318#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
6320pub struct NotifyDERStartStopResponse {
6321 #[serde(rename = "customData")]
6323 #[serde(default, skip_serializing_if = "Option::is_none")]
6324 pub custom_data: Option<crate::types::CustomData>,
6325}
6326
6327impl NotifyDERStartStopResponse {
6328 #[must_use]
6330 pub fn new() -> Self {
6331 Self::default()
6332 }
6333
6334 #[must_use]
6336 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6337 self.custom_data = Some(value);
6338 self
6339 }
6340}
6341
6342impl Validate for NotifyDERStartStopResponse {
6343 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6344 path.push_key("customData");
6345 if let Some(value) = &self.custom_data {
6346 Validate::validate_at(value, path, out);
6347 }
6348 path.pop();
6349 }
6350}
6351
6352impl Sealed for NotifyDERStartStopResponse {}
6353impl Response for NotifyDERStartStopResponse {}
6354
6355#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6357pub struct NotifyDisplayMessagesRequest {
6358 #[serde(rename = "requestId")]
6360 #[serde(deserialize_with = "crate::types::integer::one")]
6361 pub request_id: i32,
6362 #[serde(rename = "messageInfo")]
6364 #[serde(default, skip_serializing_if = "Option::is_none")]
6365 pub message_info: Option<Vec<MessageInfo>>,
6366 #[serde(default, skip_serializing_if = "Option::is_none")]
6369 pub tbc: Option<bool>,
6370 #[serde(rename = "customData")]
6372 #[serde(default, skip_serializing_if = "Option::is_none")]
6373 pub custom_data: Option<crate::types::CustomData>,
6374}
6375
6376impl NotifyDisplayMessagesRequest {
6377 #[must_use]
6379 pub fn new(request_id: i32) -> Self {
6380 Self {
6381 request_id,
6382 message_info: None,
6383 tbc: None,
6384 custom_data: None,
6385 }
6386 }
6387
6388 #[must_use]
6390 pub fn with_message_info(mut self, value: Vec<MessageInfo>) -> Self {
6391 self.message_info = Some(value);
6392 self
6393 }
6394
6395 #[must_use]
6397 pub fn with_tbc(mut self, value: bool) -> Self {
6398 self.tbc = Some(value);
6399 self
6400 }
6401
6402 #[must_use]
6404 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6405 self.custom_data = Some(value);
6406 self
6407 }
6408}
6409
6410impl Validate for NotifyDisplayMessagesRequest {
6411 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6412 path.push_key("messageInfo");
6413 if let Some(value) = &self.message_info {
6414 validate::list_len(value.len(), Some(1), None, path, out);
6415 for (index, item) in value.iter().enumerate() {
6416 path.push_index(index);
6417 Validate::validate_at(item, path, out);
6418 path.pop();
6419 }
6420 }
6421 path.pop();
6422 path.push_key("customData");
6423 if let Some(value) = &self.custom_data {
6424 Validate::validate_at(value, path, out);
6425 }
6426 path.pop();
6427 }
6428}
6429
6430impl Sealed for NotifyDisplayMessagesRequest {}
6431impl Request for NotifyDisplayMessagesRequest {
6432 type Action = Action;
6433 const ACTION: Action = Action::NotifyDisplayMessages;
6434 const KIND: MessageKind = MessageKind::Call;
6435 const ORIGIN: Origin = Origin::ChargingStation;
6436 type Response = NotifyDisplayMessagesResponse;
6437}
6438
6439impl Confirmed for NotifyDisplayMessagesRequest {}
6440
6441#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
6443pub struct NotifyDisplayMessagesResponse {
6444 #[serde(rename = "customData")]
6446 #[serde(default, skip_serializing_if = "Option::is_none")]
6447 pub custom_data: Option<crate::types::CustomData>,
6448}
6449
6450impl NotifyDisplayMessagesResponse {
6451 #[must_use]
6453 pub fn new() -> Self {
6454 Self::default()
6455 }
6456
6457 #[must_use]
6459 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6460 self.custom_data = Some(value);
6461 self
6462 }
6463}
6464
6465impl Validate for NotifyDisplayMessagesResponse {
6466 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6467 path.push_key("customData");
6468 if let Some(value) = &self.custom_data {
6469 Validate::validate_at(value, path, out);
6470 }
6471 path.pop();
6472 }
6473}
6474
6475impl Sealed for NotifyDisplayMessagesResponse {}
6476impl Response for NotifyDisplayMessagesResponse {}
6477
6478#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6480pub struct NotifyEVChargingNeedsRequest {
6481 #[serde(rename = "evseId")]
6483 #[serde(deserialize_with = "crate::types::integer::one")]
6484 pub evse_id: i32,
6485 #[serde(rename = "chargingNeeds")]
6487 pub charging_needs: ChargingNeeds,
6488 #[serde(rename = "maxScheduleTuples")]
6492 #[serde(default, skip_serializing_if = "Option::is_none")]
6493 #[serde(deserialize_with = "crate::types::integer::option")]
6494 pub max_schedule_tuples: Option<i32>,
6495 #[serde(default, skip_serializing_if = "Option::is_none")]
6498 pub timestamp: Option<crate::types::DateTime>,
6499 #[serde(rename = "customData")]
6501 #[serde(default, skip_serializing_if = "Option::is_none")]
6502 pub custom_data: Option<crate::types::CustomData>,
6503}
6504
6505impl NotifyEVChargingNeedsRequest {
6506 #[must_use]
6508 pub fn new(evse_id: i32, charging_needs: ChargingNeeds) -> Self {
6509 Self {
6510 evse_id,
6511 charging_needs,
6512 max_schedule_tuples: None,
6513 timestamp: None,
6514 custom_data: None,
6515 }
6516 }
6517
6518 #[must_use]
6520 pub fn with_max_schedule_tuples(mut self, value: i32) -> Self {
6521 self.max_schedule_tuples = Some(value);
6522 self
6523 }
6524
6525 #[must_use]
6527 pub fn with_timestamp(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6528 self.timestamp = Some(value.into());
6529 self
6530 }
6531
6532 #[must_use]
6534 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6535 self.custom_data = Some(value);
6536 self
6537 }
6538}
6539
6540impl Validate for NotifyEVChargingNeedsRequest {
6541 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6542 path.push_key("evseId");
6543 validate::int_range(i64::from(self.evse_id), Some(1), None, path, out);
6544 path.pop();
6545 path.push_key("chargingNeeds");
6546 Validate::validate_at(&self.charging_needs, path, out);
6547 path.pop();
6548 path.push_key("maxScheduleTuples");
6549 if let Some(value) = &self.max_schedule_tuples {
6550 validate::int_range(i64::from(*value), Some(0), None, path, out);
6551 }
6552 path.pop();
6553 path.push_key("customData");
6554 if let Some(value) = &self.custom_data {
6555 Validate::validate_at(value, path, out);
6556 }
6557 path.pop();
6558 }
6559}
6560
6561impl Sealed for NotifyEVChargingNeedsRequest {}
6562impl Request for NotifyEVChargingNeedsRequest {
6563 type Action = Action;
6564 const ACTION: Action = Action::NotifyEVChargingNeeds;
6565 const KIND: MessageKind = MessageKind::Call;
6566 const ORIGIN: Origin = Origin::ChargingStation;
6567 type Response = NotifyEVChargingNeedsResponse;
6568}
6569
6570impl Confirmed for NotifyEVChargingNeedsRequest {}
6571
6572#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6574pub struct NotifyEVChargingNeedsResponse {
6575 pub status: NotifyEVChargingNeedsStatus,
6577 #[serde(rename = "statusInfo")]
6579 #[serde(default, skip_serializing_if = "Option::is_none")]
6580 pub status_info: Option<StatusInfo>,
6581 #[serde(rename = "customData")]
6583 #[serde(default, skip_serializing_if = "Option::is_none")]
6584 pub custom_data: Option<crate::types::CustomData>,
6585}
6586
6587impl NotifyEVChargingNeedsResponse {
6588 #[must_use]
6590 pub fn new(status: NotifyEVChargingNeedsStatus) -> Self {
6591 Self {
6592 status,
6593 status_info: None,
6594 custom_data: None,
6595 }
6596 }
6597
6598 #[must_use]
6600 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6601 self.status_info = Some(value);
6602 self
6603 }
6604
6605 #[must_use]
6607 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6608 self.custom_data = Some(value);
6609 self
6610 }
6611}
6612
6613impl Validate for NotifyEVChargingNeedsResponse {
6614 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6615 path.push_key("status");
6616 Validate::validate_at(&self.status, path, out);
6617 path.pop();
6618 path.push_key("statusInfo");
6619 if let Some(value) = &self.status_info {
6620 Validate::validate_at(value, path, out);
6621 }
6622 path.pop();
6623 path.push_key("customData");
6624 if let Some(value) = &self.custom_data {
6625 Validate::validate_at(value, path, out);
6626 }
6627 path.pop();
6628 }
6629}
6630
6631impl Sealed for NotifyEVChargingNeedsResponse {}
6632impl Response for NotifyEVChargingNeedsResponse {}
6633
6634#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6636pub struct NotifyEVChargingScheduleRequest {
6637 #[serde(rename = "timeBase")]
6639 pub time_base: crate::types::DateTime,
6640 #[serde(rename = "chargingSchedule")]
6642 pub charging_schedule: ChargingSchedule,
6643 #[serde(rename = "evseId")]
6645 #[serde(deserialize_with = "crate::types::integer::one")]
6646 pub evse_id: i32,
6647 #[serde(rename = "selectedChargingScheduleId")]
6649 #[serde(default, skip_serializing_if = "Option::is_none")]
6650 #[serde(deserialize_with = "crate::types::integer::option")]
6651 pub selected_charging_schedule_id: Option<i32>,
6652 #[serde(rename = "powerToleranceAcceptance")]
6655 #[serde(default, skip_serializing_if = "Option::is_none")]
6656 pub power_tolerance_acceptance: Option<bool>,
6657 #[serde(rename = "customData")]
6659 #[serde(default, skip_serializing_if = "Option::is_none")]
6660 pub custom_data: Option<crate::types::CustomData>,
6661}
6662
6663impl NotifyEVChargingScheduleRequest {
6664 #[must_use]
6666 pub fn new(
6667 time_base: impl Into<crate::types::DateTime>,
6668 charging_schedule: ChargingSchedule,
6669 evse_id: i32,
6670 ) -> Self {
6671 Self {
6672 time_base: time_base.into(),
6673 charging_schedule,
6674 evse_id,
6675 selected_charging_schedule_id: None,
6676 power_tolerance_acceptance: None,
6677 custom_data: None,
6678 }
6679 }
6680
6681 #[must_use]
6683 pub fn with_selected_charging_schedule_id(mut self, value: i32) -> Self {
6684 self.selected_charging_schedule_id = Some(value);
6685 self
6686 }
6687
6688 #[must_use]
6690 pub fn with_power_tolerance_acceptance(mut self, value: bool) -> Self {
6691 self.power_tolerance_acceptance = Some(value);
6692 self
6693 }
6694
6695 #[must_use]
6697 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6698 self.custom_data = Some(value);
6699 self
6700 }
6701}
6702
6703impl Validate for NotifyEVChargingScheduleRequest {
6704 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6705 path.push_key("chargingSchedule");
6706 Validate::validate_at(&self.charging_schedule, path, out);
6707 path.pop();
6708 path.push_key("evseId");
6709 validate::int_range(i64::from(self.evse_id), Some(1), None, path, out);
6710 path.pop();
6711 path.push_key("selectedChargingScheduleId");
6712 if let Some(value) = &self.selected_charging_schedule_id {
6713 validate::int_range(i64::from(*value), Some(0), None, path, out);
6714 }
6715 path.pop();
6716 path.push_key("customData");
6717 if let Some(value) = &self.custom_data {
6718 Validate::validate_at(value, path, out);
6719 }
6720 path.pop();
6721 }
6722}
6723
6724impl Sealed for NotifyEVChargingScheduleRequest {}
6725impl Request for NotifyEVChargingScheduleRequest {
6726 type Action = Action;
6727 const ACTION: Action = Action::NotifyEVChargingSchedule;
6728 const KIND: MessageKind = MessageKind::Call;
6729 const ORIGIN: Origin = Origin::ChargingStation;
6730 type Response = NotifyEVChargingScheduleResponse;
6731}
6732
6733impl Confirmed for NotifyEVChargingScheduleRequest {}
6734
6735#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6737pub struct NotifyEVChargingScheduleResponse {
6738 pub status: GenericStatus,
6740 #[serde(rename = "statusInfo")]
6742 #[serde(default, skip_serializing_if = "Option::is_none")]
6743 pub status_info: Option<StatusInfo>,
6744 #[serde(rename = "customData")]
6746 #[serde(default, skip_serializing_if = "Option::is_none")]
6747 pub custom_data: Option<crate::types::CustomData>,
6748}
6749
6750impl NotifyEVChargingScheduleResponse {
6751 #[must_use]
6753 pub fn new(status: GenericStatus) -> Self {
6754 Self {
6755 status,
6756 status_info: None,
6757 custom_data: None,
6758 }
6759 }
6760
6761 #[must_use]
6763 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
6764 self.status_info = Some(value);
6765 self
6766 }
6767
6768 #[must_use]
6770 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6771 self.custom_data = Some(value);
6772 self
6773 }
6774}
6775
6776impl Validate for NotifyEVChargingScheduleResponse {
6777 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6778 path.push_key("status");
6779 Validate::validate_at(&self.status, path, out);
6780 path.pop();
6781 path.push_key("statusInfo");
6782 if let Some(value) = &self.status_info {
6783 Validate::validate_at(value, path, out);
6784 }
6785 path.pop();
6786 path.push_key("customData");
6787 if let Some(value) = &self.custom_data {
6788 Validate::validate_at(value, path, out);
6789 }
6790 path.pop();
6791 }
6792}
6793
6794impl Sealed for NotifyEVChargingScheduleResponse {}
6795impl Response for NotifyEVChargingScheduleResponse {}
6796
6797#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6799pub struct NotifyEventRequest {
6800 #[serde(rename = "generatedAt")]
6802 pub generated_at: crate::types::DateTime,
6803 #[serde(rename = "seqNo")]
6805 #[serde(deserialize_with = "crate::types::integer::one")]
6806 pub seq_no: i32,
6807 #[serde(rename = "eventData")]
6809 pub event_data: Vec<EventData>,
6810 #[serde(default, skip_serializing_if = "Option::is_none")]
6813 pub tbc: Option<bool>,
6814 #[serde(rename = "customData")]
6816 #[serde(default, skip_serializing_if = "Option::is_none")]
6817 pub custom_data: Option<crate::types::CustomData>,
6818}
6819
6820impl NotifyEventRequest {
6821 #[must_use]
6823 pub fn new(
6824 generated_at: impl Into<crate::types::DateTime>,
6825 seq_no: i32,
6826 event_data: Vec<EventData>,
6827 ) -> Self {
6828 Self {
6829 generated_at: generated_at.into(),
6830 seq_no,
6831 event_data,
6832 tbc: None,
6833 custom_data: None,
6834 }
6835 }
6836
6837 #[must_use]
6839 pub fn with_tbc(mut self, value: bool) -> Self {
6840 self.tbc = Some(value);
6841 self
6842 }
6843
6844 #[must_use]
6846 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6847 self.custom_data = Some(value);
6848 self
6849 }
6850}
6851
6852impl Validate for NotifyEventRequest {
6853 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6854 path.push_key("seqNo");
6855 validate::int_range(i64::from(self.seq_no), Some(0), None, path, out);
6856 path.pop();
6857 path.push_key("eventData");
6858 validate::list_len(self.event_data.len(), Some(1), None, path, out);
6859 for (index, item) in self.event_data.iter().enumerate() {
6860 path.push_index(index);
6861 Validate::validate_at(item, path, out);
6862 path.pop();
6863 }
6864 path.pop();
6865 path.push_key("customData");
6866 if let Some(value) = &self.custom_data {
6867 Validate::validate_at(value, path, out);
6868 }
6869 path.pop();
6870 }
6871}
6872
6873impl Sealed for NotifyEventRequest {}
6874impl Request for NotifyEventRequest {
6875 type Action = Action;
6876 const ACTION: Action = Action::NotifyEvent;
6877 const KIND: MessageKind = MessageKind::Call;
6878 const ORIGIN: Origin = Origin::ChargingStation;
6879 type Response = NotifyEventResponse;
6880}
6881
6882impl Confirmed for NotifyEventRequest {}
6883
6884#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
6886pub struct NotifyEventResponse {
6887 #[serde(rename = "customData")]
6889 #[serde(default, skip_serializing_if = "Option::is_none")]
6890 pub custom_data: Option<crate::types::CustomData>,
6891}
6892
6893impl NotifyEventResponse {
6894 #[must_use]
6896 pub fn new() -> Self {
6897 Self::default()
6898 }
6899
6900 #[must_use]
6902 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6903 self.custom_data = Some(value);
6904 self
6905 }
6906}
6907
6908impl Validate for NotifyEventResponse {
6909 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6910 path.push_key("customData");
6911 if let Some(value) = &self.custom_data {
6912 Validate::validate_at(value, path, out);
6913 }
6914 path.pop();
6915 }
6916}
6917
6918impl Sealed for NotifyEventResponse {}
6919impl Response for NotifyEventResponse {}
6920
6921#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6923pub struct NotifyMonitoringReportRequest {
6924 #[serde(rename = "requestId")]
6926 #[serde(deserialize_with = "crate::types::integer::one")]
6927 pub request_id: i32,
6928 #[serde(rename = "seqNo")]
6930 #[serde(deserialize_with = "crate::types::integer::one")]
6931 pub seq_no: i32,
6932 #[serde(rename = "generatedAt")]
6934 pub generated_at: crate::types::DateTime,
6935 #[serde(default, skip_serializing_if = "Option::is_none")]
6937 pub monitor: Option<Vec<MonitoringData>>,
6938 #[serde(default, skip_serializing_if = "Option::is_none")]
6941 pub tbc: Option<bool>,
6942 #[serde(rename = "customData")]
6944 #[serde(default, skip_serializing_if = "Option::is_none")]
6945 pub custom_data: Option<crate::types::CustomData>,
6946}
6947
6948impl NotifyMonitoringReportRequest {
6949 #[must_use]
6951 pub fn new(
6952 request_id: i32,
6953 seq_no: i32,
6954 generated_at: impl Into<crate::types::DateTime>,
6955 ) -> Self {
6956 Self {
6957 request_id,
6958 seq_no,
6959 generated_at: generated_at.into(),
6960 monitor: None,
6961 tbc: None,
6962 custom_data: None,
6963 }
6964 }
6965
6966 #[must_use]
6968 pub fn with_monitor(mut self, value: Vec<MonitoringData>) -> Self {
6969 self.monitor = Some(value);
6970 self
6971 }
6972
6973 #[must_use]
6975 pub fn with_tbc(mut self, value: bool) -> Self {
6976 self.tbc = Some(value);
6977 self
6978 }
6979
6980 #[must_use]
6982 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6983 self.custom_data = Some(value);
6984 self
6985 }
6986}
6987
6988impl Validate for NotifyMonitoringReportRequest {
6989 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6990 path.push_key("seqNo");
6991 validate::int_range(i64::from(self.seq_no), Some(0), None, path, out);
6992 path.pop();
6993 path.push_key("monitor");
6994 if let Some(value) = &self.monitor {
6995 validate::list_len(value.len(), Some(1), None, path, out);
6996 for (index, item) in value.iter().enumerate() {
6997 path.push_index(index);
6998 Validate::validate_at(item, path, out);
6999 path.pop();
7000 }
7001 }
7002 path.pop();
7003 path.push_key("customData");
7004 if let Some(value) = &self.custom_data {
7005 Validate::validate_at(value, path, out);
7006 }
7007 path.pop();
7008 }
7009}
7010
7011impl Sealed for NotifyMonitoringReportRequest {}
7012impl Request for NotifyMonitoringReportRequest {
7013 type Action = Action;
7014 const ACTION: Action = Action::NotifyMonitoringReport;
7015 const KIND: MessageKind = MessageKind::Call;
7016 const ORIGIN: Origin = Origin::ChargingStation;
7017 type Response = NotifyMonitoringReportResponse;
7018}
7019
7020impl Confirmed for NotifyMonitoringReportRequest {}
7021
7022#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7024pub struct NotifyMonitoringReportResponse {
7025 #[serde(rename = "customData")]
7027 #[serde(default, skip_serializing_if = "Option::is_none")]
7028 pub custom_data: Option<crate::types::CustomData>,
7029}
7030
7031impl NotifyMonitoringReportResponse {
7032 #[must_use]
7034 pub fn new() -> Self {
7035 Self::default()
7036 }
7037
7038 #[must_use]
7040 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7041 self.custom_data = Some(value);
7042 self
7043 }
7044}
7045
7046impl Validate for NotifyMonitoringReportResponse {
7047 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7048 path.push_key("customData");
7049 if let Some(value) = &self.custom_data {
7050 Validate::validate_at(value, path, out);
7051 }
7052 path.pop();
7053 }
7054}
7055
7056impl Sealed for NotifyMonitoringReportResponse {}
7057impl Response for NotifyMonitoringReportResponse {}
7058
7059#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7061pub struct NotifyPeriodicEventStreamRequest {
7062 pub data: Vec<StreamDataElement>,
7064 #[serde(deserialize_with = "crate::types::integer::one")]
7066 pub id: i32,
7067 #[serde(deserialize_with = "crate::types::integer::one")]
7069 pub pending: i32,
7070 pub basetime: crate::types::DateTime,
7072 #[serde(rename = "customData")]
7074 #[serde(default, skip_serializing_if = "Option::is_none")]
7075 pub custom_data: Option<crate::types::CustomData>,
7076}
7077
7078impl NotifyPeriodicEventStreamRequest {
7079 #[must_use]
7081 pub fn new(
7082 data: Vec<StreamDataElement>,
7083 id: i32,
7084 pending: i32,
7085 basetime: impl Into<crate::types::DateTime>,
7086 ) -> Self {
7087 Self {
7088 data,
7089 id,
7090 pending,
7091 basetime: basetime.into(),
7092 custom_data: None,
7093 }
7094 }
7095
7096 #[must_use]
7098 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7099 self.custom_data = Some(value);
7100 self
7101 }
7102}
7103
7104impl Validate for NotifyPeriodicEventStreamRequest {
7105 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7106 path.push_key("data");
7107 validate::list_len(self.data.len(), Some(1), None, path, out);
7108 for (index, item) in self.data.iter().enumerate() {
7109 path.push_index(index);
7110 Validate::validate_at(item, path, out);
7111 path.pop();
7112 }
7113 path.pop();
7114 path.push_key("id");
7115 validate::int_range(i64::from(self.id), Some(0), None, path, out);
7116 path.pop();
7117 path.push_key("pending");
7118 validate::int_range(i64::from(self.pending), Some(0), None, path, out);
7119 path.pop();
7120 path.push_key("customData");
7121 if let Some(value) = &self.custom_data {
7122 Validate::validate_at(value, path, out);
7123 }
7124 path.pop();
7125 }
7126}
7127
7128impl Sealed for NotifyPeriodicEventStreamRequest {}
7129impl Request for NotifyPeriodicEventStreamRequest {
7130 type Action = Action;
7131 const ACTION: Action = Action::NotifyPeriodicEventStream;
7132 const KIND: MessageKind = MessageKind::Send;
7133 const ORIGIN: Origin = Origin::ChargingStation;
7134 type Response = crate::message::NoResponse;
7135}
7136
7137impl Unconfirmed for NotifyPeriodicEventStreamRequest {}
7138
7139#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7141pub struct NotifyPriorityChargingRequest {
7142 #[serde(rename = "transactionId")]
7144 pub transaction_id: String,
7145 pub activated: bool,
7147 #[serde(rename = "customData")]
7149 #[serde(default, skip_serializing_if = "Option::is_none")]
7150 pub custom_data: Option<crate::types::CustomData>,
7151}
7152
7153impl NotifyPriorityChargingRequest {
7154 #[must_use]
7156 pub fn new(transaction_id: impl Into<String>, activated: bool) -> Self {
7157 Self {
7158 transaction_id: transaction_id.into(),
7159 activated,
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 NotifyPriorityChargingRequest {
7173 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7174 path.push_key("transactionId");
7175 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
7176 path.pop();
7177 path.push_key("customData");
7178 if let Some(value) = &self.custom_data {
7179 Validate::validate_at(value, path, out);
7180 }
7181 path.pop();
7182 }
7183}
7184
7185impl Sealed for NotifyPriorityChargingRequest {}
7186impl Request for NotifyPriorityChargingRequest {
7187 type Action = Action;
7188 const ACTION: Action = Action::NotifyPriorityCharging;
7189 const KIND: MessageKind = MessageKind::Call;
7190 const ORIGIN: Origin = Origin::ChargingStation;
7191 type Response = NotifyPriorityChargingResponse;
7192}
7193
7194impl Confirmed for NotifyPriorityChargingRequest {}
7195
7196#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7200pub struct NotifyPriorityChargingResponse {
7201 #[serde(rename = "customData")]
7203 #[serde(default, skip_serializing_if = "Option::is_none")]
7204 pub custom_data: Option<crate::types::CustomData>,
7205}
7206
7207impl NotifyPriorityChargingResponse {
7208 #[must_use]
7210 pub fn new() -> Self {
7211 Self::default()
7212 }
7213
7214 #[must_use]
7216 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7217 self.custom_data = Some(value);
7218 self
7219 }
7220}
7221
7222impl Validate for NotifyPriorityChargingResponse {
7223 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7224 path.push_key("customData");
7225 if let Some(value) = &self.custom_data {
7226 Validate::validate_at(value, path, out);
7227 }
7228 path.pop();
7229 }
7230}
7231
7232impl Sealed for NotifyPriorityChargingResponse {}
7233impl Response for NotifyPriorityChargingResponse {}
7234
7235#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7237pub struct NotifyReportRequest {
7238 #[serde(rename = "requestId")]
7240 #[serde(deserialize_with = "crate::types::integer::one")]
7241 pub request_id: i32,
7242 #[serde(rename = "generatedAt")]
7244 pub generated_at: crate::types::DateTime,
7245 #[serde(rename = "seqNo")]
7247 #[serde(deserialize_with = "crate::types::integer::one")]
7248 pub seq_no: i32,
7249 #[serde(rename = "reportData")]
7251 #[serde(default, skip_serializing_if = "Option::is_none")]
7252 pub report_data: Option<Vec<ReportData>>,
7253 #[serde(default, skip_serializing_if = "Option::is_none")]
7256 pub tbc: Option<bool>,
7257 #[serde(rename = "customData")]
7259 #[serde(default, skip_serializing_if = "Option::is_none")]
7260 pub custom_data: Option<crate::types::CustomData>,
7261}
7262
7263impl NotifyReportRequest {
7264 #[must_use]
7266 pub fn new(
7267 request_id: i32,
7268 generated_at: impl Into<crate::types::DateTime>,
7269 seq_no: i32,
7270 ) -> Self {
7271 Self {
7272 request_id,
7273 generated_at: generated_at.into(),
7274 seq_no,
7275 report_data: None,
7276 tbc: None,
7277 custom_data: None,
7278 }
7279 }
7280
7281 #[must_use]
7283 pub fn with_report_data(mut self, value: Vec<ReportData>) -> Self {
7284 self.report_data = Some(value);
7285 self
7286 }
7287
7288 #[must_use]
7290 pub fn with_tbc(mut self, value: bool) -> Self {
7291 self.tbc = Some(value);
7292 self
7293 }
7294
7295 #[must_use]
7297 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7298 self.custom_data = Some(value);
7299 self
7300 }
7301}
7302
7303impl Validate for NotifyReportRequest {
7304 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7305 path.push_key("seqNo");
7306 validate::int_range(i64::from(self.seq_no), Some(0), None, path, out);
7307 path.pop();
7308 path.push_key("reportData");
7309 if let Some(value) = &self.report_data {
7310 validate::list_len(value.len(), Some(1), None, path, out);
7311 for (index, item) in value.iter().enumerate() {
7312 path.push_index(index);
7313 Validate::validate_at(item, path, out);
7314 path.pop();
7315 }
7316 }
7317 path.pop();
7318 path.push_key("customData");
7319 if let Some(value) = &self.custom_data {
7320 Validate::validate_at(value, path, out);
7321 }
7322 path.pop();
7323 }
7324}
7325
7326impl Sealed for NotifyReportRequest {}
7327impl Request for NotifyReportRequest {
7328 type Action = Action;
7329 const ACTION: Action = Action::NotifyReport;
7330 const KIND: MessageKind = MessageKind::Call;
7331 const ORIGIN: Origin = Origin::ChargingStation;
7332 type Response = NotifyReportResponse;
7333}
7334
7335impl Confirmed for NotifyReportRequest {}
7336
7337#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7339pub struct NotifyReportResponse {
7340 #[serde(rename = "customData")]
7342 #[serde(default, skip_serializing_if = "Option::is_none")]
7343 pub custom_data: Option<crate::types::CustomData>,
7344}
7345
7346impl NotifyReportResponse {
7347 #[must_use]
7349 pub fn new() -> Self {
7350 Self::default()
7351 }
7352
7353 #[must_use]
7355 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7356 self.custom_data = Some(value);
7357 self
7358 }
7359}
7360
7361impl Validate for NotifyReportResponse {
7362 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7363 path.push_key("customData");
7364 if let Some(value) = &self.custom_data {
7365 Validate::validate_at(value, path, out);
7366 }
7367 path.pop();
7368 }
7369}
7370
7371impl Sealed for NotifyReportResponse {}
7372impl Response for NotifyReportResponse {}
7373
7374#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7376pub struct NotifySettlementRequest {
7377 #[serde(rename = "pspRef")]
7379 pub psp_ref: String,
7380 pub status: PaymentStatus,
7382 #[serde(rename = "settlementAmount")]
7384 pub settlement_amount: crate::types::Decimal,
7385 #[serde(rename = "settlementTime")]
7387 pub settlement_time: crate::types::DateTime,
7388 #[serde(rename = "transactionId")]
7390 #[serde(default, skip_serializing_if = "Option::is_none")]
7391 pub transaction_id: Option<String>,
7392 #[serde(rename = "statusInfo")]
7394 #[serde(default, skip_serializing_if = "Option::is_none")]
7395 pub status_info: Option<String>,
7396 #[serde(rename = "receiptId")]
7398 #[serde(default, skip_serializing_if = "Option::is_none")]
7399 pub receipt_id: Option<String>,
7400 #[serde(rename = "receiptUrl")]
7402 #[serde(default, skip_serializing_if = "Option::is_none")]
7403 pub receipt_url: Option<String>,
7404 #[serde(rename = "vatCompany")]
7406 #[serde(default, skip_serializing_if = "Option::is_none")]
7407 pub vat_company: Option<Address>,
7408 #[serde(rename = "vatNumber")]
7410 #[serde(default, skip_serializing_if = "Option::is_none")]
7411 pub vat_number: Option<String>,
7412 #[serde(rename = "customData")]
7414 #[serde(default, skip_serializing_if = "Option::is_none")]
7415 pub custom_data: Option<crate::types::CustomData>,
7416}
7417
7418impl NotifySettlementRequest {
7419 #[must_use]
7421 pub fn new(
7422 psp_ref: impl Into<String>,
7423 status: PaymentStatus,
7424 settlement_amount: impl Into<crate::types::Decimal>,
7425 settlement_time: impl Into<crate::types::DateTime>,
7426 ) -> Self {
7427 Self {
7428 psp_ref: psp_ref.into(),
7429 status,
7430 settlement_amount: settlement_amount.into(),
7431 settlement_time: settlement_time.into(),
7432 transaction_id: None,
7433 status_info: None,
7434 receipt_id: None,
7435 receipt_url: None,
7436 vat_company: None,
7437 vat_number: None,
7438 custom_data: None,
7439 }
7440 }
7441
7442 #[must_use]
7444 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
7445 self.transaction_id = Some(value.into());
7446 self
7447 }
7448
7449 #[must_use]
7451 pub fn with_status_info(mut self, value: impl Into<String>) -> Self {
7452 self.status_info = Some(value.into());
7453 self
7454 }
7455
7456 #[must_use]
7458 pub fn with_receipt_id(mut self, value: impl Into<String>) -> Self {
7459 self.receipt_id = Some(value.into());
7460 self
7461 }
7462
7463 #[must_use]
7465 pub fn with_receipt_url(mut self, value: impl Into<String>) -> Self {
7466 self.receipt_url = Some(value.into());
7467 self
7468 }
7469
7470 #[must_use]
7472 pub fn with_vat_company(mut self, value: Address) -> Self {
7473 self.vat_company = Some(value);
7474 self
7475 }
7476
7477 #[must_use]
7479 pub fn with_vat_number(mut self, value: impl Into<String>) -> Self {
7480 self.vat_number = Some(value.into());
7481 self
7482 }
7483
7484 #[must_use]
7486 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7487 self.custom_data = Some(value);
7488 self
7489 }
7490}
7491
7492impl Validate for NotifySettlementRequest {
7493 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7494 path.push_key("pspRef");
7495 validate::string(self.psp_ref.as_str(), None, Some(255), path, out);
7496 path.pop();
7497 path.push_key("status");
7498 Validate::validate_at(&self.status, path, out);
7499 path.pop();
7500 path.push_key("transactionId");
7501 if let Some(value) = &self.transaction_id {
7502 validate::string(value.as_str(), None, Some(36), path, out);
7503 }
7504 path.pop();
7505 path.push_key("statusInfo");
7506 if let Some(value) = &self.status_info {
7507 validate::string(value.as_str(), None, Some(500), path, out);
7508 }
7509 path.pop();
7510 path.push_key("receiptId");
7511 if let Some(value) = &self.receipt_id {
7512 validate::string(value.as_str(), None, Some(50), path, out);
7513 }
7514 path.pop();
7515 path.push_key("receiptUrl");
7516 if let Some(value) = &self.receipt_url {
7517 validate::string(value.as_str(), None, Some(2000), path, out);
7518 }
7519 path.pop();
7520 path.push_key("vatCompany");
7521 if let Some(value) = &self.vat_company {
7522 Validate::validate_at(value, path, out);
7523 }
7524 path.pop();
7525 path.push_key("vatNumber");
7526 if let Some(value) = &self.vat_number {
7527 validate::string(value.as_str(), None, Some(20), path, out);
7528 }
7529 path.pop();
7530 path.push_key("customData");
7531 if let Some(value) = &self.custom_data {
7532 Validate::validate_at(value, path, out);
7533 }
7534 path.pop();
7535 }
7536}
7537
7538impl Sealed for NotifySettlementRequest {}
7539impl Request for NotifySettlementRequest {
7540 type Action = Action;
7541 const ACTION: Action = Action::NotifySettlement;
7542 const KIND: MessageKind = MessageKind::Call;
7543 const ORIGIN: Origin = Origin::ChargingStation;
7544 type Response = NotifySettlementResponse;
7545}
7546
7547impl Confirmed for NotifySettlementRequest {}
7548
7549#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7551pub struct NotifySettlementResponse {
7552 #[serde(rename = "receiptUrl")]
7554 #[serde(default, skip_serializing_if = "Option::is_none")]
7555 pub receipt_url: Option<String>,
7556 #[serde(rename = "receiptId")]
7558 #[serde(default, skip_serializing_if = "Option::is_none")]
7559 pub receipt_id: Option<String>,
7560 #[serde(rename = "customData")]
7562 #[serde(default, skip_serializing_if = "Option::is_none")]
7563 pub custom_data: Option<crate::types::CustomData>,
7564}
7565
7566impl NotifySettlementResponse {
7567 #[must_use]
7569 pub fn new() -> Self {
7570 Self::default()
7571 }
7572
7573 #[must_use]
7575 pub fn with_receipt_url(mut self, value: impl Into<String>) -> Self {
7576 self.receipt_url = Some(value.into());
7577 self
7578 }
7579
7580 #[must_use]
7582 pub fn with_receipt_id(mut self, value: impl Into<String>) -> Self {
7583 self.receipt_id = Some(value.into());
7584 self
7585 }
7586
7587 #[must_use]
7589 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7590 self.custom_data = Some(value);
7591 self
7592 }
7593}
7594
7595impl Validate for NotifySettlementResponse {
7596 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7597 path.push_key("receiptUrl");
7598 if let Some(value) = &self.receipt_url {
7599 validate::string(value.as_str(), None, Some(2000), path, out);
7600 }
7601 path.pop();
7602 path.push_key("receiptId");
7603 if let Some(value) = &self.receipt_id {
7604 validate::string(value.as_str(), None, Some(50), path, out);
7605 }
7606 path.pop();
7607 path.push_key("customData");
7608 if let Some(value) = &self.custom_data {
7609 Validate::validate_at(value, path, out);
7610 }
7611 path.pop();
7612 }
7613}
7614
7615impl Sealed for NotifySettlementResponse {}
7616impl Response for NotifySettlementResponse {}
7617
7618#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7620pub struct NotifyWebPaymentStartedRequest {
7621 #[serde(rename = "evseId")]
7623 #[serde(deserialize_with = "crate::types::integer::one")]
7624 pub evse_id: i32,
7625 #[serde(deserialize_with = "crate::types::integer::one")]
7627 pub timeout: i32,
7628 #[serde(rename = "customData")]
7630 #[serde(default, skip_serializing_if = "Option::is_none")]
7631 pub custom_data: Option<crate::types::CustomData>,
7632}
7633
7634impl NotifyWebPaymentStartedRequest {
7635 #[must_use]
7637 pub fn new(evse_id: i32, timeout: i32) -> Self {
7638 Self {
7639 evse_id,
7640 timeout,
7641 custom_data: None,
7642 }
7643 }
7644
7645 #[must_use]
7647 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7648 self.custom_data = Some(value);
7649 self
7650 }
7651}
7652
7653impl Validate for NotifyWebPaymentStartedRequest {
7654 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7655 path.push_key("evseId");
7656 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
7657 path.pop();
7658 path.push_key("customData");
7659 if let Some(value) = &self.custom_data {
7660 Validate::validate_at(value, path, out);
7661 }
7662 path.pop();
7663 }
7664}
7665
7666impl Sealed for NotifyWebPaymentStartedRequest {}
7667impl Request for NotifyWebPaymentStartedRequest {
7668 type Action = Action;
7669 const ACTION: Action = Action::NotifyWebPaymentStarted;
7670 const KIND: MessageKind = MessageKind::Call;
7671 const ORIGIN: Origin = Origin::Csms;
7672 type Response = NotifyWebPaymentStartedResponse;
7673}
7674
7675impl Confirmed for NotifyWebPaymentStartedRequest {}
7676
7677#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7679pub struct NotifyWebPaymentStartedResponse {
7680 #[serde(rename = "customData")]
7682 #[serde(default, skip_serializing_if = "Option::is_none")]
7683 pub custom_data: Option<crate::types::CustomData>,
7684}
7685
7686impl NotifyWebPaymentStartedResponse {
7687 #[must_use]
7689 pub fn new() -> Self {
7690 Self::default()
7691 }
7692
7693 #[must_use]
7695 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7696 self.custom_data = Some(value);
7697 self
7698 }
7699}
7700
7701impl Validate for NotifyWebPaymentStartedResponse {
7702 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7703 path.push_key("customData");
7704 if let Some(value) = &self.custom_data {
7705 Validate::validate_at(value, path, out);
7706 }
7707 path.pop();
7708 }
7709}
7710
7711impl Sealed for NotifyWebPaymentStartedResponse {}
7712impl Response for NotifyWebPaymentStartedResponse {}
7713
7714#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7716pub struct OpenPeriodicEventStreamRequest {
7717 #[serde(rename = "constantStreamData")]
7719 pub constant_stream_data: ConstantStreamData,
7720 #[serde(rename = "customData")]
7722 #[serde(default, skip_serializing_if = "Option::is_none")]
7723 pub custom_data: Option<crate::types::CustomData>,
7724}
7725
7726impl OpenPeriodicEventStreamRequest {
7727 #[must_use]
7729 pub fn new(constant_stream_data: ConstantStreamData) -> Self {
7730 Self {
7731 constant_stream_data,
7732 custom_data: None,
7733 }
7734 }
7735
7736 #[must_use]
7738 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7739 self.custom_data = Some(value);
7740 self
7741 }
7742}
7743
7744impl Validate for OpenPeriodicEventStreamRequest {
7745 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7746 path.push_key("constantStreamData");
7747 Validate::validate_at(&self.constant_stream_data, path, out);
7748 path.pop();
7749 path.push_key("customData");
7750 if let Some(value) = &self.custom_data {
7751 Validate::validate_at(value, path, out);
7752 }
7753 path.pop();
7754 }
7755}
7756
7757impl Sealed for OpenPeriodicEventStreamRequest {}
7758impl Request for OpenPeriodicEventStreamRequest {
7759 type Action = Action;
7760 const ACTION: Action = Action::OpenPeriodicEventStream;
7761 const KIND: MessageKind = MessageKind::Call;
7762 const ORIGIN: Origin = Origin::ChargingStation;
7763 type Response = OpenPeriodicEventStreamResponse;
7764}
7765
7766impl Confirmed for OpenPeriodicEventStreamRequest {}
7767
7768#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7770pub struct OpenPeriodicEventStreamResponse {
7771 pub status: GenericStatus,
7773 #[serde(rename = "statusInfo")]
7775 #[serde(default, skip_serializing_if = "Option::is_none")]
7776 pub status_info: Option<StatusInfo>,
7777 #[serde(rename = "customData")]
7779 #[serde(default, skip_serializing_if = "Option::is_none")]
7780 pub custom_data: Option<crate::types::CustomData>,
7781}
7782
7783impl OpenPeriodicEventStreamResponse {
7784 #[must_use]
7786 pub fn new(status: GenericStatus) -> Self {
7787 Self {
7788 status,
7789 status_info: None,
7790 custom_data: None,
7791 }
7792 }
7793
7794 #[must_use]
7796 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
7797 self.status_info = Some(value);
7798 self
7799 }
7800
7801 #[must_use]
7803 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7804 self.custom_data = Some(value);
7805 self
7806 }
7807}
7808
7809impl Validate for OpenPeriodicEventStreamResponse {
7810 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7811 path.push_key("status");
7812 Validate::validate_at(&self.status, path, out);
7813 path.pop();
7814 path.push_key("statusInfo");
7815 if let Some(value) = &self.status_info {
7816 Validate::validate_at(value, path, out);
7817 }
7818 path.pop();
7819 path.push_key("customData");
7820 if let Some(value) = &self.custom_data {
7821 Validate::validate_at(value, path, out);
7822 }
7823 path.pop();
7824 }
7825}
7826
7827impl Sealed for OpenPeriodicEventStreamResponse {}
7828impl Response for OpenPeriodicEventStreamResponse {}
7829
7830#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7832pub struct PublishFirmwareRequest {
7833 pub location: String,
7836 pub checksum: String,
7838 #[serde(rename = "requestId")]
7840 #[serde(deserialize_with = "crate::types::integer::one")]
7841 pub request_id: i32,
7842 #[serde(default, skip_serializing_if = "Option::is_none")]
7847 #[serde(deserialize_with = "crate::types::integer::option")]
7848 pub retries: Option<i32>,
7849 #[serde(rename = "retryInterval")]
7856 #[serde(default, skip_serializing_if = "Option::is_none")]
7857 #[serde(deserialize_with = "crate::types::integer::option")]
7858 pub retry_interval: Option<i32>,
7859 #[serde(rename = "customData")]
7861 #[serde(default, skip_serializing_if = "Option::is_none")]
7862 pub custom_data: Option<crate::types::CustomData>,
7863}
7864
7865impl PublishFirmwareRequest {
7866 #[must_use]
7868 pub fn new(location: impl Into<String>, checksum: impl Into<String>, request_id: i32) -> Self {
7869 Self {
7870 location: location.into(),
7871 checksum: checksum.into(),
7872 request_id,
7873 retries: None,
7874 retry_interval: None,
7875 custom_data: None,
7876 }
7877 }
7878
7879 #[must_use]
7881 pub fn with_retries(mut self, value: i32) -> Self {
7882 self.retries = Some(value);
7883 self
7884 }
7885
7886 #[must_use]
7888 pub fn with_retry_interval(mut self, value: i32) -> Self {
7889 self.retry_interval = Some(value);
7890 self
7891 }
7892
7893 #[must_use]
7895 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7896 self.custom_data = Some(value);
7897 self
7898 }
7899}
7900
7901impl Validate for PublishFirmwareRequest {
7902 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7903 path.push_key("location");
7904 validate::string(self.location.as_str(), None, Some(2000), path, out);
7905 path.pop();
7906 path.push_key("checksum");
7907 validate::string(self.checksum.as_str(), None, Some(32), path, out);
7908 path.pop();
7909 path.push_key("requestId");
7910 validate::int_range(i64::from(self.request_id), Some(0), None, path, out);
7911 path.pop();
7912 path.push_key("retries");
7913 if let Some(value) = &self.retries {
7914 validate::int_range(i64::from(*value), Some(0), None, path, out);
7915 }
7916 path.pop();
7917 path.push_key("retryInterval");
7918 if let Some(value) = &self.retry_interval {
7919 validate::int_range(i64::from(*value), Some(0), None, path, out);
7920 }
7921 path.pop();
7922 path.push_key("customData");
7923 if let Some(value) = &self.custom_data {
7924 Validate::validate_at(value, path, out);
7925 }
7926 path.pop();
7927 }
7928}
7929
7930impl Sealed for PublishFirmwareRequest {}
7931impl Request for PublishFirmwareRequest {
7932 type Action = Action;
7933 const ACTION: Action = Action::PublishFirmware;
7934 const KIND: MessageKind = MessageKind::Call;
7935 const ORIGIN: Origin = Origin::Csms;
7936 type Response = PublishFirmwareResponse;
7937}
7938
7939impl Confirmed for PublishFirmwareRequest {}
7940
7941#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7943pub struct PublishFirmwareResponse {
7944 pub status: GenericStatus,
7946 #[serde(rename = "statusInfo")]
7948 #[serde(default, skip_serializing_if = "Option::is_none")]
7949 pub status_info: Option<StatusInfo>,
7950 #[serde(rename = "customData")]
7952 #[serde(default, skip_serializing_if = "Option::is_none")]
7953 pub custom_data: Option<crate::types::CustomData>,
7954}
7955
7956impl PublishFirmwareResponse {
7957 #[must_use]
7959 pub fn new(status: GenericStatus) -> Self {
7960 Self {
7961 status,
7962 status_info: None,
7963 custom_data: None,
7964 }
7965 }
7966
7967 #[must_use]
7969 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
7970 self.status_info = Some(value);
7971 self
7972 }
7973
7974 #[must_use]
7976 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7977 self.custom_data = Some(value);
7978 self
7979 }
7980}
7981
7982impl Validate for PublishFirmwareResponse {
7983 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7984 path.push_key("status");
7985 Validate::validate_at(&self.status, path, out);
7986 path.pop();
7987 path.push_key("statusInfo");
7988 if let Some(value) = &self.status_info {
7989 Validate::validate_at(value, path, out);
7990 }
7991 path.pop();
7992 path.push_key("customData");
7993 if let Some(value) = &self.custom_data {
7994 Validate::validate_at(value, path, out);
7995 }
7996 path.pop();
7997 }
7998}
7999
8000impl Sealed for PublishFirmwareResponse {}
8001impl Response for PublishFirmwareResponse {}
8002
8003#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8005pub struct PublishFirmwareStatusNotificationRequest {
8006 pub status: PublishFirmwareStatus,
8008 #[serde(default, skip_serializing_if = "Option::is_none")]
8010 pub location: Option<Vec<String>>,
8011 #[serde(rename = "requestId")]
8016 #[serde(default, skip_serializing_if = "Option::is_none")]
8017 #[serde(deserialize_with = "crate::types::integer::option")]
8018 pub request_id: Option<i32>,
8019 #[serde(rename = "statusInfo")]
8021 #[serde(default, skip_serializing_if = "Option::is_none")]
8022 pub status_info: Option<StatusInfo>,
8023 #[serde(rename = "customData")]
8025 #[serde(default, skip_serializing_if = "Option::is_none")]
8026 pub custom_data: Option<crate::types::CustomData>,
8027}
8028
8029impl PublishFirmwareStatusNotificationRequest {
8030 #[must_use]
8032 pub fn new(status: PublishFirmwareStatus) -> Self {
8033 Self {
8034 status,
8035 location: None,
8036 request_id: None,
8037 status_info: None,
8038 custom_data: None,
8039 }
8040 }
8041
8042 #[must_use]
8044 pub fn with_location(mut self, value: impl IntoIterator<Item = impl Into<String>>) -> Self {
8045 self.location = Some(value.into_iter().map(Into::into).collect());
8046 self
8047 }
8048
8049 #[must_use]
8051 pub fn with_request_id(mut self, value: i32) -> Self {
8052 self.request_id = Some(value);
8053 self
8054 }
8055
8056 #[must_use]
8058 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
8059 self.status_info = Some(value);
8060 self
8061 }
8062
8063 #[must_use]
8065 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8066 self.custom_data = Some(value);
8067 self
8068 }
8069}
8070
8071impl Validate for PublishFirmwareStatusNotificationRequest {
8072 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8073 path.push_key("status");
8074 Validate::validate_at(&self.status, path, out);
8075 path.pop();
8076 path.push_key("location");
8077 if let Some(value) = &self.location {
8078 validate::list_len(value.len(), Some(1), None, path, out);
8079 for (index, item) in value.iter().enumerate() {
8080 path.push_index(index);
8081 validate::string(item.as_str(), None, Some(2000), path, out);
8082 path.pop();
8083 }
8084 }
8085 path.pop();
8086 path.push_key("requestId");
8087 if let Some(value) = &self.request_id {
8088 validate::int_range(i64::from(*value), Some(0), None, path, out);
8089 }
8090 path.pop();
8091 path.push_key("statusInfo");
8092 if let Some(value) = &self.status_info {
8093 Validate::validate_at(value, path, out);
8094 }
8095 path.pop();
8096 path.push_key("customData");
8097 if let Some(value) = &self.custom_data {
8098 Validate::validate_at(value, path, out);
8099 }
8100 path.pop();
8101 }
8102}
8103
8104impl Sealed for PublishFirmwareStatusNotificationRequest {}
8105impl Request for PublishFirmwareStatusNotificationRequest {
8106 type Action = Action;
8107 const ACTION: Action = Action::PublishFirmwareStatusNotification;
8108 const KIND: MessageKind = MessageKind::Call;
8109 const ORIGIN: Origin = Origin::ChargingStation;
8110 type Response = PublishFirmwareStatusNotificationResponse;
8111}
8112
8113impl Confirmed for PublishFirmwareStatusNotificationRequest {}
8114
8115#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
8117pub struct PublishFirmwareStatusNotificationResponse {
8118 #[serde(rename = "customData")]
8120 #[serde(default, skip_serializing_if = "Option::is_none")]
8121 pub custom_data: Option<crate::types::CustomData>,
8122}
8123
8124impl PublishFirmwareStatusNotificationResponse {
8125 #[must_use]
8127 pub fn new() -> Self {
8128 Self::default()
8129 }
8130
8131 #[must_use]
8133 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8134 self.custom_data = Some(value);
8135 self
8136 }
8137}
8138
8139impl Validate for PublishFirmwareStatusNotificationResponse {
8140 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8141 path.push_key("customData");
8142 if let Some(value) = &self.custom_data {
8143 Validate::validate_at(value, path, out);
8144 }
8145 path.pop();
8146 }
8147}
8148
8149impl Sealed for PublishFirmwareStatusNotificationResponse {}
8150impl Response for PublishFirmwareStatusNotificationResponse {}
8151
8152#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8154pub struct PullDynamicScheduleUpdateRequest {
8155 #[serde(rename = "chargingProfileId")]
8157 #[serde(deserialize_with = "crate::types::integer::one")]
8158 pub charging_profile_id: i32,
8159 #[serde(rename = "customData")]
8161 #[serde(default, skip_serializing_if = "Option::is_none")]
8162 pub custom_data: Option<crate::types::CustomData>,
8163}
8164
8165impl PullDynamicScheduleUpdateRequest {
8166 #[must_use]
8168 pub fn new(charging_profile_id: i32) -> Self {
8169 Self {
8170 charging_profile_id,
8171 custom_data: None,
8172 }
8173 }
8174
8175 #[must_use]
8177 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8178 self.custom_data = Some(value);
8179 self
8180 }
8181}
8182
8183impl Validate for PullDynamicScheduleUpdateRequest {
8184 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8185 path.push_key("customData");
8186 if let Some(value) = &self.custom_data {
8187 Validate::validate_at(value, path, out);
8188 }
8189 path.pop();
8190 }
8191}
8192
8193impl Sealed for PullDynamicScheduleUpdateRequest {}
8194impl Request for PullDynamicScheduleUpdateRequest {
8195 type Action = Action;
8196 const ACTION: Action = Action::PullDynamicScheduleUpdate;
8197 const KIND: MessageKind = MessageKind::Call;
8198 const ORIGIN: Origin = Origin::ChargingStation;
8199 type Response = PullDynamicScheduleUpdateResponse;
8200}
8201
8202impl Confirmed for PullDynamicScheduleUpdateRequest {}
8203
8204#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8206pub struct PullDynamicScheduleUpdateResponse {
8207 pub status: ChargingProfileStatus,
8209 #[serde(rename = "scheduleUpdate")]
8211 #[serde(default, skip_serializing_if = "Option::is_none")]
8212 pub schedule_update: Option<ChargingScheduleUpdate>,
8213 #[serde(rename = "statusInfo")]
8215 #[serde(default, skip_serializing_if = "Option::is_none")]
8216 pub status_info: Option<StatusInfo>,
8217 #[serde(rename = "customData")]
8219 #[serde(default, skip_serializing_if = "Option::is_none")]
8220 pub custom_data: Option<crate::types::CustomData>,
8221}
8222
8223impl PullDynamicScheduleUpdateResponse {
8224 #[must_use]
8226 pub fn new(status: ChargingProfileStatus) -> Self {
8227 Self {
8228 status,
8229 schedule_update: None,
8230 status_info: None,
8231 custom_data: None,
8232 }
8233 }
8234
8235 #[must_use]
8237 pub fn with_schedule_update(mut self, value: ChargingScheduleUpdate) -> Self {
8238 self.schedule_update = Some(value);
8239 self
8240 }
8241
8242 #[must_use]
8244 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
8245 self.status_info = Some(value);
8246 self
8247 }
8248
8249 #[must_use]
8251 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8252 self.custom_data = Some(value);
8253 self
8254 }
8255}
8256
8257impl Validate for PullDynamicScheduleUpdateResponse {
8258 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8259 path.push_key("status");
8260 Validate::validate_at(&self.status, path, out);
8261 path.pop();
8262 path.push_key("scheduleUpdate");
8263 if let Some(value) = &self.schedule_update {
8264 Validate::validate_at(value, path, out);
8265 }
8266 path.pop();
8267 path.push_key("statusInfo");
8268 if let Some(value) = &self.status_info {
8269 Validate::validate_at(value, path, out);
8270 }
8271 path.pop();
8272 path.push_key("customData");
8273 if let Some(value) = &self.custom_data {
8274 Validate::validate_at(value, path, out);
8275 }
8276 path.pop();
8277 }
8278}
8279
8280impl Sealed for PullDynamicScheduleUpdateResponse {}
8281impl Response for PullDynamicScheduleUpdateResponse {}
8282
8283#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8285pub struct ReportChargingProfilesRequest {
8286 #[serde(rename = "requestId")]
8288 #[serde(deserialize_with = "crate::types::integer::one")]
8289 pub request_id: i32,
8290 #[serde(rename = "chargingLimitSource")]
8292 pub charging_limit_source: String,
8293 #[serde(rename = "chargingProfile")]
8295 pub charging_profile: Vec<ChargingProfile>,
8296 #[serde(rename = "evseId")]
8298 #[serde(deserialize_with = "crate::types::integer::one")]
8299 pub evse_id: i32,
8300 #[serde(default, skip_serializing_if = "Option::is_none")]
8303 pub tbc: Option<bool>,
8304 #[serde(rename = "customData")]
8306 #[serde(default, skip_serializing_if = "Option::is_none")]
8307 pub custom_data: Option<crate::types::CustomData>,
8308}
8309
8310impl ReportChargingProfilesRequest {
8311 #[must_use]
8313 pub fn new(
8314 request_id: i32,
8315 charging_limit_source: impl Into<String>,
8316 charging_profile: Vec<ChargingProfile>,
8317 evse_id: i32,
8318 ) -> Self {
8319 Self {
8320 request_id,
8321 charging_limit_source: charging_limit_source.into(),
8322 charging_profile,
8323 evse_id,
8324 tbc: None,
8325 custom_data: None,
8326 }
8327 }
8328
8329 #[must_use]
8331 pub fn with_tbc(mut self, value: bool) -> Self {
8332 self.tbc = Some(value);
8333 self
8334 }
8335
8336 #[must_use]
8338 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8339 self.custom_data = Some(value);
8340 self
8341 }
8342}
8343
8344impl Validate for ReportChargingProfilesRequest {
8345 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8346 path.push_key("chargingLimitSource");
8347 validate::string(
8348 self.charging_limit_source.as_str(),
8349 None,
8350 Some(20),
8351 path,
8352 out,
8353 );
8354 path.pop();
8355 path.push_key("chargingProfile");
8356 validate::list_len(self.charging_profile.len(), Some(1), None, path, out);
8357 for (index, item) in self.charging_profile.iter().enumerate() {
8358 path.push_index(index);
8359 Validate::validate_at(item, path, out);
8360 path.pop();
8361 }
8362 path.pop();
8363 path.push_key("evseId");
8364 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
8365 path.pop();
8366 path.push_key("customData");
8367 if let Some(value) = &self.custom_data {
8368 Validate::validate_at(value, path, out);
8369 }
8370 path.pop();
8371 }
8372}
8373
8374impl Sealed for ReportChargingProfilesRequest {}
8375impl Request for ReportChargingProfilesRequest {
8376 type Action = Action;
8377 const ACTION: Action = Action::ReportChargingProfiles;
8378 const KIND: MessageKind = MessageKind::Call;
8379 const ORIGIN: Origin = Origin::ChargingStation;
8380 type Response = ReportChargingProfilesResponse;
8381}
8382
8383impl Confirmed for ReportChargingProfilesRequest {}
8384
8385#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
8387pub struct ReportChargingProfilesResponse {
8388 #[serde(rename = "customData")]
8390 #[serde(default, skip_serializing_if = "Option::is_none")]
8391 pub custom_data: Option<crate::types::CustomData>,
8392}
8393
8394impl ReportChargingProfilesResponse {
8395 #[must_use]
8397 pub fn new() -> Self {
8398 Self::default()
8399 }
8400
8401 #[must_use]
8403 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8404 self.custom_data = Some(value);
8405 self
8406 }
8407}
8408
8409impl Validate for ReportChargingProfilesResponse {
8410 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8411 path.push_key("customData");
8412 if let Some(value) = &self.custom_data {
8413 Validate::validate_at(value, path, out);
8414 }
8415 path.pop();
8416 }
8417}
8418
8419impl Sealed for ReportChargingProfilesResponse {}
8420impl Response for ReportChargingProfilesResponse {}
8421
8422#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8424pub struct ReportDERControlRequest {
8425 #[serde(rename = "requestId")]
8427 #[serde(deserialize_with = "crate::types::integer::one")]
8428 pub request_id: i32,
8429 #[serde(default, skip_serializing_if = "Option::is_none")]
8431 pub curve: Option<Vec<DERCurveGet>>,
8432 #[serde(rename = "enterService")]
8434 #[serde(default, skip_serializing_if = "Option::is_none")]
8435 pub enter_service: Option<Vec<EnterServiceGet>>,
8436 #[serde(rename = "fixedPFAbsorb")]
8438 #[serde(default, skip_serializing_if = "Option::is_none")]
8439 pub fixed_pf_absorb: Option<Vec<FixedPFGet>>,
8440 #[serde(rename = "fixedPFInject")]
8442 #[serde(default, skip_serializing_if = "Option::is_none")]
8443 pub fixed_pf_inject: Option<Vec<FixedPFGet>>,
8444 #[serde(rename = "fixedVar")]
8446 #[serde(default, skip_serializing_if = "Option::is_none")]
8447 pub fixed_var: Option<Vec<FixedVarGet>>,
8448 #[serde(rename = "freqDroop")]
8450 #[serde(default, skip_serializing_if = "Option::is_none")]
8451 pub freq_droop: Option<Vec<FreqDroopGet>>,
8452 #[serde(default, skip_serializing_if = "Option::is_none")]
8454 pub gradient: Option<Vec<GradientGet>>,
8455 #[serde(rename = "limitMaxDischarge")]
8457 #[serde(default, skip_serializing_if = "Option::is_none")]
8458 pub limit_max_discharge: Option<Vec<LimitMaxDischargeGet>>,
8459 #[serde(default, skip_serializing_if = "Option::is_none")]
8462 pub tbc: Option<bool>,
8463 #[serde(rename = "customData")]
8465 #[serde(default, skip_serializing_if = "Option::is_none")]
8466 pub custom_data: Option<crate::types::CustomData>,
8467}
8468
8469impl ReportDERControlRequest {
8470 #[must_use]
8472 pub fn new(request_id: i32) -> Self {
8473 Self {
8474 request_id,
8475 curve: None,
8476 enter_service: None,
8477 fixed_pf_absorb: None,
8478 fixed_pf_inject: None,
8479 fixed_var: None,
8480 freq_droop: None,
8481 gradient: None,
8482 limit_max_discharge: None,
8483 tbc: None,
8484 custom_data: None,
8485 }
8486 }
8487
8488 #[must_use]
8490 pub fn with_curve(mut self, value: Vec<DERCurveGet>) -> Self {
8491 self.curve = Some(value);
8492 self
8493 }
8494
8495 #[must_use]
8497 pub fn with_enter_service(mut self, value: Vec<EnterServiceGet>) -> Self {
8498 self.enter_service = Some(value);
8499 self
8500 }
8501
8502 #[must_use]
8504 pub fn with_fixed_pf_absorb(mut self, value: Vec<FixedPFGet>) -> Self {
8505 self.fixed_pf_absorb = Some(value);
8506 self
8507 }
8508
8509 #[must_use]
8511 pub fn with_fixed_pf_inject(mut self, value: Vec<FixedPFGet>) -> Self {
8512 self.fixed_pf_inject = Some(value);
8513 self
8514 }
8515
8516 #[must_use]
8518 pub fn with_fixed_var(mut self, value: Vec<FixedVarGet>) -> Self {
8519 self.fixed_var = Some(value);
8520 self
8521 }
8522
8523 #[must_use]
8525 pub fn with_freq_droop(mut self, value: Vec<FreqDroopGet>) -> Self {
8526 self.freq_droop = Some(value);
8527 self
8528 }
8529
8530 #[must_use]
8532 pub fn with_gradient(mut self, value: Vec<GradientGet>) -> Self {
8533 self.gradient = Some(value);
8534 self
8535 }
8536
8537 #[must_use]
8539 pub fn with_limit_max_discharge(mut self, value: Vec<LimitMaxDischargeGet>) -> Self {
8540 self.limit_max_discharge = Some(value);
8541 self
8542 }
8543
8544 #[must_use]
8546 pub fn with_tbc(mut self, value: bool) -> Self {
8547 self.tbc = Some(value);
8548 self
8549 }
8550
8551 #[must_use]
8553 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8554 self.custom_data = Some(value);
8555 self
8556 }
8557}
8558
8559impl Validate for ReportDERControlRequest {
8560 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8561 path.push_key("curve");
8562 if let Some(value) = &self.curve {
8563 validate::list_len(value.len(), Some(1), Some(24), path, out);
8564 for (index, item) in value.iter().enumerate() {
8565 path.push_index(index);
8566 Validate::validate_at(item, path, out);
8567 path.pop();
8568 }
8569 }
8570 path.pop();
8571 path.push_key("enterService");
8572 if let Some(value) = &self.enter_service {
8573 validate::list_len(value.len(), Some(1), Some(24), path, out);
8574 for (index, item) in value.iter().enumerate() {
8575 path.push_index(index);
8576 Validate::validate_at(item, path, out);
8577 path.pop();
8578 }
8579 }
8580 path.pop();
8581 path.push_key("fixedPFAbsorb");
8582 if let Some(value) = &self.fixed_pf_absorb {
8583 validate::list_len(value.len(), Some(1), Some(24), path, out);
8584 for (index, item) in value.iter().enumerate() {
8585 path.push_index(index);
8586 Validate::validate_at(item, path, out);
8587 path.pop();
8588 }
8589 }
8590 path.pop();
8591 path.push_key("fixedPFInject");
8592 if let Some(value) = &self.fixed_pf_inject {
8593 validate::list_len(value.len(), Some(1), Some(24), path, out);
8594 for (index, item) in value.iter().enumerate() {
8595 path.push_index(index);
8596 Validate::validate_at(item, path, out);
8597 path.pop();
8598 }
8599 }
8600 path.pop();
8601 path.push_key("fixedVar");
8602 if let Some(value) = &self.fixed_var {
8603 validate::list_len(value.len(), Some(1), Some(24), path, out);
8604 for (index, item) in value.iter().enumerate() {
8605 path.push_index(index);
8606 Validate::validate_at(item, path, out);
8607 path.pop();
8608 }
8609 }
8610 path.pop();
8611 path.push_key("freqDroop");
8612 if let Some(value) = &self.freq_droop {
8613 validate::list_len(value.len(), Some(1), Some(24), path, out);
8614 for (index, item) in value.iter().enumerate() {
8615 path.push_index(index);
8616 Validate::validate_at(item, path, out);
8617 path.pop();
8618 }
8619 }
8620 path.pop();
8621 path.push_key("gradient");
8622 if let Some(value) = &self.gradient {
8623 validate::list_len(value.len(), Some(1), Some(24), path, out);
8624 for (index, item) in value.iter().enumerate() {
8625 path.push_index(index);
8626 Validate::validate_at(item, path, out);
8627 path.pop();
8628 }
8629 }
8630 path.pop();
8631 path.push_key("limitMaxDischarge");
8632 if let Some(value) = &self.limit_max_discharge {
8633 validate::list_len(value.len(), Some(1), Some(24), path, out);
8634 for (index, item) in value.iter().enumerate() {
8635 path.push_index(index);
8636 Validate::validate_at(item, path, out);
8637 path.pop();
8638 }
8639 }
8640 path.pop();
8641 path.push_key("customData");
8642 if let Some(value) = &self.custom_data {
8643 Validate::validate_at(value, path, out);
8644 }
8645 path.pop();
8646 }
8647}
8648
8649impl Sealed for ReportDERControlRequest {}
8650impl Request for ReportDERControlRequest {
8651 type Action = Action;
8652 const ACTION: Action = Action::ReportDERControl;
8653 const KIND: MessageKind = MessageKind::Call;
8654 const ORIGIN: Origin = Origin::ChargingStation;
8655 type Response = ReportDERControlResponse;
8656}
8657
8658impl Confirmed for ReportDERControlRequest {}
8659
8660#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
8664pub struct ReportDERControlResponse {
8665 #[serde(rename = "customData")]
8667 #[serde(default, skip_serializing_if = "Option::is_none")]
8668 pub custom_data: Option<crate::types::CustomData>,
8669}
8670
8671impl ReportDERControlResponse {
8672 #[must_use]
8674 pub fn new() -> Self {
8675 Self::default()
8676 }
8677
8678 #[must_use]
8680 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8681 self.custom_data = Some(value);
8682 self
8683 }
8684}
8685
8686impl Validate for ReportDERControlResponse {
8687 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8688 path.push_key("customData");
8689 if let Some(value) = &self.custom_data {
8690 Validate::validate_at(value, path, out);
8691 }
8692 path.pop();
8693 }
8694}
8695
8696impl Sealed for ReportDERControlResponse {}
8697impl Response for ReportDERControlResponse {}
8698
8699#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8701pub struct RequestBatterySwapRequest {
8702 #[serde(rename = "idToken")]
8704 pub id_token: IdToken,
8705 #[serde(rename = "requestId")]
8707 #[serde(deserialize_with = "crate::types::integer::one")]
8708 pub request_id: i32,
8709 #[serde(rename = "customData")]
8711 #[serde(default, skip_serializing_if = "Option::is_none")]
8712 pub custom_data: Option<crate::types::CustomData>,
8713}
8714
8715impl RequestBatterySwapRequest {
8716 #[must_use]
8718 pub fn new(id_token: IdToken, request_id: i32) -> Self {
8719 Self {
8720 id_token,
8721 request_id,
8722 custom_data: None,
8723 }
8724 }
8725
8726 #[must_use]
8728 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8729 self.custom_data = Some(value);
8730 self
8731 }
8732}
8733
8734impl Validate for RequestBatterySwapRequest {
8735 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8736 path.push_key("idToken");
8737 Validate::validate_at(&self.id_token, path, out);
8738 path.pop();
8739 path.push_key("customData");
8740 if let Some(value) = &self.custom_data {
8741 Validate::validate_at(value, path, out);
8742 }
8743 path.pop();
8744 }
8745}
8746
8747impl Sealed for RequestBatterySwapRequest {}
8748impl Request for RequestBatterySwapRequest {
8749 type Action = Action;
8750 const ACTION: Action = Action::RequestBatterySwap;
8751 const KIND: MessageKind = MessageKind::Call;
8752 const ORIGIN: Origin = Origin::Csms;
8753 type Response = RequestBatterySwapResponse;
8754}
8755
8756impl Confirmed for RequestBatterySwapRequest {}
8757
8758#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8760pub struct RequestBatterySwapResponse {
8761 pub status: GenericStatus,
8763 #[serde(rename = "statusInfo")]
8765 #[serde(default, skip_serializing_if = "Option::is_none")]
8766 pub status_info: Option<StatusInfo>,
8767 #[serde(rename = "customData")]
8769 #[serde(default, skip_serializing_if = "Option::is_none")]
8770 pub custom_data: Option<crate::types::CustomData>,
8771}
8772
8773impl RequestBatterySwapResponse {
8774 #[must_use]
8776 pub fn new(status: GenericStatus) -> Self {
8777 Self {
8778 status,
8779 status_info: None,
8780 custom_data: None,
8781 }
8782 }
8783
8784 #[must_use]
8786 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
8787 self.status_info = Some(value);
8788 self
8789 }
8790
8791 #[must_use]
8793 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8794 self.custom_data = Some(value);
8795 self
8796 }
8797}
8798
8799impl Validate for RequestBatterySwapResponse {
8800 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8801 path.push_key("status");
8802 Validate::validate_at(&self.status, path, out);
8803 path.pop();
8804 path.push_key("statusInfo");
8805 if let Some(value) = &self.status_info {
8806 Validate::validate_at(value, path, out);
8807 }
8808 path.pop();
8809 path.push_key("customData");
8810 if let Some(value) = &self.custom_data {
8811 Validate::validate_at(value, path, out);
8812 }
8813 path.pop();
8814 }
8815}
8816
8817impl Sealed for RequestBatterySwapResponse {}
8818impl Response for RequestBatterySwapResponse {}
8819
8820#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8822pub struct RequestStartTransactionRequest {
8823 #[serde(rename = "idToken")]
8825 pub id_token: IdToken,
8826 #[serde(rename = "remoteStartId")]
8828 #[serde(deserialize_with = "crate::types::integer::one")]
8829 pub remote_start_id: i32,
8830 #[serde(rename = "evseId")]
8832 #[serde(default, skip_serializing_if = "Option::is_none")]
8833 #[serde(deserialize_with = "crate::types::integer::option")]
8834 pub evse_id: Option<i32>,
8835 #[serde(rename = "groupIdToken")]
8837 #[serde(default, skip_serializing_if = "Option::is_none")]
8838 pub group_id_token: Option<IdToken>,
8839 #[serde(rename = "chargingProfile")]
8841 #[serde(default, skip_serializing_if = "Option::is_none")]
8842 pub charging_profile: Option<ChargingProfile>,
8843 #[serde(rename = "customData")]
8845 #[serde(default, skip_serializing_if = "Option::is_none")]
8846 pub custom_data: Option<crate::types::CustomData>,
8847}
8848
8849impl RequestStartTransactionRequest {
8850 #[must_use]
8852 pub fn new(id_token: IdToken, remote_start_id: i32) -> Self {
8853 Self {
8854 id_token,
8855 remote_start_id,
8856 evse_id: None,
8857 group_id_token: None,
8858 charging_profile: None,
8859 custom_data: None,
8860 }
8861 }
8862
8863 #[must_use]
8865 pub fn with_evse_id(mut self, value: i32) -> Self {
8866 self.evse_id = Some(value);
8867 self
8868 }
8869
8870 #[must_use]
8872 pub fn with_group_id_token(mut self, value: IdToken) -> Self {
8873 self.group_id_token = Some(value);
8874 self
8875 }
8876
8877 #[must_use]
8879 pub fn with_charging_profile(mut self, value: ChargingProfile) -> Self {
8880 self.charging_profile = Some(value);
8881 self
8882 }
8883
8884 #[must_use]
8886 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8887 self.custom_data = Some(value);
8888 self
8889 }
8890}
8891
8892impl Validate for RequestStartTransactionRequest {
8893 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8894 path.push_key("idToken");
8895 Validate::validate_at(&self.id_token, path, out);
8896 path.pop();
8897 path.push_key("evseId");
8898 if let Some(value) = &self.evse_id {
8899 validate::int_range(i64::from(*value), Some(1), None, path, out);
8900 }
8901 path.pop();
8902 path.push_key("groupIdToken");
8903 if let Some(value) = &self.group_id_token {
8904 Validate::validate_at(value, path, out);
8905 }
8906 path.pop();
8907 path.push_key("chargingProfile");
8908 if let Some(value) = &self.charging_profile {
8909 Validate::validate_at(value, path, out);
8910 }
8911 path.pop();
8912 path.push_key("customData");
8913 if let Some(value) = &self.custom_data {
8914 Validate::validate_at(value, path, out);
8915 }
8916 path.pop();
8917 }
8918}
8919
8920impl Sealed for RequestStartTransactionRequest {}
8921impl Request for RequestStartTransactionRequest {
8922 type Action = Action;
8923 const ACTION: Action = Action::RequestStartTransaction;
8924 const KIND: MessageKind = MessageKind::Call;
8925 const ORIGIN: Origin = Origin::Csms;
8926 type Response = RequestStartTransactionResponse;
8927}
8928
8929impl Confirmed for RequestStartTransactionRequest {}
8930
8931#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8933pub struct RequestStartTransactionResponse {
8934 pub status: RequestStartStopStatus,
8936 #[serde(rename = "statusInfo")]
8938 #[serde(default, skip_serializing_if = "Option::is_none")]
8939 pub status_info: Option<StatusInfo>,
8940 #[serde(rename = "transactionId")]
8942 #[serde(default, skip_serializing_if = "Option::is_none")]
8943 pub transaction_id: Option<String>,
8944 #[serde(rename = "customData")]
8946 #[serde(default, skip_serializing_if = "Option::is_none")]
8947 pub custom_data: Option<crate::types::CustomData>,
8948}
8949
8950impl RequestStartTransactionResponse {
8951 #[must_use]
8953 pub fn new(status: RequestStartStopStatus) -> Self {
8954 Self {
8955 status,
8956 status_info: None,
8957 transaction_id: None,
8958 custom_data: None,
8959 }
8960 }
8961
8962 #[must_use]
8964 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
8965 self.status_info = Some(value);
8966 self
8967 }
8968
8969 #[must_use]
8971 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
8972 self.transaction_id = Some(value.into());
8973 self
8974 }
8975
8976 #[must_use]
8978 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8979 self.custom_data = Some(value);
8980 self
8981 }
8982}
8983
8984impl Validate for RequestStartTransactionResponse {
8985 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8986 path.push_key("status");
8987 Validate::validate_at(&self.status, path, out);
8988 path.pop();
8989 path.push_key("statusInfo");
8990 if let Some(value) = &self.status_info {
8991 Validate::validate_at(value, path, out);
8992 }
8993 path.pop();
8994 path.push_key("transactionId");
8995 if let Some(value) = &self.transaction_id {
8996 validate::string(value.as_str(), None, Some(36), path, out);
8997 }
8998 path.pop();
8999 path.push_key("customData");
9000 if let Some(value) = &self.custom_data {
9001 Validate::validate_at(value, path, out);
9002 }
9003 path.pop();
9004 }
9005}
9006
9007impl Sealed for RequestStartTransactionResponse {}
9008impl Response for RequestStartTransactionResponse {}
9009
9010#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9012pub struct RequestStopTransactionRequest {
9013 #[serde(rename = "transactionId")]
9015 pub transaction_id: String,
9016 #[serde(rename = "customData")]
9018 #[serde(default, skip_serializing_if = "Option::is_none")]
9019 pub custom_data: Option<crate::types::CustomData>,
9020}
9021
9022impl RequestStopTransactionRequest {
9023 #[must_use]
9025 pub fn new(transaction_id: impl Into<String>) -> Self {
9026 Self {
9027 transaction_id: transaction_id.into(),
9028 custom_data: None,
9029 }
9030 }
9031
9032 #[must_use]
9034 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9035 self.custom_data = Some(value);
9036 self
9037 }
9038}
9039
9040impl Validate for RequestStopTransactionRequest {
9041 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9042 path.push_key("transactionId");
9043 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
9044 path.pop();
9045 path.push_key("customData");
9046 if let Some(value) = &self.custom_data {
9047 Validate::validate_at(value, path, out);
9048 }
9049 path.pop();
9050 }
9051}
9052
9053impl Sealed for RequestStopTransactionRequest {}
9054impl Request for RequestStopTransactionRequest {
9055 type Action = Action;
9056 const ACTION: Action = Action::RequestStopTransaction;
9057 const KIND: MessageKind = MessageKind::Call;
9058 const ORIGIN: Origin = Origin::Csms;
9059 type Response = RequestStopTransactionResponse;
9060}
9061
9062impl Confirmed for RequestStopTransactionRequest {}
9063
9064#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9066pub struct RequestStopTransactionResponse {
9067 pub status: RequestStartStopStatus,
9069 #[serde(rename = "statusInfo")]
9071 #[serde(default, skip_serializing_if = "Option::is_none")]
9072 pub status_info: Option<StatusInfo>,
9073 #[serde(rename = "customData")]
9075 #[serde(default, skip_serializing_if = "Option::is_none")]
9076 pub custom_data: Option<crate::types::CustomData>,
9077}
9078
9079impl RequestStopTransactionResponse {
9080 #[must_use]
9082 pub fn new(status: RequestStartStopStatus) -> Self {
9083 Self {
9084 status,
9085 status_info: None,
9086 custom_data: None,
9087 }
9088 }
9089
9090 #[must_use]
9092 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
9093 self.status_info = Some(value);
9094 self
9095 }
9096
9097 #[must_use]
9099 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9100 self.custom_data = Some(value);
9101 self
9102 }
9103}
9104
9105impl Validate for RequestStopTransactionResponse {
9106 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9107 path.push_key("status");
9108 Validate::validate_at(&self.status, path, out);
9109 path.pop();
9110 path.push_key("statusInfo");
9111 if let Some(value) = &self.status_info {
9112 Validate::validate_at(value, path, out);
9113 }
9114 path.pop();
9115 path.push_key("customData");
9116 if let Some(value) = &self.custom_data {
9117 Validate::validate_at(value, path, out);
9118 }
9119 path.pop();
9120 }
9121}
9122
9123impl Sealed for RequestStopTransactionResponse {}
9124impl Response for RequestStopTransactionResponse {}
9125
9126#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9128pub struct ReservationStatusUpdateRequest {
9129 #[serde(rename = "reservationId")]
9131 #[serde(deserialize_with = "crate::types::integer::one")]
9132 pub reservation_id: i32,
9133 #[serde(rename = "reservationUpdateStatus")]
9135 pub reservation_update_status: ReservationUpdateStatus,
9136 #[serde(rename = "customData")]
9138 #[serde(default, skip_serializing_if = "Option::is_none")]
9139 pub custom_data: Option<crate::types::CustomData>,
9140}
9141
9142impl ReservationStatusUpdateRequest {
9143 #[must_use]
9145 pub fn new(reservation_id: i32, reservation_update_status: ReservationUpdateStatus) -> Self {
9146 Self {
9147 reservation_id,
9148 reservation_update_status,
9149 custom_data: None,
9150 }
9151 }
9152
9153 #[must_use]
9155 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9156 self.custom_data = Some(value);
9157 self
9158 }
9159}
9160
9161impl Validate for ReservationStatusUpdateRequest {
9162 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9163 path.push_key("reservationId");
9164 validate::int_range(i64::from(self.reservation_id), Some(0), None, path, out);
9165 path.pop();
9166 path.push_key("reservationUpdateStatus");
9167 Validate::validate_at(&self.reservation_update_status, path, out);
9168 path.pop();
9169 path.push_key("customData");
9170 if let Some(value) = &self.custom_data {
9171 Validate::validate_at(value, path, out);
9172 }
9173 path.pop();
9174 }
9175}
9176
9177impl Sealed for ReservationStatusUpdateRequest {}
9178impl Request for ReservationStatusUpdateRequest {
9179 type Action = Action;
9180 const ACTION: Action = Action::ReservationStatusUpdate;
9181 const KIND: MessageKind = MessageKind::Call;
9182 const ORIGIN: Origin = Origin::ChargingStation;
9183 type Response = ReservationStatusUpdateResponse;
9184}
9185
9186impl Confirmed for ReservationStatusUpdateRequest {}
9187
9188#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
9190pub struct ReservationStatusUpdateResponse {
9191 #[serde(rename = "customData")]
9193 #[serde(default, skip_serializing_if = "Option::is_none")]
9194 pub custom_data: Option<crate::types::CustomData>,
9195}
9196
9197impl ReservationStatusUpdateResponse {
9198 #[must_use]
9200 pub fn new() -> Self {
9201 Self::default()
9202 }
9203
9204 #[must_use]
9206 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9207 self.custom_data = Some(value);
9208 self
9209 }
9210}
9211
9212impl Validate for ReservationStatusUpdateResponse {
9213 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9214 path.push_key("customData");
9215 if let Some(value) = &self.custom_data {
9216 Validate::validate_at(value, path, out);
9217 }
9218 path.pop();
9219 }
9220}
9221
9222impl Sealed for ReservationStatusUpdateResponse {}
9223impl Response for ReservationStatusUpdateResponse {}
9224
9225#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9227pub struct ReserveNowRequest {
9228 #[serde(deserialize_with = "crate::types::integer::one")]
9230 pub id: i32,
9231 #[serde(rename = "expiryDateTime")]
9233 pub expiry_date_time: crate::types::DateTime,
9234 #[serde(rename = "idToken")]
9236 pub id_token: IdToken,
9237 #[serde(rename = "connectorType")]
9239 #[serde(default, skip_serializing_if = "Option::is_none")]
9240 pub connector_type: Option<String>,
9241 #[serde(rename = "evseId")]
9243 #[serde(default, skip_serializing_if = "Option::is_none")]
9244 #[serde(deserialize_with = "crate::types::integer::option")]
9245 pub evse_id: Option<i32>,
9246 #[serde(rename = "groupIdToken")]
9248 #[serde(default, skip_serializing_if = "Option::is_none")]
9249 pub group_id_token: Option<IdToken>,
9250 #[serde(rename = "customData")]
9252 #[serde(default, skip_serializing_if = "Option::is_none")]
9253 pub custom_data: Option<crate::types::CustomData>,
9254}
9255
9256impl ReserveNowRequest {
9257 #[must_use]
9259 pub fn new(
9260 id: i32,
9261 expiry_date_time: impl Into<crate::types::DateTime>,
9262 id_token: IdToken,
9263 ) -> Self {
9264 Self {
9265 id,
9266 expiry_date_time: expiry_date_time.into(),
9267 id_token,
9268 connector_type: None,
9269 evse_id: None,
9270 group_id_token: None,
9271 custom_data: None,
9272 }
9273 }
9274
9275 #[must_use]
9277 pub fn with_connector_type(mut self, value: impl Into<String>) -> Self {
9278 self.connector_type = Some(value.into());
9279 self
9280 }
9281
9282 #[must_use]
9284 pub fn with_evse_id(mut self, value: i32) -> Self {
9285 self.evse_id = Some(value);
9286 self
9287 }
9288
9289 #[must_use]
9291 pub fn with_group_id_token(mut self, value: IdToken) -> Self {
9292 self.group_id_token = Some(value);
9293 self
9294 }
9295
9296 #[must_use]
9298 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9299 self.custom_data = Some(value);
9300 self
9301 }
9302}
9303
9304impl Validate for ReserveNowRequest {
9305 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9306 path.push_key("id");
9307 validate::int_range(i64::from(self.id), Some(0), None, path, out);
9308 path.pop();
9309 path.push_key("idToken");
9310 Validate::validate_at(&self.id_token, path, out);
9311 path.pop();
9312 path.push_key("connectorType");
9313 if let Some(value) = &self.connector_type {
9314 validate::string(value.as_str(), None, Some(20), path, out);
9315 }
9316 path.pop();
9317 path.push_key("evseId");
9318 if let Some(value) = &self.evse_id {
9319 validate::int_range(i64::from(*value), Some(0), None, path, out);
9320 }
9321 path.pop();
9322 path.push_key("groupIdToken");
9323 if let Some(value) = &self.group_id_token {
9324 Validate::validate_at(value, path, out);
9325 }
9326 path.pop();
9327 path.push_key("customData");
9328 if let Some(value) = &self.custom_data {
9329 Validate::validate_at(value, path, out);
9330 }
9331 path.pop();
9332 }
9333}
9334
9335impl Sealed for ReserveNowRequest {}
9336impl Request for ReserveNowRequest {
9337 type Action = Action;
9338 const ACTION: Action = Action::ReserveNow;
9339 const KIND: MessageKind = MessageKind::Call;
9340 const ORIGIN: Origin = Origin::Csms;
9341 type Response = ReserveNowResponse;
9342}
9343
9344impl Confirmed for ReserveNowRequest {}
9345
9346#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9348pub struct ReserveNowResponse {
9349 pub status: ReserveNowStatus,
9351 #[serde(rename = "statusInfo")]
9353 #[serde(default, skip_serializing_if = "Option::is_none")]
9354 pub status_info: Option<StatusInfo>,
9355 #[serde(rename = "customData")]
9357 #[serde(default, skip_serializing_if = "Option::is_none")]
9358 pub custom_data: Option<crate::types::CustomData>,
9359}
9360
9361impl ReserveNowResponse {
9362 #[must_use]
9364 pub fn new(status: ReserveNowStatus) -> Self {
9365 Self {
9366 status,
9367 status_info: None,
9368 custom_data: None,
9369 }
9370 }
9371
9372 #[must_use]
9374 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
9375 self.status_info = Some(value);
9376 self
9377 }
9378
9379 #[must_use]
9381 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9382 self.custom_data = Some(value);
9383 self
9384 }
9385}
9386
9387impl Validate for ReserveNowResponse {
9388 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9389 path.push_key("status");
9390 Validate::validate_at(&self.status, path, out);
9391 path.pop();
9392 path.push_key("statusInfo");
9393 if let Some(value) = &self.status_info {
9394 Validate::validate_at(value, path, out);
9395 }
9396 path.pop();
9397 path.push_key("customData");
9398 if let Some(value) = &self.custom_data {
9399 Validate::validate_at(value, path, out);
9400 }
9401 path.pop();
9402 }
9403}
9404
9405impl Sealed for ReserveNowResponse {}
9406impl Response for ReserveNowResponse {}
9407
9408#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9410pub struct ResetRequest {
9411 pub r#type: ResetEnum,
9413 #[serde(rename = "evseId")]
9415 #[serde(default, skip_serializing_if = "Option::is_none")]
9416 #[serde(deserialize_with = "crate::types::integer::option")]
9417 pub evse_id: Option<i32>,
9418 #[serde(rename = "customData")]
9420 #[serde(default, skip_serializing_if = "Option::is_none")]
9421 pub custom_data: Option<crate::types::CustomData>,
9422}
9423
9424impl ResetRequest {
9425 #[must_use]
9427 pub fn new(r#type: ResetEnum) -> Self {
9428 Self {
9429 r#type,
9430 evse_id: None,
9431 custom_data: None,
9432 }
9433 }
9434
9435 #[must_use]
9437 pub fn with_evse_id(mut self, value: i32) -> Self {
9438 self.evse_id = Some(value);
9439 self
9440 }
9441
9442 #[must_use]
9444 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9445 self.custom_data = Some(value);
9446 self
9447 }
9448}
9449
9450impl Validate for ResetRequest {
9451 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9452 path.push_key("type");
9453 Validate::validate_at(&self.r#type, path, out);
9454 path.pop();
9455 path.push_key("evseId");
9456 if let Some(value) = &self.evse_id {
9457 validate::int_range(i64::from(*value), Some(0), None, path, out);
9458 }
9459 path.pop();
9460 path.push_key("customData");
9461 if let Some(value) = &self.custom_data {
9462 Validate::validate_at(value, path, out);
9463 }
9464 path.pop();
9465 }
9466}
9467
9468impl Sealed for ResetRequest {}
9469impl Request for ResetRequest {
9470 type Action = Action;
9471 const ACTION: Action = Action::Reset;
9472 const KIND: MessageKind = MessageKind::Call;
9473 const ORIGIN: Origin = Origin::Csms;
9474 type Response = ResetResponse;
9475}
9476
9477impl Confirmed for ResetRequest {}
9478
9479#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9481pub struct ResetResponse {
9482 pub status: ResetStatus,
9484 #[serde(rename = "statusInfo")]
9486 #[serde(default, skip_serializing_if = "Option::is_none")]
9487 pub status_info: Option<StatusInfo>,
9488 #[serde(rename = "customData")]
9490 #[serde(default, skip_serializing_if = "Option::is_none")]
9491 pub custom_data: Option<crate::types::CustomData>,
9492}
9493
9494impl ResetResponse {
9495 #[must_use]
9497 pub fn new(status: ResetStatus) -> Self {
9498 Self {
9499 status,
9500 status_info: None,
9501 custom_data: None,
9502 }
9503 }
9504
9505 #[must_use]
9507 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
9508 self.status_info = Some(value);
9509 self
9510 }
9511
9512 #[must_use]
9514 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9515 self.custom_data = Some(value);
9516 self
9517 }
9518}
9519
9520impl Validate for ResetResponse {
9521 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9522 path.push_key("status");
9523 Validate::validate_at(&self.status, path, out);
9524 path.pop();
9525 path.push_key("statusInfo");
9526 if let Some(value) = &self.status_info {
9527 Validate::validate_at(value, path, out);
9528 }
9529 path.pop();
9530 path.push_key("customData");
9531 if let Some(value) = &self.custom_data {
9532 Validate::validate_at(value, path, out);
9533 }
9534 path.pop();
9535 }
9536}
9537
9538impl Sealed for ResetResponse {}
9539impl Response for ResetResponse {}
9540
9541#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9543pub struct SecurityEventNotificationRequest {
9544 pub r#type: String,
9546 pub timestamp: crate::types::DateTime,
9548 #[serde(rename = "techInfo")]
9550 #[serde(default, skip_serializing_if = "Option::is_none")]
9551 pub tech_info: Option<String>,
9552 #[serde(rename = "customData")]
9554 #[serde(default, skip_serializing_if = "Option::is_none")]
9555 pub custom_data: Option<crate::types::CustomData>,
9556}
9557
9558impl SecurityEventNotificationRequest {
9559 #[must_use]
9561 pub fn new(r#type: impl Into<String>, timestamp: impl Into<crate::types::DateTime>) -> Self {
9562 Self {
9563 r#type: r#type.into(),
9564 timestamp: timestamp.into(),
9565 tech_info: None,
9566 custom_data: None,
9567 }
9568 }
9569
9570 #[must_use]
9572 pub fn with_tech_info(mut self, value: impl Into<String>) -> Self {
9573 self.tech_info = Some(value.into());
9574 self
9575 }
9576
9577 #[must_use]
9579 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9580 self.custom_data = Some(value);
9581 self
9582 }
9583}
9584
9585impl Validate for SecurityEventNotificationRequest {
9586 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9587 path.push_key("type");
9588 validate::string(self.r#type.as_str(), None, Some(50), path, out);
9589 path.pop();
9590 path.push_key("techInfo");
9591 if let Some(value) = &self.tech_info {
9592 validate::string(value.as_str(), None, Some(255), path, out);
9593 }
9594 path.pop();
9595 path.push_key("customData");
9596 if let Some(value) = &self.custom_data {
9597 Validate::validate_at(value, path, out);
9598 }
9599 path.pop();
9600 }
9601}
9602
9603impl Sealed for SecurityEventNotificationRequest {}
9604impl Request for SecurityEventNotificationRequest {
9605 type Action = Action;
9606 const ACTION: Action = Action::SecurityEventNotification;
9607 const KIND: MessageKind = MessageKind::Call;
9608 const ORIGIN: Origin = Origin::ChargingStation;
9609 type Response = SecurityEventNotificationResponse;
9610}
9611
9612impl Confirmed for SecurityEventNotificationRequest {}
9613
9614#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
9616pub struct SecurityEventNotificationResponse {
9617 #[serde(rename = "customData")]
9619 #[serde(default, skip_serializing_if = "Option::is_none")]
9620 pub custom_data: Option<crate::types::CustomData>,
9621}
9622
9623impl SecurityEventNotificationResponse {
9624 #[must_use]
9626 pub fn new() -> Self {
9627 Self::default()
9628 }
9629
9630 #[must_use]
9632 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9633 self.custom_data = Some(value);
9634 self
9635 }
9636}
9637
9638impl Validate for SecurityEventNotificationResponse {
9639 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9640 path.push_key("customData");
9641 if let Some(value) = &self.custom_data {
9642 Validate::validate_at(value, path, out);
9643 }
9644 path.pop();
9645 }
9646}
9647
9648impl Sealed for SecurityEventNotificationResponse {}
9649impl Response for SecurityEventNotificationResponse {}
9650
9651#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9653pub struct SendLocalListRequest {
9654 #[serde(rename = "versionNumber")]
9656 #[serde(deserialize_with = "crate::types::integer::one")]
9657 pub version_number: i32,
9658 #[serde(rename = "updateType")]
9660 pub update_type: Update,
9661 #[serde(rename = "localAuthorizationList")]
9663 #[serde(default, skip_serializing_if = "Option::is_none")]
9664 pub local_authorization_list: Option<Vec<AuthorizationData>>,
9665 #[serde(rename = "customData")]
9667 #[serde(default, skip_serializing_if = "Option::is_none")]
9668 pub custom_data: Option<crate::types::CustomData>,
9669}
9670
9671impl SendLocalListRequest {
9672 #[must_use]
9674 pub fn new(version_number: i32, update_type: Update) -> Self {
9675 Self {
9676 version_number,
9677 update_type,
9678 local_authorization_list: None,
9679 custom_data: None,
9680 }
9681 }
9682
9683 #[must_use]
9685 pub fn with_local_authorization_list(mut self, value: Vec<AuthorizationData>) -> Self {
9686 self.local_authorization_list = Some(value);
9687 self
9688 }
9689
9690 #[must_use]
9692 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9693 self.custom_data = Some(value);
9694 self
9695 }
9696}
9697
9698impl Validate for SendLocalListRequest {
9699 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9700 path.push_key("updateType");
9701 Validate::validate_at(&self.update_type, path, out);
9702 path.pop();
9703 path.push_key("localAuthorizationList");
9704 if let Some(value) = &self.local_authorization_list {
9705 validate::list_len(value.len(), Some(1), None, path, out);
9706 for (index, item) in value.iter().enumerate() {
9707 path.push_index(index);
9708 Validate::validate_at(item, path, out);
9709 path.pop();
9710 }
9711 }
9712 path.pop();
9713 path.push_key("customData");
9714 if let Some(value) = &self.custom_data {
9715 Validate::validate_at(value, path, out);
9716 }
9717 path.pop();
9718 }
9719}
9720
9721impl Sealed for SendLocalListRequest {}
9722impl Request for SendLocalListRequest {
9723 type Action = Action;
9724 const ACTION: Action = Action::SendLocalList;
9725 const KIND: MessageKind = MessageKind::Call;
9726 const ORIGIN: Origin = Origin::Csms;
9727 type Response = SendLocalListResponse;
9728}
9729
9730impl Confirmed for SendLocalListRequest {}
9731
9732#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9734pub struct SendLocalListResponse {
9735 pub status: SendLocalListStatus,
9737 #[serde(rename = "statusInfo")]
9739 #[serde(default, skip_serializing_if = "Option::is_none")]
9740 pub status_info: Option<StatusInfo>,
9741 #[serde(rename = "customData")]
9743 #[serde(default, skip_serializing_if = "Option::is_none")]
9744 pub custom_data: Option<crate::types::CustomData>,
9745}
9746
9747impl SendLocalListResponse {
9748 #[must_use]
9750 pub fn new(status: SendLocalListStatus) -> Self {
9751 Self {
9752 status,
9753 status_info: None,
9754 custom_data: None,
9755 }
9756 }
9757
9758 #[must_use]
9760 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
9761 self.status_info = Some(value);
9762 self
9763 }
9764
9765 #[must_use]
9767 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9768 self.custom_data = Some(value);
9769 self
9770 }
9771}
9772
9773impl Validate for SendLocalListResponse {
9774 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9775 path.push_key("status");
9776 Validate::validate_at(&self.status, path, out);
9777 path.pop();
9778 path.push_key("statusInfo");
9779 if let Some(value) = &self.status_info {
9780 Validate::validate_at(value, path, out);
9781 }
9782 path.pop();
9783 path.push_key("customData");
9784 if let Some(value) = &self.custom_data {
9785 Validate::validate_at(value, path, out);
9786 }
9787 path.pop();
9788 }
9789}
9790
9791impl Sealed for SendLocalListResponse {}
9792impl Response for SendLocalListResponse {}
9793
9794#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9796pub struct SetChargingProfileRequest {
9797 #[serde(rename = "evseId")]
9799 #[serde(deserialize_with = "crate::types::integer::one")]
9800 pub evse_id: i32,
9801 #[serde(rename = "chargingProfile")]
9803 pub charging_profile: ChargingProfile,
9804 #[serde(rename = "customData")]
9806 #[serde(default, skip_serializing_if = "Option::is_none")]
9807 pub custom_data: Option<crate::types::CustomData>,
9808}
9809
9810impl SetChargingProfileRequest {
9811 #[must_use]
9813 pub fn new(evse_id: i32, charging_profile: ChargingProfile) -> Self {
9814 Self {
9815 evse_id,
9816 charging_profile,
9817 custom_data: None,
9818 }
9819 }
9820
9821 #[must_use]
9823 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9824 self.custom_data = Some(value);
9825 self
9826 }
9827}
9828
9829impl Validate for SetChargingProfileRequest {
9830 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9831 path.push_key("evseId");
9832 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
9833 path.pop();
9834 path.push_key("chargingProfile");
9835 Validate::validate_at(&self.charging_profile, path, out);
9836 path.pop();
9837 path.push_key("customData");
9838 if let Some(value) = &self.custom_data {
9839 Validate::validate_at(value, path, out);
9840 }
9841 path.pop();
9842 }
9843}
9844
9845impl Sealed for SetChargingProfileRequest {}
9846impl Request for SetChargingProfileRequest {
9847 type Action = Action;
9848 const ACTION: Action = Action::SetChargingProfile;
9849 const KIND: MessageKind = MessageKind::Call;
9850 const ORIGIN: Origin = Origin::Csms;
9851 type Response = SetChargingProfileResponse;
9852}
9853
9854impl Confirmed for SetChargingProfileRequest {}
9855
9856#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9858pub struct SetChargingProfileResponse {
9859 pub status: ChargingProfileStatus,
9861 #[serde(rename = "statusInfo")]
9863 #[serde(default, skip_serializing_if = "Option::is_none")]
9864 pub status_info: Option<StatusInfo>,
9865 #[serde(rename = "customData")]
9867 #[serde(default, skip_serializing_if = "Option::is_none")]
9868 pub custom_data: Option<crate::types::CustomData>,
9869}
9870
9871impl SetChargingProfileResponse {
9872 #[must_use]
9874 pub fn new(status: ChargingProfileStatus) -> Self {
9875 Self {
9876 status,
9877 status_info: None,
9878 custom_data: None,
9879 }
9880 }
9881
9882 #[must_use]
9884 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
9885 self.status_info = Some(value);
9886 self
9887 }
9888
9889 #[must_use]
9891 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9892 self.custom_data = Some(value);
9893 self
9894 }
9895}
9896
9897impl Validate for SetChargingProfileResponse {
9898 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9899 path.push_key("status");
9900 Validate::validate_at(&self.status, path, out);
9901 path.pop();
9902 path.push_key("statusInfo");
9903 if let Some(value) = &self.status_info {
9904 Validate::validate_at(value, path, out);
9905 }
9906 path.pop();
9907 path.push_key("customData");
9908 if let Some(value) = &self.custom_data {
9909 Validate::validate_at(value, path, out);
9910 }
9911 path.pop();
9912 }
9913}
9914
9915impl Sealed for SetChargingProfileResponse {}
9916impl Response for SetChargingProfileResponse {}
9917
9918#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9920pub struct SetDERControlRequest {
9921 #[serde(rename = "isDefault")]
9923 pub is_default: bool,
9924 #[serde(rename = "controlId")]
9926 pub control_id: String,
9927 #[serde(rename = "controlType")]
9929 pub control_type: DERControl,
9930 #[serde(default, skip_serializing_if = "Option::is_none")]
9932 pub curve: Option<DERCurve>,
9933 #[serde(rename = "enterService")]
9935 #[serde(default, skip_serializing_if = "Option::is_none")]
9936 pub enter_service: Option<EnterService>,
9937 #[serde(rename = "fixedPFAbsorb")]
9939 #[serde(default, skip_serializing_if = "Option::is_none")]
9940 pub fixed_pf_absorb: Option<FixedPF>,
9941 #[serde(rename = "fixedPFInject")]
9943 #[serde(default, skip_serializing_if = "Option::is_none")]
9944 pub fixed_pf_inject: Option<FixedPF>,
9945 #[serde(rename = "fixedVar")]
9947 #[serde(default, skip_serializing_if = "Option::is_none")]
9948 pub fixed_var: Option<FixedVar>,
9949 #[serde(rename = "freqDroop")]
9951 #[serde(default, skip_serializing_if = "Option::is_none")]
9952 pub freq_droop: Option<FreqDroop>,
9953 #[serde(default, skip_serializing_if = "Option::is_none")]
9955 pub gradient: Option<Gradient>,
9956 #[serde(rename = "limitMaxDischarge")]
9958 #[serde(default, skip_serializing_if = "Option::is_none")]
9959 pub limit_max_discharge: Option<LimitMaxDischarge>,
9960 #[serde(rename = "customData")]
9962 #[serde(default, skip_serializing_if = "Option::is_none")]
9963 pub custom_data: Option<crate::types::CustomData>,
9964}
9965
9966impl SetDERControlRequest {
9967 #[must_use]
9969 pub fn new(is_default: bool, control_id: impl Into<String>, control_type: DERControl) -> Self {
9970 Self {
9971 is_default,
9972 control_id: control_id.into(),
9973 control_type,
9974 curve: None,
9975 enter_service: None,
9976 fixed_pf_absorb: None,
9977 fixed_pf_inject: None,
9978 fixed_var: None,
9979 freq_droop: None,
9980 gradient: None,
9981 limit_max_discharge: None,
9982 custom_data: None,
9983 }
9984 }
9985
9986 #[must_use]
9988 pub fn with_curve(mut self, value: DERCurve) -> Self {
9989 self.curve = Some(value);
9990 self
9991 }
9992
9993 #[must_use]
9995 pub fn with_enter_service(mut self, value: EnterService) -> Self {
9996 self.enter_service = Some(value);
9997 self
9998 }
9999
10000 #[must_use]
10002 pub fn with_fixed_pf_absorb(mut self, value: FixedPF) -> Self {
10003 self.fixed_pf_absorb = Some(value);
10004 self
10005 }
10006
10007 #[must_use]
10009 pub fn with_fixed_pf_inject(mut self, value: FixedPF) -> Self {
10010 self.fixed_pf_inject = Some(value);
10011 self
10012 }
10013
10014 #[must_use]
10016 pub fn with_fixed_var(mut self, value: FixedVar) -> Self {
10017 self.fixed_var = Some(value);
10018 self
10019 }
10020
10021 #[must_use]
10023 pub fn with_freq_droop(mut self, value: FreqDroop) -> Self {
10024 self.freq_droop = Some(value);
10025 self
10026 }
10027
10028 #[must_use]
10030 pub fn with_gradient(mut self, value: Gradient) -> Self {
10031 self.gradient = Some(value);
10032 self
10033 }
10034
10035 #[must_use]
10037 pub fn with_limit_max_discharge(mut self, value: LimitMaxDischarge) -> Self {
10038 self.limit_max_discharge = Some(value);
10039 self
10040 }
10041
10042 #[must_use]
10044 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10045 self.custom_data = Some(value);
10046 self
10047 }
10048}
10049
10050impl Validate for SetDERControlRequest {
10051 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10052 path.push_key("controlId");
10053 validate::string(self.control_id.as_str(), None, Some(36), path, out);
10054 path.pop();
10055 path.push_key("controlType");
10056 Validate::validate_at(&self.control_type, path, out);
10057 path.pop();
10058 path.push_key("curve");
10059 if let Some(value) = &self.curve {
10060 Validate::validate_at(value, path, out);
10061 }
10062 path.pop();
10063 path.push_key("enterService");
10064 if let Some(value) = &self.enter_service {
10065 Validate::validate_at(value, path, out);
10066 }
10067 path.pop();
10068 path.push_key("fixedPFAbsorb");
10069 if let Some(value) = &self.fixed_pf_absorb {
10070 Validate::validate_at(value, path, out);
10071 }
10072 path.pop();
10073 path.push_key("fixedPFInject");
10074 if let Some(value) = &self.fixed_pf_inject {
10075 Validate::validate_at(value, path, out);
10076 }
10077 path.pop();
10078 path.push_key("fixedVar");
10079 if let Some(value) = &self.fixed_var {
10080 Validate::validate_at(value, path, out);
10081 }
10082 path.pop();
10083 path.push_key("freqDroop");
10084 if let Some(value) = &self.freq_droop {
10085 Validate::validate_at(value, path, out);
10086 }
10087 path.pop();
10088 path.push_key("gradient");
10089 if let Some(value) = &self.gradient {
10090 Validate::validate_at(value, path, out);
10091 }
10092 path.pop();
10093 path.push_key("limitMaxDischarge");
10094 if let Some(value) = &self.limit_max_discharge {
10095 Validate::validate_at(value, path, out);
10096 }
10097 path.pop();
10098 path.push_key("customData");
10099 if let Some(value) = &self.custom_data {
10100 Validate::validate_at(value, path, out);
10101 }
10102 path.pop();
10103 }
10104}
10105
10106impl Sealed for SetDERControlRequest {}
10107impl Request for SetDERControlRequest {
10108 type Action = Action;
10109 const ACTION: Action = Action::SetDERControl;
10110 const KIND: MessageKind = MessageKind::Call;
10111 const ORIGIN: Origin = Origin::Csms;
10112 type Response = SetDERControlResponse;
10113}
10114
10115impl Confirmed for SetDERControlRequest {}
10116
10117#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10119pub struct SetDERControlResponse {
10120 pub status: DERControlStatus,
10122 #[serde(rename = "statusInfo")]
10124 #[serde(default, skip_serializing_if = "Option::is_none")]
10125 pub status_info: Option<StatusInfo>,
10126 #[serde(rename = "supersededIds")]
10128 #[serde(default, skip_serializing_if = "Option::is_none")]
10129 pub superseded_ids: Option<Vec<String>>,
10130 #[serde(rename = "customData")]
10132 #[serde(default, skip_serializing_if = "Option::is_none")]
10133 pub custom_data: Option<crate::types::CustomData>,
10134}
10135
10136impl SetDERControlResponse {
10137 #[must_use]
10139 pub fn new(status: DERControlStatus) -> Self {
10140 Self {
10141 status,
10142 status_info: None,
10143 superseded_ids: None,
10144 custom_data: None,
10145 }
10146 }
10147
10148 #[must_use]
10150 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
10151 self.status_info = Some(value);
10152 self
10153 }
10154
10155 #[must_use]
10157 pub fn with_superseded_ids(
10158 mut self,
10159 value: impl IntoIterator<Item = impl Into<String>>,
10160 ) -> Self {
10161 self.superseded_ids = Some(value.into_iter().map(Into::into).collect());
10162 self
10163 }
10164
10165 #[must_use]
10167 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10168 self.custom_data = Some(value);
10169 self
10170 }
10171}
10172
10173impl Validate for SetDERControlResponse {
10174 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10175 path.push_key("status");
10176 Validate::validate_at(&self.status, path, out);
10177 path.pop();
10178 path.push_key("statusInfo");
10179 if let Some(value) = &self.status_info {
10180 Validate::validate_at(value, path, out);
10181 }
10182 path.pop();
10183 path.push_key("supersededIds");
10184 if let Some(value) = &self.superseded_ids {
10185 validate::list_len(value.len(), Some(1), Some(24), path, out);
10186 for (index, item) in value.iter().enumerate() {
10187 path.push_index(index);
10188 validate::string(item.as_str(), None, Some(36), path, out);
10189 path.pop();
10190 }
10191 }
10192 path.pop();
10193 path.push_key("customData");
10194 if let Some(value) = &self.custom_data {
10195 Validate::validate_at(value, path, out);
10196 }
10197 path.pop();
10198 }
10199}
10200
10201impl Sealed for SetDERControlResponse {}
10202impl Response for SetDERControlResponse {}
10203
10204#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10206pub struct SetDefaultTariffRequest {
10207 #[serde(rename = "evseId")]
10209 #[serde(deserialize_with = "crate::types::integer::one")]
10210 pub evse_id: i32,
10211 pub tariff: Tariff,
10213 #[serde(rename = "customData")]
10215 #[serde(default, skip_serializing_if = "Option::is_none")]
10216 pub custom_data: Option<crate::types::CustomData>,
10217}
10218
10219impl SetDefaultTariffRequest {
10220 #[must_use]
10222 pub fn new(evse_id: i32, tariff: Tariff) -> Self {
10223 Self {
10224 evse_id,
10225 tariff,
10226 custom_data: None,
10227 }
10228 }
10229
10230 #[must_use]
10232 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10233 self.custom_data = Some(value);
10234 self
10235 }
10236}
10237
10238impl Validate for SetDefaultTariffRequest {
10239 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10240 path.push_key("evseId");
10241 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
10242 path.pop();
10243 path.push_key("tariff");
10244 Validate::validate_at(&self.tariff, path, out);
10245 path.pop();
10246 path.push_key("customData");
10247 if let Some(value) = &self.custom_data {
10248 Validate::validate_at(value, path, out);
10249 }
10250 path.pop();
10251 }
10252}
10253
10254impl Sealed for SetDefaultTariffRequest {}
10255impl Request for SetDefaultTariffRequest {
10256 type Action = Action;
10257 const ACTION: Action = Action::SetDefaultTariff;
10258 const KIND: MessageKind = MessageKind::Call;
10259 const ORIGIN: Origin = Origin::Csms;
10260 type Response = SetDefaultTariffResponse;
10261}
10262
10263impl Confirmed for SetDefaultTariffRequest {}
10264
10265#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10267pub struct SetDefaultTariffResponse {
10268 pub status: TariffSetStatus,
10270 #[serde(rename = "statusInfo")]
10272 #[serde(default, skip_serializing_if = "Option::is_none")]
10273 pub status_info: Option<StatusInfo>,
10274 #[serde(rename = "customData")]
10276 #[serde(default, skip_serializing_if = "Option::is_none")]
10277 pub custom_data: Option<crate::types::CustomData>,
10278}
10279
10280impl SetDefaultTariffResponse {
10281 #[must_use]
10283 pub fn new(status: TariffSetStatus) -> Self {
10284 Self {
10285 status,
10286 status_info: None,
10287 custom_data: None,
10288 }
10289 }
10290
10291 #[must_use]
10293 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
10294 self.status_info = Some(value);
10295 self
10296 }
10297
10298 #[must_use]
10300 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10301 self.custom_data = Some(value);
10302 self
10303 }
10304}
10305
10306impl Validate for SetDefaultTariffResponse {
10307 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10308 path.push_key("status");
10309 Validate::validate_at(&self.status, path, out);
10310 path.pop();
10311 path.push_key("statusInfo");
10312 if let Some(value) = &self.status_info {
10313 Validate::validate_at(value, path, out);
10314 }
10315 path.pop();
10316 path.push_key("customData");
10317 if let Some(value) = &self.custom_data {
10318 Validate::validate_at(value, path, out);
10319 }
10320 path.pop();
10321 }
10322}
10323
10324impl Sealed for SetDefaultTariffResponse {}
10325impl Response for SetDefaultTariffResponse {}
10326
10327#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10329pub struct SetDisplayMessageRequest {
10330 pub message: MessageInfo,
10332 #[serde(rename = "customData")]
10334 #[serde(default, skip_serializing_if = "Option::is_none")]
10335 pub custom_data: Option<crate::types::CustomData>,
10336}
10337
10338impl SetDisplayMessageRequest {
10339 #[must_use]
10341 pub fn new(message: MessageInfo) -> Self {
10342 Self {
10343 message,
10344 custom_data: None,
10345 }
10346 }
10347
10348 #[must_use]
10350 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10351 self.custom_data = Some(value);
10352 self
10353 }
10354}
10355
10356impl Validate for SetDisplayMessageRequest {
10357 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10358 path.push_key("message");
10359 Validate::validate_at(&self.message, path, out);
10360 path.pop();
10361 path.push_key("customData");
10362 if let Some(value) = &self.custom_data {
10363 Validate::validate_at(value, path, out);
10364 }
10365 path.pop();
10366 }
10367}
10368
10369impl Sealed for SetDisplayMessageRequest {}
10370impl Request for SetDisplayMessageRequest {
10371 type Action = Action;
10372 const ACTION: Action = Action::SetDisplayMessage;
10373 const KIND: MessageKind = MessageKind::Call;
10374 const ORIGIN: Origin = Origin::Csms;
10375 type Response = SetDisplayMessageResponse;
10376}
10377
10378impl Confirmed for SetDisplayMessageRequest {}
10379
10380#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10382pub struct SetDisplayMessageResponse {
10383 pub status: DisplayMessageStatus,
10385 #[serde(rename = "statusInfo")]
10387 #[serde(default, skip_serializing_if = "Option::is_none")]
10388 pub status_info: Option<StatusInfo>,
10389 #[serde(rename = "customData")]
10391 #[serde(default, skip_serializing_if = "Option::is_none")]
10392 pub custom_data: Option<crate::types::CustomData>,
10393}
10394
10395impl SetDisplayMessageResponse {
10396 #[must_use]
10398 pub fn new(status: DisplayMessageStatus) -> Self {
10399 Self {
10400 status,
10401 status_info: None,
10402 custom_data: None,
10403 }
10404 }
10405
10406 #[must_use]
10408 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
10409 self.status_info = Some(value);
10410 self
10411 }
10412
10413 #[must_use]
10415 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10416 self.custom_data = Some(value);
10417 self
10418 }
10419}
10420
10421impl Validate for SetDisplayMessageResponse {
10422 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10423 path.push_key("status");
10424 Validate::validate_at(&self.status, path, out);
10425 path.pop();
10426 path.push_key("statusInfo");
10427 if let Some(value) = &self.status_info {
10428 Validate::validate_at(value, path, out);
10429 }
10430 path.pop();
10431 path.push_key("customData");
10432 if let Some(value) = &self.custom_data {
10433 Validate::validate_at(value, path, out);
10434 }
10435 path.pop();
10436 }
10437}
10438
10439impl Sealed for SetDisplayMessageResponse {}
10440impl Response for SetDisplayMessageResponse {}
10441
10442#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10444pub struct SetMonitoringBaseRequest {
10445 #[serde(rename = "monitoringBase")]
10447 pub monitoring_base: MonitoringBase,
10448 #[serde(rename = "customData")]
10450 #[serde(default, skip_serializing_if = "Option::is_none")]
10451 pub custom_data: Option<crate::types::CustomData>,
10452}
10453
10454impl SetMonitoringBaseRequest {
10455 #[must_use]
10457 pub fn new(monitoring_base: MonitoringBase) -> Self {
10458 Self {
10459 monitoring_base,
10460 custom_data: None,
10461 }
10462 }
10463
10464 #[must_use]
10466 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10467 self.custom_data = Some(value);
10468 self
10469 }
10470}
10471
10472impl Validate for SetMonitoringBaseRequest {
10473 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10474 path.push_key("monitoringBase");
10475 Validate::validate_at(&self.monitoring_base, path, out);
10476 path.pop();
10477 path.push_key("customData");
10478 if let Some(value) = &self.custom_data {
10479 Validate::validate_at(value, path, out);
10480 }
10481 path.pop();
10482 }
10483}
10484
10485impl Sealed for SetMonitoringBaseRequest {}
10486impl Request for SetMonitoringBaseRequest {
10487 type Action = Action;
10488 const ACTION: Action = Action::SetMonitoringBase;
10489 const KIND: MessageKind = MessageKind::Call;
10490 const ORIGIN: Origin = Origin::Csms;
10491 type Response = SetMonitoringBaseResponse;
10492}
10493
10494impl Confirmed for SetMonitoringBaseRequest {}
10495
10496#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10498pub struct SetMonitoringBaseResponse {
10499 pub status: GenericDeviceModelStatus,
10501 #[serde(rename = "statusInfo")]
10503 #[serde(default, skip_serializing_if = "Option::is_none")]
10504 pub status_info: Option<StatusInfo>,
10505 #[serde(rename = "customData")]
10507 #[serde(default, skip_serializing_if = "Option::is_none")]
10508 pub custom_data: Option<crate::types::CustomData>,
10509}
10510
10511impl SetMonitoringBaseResponse {
10512 #[must_use]
10514 pub fn new(status: GenericDeviceModelStatus) -> Self {
10515 Self {
10516 status,
10517 status_info: None,
10518 custom_data: None,
10519 }
10520 }
10521
10522 #[must_use]
10524 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
10525 self.status_info = Some(value);
10526 self
10527 }
10528
10529 #[must_use]
10531 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10532 self.custom_data = Some(value);
10533 self
10534 }
10535}
10536
10537impl Validate for SetMonitoringBaseResponse {
10538 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10539 path.push_key("status");
10540 Validate::validate_at(&self.status, path, out);
10541 path.pop();
10542 path.push_key("statusInfo");
10543 if let Some(value) = &self.status_info {
10544 Validate::validate_at(value, path, out);
10545 }
10546 path.pop();
10547 path.push_key("customData");
10548 if let Some(value) = &self.custom_data {
10549 Validate::validate_at(value, path, out);
10550 }
10551 path.pop();
10552 }
10553}
10554
10555impl Sealed for SetMonitoringBaseResponse {}
10556impl Response for SetMonitoringBaseResponse {}
10557
10558#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10560pub struct SetMonitoringLevelRequest {
10561 #[serde(deserialize_with = "crate::types::integer::one")]
10586 pub severity: i32,
10587 #[serde(rename = "customData")]
10589 #[serde(default, skip_serializing_if = "Option::is_none")]
10590 pub custom_data: Option<crate::types::CustomData>,
10591}
10592
10593impl SetMonitoringLevelRequest {
10594 #[must_use]
10596 pub fn new(severity: i32) -> Self {
10597 Self {
10598 severity,
10599 custom_data: None,
10600 }
10601 }
10602
10603 #[must_use]
10605 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10606 self.custom_data = Some(value);
10607 self
10608 }
10609}
10610
10611impl Validate for SetMonitoringLevelRequest {
10612 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10613 path.push_key("severity");
10614 validate::int_range(i64::from(self.severity), Some(0), None, path, out);
10615 path.pop();
10616 path.push_key("customData");
10617 if let Some(value) = &self.custom_data {
10618 Validate::validate_at(value, path, out);
10619 }
10620 path.pop();
10621 }
10622}
10623
10624impl Sealed for SetMonitoringLevelRequest {}
10625impl Request for SetMonitoringLevelRequest {
10626 type Action = Action;
10627 const ACTION: Action = Action::SetMonitoringLevel;
10628 const KIND: MessageKind = MessageKind::Call;
10629 const ORIGIN: Origin = Origin::Csms;
10630 type Response = SetMonitoringLevelResponse;
10631}
10632
10633impl Confirmed for SetMonitoringLevelRequest {}
10634
10635#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10637pub struct SetMonitoringLevelResponse {
10638 pub status: GenericStatus,
10640 #[serde(rename = "statusInfo")]
10642 #[serde(default, skip_serializing_if = "Option::is_none")]
10643 pub status_info: Option<StatusInfo>,
10644 #[serde(rename = "customData")]
10646 #[serde(default, skip_serializing_if = "Option::is_none")]
10647 pub custom_data: Option<crate::types::CustomData>,
10648}
10649
10650impl SetMonitoringLevelResponse {
10651 #[must_use]
10653 pub fn new(status: GenericStatus) -> Self {
10654 Self {
10655 status,
10656 status_info: None,
10657 custom_data: None,
10658 }
10659 }
10660
10661 #[must_use]
10663 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
10664 self.status_info = Some(value);
10665 self
10666 }
10667
10668 #[must_use]
10670 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10671 self.custom_data = Some(value);
10672 self
10673 }
10674}
10675
10676impl Validate for SetMonitoringLevelResponse {
10677 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10678 path.push_key("status");
10679 Validate::validate_at(&self.status, path, out);
10680 path.pop();
10681 path.push_key("statusInfo");
10682 if let Some(value) = &self.status_info {
10683 Validate::validate_at(value, path, out);
10684 }
10685 path.pop();
10686 path.push_key("customData");
10687 if let Some(value) = &self.custom_data {
10688 Validate::validate_at(value, path, out);
10689 }
10690 path.pop();
10691 }
10692}
10693
10694impl Sealed for SetMonitoringLevelResponse {}
10695impl Response for SetMonitoringLevelResponse {}
10696
10697#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10699pub struct SetNetworkProfileRequest {
10700 #[serde(rename = "configurationSlot")]
10702 #[serde(deserialize_with = "crate::types::integer::one")]
10703 pub configuration_slot: i32,
10704 #[serde(rename = "connectionData")]
10706 pub connection_data: NetworkConnectionProfile,
10707 #[serde(rename = "customData")]
10709 #[serde(default, skip_serializing_if = "Option::is_none")]
10710 pub custom_data: Option<crate::types::CustomData>,
10711}
10712
10713impl SetNetworkProfileRequest {
10714 #[must_use]
10716 pub fn new(configuration_slot: i32, connection_data: NetworkConnectionProfile) -> Self {
10717 Self {
10718 configuration_slot,
10719 connection_data,
10720 custom_data: None,
10721 }
10722 }
10723
10724 #[must_use]
10726 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10727 self.custom_data = Some(value);
10728 self
10729 }
10730}
10731
10732impl Validate for SetNetworkProfileRequest {
10733 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10734 path.push_key("connectionData");
10735 Validate::validate_at(&self.connection_data, path, out);
10736 path.pop();
10737 path.push_key("customData");
10738 if let Some(value) = &self.custom_data {
10739 Validate::validate_at(value, path, out);
10740 }
10741 path.pop();
10742 }
10743}
10744
10745impl Sealed for SetNetworkProfileRequest {}
10746impl Request for SetNetworkProfileRequest {
10747 type Action = Action;
10748 const ACTION: Action = Action::SetNetworkProfile;
10749 const KIND: MessageKind = MessageKind::Call;
10750 const ORIGIN: Origin = Origin::Csms;
10751 type Response = SetNetworkProfileResponse;
10752}
10753
10754impl Confirmed for SetNetworkProfileRequest {}
10755
10756#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10758pub struct SetNetworkProfileResponse {
10759 pub status: SetNetworkProfileStatus,
10761 #[serde(rename = "statusInfo")]
10763 #[serde(default, skip_serializing_if = "Option::is_none")]
10764 pub status_info: Option<StatusInfo>,
10765 #[serde(rename = "customData")]
10767 #[serde(default, skip_serializing_if = "Option::is_none")]
10768 pub custom_data: Option<crate::types::CustomData>,
10769}
10770
10771impl SetNetworkProfileResponse {
10772 #[must_use]
10774 pub fn new(status: SetNetworkProfileStatus) -> Self {
10775 Self {
10776 status,
10777 status_info: None,
10778 custom_data: None,
10779 }
10780 }
10781
10782 #[must_use]
10784 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
10785 self.status_info = Some(value);
10786 self
10787 }
10788
10789 #[must_use]
10791 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10792 self.custom_data = Some(value);
10793 self
10794 }
10795}
10796
10797impl Validate for SetNetworkProfileResponse {
10798 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10799 path.push_key("status");
10800 Validate::validate_at(&self.status, path, out);
10801 path.pop();
10802 path.push_key("statusInfo");
10803 if let Some(value) = &self.status_info {
10804 Validate::validate_at(value, path, out);
10805 }
10806 path.pop();
10807 path.push_key("customData");
10808 if let Some(value) = &self.custom_data {
10809 Validate::validate_at(value, path, out);
10810 }
10811 path.pop();
10812 }
10813}
10814
10815impl Sealed for SetNetworkProfileResponse {}
10816impl Response for SetNetworkProfileResponse {}
10817
10818#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10820pub struct SetVariableMonitoringRequest {
10821 #[serde(rename = "setMonitoringData")]
10823 pub set_monitoring_data: Vec<SetMonitoringData>,
10824 #[serde(rename = "customData")]
10826 #[serde(default, skip_serializing_if = "Option::is_none")]
10827 pub custom_data: Option<crate::types::CustomData>,
10828}
10829
10830impl SetVariableMonitoringRequest {
10831 #[must_use]
10833 pub fn new(set_monitoring_data: Vec<SetMonitoringData>) -> Self {
10834 Self {
10835 set_monitoring_data,
10836 custom_data: None,
10837 }
10838 }
10839
10840 #[must_use]
10842 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10843 self.custom_data = Some(value);
10844 self
10845 }
10846}
10847
10848impl Validate for SetVariableMonitoringRequest {
10849 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10850 path.push_key("setMonitoringData");
10851 validate::list_len(self.set_monitoring_data.len(), Some(1), None, path, out);
10852 for (index, item) in self.set_monitoring_data.iter().enumerate() {
10853 path.push_index(index);
10854 Validate::validate_at(item, path, out);
10855 path.pop();
10856 }
10857 path.pop();
10858 path.push_key("customData");
10859 if let Some(value) = &self.custom_data {
10860 Validate::validate_at(value, path, out);
10861 }
10862 path.pop();
10863 }
10864}
10865
10866impl Sealed for SetVariableMonitoringRequest {}
10867impl Request for SetVariableMonitoringRequest {
10868 type Action = Action;
10869 const ACTION: Action = Action::SetVariableMonitoring;
10870 const KIND: MessageKind = MessageKind::Call;
10871 const ORIGIN: Origin = Origin::Csms;
10872 type Response = SetVariableMonitoringResponse;
10873}
10874
10875impl Confirmed for SetVariableMonitoringRequest {}
10876
10877#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10879pub struct SetVariableMonitoringResponse {
10880 #[serde(rename = "setMonitoringResult")]
10882 pub set_monitoring_result: Vec<SetMonitoringResult>,
10883 #[serde(rename = "customData")]
10885 #[serde(default, skip_serializing_if = "Option::is_none")]
10886 pub custom_data: Option<crate::types::CustomData>,
10887}
10888
10889impl SetVariableMonitoringResponse {
10890 #[must_use]
10892 pub fn new(set_monitoring_result: Vec<SetMonitoringResult>) -> Self {
10893 Self {
10894 set_monitoring_result,
10895 custom_data: None,
10896 }
10897 }
10898
10899 #[must_use]
10901 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10902 self.custom_data = Some(value);
10903 self
10904 }
10905}
10906
10907impl Validate for SetVariableMonitoringResponse {
10908 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10909 path.push_key("setMonitoringResult");
10910 validate::list_len(self.set_monitoring_result.len(), Some(1), None, path, out);
10911 for (index, item) in self.set_monitoring_result.iter().enumerate() {
10912 path.push_index(index);
10913 Validate::validate_at(item, path, out);
10914 path.pop();
10915 }
10916 path.pop();
10917 path.push_key("customData");
10918 if let Some(value) = &self.custom_data {
10919 Validate::validate_at(value, path, out);
10920 }
10921 path.pop();
10922 }
10923}
10924
10925impl Sealed for SetVariableMonitoringResponse {}
10926impl Response for SetVariableMonitoringResponse {}
10927
10928#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10930pub struct SetVariablesRequest {
10931 #[serde(rename = "setVariableData")]
10933 pub set_variable_data: Vec<SetVariableData>,
10934 #[serde(rename = "customData")]
10936 #[serde(default, skip_serializing_if = "Option::is_none")]
10937 pub custom_data: Option<crate::types::CustomData>,
10938}
10939
10940impl SetVariablesRequest {
10941 #[must_use]
10943 pub fn new(set_variable_data: Vec<SetVariableData>) -> Self {
10944 Self {
10945 set_variable_data,
10946 custom_data: None,
10947 }
10948 }
10949
10950 #[must_use]
10952 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10953 self.custom_data = Some(value);
10954 self
10955 }
10956}
10957
10958impl Validate for SetVariablesRequest {
10959 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10960 path.push_key("setVariableData");
10961 validate::list_len(self.set_variable_data.len(), Some(1), None, path, out);
10962 for (index, item) in self.set_variable_data.iter().enumerate() {
10963 path.push_index(index);
10964 Validate::validate_at(item, path, out);
10965 path.pop();
10966 }
10967 path.pop();
10968 path.push_key("customData");
10969 if let Some(value) = &self.custom_data {
10970 Validate::validate_at(value, path, out);
10971 }
10972 path.pop();
10973 }
10974}
10975
10976impl Sealed for SetVariablesRequest {}
10977impl Request for SetVariablesRequest {
10978 type Action = Action;
10979 const ACTION: Action = Action::SetVariables;
10980 const KIND: MessageKind = MessageKind::Call;
10981 const ORIGIN: Origin = Origin::Csms;
10982 type Response = SetVariablesResponse;
10983}
10984
10985impl Confirmed for SetVariablesRequest {}
10986
10987#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10989pub struct SetVariablesResponse {
10990 #[serde(rename = "setVariableResult")]
10992 pub set_variable_result: Vec<SetVariableResult>,
10993 #[serde(rename = "customData")]
10995 #[serde(default, skip_serializing_if = "Option::is_none")]
10996 pub custom_data: Option<crate::types::CustomData>,
10997}
10998
10999impl SetVariablesResponse {
11000 #[must_use]
11002 pub fn new(set_variable_result: Vec<SetVariableResult>) -> Self {
11003 Self {
11004 set_variable_result,
11005 custom_data: None,
11006 }
11007 }
11008
11009 #[must_use]
11011 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11012 self.custom_data = Some(value);
11013 self
11014 }
11015}
11016
11017impl Validate for SetVariablesResponse {
11018 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11019 path.push_key("setVariableResult");
11020 validate::list_len(self.set_variable_result.len(), Some(1), None, path, out);
11021 for (index, item) in self.set_variable_result.iter().enumerate() {
11022 path.push_index(index);
11023 Validate::validate_at(item, path, out);
11024 path.pop();
11025 }
11026 path.pop();
11027 path.push_key("customData");
11028 if let Some(value) = &self.custom_data {
11029 Validate::validate_at(value, path, out);
11030 }
11031 path.pop();
11032 }
11033}
11034
11035impl Sealed for SetVariablesResponse {}
11036impl Response for SetVariablesResponse {}
11037
11038#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11040pub struct SignCertificateRequest {
11041 pub csr: String,
11043 #[serde(rename = "certificateType")]
11045 #[serde(default, skip_serializing_if = "Option::is_none")]
11046 pub certificate_type: Option<CertificateSigningUse>,
11047 #[serde(rename = "hashRootCertificate")]
11049 #[serde(default, skip_serializing_if = "Option::is_none")]
11050 pub hash_root_certificate: Option<CertificateHashData>,
11051 #[serde(rename = "requestId")]
11053 #[serde(default, skip_serializing_if = "Option::is_none")]
11054 #[serde(deserialize_with = "crate::types::integer::option")]
11055 pub request_id: Option<i32>,
11056 #[serde(rename = "customData")]
11058 #[serde(default, skip_serializing_if = "Option::is_none")]
11059 pub custom_data: Option<crate::types::CustomData>,
11060}
11061
11062impl SignCertificateRequest {
11063 #[must_use]
11065 pub fn new(csr: impl Into<String>) -> Self {
11066 Self {
11067 csr: csr.into(),
11068 certificate_type: None,
11069 hash_root_certificate: None,
11070 request_id: None,
11071 custom_data: None,
11072 }
11073 }
11074
11075 #[must_use]
11077 pub fn with_certificate_type(mut self, value: CertificateSigningUse) -> Self {
11078 self.certificate_type = Some(value);
11079 self
11080 }
11081
11082 #[must_use]
11084 pub fn with_hash_root_certificate(mut self, value: CertificateHashData) -> Self {
11085 self.hash_root_certificate = Some(value);
11086 self
11087 }
11088
11089 #[must_use]
11091 pub fn with_request_id(mut self, value: i32) -> Self {
11092 self.request_id = Some(value);
11093 self
11094 }
11095
11096 #[must_use]
11098 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11099 self.custom_data = Some(value);
11100 self
11101 }
11102}
11103
11104impl Validate for SignCertificateRequest {
11105 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11106 path.push_key("csr");
11107 validate::string(self.csr.as_str(), None, Some(5500), path, out);
11108 path.pop();
11109 path.push_key("certificateType");
11110 if let Some(value) = &self.certificate_type {
11111 Validate::validate_at(value, path, out);
11112 }
11113 path.pop();
11114 path.push_key("hashRootCertificate");
11115 if let Some(value) = &self.hash_root_certificate {
11116 Validate::validate_at(value, path, out);
11117 }
11118 path.pop();
11119 path.push_key("customData");
11120 if let Some(value) = &self.custom_data {
11121 Validate::validate_at(value, path, out);
11122 }
11123 path.pop();
11124 }
11125}
11126
11127impl Sealed for SignCertificateRequest {}
11128impl Request for SignCertificateRequest {
11129 type Action = Action;
11130 const ACTION: Action = Action::SignCertificate;
11131 const KIND: MessageKind = MessageKind::Call;
11132 const ORIGIN: Origin = Origin::ChargingStation;
11133 type Response = SignCertificateResponse;
11134}
11135
11136impl Confirmed for SignCertificateRequest {}
11137
11138#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11140pub struct SignCertificateResponse {
11141 pub status: GenericStatus,
11143 #[serde(rename = "statusInfo")]
11145 #[serde(default, skip_serializing_if = "Option::is_none")]
11146 pub status_info: Option<StatusInfo>,
11147 #[serde(rename = "customData")]
11149 #[serde(default, skip_serializing_if = "Option::is_none")]
11150 pub custom_data: Option<crate::types::CustomData>,
11151}
11152
11153impl SignCertificateResponse {
11154 #[must_use]
11156 pub fn new(status: GenericStatus) -> Self {
11157 Self {
11158 status,
11159 status_info: None,
11160 custom_data: None,
11161 }
11162 }
11163
11164 #[must_use]
11166 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
11167 self.status_info = Some(value);
11168 self
11169 }
11170
11171 #[must_use]
11173 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11174 self.custom_data = Some(value);
11175 self
11176 }
11177}
11178
11179impl Validate for SignCertificateResponse {
11180 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11181 path.push_key("status");
11182 Validate::validate_at(&self.status, path, out);
11183 path.pop();
11184 path.push_key("statusInfo");
11185 if let Some(value) = &self.status_info {
11186 Validate::validate_at(value, path, out);
11187 }
11188 path.pop();
11189 path.push_key("customData");
11190 if let Some(value) = &self.custom_data {
11191 Validate::validate_at(value, path, out);
11192 }
11193 path.pop();
11194 }
11195}
11196
11197impl Sealed for SignCertificateResponse {}
11198impl Response for SignCertificateResponse {}
11199
11200#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11202pub struct StatusNotificationRequest {
11203 pub timestamp: crate::types::DateTime,
11205 #[serde(rename = "connectorStatus")]
11207 pub connector_status: ConnectorStatus,
11208 #[serde(rename = "evseId")]
11210 #[serde(deserialize_with = "crate::types::integer::one")]
11211 pub evse_id: i32,
11212 #[serde(rename = "connectorId")]
11214 #[serde(deserialize_with = "crate::types::integer::one")]
11215 pub connector_id: i32,
11216 #[serde(rename = "customData")]
11218 #[serde(default, skip_serializing_if = "Option::is_none")]
11219 pub custom_data: Option<crate::types::CustomData>,
11220}
11221
11222impl StatusNotificationRequest {
11223 #[must_use]
11225 pub fn new(
11226 timestamp: impl Into<crate::types::DateTime>,
11227 connector_status: ConnectorStatus,
11228 evse_id: i32,
11229 connector_id: i32,
11230 ) -> Self {
11231 Self {
11232 timestamp: timestamp.into(),
11233 connector_status,
11234 evse_id,
11235 connector_id,
11236 custom_data: None,
11237 }
11238 }
11239
11240 #[must_use]
11242 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11243 self.custom_data = Some(value);
11244 self
11245 }
11246}
11247
11248impl Validate for StatusNotificationRequest {
11249 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11250 path.push_key("connectorStatus");
11251 Validate::validate_at(&self.connector_status, path, out);
11252 path.pop();
11253 path.push_key("evseId");
11254 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
11255 path.pop();
11256 path.push_key("connectorId");
11257 validate::int_range(i64::from(self.connector_id), Some(0), None, path, out);
11258 path.pop();
11259 path.push_key("customData");
11260 if let Some(value) = &self.custom_data {
11261 Validate::validate_at(value, path, out);
11262 }
11263 path.pop();
11264 }
11265}
11266
11267impl Sealed for StatusNotificationRequest {}
11268impl Request for StatusNotificationRequest {
11269 type Action = Action;
11270 const ACTION: Action = Action::StatusNotification;
11271 const KIND: MessageKind = MessageKind::Call;
11272 const ORIGIN: Origin = Origin::ChargingStation;
11273 type Response = StatusNotificationResponse;
11274}
11275
11276impl Confirmed for StatusNotificationRequest {}
11277
11278#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
11280pub struct StatusNotificationResponse {
11281 #[serde(rename = "customData")]
11283 #[serde(default, skip_serializing_if = "Option::is_none")]
11284 pub custom_data: Option<crate::types::CustomData>,
11285}
11286
11287impl StatusNotificationResponse {
11288 #[must_use]
11290 pub fn new() -> Self {
11291 Self::default()
11292 }
11293
11294 #[must_use]
11296 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11297 self.custom_data = Some(value);
11298 self
11299 }
11300}
11301
11302impl Validate for StatusNotificationResponse {
11303 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11304 path.push_key("customData");
11305 if let Some(value) = &self.custom_data {
11306 Validate::validate_at(value, path, out);
11307 }
11308 path.pop();
11309 }
11310}
11311
11312impl Sealed for StatusNotificationResponse {}
11313impl Response for StatusNotificationResponse {}
11314
11315#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11317pub struct TransactionEventRequest {
11318 #[serde(rename = "eventType")]
11320 pub event_type: TransactionEventEnum,
11321 pub timestamp: crate::types::DateTime,
11323 #[serde(rename = "triggerReason")]
11325 pub trigger_reason: TriggerReason,
11326 #[serde(rename = "seqNo")]
11328 #[serde(deserialize_with = "crate::types::integer::one")]
11329 pub seq_no: i32,
11330 #[serde(rename = "transactionInfo")]
11332 pub transaction_info: Transaction,
11333 #[serde(rename = "costDetails")]
11335 #[serde(default, skip_serializing_if = "Option::is_none")]
11336 pub cost_details: Option<CostDetails>,
11337 #[serde(rename = "meterValue")]
11339 #[serde(default, skip_serializing_if = "Option::is_none")]
11340 pub meter_value: Option<Vec<MeterValue>>,
11341 #[serde(default, skip_serializing_if = "Option::is_none")]
11344 pub offline: Option<bool>,
11345 #[serde(rename = "numberOfPhasesUsed")]
11350 #[serde(default, skip_serializing_if = "Option::is_none")]
11351 #[serde(deserialize_with = "crate::types::integer::option")]
11352 pub number_of_phases_used: Option<i32>,
11353 #[serde(rename = "cableMaxCurrent")]
11355 #[serde(default, skip_serializing_if = "Option::is_none")]
11356 #[serde(deserialize_with = "crate::types::integer::option")]
11357 pub cable_max_current: Option<i32>,
11358 #[serde(rename = "reservationId")]
11360 #[serde(default, skip_serializing_if = "Option::is_none")]
11361 #[serde(deserialize_with = "crate::types::integer::option")]
11362 pub reservation_id: Option<i32>,
11363 #[serde(rename = "preconditioningStatus")]
11365 #[serde(default, skip_serializing_if = "Option::is_none")]
11366 pub preconditioning_status: Option<PreconditioningStatus>,
11367 #[serde(rename = "evseSleep")]
11369 #[serde(default, skip_serializing_if = "Option::is_none")]
11370 pub evse_sleep: Option<bool>,
11371 #[serde(default, skip_serializing_if = "Option::is_none")]
11373 pub evse: Option<EVSE>,
11374 #[serde(rename = "idToken")]
11376 #[serde(default, skip_serializing_if = "Option::is_none")]
11377 pub id_token: Option<IdToken>,
11378 #[serde(rename = "customData")]
11380 #[serde(default, skip_serializing_if = "Option::is_none")]
11381 pub custom_data: Option<crate::types::CustomData>,
11382}
11383
11384impl TransactionEventRequest {
11385 #[must_use]
11387 pub fn new(
11388 event_type: TransactionEventEnum,
11389 timestamp: impl Into<crate::types::DateTime>,
11390 trigger_reason: TriggerReason,
11391 seq_no: i32,
11392 transaction_info: Transaction,
11393 ) -> Self {
11394 Self {
11395 event_type,
11396 timestamp: timestamp.into(),
11397 trigger_reason,
11398 seq_no,
11399 transaction_info,
11400 cost_details: None,
11401 meter_value: None,
11402 offline: None,
11403 number_of_phases_used: None,
11404 cable_max_current: None,
11405 reservation_id: None,
11406 preconditioning_status: None,
11407 evse_sleep: None,
11408 evse: None,
11409 id_token: None,
11410 custom_data: None,
11411 }
11412 }
11413
11414 #[must_use]
11416 pub fn with_cost_details(mut self, value: CostDetails) -> Self {
11417 self.cost_details = Some(value);
11418 self
11419 }
11420
11421 #[must_use]
11423 pub fn with_meter_value(mut self, value: Vec<MeterValue>) -> Self {
11424 self.meter_value = Some(value);
11425 self
11426 }
11427
11428 #[must_use]
11430 pub fn with_offline(mut self, value: bool) -> Self {
11431 self.offline = Some(value);
11432 self
11433 }
11434
11435 #[must_use]
11437 pub fn with_number_of_phases_used(mut self, value: i32) -> Self {
11438 self.number_of_phases_used = Some(value);
11439 self
11440 }
11441
11442 #[must_use]
11444 pub fn with_cable_max_current(mut self, value: i32) -> Self {
11445 self.cable_max_current = Some(value);
11446 self
11447 }
11448
11449 #[must_use]
11451 pub fn with_reservation_id(mut self, value: i32) -> Self {
11452 self.reservation_id = Some(value);
11453 self
11454 }
11455
11456 #[must_use]
11458 pub fn with_preconditioning_status(mut self, value: PreconditioningStatus) -> Self {
11459 self.preconditioning_status = Some(value);
11460 self
11461 }
11462
11463 #[must_use]
11465 pub fn with_evse_sleep(mut self, value: bool) -> Self {
11466 self.evse_sleep = Some(value);
11467 self
11468 }
11469
11470 #[must_use]
11472 pub fn with_evse(mut self, value: EVSE) -> Self {
11473 self.evse = Some(value);
11474 self
11475 }
11476
11477 #[must_use]
11479 pub fn with_id_token(mut self, value: IdToken) -> Self {
11480 self.id_token = Some(value);
11481 self
11482 }
11483
11484 #[must_use]
11486 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11487 self.custom_data = Some(value);
11488 self
11489 }
11490}
11491
11492impl Validate for TransactionEventRequest {
11493 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11494 path.push_key("eventType");
11495 Validate::validate_at(&self.event_type, path, out);
11496 path.pop();
11497 path.push_key("triggerReason");
11498 Validate::validate_at(&self.trigger_reason, path, out);
11499 path.pop();
11500 path.push_key("seqNo");
11501 validate::int_range(i64::from(self.seq_no), Some(0), None, path, out);
11502 path.pop();
11503 path.push_key("transactionInfo");
11504 Validate::validate_at(&self.transaction_info, path, out);
11505 path.pop();
11506 path.push_key("costDetails");
11507 if let Some(value) = &self.cost_details {
11508 Validate::validate_at(value, path, out);
11509 }
11510 path.pop();
11511 path.push_key("meterValue");
11512 if let Some(value) = &self.meter_value {
11513 validate::list_len(value.len(), Some(1), None, path, out);
11514 for (index, item) in value.iter().enumerate() {
11515 path.push_index(index);
11516 Validate::validate_at(item, path, out);
11517 path.pop();
11518 }
11519 }
11520 path.pop();
11521 path.push_key("numberOfPhasesUsed");
11522 if let Some(value) = &self.number_of_phases_used {
11523 validate::int_range(i64::from(*value), Some(0), Some(3), path, out);
11524 }
11525 path.pop();
11526 path.push_key("reservationId");
11527 if let Some(value) = &self.reservation_id {
11528 validate::int_range(i64::from(*value), Some(0), None, path, out);
11529 }
11530 path.pop();
11531 path.push_key("preconditioningStatus");
11532 if let Some(value) = &self.preconditioning_status {
11533 Validate::validate_at(value, path, out);
11534 }
11535 path.pop();
11536 path.push_key("evse");
11537 if let Some(value) = &self.evse {
11538 Validate::validate_at(value, path, out);
11539 }
11540 path.pop();
11541 path.push_key("idToken");
11542 if let Some(value) = &self.id_token {
11543 Validate::validate_at(value, path, out);
11544 }
11545 path.pop();
11546 path.push_key("customData");
11547 if let Some(value) = &self.custom_data {
11548 Validate::validate_at(value, path, out);
11549 }
11550 path.pop();
11551 }
11552}
11553
11554impl Sealed for TransactionEventRequest {}
11555impl Request for TransactionEventRequest {
11556 type Action = Action;
11557 const ACTION: Action = Action::TransactionEvent;
11558 const KIND: MessageKind = MessageKind::Call;
11559 const ORIGIN: Origin = Origin::ChargingStation;
11560 type Response = TransactionEventResponse;
11561}
11562
11563impl Confirmed for TransactionEventRequest {}
11564
11565#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
11567pub struct TransactionEventResponse {
11568 #[serde(rename = "totalCost")]
11570 #[serde(default, skip_serializing_if = "Option::is_none")]
11571 pub total_cost: Option<crate::types::Decimal>,
11572 #[serde(rename = "chargingPriority")]
11574 #[serde(default, skip_serializing_if = "Option::is_none")]
11575 #[serde(deserialize_with = "crate::types::integer::option")]
11576 pub charging_priority: Option<i32>,
11577 #[serde(rename = "idTokenInfo")]
11579 #[serde(default, skip_serializing_if = "Option::is_none")]
11580 pub id_token_info: Option<IdTokenInfo>,
11581 #[serde(rename = "transactionLimit")]
11583 #[serde(default, skip_serializing_if = "Option::is_none")]
11584 pub transaction_limit: Option<TransactionLimit>,
11585 #[serde(rename = "updatedPersonalMessage")]
11587 #[serde(default, skip_serializing_if = "Option::is_none")]
11588 pub updated_personal_message: Option<MessageContent>,
11589 #[serde(rename = "updatedPersonalMessageExtra")]
11591 #[serde(default, skip_serializing_if = "Option::is_none")]
11592 pub updated_personal_message_extra: Option<Vec<MessageContent>>,
11593 #[serde(rename = "customData")]
11595 #[serde(default, skip_serializing_if = "Option::is_none")]
11596 pub custom_data: Option<crate::types::CustomData>,
11597}
11598
11599impl TransactionEventResponse {
11600 #[must_use]
11602 pub fn new() -> Self {
11603 Self::default()
11604 }
11605
11606 #[must_use]
11608 pub fn with_total_cost(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11609 self.total_cost = Some(value.into());
11610 self
11611 }
11612
11613 #[must_use]
11615 pub fn with_charging_priority(mut self, value: i32) -> Self {
11616 self.charging_priority = Some(value);
11617 self
11618 }
11619
11620 #[must_use]
11622 pub fn with_id_token_info(mut self, value: IdTokenInfo) -> Self {
11623 self.id_token_info = Some(value);
11624 self
11625 }
11626
11627 #[must_use]
11629 pub fn with_transaction_limit(mut self, value: TransactionLimit) -> Self {
11630 self.transaction_limit = Some(value);
11631 self
11632 }
11633
11634 #[must_use]
11636 pub fn with_updated_personal_message(mut self, value: MessageContent) -> Self {
11637 self.updated_personal_message = Some(value);
11638 self
11639 }
11640
11641 #[must_use]
11643 pub fn with_updated_personal_message_extra(mut self, value: Vec<MessageContent>) -> Self {
11644 self.updated_personal_message_extra = Some(value);
11645 self
11646 }
11647
11648 #[must_use]
11650 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11651 self.custom_data = Some(value);
11652 self
11653 }
11654}
11655
11656impl Validate for TransactionEventResponse {
11657 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11658 path.push_key("idTokenInfo");
11659 if let Some(value) = &self.id_token_info {
11660 Validate::validate_at(value, path, out);
11661 }
11662 path.pop();
11663 path.push_key("transactionLimit");
11664 if let Some(value) = &self.transaction_limit {
11665 Validate::validate_at(value, path, out);
11666 }
11667 path.pop();
11668 path.push_key("updatedPersonalMessage");
11669 if let Some(value) = &self.updated_personal_message {
11670 Validate::validate_at(value, path, out);
11671 }
11672 path.pop();
11673 path.push_key("updatedPersonalMessageExtra");
11674 if let Some(value) = &self.updated_personal_message_extra {
11675 validate::list_len(value.len(), Some(1), Some(4), path, out);
11676 for (index, item) in value.iter().enumerate() {
11677 path.push_index(index);
11678 Validate::validate_at(item, path, out);
11679 path.pop();
11680 }
11681 }
11682 path.pop();
11683 path.push_key("customData");
11684 if let Some(value) = &self.custom_data {
11685 Validate::validate_at(value, path, out);
11686 }
11687 path.pop();
11688 }
11689}
11690
11691impl Sealed for TransactionEventResponse {}
11692impl Response for TransactionEventResponse {}
11693
11694#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11696pub struct TriggerMessageRequest {
11697 #[serde(rename = "requestedMessage")]
11699 pub requested_message: MessageTrigger,
11700 #[serde(default, skip_serializing_if = "Option::is_none")]
11702 pub evse: Option<EVSE>,
11703 #[serde(rename = "customTrigger")]
11705 #[serde(default, skip_serializing_if = "Option::is_none")]
11706 pub custom_trigger: Option<String>,
11707 #[serde(rename = "customData")]
11709 #[serde(default, skip_serializing_if = "Option::is_none")]
11710 pub custom_data: Option<crate::types::CustomData>,
11711}
11712
11713impl TriggerMessageRequest {
11714 #[must_use]
11716 pub fn new(requested_message: MessageTrigger) -> Self {
11717 Self {
11718 requested_message,
11719 evse: None,
11720 custom_trigger: None,
11721 custom_data: None,
11722 }
11723 }
11724
11725 #[must_use]
11727 pub fn with_evse(mut self, value: EVSE) -> Self {
11728 self.evse = Some(value);
11729 self
11730 }
11731
11732 #[must_use]
11734 pub fn with_custom_trigger(mut self, value: impl Into<String>) -> Self {
11735 self.custom_trigger = Some(value.into());
11736 self
11737 }
11738
11739 #[must_use]
11741 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11742 self.custom_data = Some(value);
11743 self
11744 }
11745}
11746
11747impl Validate for TriggerMessageRequest {
11748 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11749 path.push_key("requestedMessage");
11750 Validate::validate_at(&self.requested_message, path, out);
11751 path.pop();
11752 path.push_key("evse");
11753 if let Some(value) = &self.evse {
11754 Validate::validate_at(value, path, out);
11755 }
11756 path.pop();
11757 path.push_key("customTrigger");
11758 if let Some(value) = &self.custom_trigger {
11759 validate::string(value.as_str(), None, Some(50), path, out);
11760 }
11761 path.pop();
11762 path.push_key("customData");
11763 if let Some(value) = &self.custom_data {
11764 Validate::validate_at(value, path, out);
11765 }
11766 path.pop();
11767 }
11768}
11769
11770impl Sealed for TriggerMessageRequest {}
11771impl Request for TriggerMessageRequest {
11772 type Action = Action;
11773 const ACTION: Action = Action::TriggerMessage;
11774 const KIND: MessageKind = MessageKind::Call;
11775 const ORIGIN: Origin = Origin::Csms;
11776 type Response = TriggerMessageResponse;
11777}
11778
11779impl Confirmed for TriggerMessageRequest {}
11780
11781#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11783pub struct TriggerMessageResponse {
11784 pub status: TriggerMessageStatus,
11786 #[serde(rename = "statusInfo")]
11788 #[serde(default, skip_serializing_if = "Option::is_none")]
11789 pub status_info: Option<StatusInfo>,
11790 #[serde(rename = "customData")]
11792 #[serde(default, skip_serializing_if = "Option::is_none")]
11793 pub custom_data: Option<crate::types::CustomData>,
11794}
11795
11796impl TriggerMessageResponse {
11797 #[must_use]
11799 pub fn new(status: TriggerMessageStatus) -> Self {
11800 Self {
11801 status,
11802 status_info: None,
11803 custom_data: None,
11804 }
11805 }
11806
11807 #[must_use]
11809 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
11810 self.status_info = Some(value);
11811 self
11812 }
11813
11814 #[must_use]
11816 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11817 self.custom_data = Some(value);
11818 self
11819 }
11820}
11821
11822impl Validate for TriggerMessageResponse {
11823 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11824 path.push_key("status");
11825 Validate::validate_at(&self.status, path, out);
11826 path.pop();
11827 path.push_key("statusInfo");
11828 if let Some(value) = &self.status_info {
11829 Validate::validate_at(value, path, out);
11830 }
11831 path.pop();
11832 path.push_key("customData");
11833 if let Some(value) = &self.custom_data {
11834 Validate::validate_at(value, path, out);
11835 }
11836 path.pop();
11837 }
11838}
11839
11840impl Sealed for TriggerMessageResponse {}
11841impl Response for TriggerMessageResponse {}
11842
11843#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11845pub struct UnlockConnectorRequest {
11846 #[serde(rename = "evseId")]
11848 #[serde(deserialize_with = "crate::types::integer::one")]
11849 pub evse_id: i32,
11850 #[serde(rename = "connectorId")]
11852 #[serde(deserialize_with = "crate::types::integer::one")]
11853 pub connector_id: i32,
11854 #[serde(rename = "customData")]
11856 #[serde(default, skip_serializing_if = "Option::is_none")]
11857 pub custom_data: Option<crate::types::CustomData>,
11858}
11859
11860impl UnlockConnectorRequest {
11861 #[must_use]
11863 pub fn new(evse_id: i32, connector_id: i32) -> Self {
11864 Self {
11865 evse_id,
11866 connector_id,
11867 custom_data: None,
11868 }
11869 }
11870
11871 #[must_use]
11873 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11874 self.custom_data = Some(value);
11875 self
11876 }
11877}
11878
11879impl Validate for UnlockConnectorRequest {
11880 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11881 path.push_key("evseId");
11882 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
11883 path.pop();
11884 path.push_key("connectorId");
11885 validate::int_range(i64::from(self.connector_id), Some(0), None, path, out);
11886 path.pop();
11887 path.push_key("customData");
11888 if let Some(value) = &self.custom_data {
11889 Validate::validate_at(value, path, out);
11890 }
11891 path.pop();
11892 }
11893}
11894
11895impl Sealed for UnlockConnectorRequest {}
11896impl Request for UnlockConnectorRequest {
11897 type Action = Action;
11898 const ACTION: Action = Action::UnlockConnector;
11899 const KIND: MessageKind = MessageKind::Call;
11900 const ORIGIN: Origin = Origin::Csms;
11901 type Response = UnlockConnectorResponse;
11902}
11903
11904impl Confirmed for UnlockConnectorRequest {}
11905
11906#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11908pub struct UnlockConnectorResponse {
11909 pub status: UnlockStatus,
11911 #[serde(rename = "statusInfo")]
11913 #[serde(default, skip_serializing_if = "Option::is_none")]
11914 pub status_info: Option<StatusInfo>,
11915 #[serde(rename = "customData")]
11917 #[serde(default, skip_serializing_if = "Option::is_none")]
11918 pub custom_data: Option<crate::types::CustomData>,
11919}
11920
11921impl UnlockConnectorResponse {
11922 #[must_use]
11924 pub fn new(status: UnlockStatus) -> Self {
11925 Self {
11926 status,
11927 status_info: None,
11928 custom_data: None,
11929 }
11930 }
11931
11932 #[must_use]
11934 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
11935 self.status_info = Some(value);
11936 self
11937 }
11938
11939 #[must_use]
11941 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11942 self.custom_data = Some(value);
11943 self
11944 }
11945}
11946
11947impl Validate for UnlockConnectorResponse {
11948 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11949 path.push_key("status");
11950 Validate::validate_at(&self.status, path, out);
11951 path.pop();
11952 path.push_key("statusInfo");
11953 if let Some(value) = &self.status_info {
11954 Validate::validate_at(value, path, out);
11955 }
11956 path.pop();
11957 path.push_key("customData");
11958 if let Some(value) = &self.custom_data {
11959 Validate::validate_at(value, path, out);
11960 }
11961 path.pop();
11962 }
11963}
11964
11965impl Sealed for UnlockConnectorResponse {}
11966impl Response for UnlockConnectorResponse {}
11967
11968#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11970pub struct UnpublishFirmwareRequest {
11971 pub checksum: String,
11973 #[serde(rename = "customData")]
11975 #[serde(default, skip_serializing_if = "Option::is_none")]
11976 pub custom_data: Option<crate::types::CustomData>,
11977}
11978
11979impl UnpublishFirmwareRequest {
11980 #[must_use]
11982 pub fn new(checksum: impl Into<String>) -> Self {
11983 Self {
11984 checksum: checksum.into(),
11985 custom_data: None,
11986 }
11987 }
11988
11989 #[must_use]
11991 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11992 self.custom_data = Some(value);
11993 self
11994 }
11995}
11996
11997impl Validate for UnpublishFirmwareRequest {
11998 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11999 path.push_key("checksum");
12000 validate::string(self.checksum.as_str(), None, Some(32), path, out);
12001 path.pop();
12002 path.push_key("customData");
12003 if let Some(value) = &self.custom_data {
12004 Validate::validate_at(value, path, out);
12005 }
12006 path.pop();
12007 }
12008}
12009
12010impl Sealed for UnpublishFirmwareRequest {}
12011impl Request for UnpublishFirmwareRequest {
12012 type Action = Action;
12013 const ACTION: Action = Action::UnpublishFirmware;
12014 const KIND: MessageKind = MessageKind::Call;
12015 const ORIGIN: Origin = Origin::Csms;
12016 type Response = UnpublishFirmwareResponse;
12017}
12018
12019impl Confirmed for UnpublishFirmwareRequest {}
12020
12021#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12023pub struct UnpublishFirmwareResponse {
12024 pub status: UnpublishFirmwareStatus,
12026 #[serde(rename = "customData")]
12028 #[serde(default, skip_serializing_if = "Option::is_none")]
12029 pub custom_data: Option<crate::types::CustomData>,
12030}
12031
12032impl UnpublishFirmwareResponse {
12033 #[must_use]
12035 pub fn new(status: UnpublishFirmwareStatus) -> Self {
12036 Self {
12037 status,
12038 custom_data: None,
12039 }
12040 }
12041
12042 #[must_use]
12044 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12045 self.custom_data = Some(value);
12046 self
12047 }
12048}
12049
12050impl Validate for UnpublishFirmwareResponse {
12051 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12052 path.push_key("status");
12053 Validate::validate_at(&self.status, path, out);
12054 path.pop();
12055 path.push_key("customData");
12056 if let Some(value) = &self.custom_data {
12057 Validate::validate_at(value, path, out);
12058 }
12059 path.pop();
12060 }
12061}
12062
12063impl Sealed for UnpublishFirmwareResponse {}
12064impl Response for UnpublishFirmwareResponse {}
12065
12066#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12070pub struct UpdateDynamicScheduleRequest {
12071 #[serde(rename = "chargingProfileId")]
12073 #[serde(deserialize_with = "crate::types::integer::one")]
12074 pub charging_profile_id: i32,
12075 #[serde(rename = "scheduleUpdate")]
12077 pub schedule_update: ChargingScheduleUpdate,
12078 #[serde(rename = "customData")]
12080 #[serde(default, skip_serializing_if = "Option::is_none")]
12081 pub custom_data: Option<crate::types::CustomData>,
12082}
12083
12084impl UpdateDynamicScheduleRequest {
12085 #[must_use]
12087 pub fn new(charging_profile_id: i32, schedule_update: ChargingScheduleUpdate) -> Self {
12088 Self {
12089 charging_profile_id,
12090 schedule_update,
12091 custom_data: None,
12092 }
12093 }
12094
12095 #[must_use]
12097 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12098 self.custom_data = Some(value);
12099 self
12100 }
12101}
12102
12103impl Validate for UpdateDynamicScheduleRequest {
12104 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12105 path.push_key("scheduleUpdate");
12106 Validate::validate_at(&self.schedule_update, path, out);
12107 path.pop();
12108 path.push_key("customData");
12109 if let Some(value) = &self.custom_data {
12110 Validate::validate_at(value, path, out);
12111 }
12112 path.pop();
12113 }
12114}
12115
12116impl Sealed for UpdateDynamicScheduleRequest {}
12117impl Request for UpdateDynamicScheduleRequest {
12118 type Action = Action;
12119 const ACTION: Action = Action::UpdateDynamicSchedule;
12120 const KIND: MessageKind = MessageKind::Call;
12121 const ORIGIN: Origin = Origin::Csms;
12122 type Response = UpdateDynamicScheduleResponse;
12123}
12124
12125impl Confirmed for UpdateDynamicScheduleRequest {}
12126
12127#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12129pub struct UpdateDynamicScheduleResponse {
12130 pub status: ChargingProfileStatus,
12132 #[serde(rename = "statusInfo")]
12134 #[serde(default, skip_serializing_if = "Option::is_none")]
12135 pub status_info: Option<StatusInfo>,
12136 #[serde(rename = "customData")]
12138 #[serde(default, skip_serializing_if = "Option::is_none")]
12139 pub custom_data: Option<crate::types::CustomData>,
12140}
12141
12142impl UpdateDynamicScheduleResponse {
12143 #[must_use]
12145 pub fn new(status: ChargingProfileStatus) -> Self {
12146 Self {
12147 status,
12148 status_info: None,
12149 custom_data: None,
12150 }
12151 }
12152
12153 #[must_use]
12155 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
12156 self.status_info = Some(value);
12157 self
12158 }
12159
12160 #[must_use]
12162 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12163 self.custom_data = Some(value);
12164 self
12165 }
12166}
12167
12168impl Validate for UpdateDynamicScheduleResponse {
12169 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12170 path.push_key("status");
12171 Validate::validate_at(&self.status, path, out);
12172 path.pop();
12173 path.push_key("statusInfo");
12174 if let Some(value) = &self.status_info {
12175 Validate::validate_at(value, path, out);
12176 }
12177 path.pop();
12178 path.push_key("customData");
12179 if let Some(value) = &self.custom_data {
12180 Validate::validate_at(value, path, out);
12181 }
12182 path.pop();
12183 }
12184}
12185
12186impl Sealed for UpdateDynamicScheduleResponse {}
12187impl Response for UpdateDynamicScheduleResponse {}
12188
12189#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12191pub struct UpdateFirmwareRequest {
12192 #[serde(rename = "requestId")]
12194 #[serde(deserialize_with = "crate::types::integer::one")]
12195 pub request_id: i32,
12196 pub firmware: Firmware,
12198 #[serde(default, skip_serializing_if = "Option::is_none")]
12201 #[serde(deserialize_with = "crate::types::integer::option")]
12202 pub retries: Option<i32>,
12203 #[serde(rename = "retryInterval")]
12205 #[serde(default, skip_serializing_if = "Option::is_none")]
12206 #[serde(deserialize_with = "crate::types::integer::option")]
12207 pub retry_interval: Option<i32>,
12208 #[serde(rename = "customData")]
12210 #[serde(default, skip_serializing_if = "Option::is_none")]
12211 pub custom_data: Option<crate::types::CustomData>,
12212}
12213
12214impl UpdateFirmwareRequest {
12215 #[must_use]
12217 pub fn new(request_id: i32, firmware: Firmware) -> Self {
12218 Self {
12219 request_id,
12220 firmware,
12221 retries: None,
12222 retry_interval: None,
12223 custom_data: None,
12224 }
12225 }
12226
12227 #[must_use]
12229 pub fn with_retries(mut self, value: i32) -> Self {
12230 self.retries = Some(value);
12231 self
12232 }
12233
12234 #[must_use]
12236 pub fn with_retry_interval(mut self, value: i32) -> Self {
12237 self.retry_interval = Some(value);
12238 self
12239 }
12240
12241 #[must_use]
12243 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12244 self.custom_data = Some(value);
12245 self
12246 }
12247}
12248
12249impl Validate for UpdateFirmwareRequest {
12250 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12251 path.push_key("firmware");
12252 Validate::validate_at(&self.firmware, path, out);
12253 path.pop();
12254 path.push_key("retries");
12255 if let Some(value) = &self.retries {
12256 validate::int_range(i64::from(*value), Some(0), None, path, out);
12257 }
12258 path.pop();
12259 path.push_key("customData");
12260 if let Some(value) = &self.custom_data {
12261 Validate::validate_at(value, path, out);
12262 }
12263 path.pop();
12264 }
12265}
12266
12267impl Sealed for UpdateFirmwareRequest {}
12268impl Request for UpdateFirmwareRequest {
12269 type Action = Action;
12270 const ACTION: Action = Action::UpdateFirmware;
12271 const KIND: MessageKind = MessageKind::Call;
12272 const ORIGIN: Origin = Origin::Csms;
12273 type Response = UpdateFirmwareResponse;
12274}
12275
12276impl Confirmed for UpdateFirmwareRequest {}
12277
12278#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12280pub struct UpdateFirmwareResponse {
12281 pub status: UpdateFirmwareStatus,
12283 #[serde(rename = "statusInfo")]
12285 #[serde(default, skip_serializing_if = "Option::is_none")]
12286 pub status_info: Option<StatusInfo>,
12287 #[serde(rename = "customData")]
12289 #[serde(default, skip_serializing_if = "Option::is_none")]
12290 pub custom_data: Option<crate::types::CustomData>,
12291}
12292
12293impl UpdateFirmwareResponse {
12294 #[must_use]
12296 pub fn new(status: UpdateFirmwareStatus) -> Self {
12297 Self {
12298 status,
12299 status_info: None,
12300 custom_data: None,
12301 }
12302 }
12303
12304 #[must_use]
12306 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
12307 self.status_info = Some(value);
12308 self
12309 }
12310
12311 #[must_use]
12313 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12314 self.custom_data = Some(value);
12315 self
12316 }
12317}
12318
12319impl Validate for UpdateFirmwareResponse {
12320 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12321 path.push_key("status");
12322 Validate::validate_at(&self.status, path, out);
12323 path.pop();
12324 path.push_key("statusInfo");
12325 if let Some(value) = &self.status_info {
12326 Validate::validate_at(value, path, out);
12327 }
12328 path.pop();
12329 path.push_key("customData");
12330 if let Some(value) = &self.custom_data {
12331 Validate::validate_at(value, path, out);
12332 }
12333 path.pop();
12334 }
12335}
12336
12337impl Sealed for UpdateFirmwareResponse {}
12338impl Response for UpdateFirmwareResponse {}
12339
12340#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12342pub struct UsePriorityChargingRequest {
12343 #[serde(rename = "transactionId")]
12345 pub transaction_id: String,
12346 pub activate: bool,
12349 #[serde(rename = "customData")]
12351 #[serde(default, skip_serializing_if = "Option::is_none")]
12352 pub custom_data: Option<crate::types::CustomData>,
12353}
12354
12355impl UsePriorityChargingRequest {
12356 #[must_use]
12358 pub fn new(transaction_id: impl Into<String>, activate: bool) -> Self {
12359 Self {
12360 transaction_id: transaction_id.into(),
12361 activate,
12362 custom_data: None,
12363 }
12364 }
12365
12366 #[must_use]
12368 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12369 self.custom_data = Some(value);
12370 self
12371 }
12372}
12373
12374impl Validate for UsePriorityChargingRequest {
12375 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12376 path.push_key("transactionId");
12377 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
12378 path.pop();
12379 path.push_key("customData");
12380 if let Some(value) = &self.custom_data {
12381 Validate::validate_at(value, path, out);
12382 }
12383 path.pop();
12384 }
12385}
12386
12387impl Sealed for UsePriorityChargingRequest {}
12388impl Request for UsePriorityChargingRequest {
12389 type Action = Action;
12390 const ACTION: Action = Action::UsePriorityCharging;
12391 const KIND: MessageKind = MessageKind::Call;
12392 const ORIGIN: Origin = Origin::Csms;
12393 type Response = UsePriorityChargingResponse;
12394}
12395
12396impl Confirmed for UsePriorityChargingRequest {}
12397
12398#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12400pub struct UsePriorityChargingResponse {
12401 pub status: PriorityChargingStatus,
12403 #[serde(rename = "statusInfo")]
12405 #[serde(default, skip_serializing_if = "Option::is_none")]
12406 pub status_info: Option<StatusInfo>,
12407 #[serde(rename = "customData")]
12409 #[serde(default, skip_serializing_if = "Option::is_none")]
12410 pub custom_data: Option<crate::types::CustomData>,
12411}
12412
12413impl UsePriorityChargingResponse {
12414 #[must_use]
12416 pub fn new(status: PriorityChargingStatus) -> Self {
12417 Self {
12418 status,
12419 status_info: None,
12420 custom_data: None,
12421 }
12422 }
12423
12424 #[must_use]
12426 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
12427 self.status_info = Some(value);
12428 self
12429 }
12430
12431 #[must_use]
12433 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12434 self.custom_data = Some(value);
12435 self
12436 }
12437}
12438
12439impl Validate for UsePriorityChargingResponse {
12440 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12441 path.push_key("status");
12442 Validate::validate_at(&self.status, path, out);
12443 path.pop();
12444 path.push_key("statusInfo");
12445 if let Some(value) = &self.status_info {
12446 Validate::validate_at(value, path, out);
12447 }
12448 path.pop();
12449 path.push_key("customData");
12450 if let Some(value) = &self.custom_data {
12451 Validate::validate_at(value, path, out);
12452 }
12453 path.pop();
12454 }
12455}
12456
12457impl Sealed for UsePriorityChargingResponse {}
12458impl Response for UsePriorityChargingResponse {}
12459
12460#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12462pub struct VatNumberValidationRequest {
12463 #[serde(rename = "vatNumber")]
12465 pub vat_number: String,
12466 #[serde(rename = "evseId")]
12468 #[serde(default, skip_serializing_if = "Option::is_none")]
12469 #[serde(deserialize_with = "crate::types::integer::option")]
12470 pub evse_id: Option<i32>,
12471 #[serde(rename = "customData")]
12473 #[serde(default, skip_serializing_if = "Option::is_none")]
12474 pub custom_data: Option<crate::types::CustomData>,
12475}
12476
12477impl VatNumberValidationRequest {
12478 #[must_use]
12480 pub fn new(vat_number: impl Into<String>) -> Self {
12481 Self {
12482 vat_number: vat_number.into(),
12483 evse_id: None,
12484 custom_data: None,
12485 }
12486 }
12487
12488 #[must_use]
12490 pub fn with_evse_id(mut self, value: i32) -> Self {
12491 self.evse_id = Some(value);
12492 self
12493 }
12494
12495 #[must_use]
12497 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12498 self.custom_data = Some(value);
12499 self
12500 }
12501}
12502
12503impl Validate for VatNumberValidationRequest {
12504 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12505 path.push_key("vatNumber");
12506 validate::string(self.vat_number.as_str(), None, Some(20), path, out);
12507 path.pop();
12508 path.push_key("evseId");
12509 if let Some(value) = &self.evse_id {
12510 validate::int_range(i64::from(*value), Some(0), None, path, out);
12511 }
12512 path.pop();
12513 path.push_key("customData");
12514 if let Some(value) = &self.custom_data {
12515 Validate::validate_at(value, path, out);
12516 }
12517 path.pop();
12518 }
12519}
12520
12521impl Sealed for VatNumberValidationRequest {}
12522impl Request for VatNumberValidationRequest {
12523 type Action = Action;
12524 const ACTION: Action = Action::VatNumberValidation;
12525 const KIND: MessageKind = MessageKind::Call;
12526 const ORIGIN: Origin = Origin::ChargingStation;
12527 type Response = VatNumberValidationResponse;
12528}
12529
12530impl Confirmed for VatNumberValidationRequest {}
12531
12532#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12534pub struct VatNumberValidationResponse {
12535 #[serde(rename = "vatNumber")]
12537 pub vat_number: String,
12538 pub status: GenericStatus,
12540 #[serde(default, skip_serializing_if = "Option::is_none")]
12542 pub company: Option<Address>,
12543 #[serde(rename = "statusInfo")]
12545 #[serde(default, skip_serializing_if = "Option::is_none")]
12546 pub status_info: Option<StatusInfo>,
12547 #[serde(rename = "evseId")]
12549 #[serde(default, skip_serializing_if = "Option::is_none")]
12550 #[serde(deserialize_with = "crate::types::integer::option")]
12551 pub evse_id: Option<i32>,
12552 #[serde(rename = "customData")]
12554 #[serde(default, skip_serializing_if = "Option::is_none")]
12555 pub custom_data: Option<crate::types::CustomData>,
12556}
12557
12558impl VatNumberValidationResponse {
12559 #[must_use]
12561 pub fn new(vat_number: impl Into<String>, status: GenericStatus) -> Self {
12562 Self {
12563 vat_number: vat_number.into(),
12564 status,
12565 company: None,
12566 status_info: None,
12567 evse_id: None,
12568 custom_data: None,
12569 }
12570 }
12571
12572 #[must_use]
12574 pub fn with_company(mut self, value: Address) -> Self {
12575 self.company = Some(value);
12576 self
12577 }
12578
12579 #[must_use]
12581 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
12582 self.status_info = Some(value);
12583 self
12584 }
12585
12586 #[must_use]
12588 pub fn with_evse_id(mut self, value: i32) -> Self {
12589 self.evse_id = Some(value);
12590 self
12591 }
12592
12593 #[must_use]
12595 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12596 self.custom_data = Some(value);
12597 self
12598 }
12599}
12600
12601impl Validate for VatNumberValidationResponse {
12602 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12603 path.push_key("vatNumber");
12604 validate::string(self.vat_number.as_str(), None, Some(20), path, out);
12605 path.pop();
12606 path.push_key("status");
12607 Validate::validate_at(&self.status, path, out);
12608 path.pop();
12609 path.push_key("company");
12610 if let Some(value) = &self.company {
12611 Validate::validate_at(value, path, out);
12612 }
12613 path.pop();
12614 path.push_key("statusInfo");
12615 if let Some(value) = &self.status_info {
12616 Validate::validate_at(value, path, out);
12617 }
12618 path.pop();
12619 path.push_key("evseId");
12620 if let Some(value) = &self.evse_id {
12621 validate::int_range(i64::from(*value), Some(0), None, path, out);
12622 }
12623 path.pop();
12624 path.push_key("customData");
12625 if let Some(value) = &self.custom_data {
12626 Validate::validate_at(value, path, out);
12627 }
12628 path.pop();
12629 }
12630}
12631
12632impl Sealed for VatNumberValidationResponse {}
12633impl Response for VatNumberValidationResponse {}