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::enums::*;
20use crate::validate::{self, Validate, ValidationPath, Violations};
21
22#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
26pub struct ACChargingParameters {
27 #[serde(rename = "energyAmount")]
32 pub energy_amount: crate::types::Decimal,
33 #[serde(rename = "evMinCurrent")]
37 pub ev_min_current: crate::types::Decimal,
38 #[serde(rename = "evMaxCurrent")]
42 pub ev_max_current: crate::types::Decimal,
43 #[serde(rename = "evMaxVoltage")]
47 pub ev_max_voltage: crate::types::Decimal,
48 #[serde(rename = "customData")]
50 #[serde(default, skip_serializing_if = "Option::is_none")]
51 pub custom_data: Option<crate::types::CustomData>,
52}
53
54impl ACChargingParameters {
55 #[must_use]
57 pub fn new(
58 energy_amount: impl Into<crate::types::Decimal>,
59 ev_min_current: impl Into<crate::types::Decimal>,
60 ev_max_current: impl Into<crate::types::Decimal>,
61 ev_max_voltage: impl Into<crate::types::Decimal>,
62 ) -> Self {
63 Self {
64 energy_amount: energy_amount.into(),
65 ev_min_current: ev_min_current.into(),
66 ev_max_current: ev_max_current.into(),
67 ev_max_voltage: ev_max_voltage.into(),
68 custom_data: None,
69 }
70 }
71
72 #[must_use]
74 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
75 self.custom_data = Some(value);
76 self
77 }
78}
79
80impl Validate for ACChargingParameters {
81 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
82 path.push_key("customData");
83 if let Some(value) = &self.custom_data {
84 Validate::validate_at(value, path, out);
85 }
86 path.pop();
87 }
88}
89
90#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
96pub struct APN {
97 pub apn: String,
99 #[serde(rename = "apnAuthentication")]
101 pub apn_authentication: APNAuthentication,
102 #[serde(rename = "apnUserName")]
104 #[serde(default, skip_serializing_if = "Option::is_none")]
105 pub apn_user_name: Option<String>,
106 #[serde(rename = "apnPassword")]
108 #[serde(default, skip_serializing_if = "Option::is_none")]
109 pub apn_password: Option<String>,
110 #[serde(rename = "simPin")]
112 #[serde(default, skip_serializing_if = "Option::is_none")]
113 #[serde(deserialize_with = "crate::types::integer::option")]
114 pub sim_pin: Option<i32>,
115 #[serde(rename = "preferredNetwork")]
117 #[serde(default, skip_serializing_if = "Option::is_none")]
118 pub preferred_network: Option<String>,
119 #[serde(rename = "useOnlyPreferredNetwork")]
123 #[serde(default, skip_serializing_if = "Option::is_none")]
124 pub use_only_preferred_network: Option<bool>,
125 #[serde(rename = "customData")]
127 #[serde(default, skip_serializing_if = "Option::is_none")]
128 pub custom_data: Option<crate::types::CustomData>,
129}
130
131impl APN {
132 #[must_use]
134 pub fn new(apn: impl Into<String>, apn_authentication: APNAuthentication) -> Self {
135 Self {
136 apn: apn.into(),
137 apn_authentication,
138 apn_user_name: None,
139 apn_password: None,
140 sim_pin: None,
141 preferred_network: None,
142 use_only_preferred_network: None,
143 custom_data: None,
144 }
145 }
146
147 #[must_use]
149 pub fn with_apn_user_name(mut self, value: impl Into<String>) -> Self {
150 self.apn_user_name = Some(value.into());
151 self
152 }
153
154 #[must_use]
156 pub fn with_apn_password(mut self, value: impl Into<String>) -> Self {
157 self.apn_password = Some(value.into());
158 self
159 }
160
161 #[must_use]
163 pub fn with_sim_pin(mut self, value: i32) -> Self {
164 self.sim_pin = Some(value);
165 self
166 }
167
168 #[must_use]
170 pub fn with_preferred_network(mut self, value: impl Into<String>) -> Self {
171 self.preferred_network = Some(value.into());
172 self
173 }
174
175 #[must_use]
177 pub fn with_use_only_preferred_network(mut self, value: bool) -> Self {
178 self.use_only_preferred_network = Some(value);
179 self
180 }
181
182 #[must_use]
184 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
185 self.custom_data = Some(value);
186 self
187 }
188}
189
190impl Validate for APN {
191 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
192 path.push_key("apn");
193 validate::string(self.apn.as_str(), None, Some(2000), path, out);
194 path.pop();
195 path.push_key("apnAuthentication");
196 Validate::validate_at(&self.apn_authentication, path, out);
197 path.pop();
198 path.push_key("apnUserName");
199 if let Some(value) = &self.apn_user_name {
200 validate::string(value.as_str(), None, Some(50), path, out);
201 }
202 path.pop();
203 path.push_key("apnPassword");
204 if let Some(value) = &self.apn_password {
205 validate::string(value.as_str(), None, Some(64), path, out);
206 }
207 path.pop();
208 path.push_key("preferredNetwork");
209 if let Some(value) = &self.preferred_network {
210 validate::string(value.as_str(), None, Some(6), path, out);
211 }
212 path.pop();
213 path.push_key("customData");
214 if let Some(value) = &self.custom_data {
215 Validate::validate_at(value, path, out);
216 }
217 path.pop();
218 }
219}
220
221#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
227pub struct AbsolutePriceSchedule {
228 #[serde(rename = "timeAnchor")]
230 pub time_anchor: crate::types::DateTime,
231 #[serde(rename = "priceScheduleID")]
233 #[serde(deserialize_with = "crate::types::integer::one")]
234 pub price_schedule_id: i32,
235 pub currency: String,
237 pub language: String,
239 #[serde(rename = "priceAlgorithm")]
241 pub price_algorithm: String,
242 #[serde(rename = "priceRuleStacks")]
244 pub price_rule_stacks: Vec<PriceRuleStack>,
245 #[serde(rename = "priceScheduleDescription")]
247 #[serde(default, skip_serializing_if = "Option::is_none")]
248 pub price_schedule_description: Option<String>,
249 #[serde(rename = "minimumCost")]
251 #[serde(default, skip_serializing_if = "Option::is_none")]
252 pub minimum_cost: Option<RationalNumber>,
253 #[serde(rename = "maximumCost")]
255 #[serde(default, skip_serializing_if = "Option::is_none")]
256 pub maximum_cost: Option<RationalNumber>,
257 #[serde(rename = "taxRules")]
259 #[serde(default, skip_serializing_if = "Option::is_none")]
260 pub tax_rules: Option<Vec<TaxRule>>,
261 #[serde(rename = "overstayRuleList")]
263 #[serde(default, skip_serializing_if = "Option::is_none")]
264 pub overstay_rule_list: Option<OverstayRuleList>,
265 #[serde(rename = "additionalSelectedServices")]
267 #[serde(default, skip_serializing_if = "Option::is_none")]
268 pub additional_selected_services: Option<Vec<AdditionalSelectedServices>>,
269 #[serde(rename = "customData")]
271 #[serde(default, skip_serializing_if = "Option::is_none")]
272 pub custom_data: Option<crate::types::CustomData>,
273}
274
275impl AbsolutePriceSchedule {
276 #[must_use]
278 pub fn new(
279 time_anchor: impl Into<crate::types::DateTime>,
280 price_schedule_id: i32,
281 currency: impl Into<String>,
282 language: impl Into<String>,
283 price_algorithm: impl Into<String>,
284 price_rule_stacks: Vec<PriceRuleStack>,
285 ) -> Self {
286 Self {
287 time_anchor: time_anchor.into(),
288 price_schedule_id,
289 currency: currency.into(),
290 language: language.into(),
291 price_algorithm: price_algorithm.into(),
292 price_rule_stacks,
293 price_schedule_description: None,
294 minimum_cost: None,
295 maximum_cost: None,
296 tax_rules: None,
297 overstay_rule_list: None,
298 additional_selected_services: None,
299 custom_data: None,
300 }
301 }
302
303 #[must_use]
305 pub fn with_price_schedule_description(mut self, value: impl Into<String>) -> Self {
306 self.price_schedule_description = Some(value.into());
307 self
308 }
309
310 #[must_use]
312 pub fn with_minimum_cost(mut self, value: RationalNumber) -> Self {
313 self.minimum_cost = Some(value);
314 self
315 }
316
317 #[must_use]
319 pub fn with_maximum_cost(mut self, value: RationalNumber) -> Self {
320 self.maximum_cost = Some(value);
321 self
322 }
323
324 #[must_use]
326 pub fn with_tax_rules(mut self, value: Vec<TaxRule>) -> Self {
327 self.tax_rules = Some(value);
328 self
329 }
330
331 #[must_use]
333 pub fn with_overstay_rule_list(mut self, value: OverstayRuleList) -> Self {
334 self.overstay_rule_list = Some(value);
335 self
336 }
337
338 #[must_use]
340 pub fn with_additional_selected_services(
341 mut self,
342 value: Vec<AdditionalSelectedServices>,
343 ) -> Self {
344 self.additional_selected_services = Some(value);
345 self
346 }
347
348 #[must_use]
350 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
351 self.custom_data = Some(value);
352 self
353 }
354}
355
356impl Validate for AbsolutePriceSchedule {
357 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
358 path.push_key("priceScheduleID");
359 validate::int_range(i64::from(self.price_schedule_id), Some(0), None, path, out);
360 path.pop();
361 path.push_key("currency");
362 validate::string(self.currency.as_str(), None, Some(3), path, out);
363 path.pop();
364 path.push_key("language");
365 validate::string(self.language.as_str(), None, Some(8), path, out);
366 path.pop();
367 path.push_key("priceAlgorithm");
368 validate::string(self.price_algorithm.as_str(), None, Some(2000), path, out);
369 path.pop();
370 path.push_key("priceRuleStacks");
371 validate::list_len(self.price_rule_stacks.len(), Some(1), Some(1024), path, out);
372 for (index, item) in self.price_rule_stacks.iter().enumerate() {
373 path.push_index(index);
374 Validate::validate_at(item, path, out);
375 path.pop();
376 }
377 path.pop();
378 path.push_key("priceScheduleDescription");
379 if let Some(value) = &self.price_schedule_description {
380 validate::string(value.as_str(), None, Some(160), path, out);
381 }
382 path.pop();
383 path.push_key("minimumCost");
384 if let Some(value) = &self.minimum_cost {
385 Validate::validate_at(value, path, out);
386 }
387 path.pop();
388 path.push_key("maximumCost");
389 if let Some(value) = &self.maximum_cost {
390 Validate::validate_at(value, path, out);
391 }
392 path.pop();
393 path.push_key("taxRules");
394 if let Some(value) = &self.tax_rules {
395 validate::list_len(value.len(), Some(1), Some(10), path, out);
396 for (index, item) in value.iter().enumerate() {
397 path.push_index(index);
398 Validate::validate_at(item, path, out);
399 path.pop();
400 }
401 }
402 path.pop();
403 path.push_key("overstayRuleList");
404 if let Some(value) = &self.overstay_rule_list {
405 Validate::validate_at(value, path, out);
406 }
407 path.pop();
408 path.push_key("additionalSelectedServices");
409 if let Some(value) = &self.additional_selected_services {
410 validate::list_len(value.len(), Some(1), Some(5), path, out);
411 for (index, item) in value.iter().enumerate() {
412 path.push_index(index);
413 Validate::validate_at(item, path, out);
414 path.pop();
415 }
416 }
417 path.pop();
418 path.push_key("customData");
419 if let Some(value) = &self.custom_data {
420 Validate::validate_at(value, path, out);
421 }
422 path.pop();
423 }
424}
425
426#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
430pub struct AdditionalInfo {
431 #[serde(rename = "additionalIdToken")]
433 pub additional_id_token: String,
434 pub r#type: String,
436 #[serde(rename = "customData")]
438 #[serde(default, skip_serializing_if = "Option::is_none")]
439 pub custom_data: Option<crate::types::CustomData>,
440}
441
442impl AdditionalInfo {
443 #[must_use]
445 pub fn new(additional_id_token: impl Into<String>, r#type: impl Into<String>) -> Self {
446 Self {
447 additional_id_token: additional_id_token.into(),
448 r#type: r#type.into(),
449 custom_data: None,
450 }
451 }
452
453 #[must_use]
455 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
456 self.custom_data = Some(value);
457 self
458 }
459}
460
461impl Validate for AdditionalInfo {
462 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
463 path.push_key("additionalIdToken");
464 validate::string(
465 self.additional_id_token.as_str(),
466 None,
467 Some(255),
468 path,
469 out,
470 );
471 path.pop();
472 path.push_key("type");
473 validate::string(self.r#type.as_str(), None, Some(50), path, out);
474 path.pop();
475 path.push_key("customData");
476 if let Some(value) = &self.custom_data {
477 Validate::validate_at(value, path, out);
478 }
479 path.pop();
480 }
481}
482
483#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
487pub struct AdditionalSelectedServices {
488 #[serde(rename = "serviceFee")]
490 pub service_fee: RationalNumber,
491 #[serde(rename = "serviceName")]
493 pub service_name: String,
494 #[serde(rename = "customData")]
496 #[serde(default, skip_serializing_if = "Option::is_none")]
497 pub custom_data: Option<crate::types::CustomData>,
498}
499
500impl AdditionalSelectedServices {
501 #[must_use]
503 pub fn new(service_fee: RationalNumber, service_name: impl Into<String>) -> Self {
504 Self {
505 service_fee,
506 service_name: service_name.into(),
507 custom_data: None,
508 }
509 }
510
511 #[must_use]
513 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
514 self.custom_data = Some(value);
515 self
516 }
517}
518
519impl Validate for AdditionalSelectedServices {
520 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
521 path.push_key("serviceFee");
522 Validate::validate_at(&self.service_fee, path, out);
523 path.pop();
524 path.push_key("serviceName");
525 validate::string(self.service_name.as_str(), None, Some(80), path, out);
526 path.pop();
527 path.push_key("customData");
528 if let Some(value) = &self.custom_data {
529 Validate::validate_at(value, path, out);
530 }
531 path.pop();
532 }
533}
534
535#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
539pub struct Address {
540 pub name: String,
542 pub address1: String,
544 pub city: String,
546 pub country: String,
548 #[serde(default, skip_serializing_if = "Option::is_none")]
550 pub address2: Option<String>,
551 #[serde(rename = "postalCode")]
553 #[serde(default, skip_serializing_if = "Option::is_none")]
554 pub postal_code: Option<String>,
555 #[serde(rename = "customData")]
557 #[serde(default, skip_serializing_if = "Option::is_none")]
558 pub custom_data: Option<crate::types::CustomData>,
559}
560
561impl Address {
562 #[must_use]
564 pub fn new(
565 name: impl Into<String>,
566 address1: impl Into<String>,
567 city: impl Into<String>,
568 country: impl Into<String>,
569 ) -> Self {
570 Self {
571 name: name.into(),
572 address1: address1.into(),
573 city: city.into(),
574 country: country.into(),
575 address2: None,
576 postal_code: None,
577 custom_data: None,
578 }
579 }
580
581 #[must_use]
583 pub fn with_address2(mut self, value: impl Into<String>) -> Self {
584 self.address2 = Some(value.into());
585 self
586 }
587
588 #[must_use]
590 pub fn with_postal_code(mut self, value: impl Into<String>) -> Self {
591 self.postal_code = Some(value.into());
592 self
593 }
594
595 #[must_use]
597 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
598 self.custom_data = Some(value);
599 self
600 }
601}
602
603impl Validate for Address {
604 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
605 path.push_key("name");
606 validate::string(self.name.as_str(), None, Some(50), path, out);
607 path.pop();
608 path.push_key("address1");
609 validate::string(self.address1.as_str(), None, Some(100), path, out);
610 path.pop();
611 path.push_key("city");
612 validate::string(self.city.as_str(), None, Some(100), path, out);
613 path.pop();
614 path.push_key("country");
615 validate::string(self.country.as_str(), None, Some(50), path, out);
616 path.pop();
617 path.push_key("address2");
618 if let Some(value) = &self.address2 {
619 validate::string(value.as_str(), None, Some(100), path, out);
620 }
621 path.pop();
622 path.push_key("postalCode");
623 if let Some(value) = &self.postal_code {
624 validate::string(value.as_str(), None, Some(20), path, out);
625 }
626 path.pop();
627 path.push_key("customData");
628 if let Some(value) = &self.custom_data {
629 Validate::validate_at(value, path, out);
630 }
631 path.pop();
632 }
633}
634
635#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
639pub struct AuthorizationData {
640 #[serde(rename = "idToken")]
642 pub id_token: IdToken,
643 #[serde(rename = "idTokenInfo")]
645 #[serde(default, skip_serializing_if = "Option::is_none")]
646 pub id_token_info: Option<IdTokenInfo>,
647 #[serde(rename = "customData")]
649 #[serde(default, skip_serializing_if = "Option::is_none")]
650 pub custom_data: Option<crate::types::CustomData>,
651}
652
653impl AuthorizationData {
654 #[must_use]
656 pub fn new(id_token: IdToken) -> Self {
657 Self {
658 id_token,
659 id_token_info: None,
660 custom_data: None,
661 }
662 }
663
664 #[must_use]
666 pub fn with_id_token_info(mut self, value: IdTokenInfo) -> Self {
667 self.id_token_info = Some(value);
668 self
669 }
670
671 #[must_use]
673 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
674 self.custom_data = Some(value);
675 self
676 }
677}
678
679impl Validate for AuthorizationData {
680 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
681 path.push_key("idToken");
682 Validate::validate_at(&self.id_token, path, out);
683 path.pop();
684 path.push_key("idTokenInfo");
685 if let Some(value) = &self.id_token_info {
686 Validate::validate_at(value, path, out);
687 }
688 path.pop();
689 path.push_key("customData");
690 if let Some(value) = &self.custom_data {
691 Validate::validate_at(value, path, out);
692 }
693 path.pop();
694 }
695}
696
697#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
699pub struct BatteryData {
700 #[serde(rename = "evseId")]
702 #[serde(deserialize_with = "crate::types::integer::one")]
703 pub evse_id: i32,
704 #[serde(rename = "serialNumber")]
706 pub serial_number: String,
707 #[serde(rename = "soC")]
709 pub so_c: crate::types::Decimal,
710 #[serde(rename = "soH")]
712 pub so_h: crate::types::Decimal,
713 #[serde(rename = "productionDate")]
715 #[serde(default, skip_serializing_if = "Option::is_none")]
716 pub production_date: Option<crate::types::DateTime>,
717 #[serde(rename = "vendorInfo")]
719 #[serde(default, skip_serializing_if = "Option::is_none")]
720 pub vendor_info: Option<String>,
721 #[serde(rename = "customData")]
723 #[serde(default, skip_serializing_if = "Option::is_none")]
724 pub custom_data: Option<crate::types::CustomData>,
725}
726
727impl BatteryData {
728 #[must_use]
730 pub fn new(
731 evse_id: i32,
732 serial_number: impl Into<String>,
733 so_c: impl Into<crate::types::Decimal>,
734 so_h: impl Into<crate::types::Decimal>,
735 ) -> Self {
736 Self {
737 evse_id,
738 serial_number: serial_number.into(),
739 so_c: so_c.into(),
740 so_h: so_h.into(),
741 production_date: None,
742 vendor_info: None,
743 custom_data: None,
744 }
745 }
746
747 #[must_use]
749 pub fn with_production_date(mut self, value: impl Into<crate::types::DateTime>) -> Self {
750 self.production_date = Some(value.into());
751 self
752 }
753
754 #[must_use]
756 pub fn with_vendor_info(mut self, value: impl Into<String>) -> Self {
757 self.vendor_info = Some(value.into());
758 self
759 }
760
761 #[must_use]
763 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
764 self.custom_data = Some(value);
765 self
766 }
767}
768
769impl Validate for BatteryData {
770 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
771 path.push_key("evseId");
772 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
773 path.pop();
774 path.push_key("serialNumber");
775 validate::string(self.serial_number.as_str(), None, Some(50), path, out);
776 path.pop();
777 path.push_key("soC");
778 validate::range(
779 self.so_c,
780 Some(crate::types::Decimal::new(0, 0)),
781 Some(crate::types::Decimal::new(100, 0)),
782 path,
783 out,
784 );
785 path.pop();
786 path.push_key("soH");
787 validate::range(
788 self.so_h,
789 Some(crate::types::Decimal::new(0, 0)),
790 Some(crate::types::Decimal::new(100, 0)),
791 path,
792 out,
793 );
794 path.pop();
795 path.push_key("vendorInfo");
796 if let Some(value) = &self.vendor_info {
797 validate::string(value.as_str(), None, Some(500), path, out);
798 }
799 path.pop();
800 path.push_key("customData");
801 if let Some(value) = &self.custom_data {
802 Validate::validate_at(value, path, out);
803 }
804 path.pop();
805 }
806}
807
808#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
810pub struct CertificateHashData {
811 #[serde(rename = "hashAlgorithm")]
813 pub hash_algorithm: HashAlgorithm,
814 #[serde(rename = "issuerNameHash")]
819 pub issuer_name_hash: String,
820 #[serde(rename = "issuerKeyHash")]
824 pub issuer_key_hash: String,
825 #[serde(rename = "serialNumber")]
829 pub serial_number: String,
830 #[serde(rename = "customData")]
832 #[serde(default, skip_serializing_if = "Option::is_none")]
833 pub custom_data: Option<crate::types::CustomData>,
834}
835
836impl CertificateHashData {
837 #[must_use]
839 pub fn new(
840 hash_algorithm: HashAlgorithm,
841 issuer_name_hash: impl Into<String>,
842 issuer_key_hash: impl Into<String>,
843 serial_number: impl Into<String>,
844 ) -> Self {
845 Self {
846 hash_algorithm,
847 issuer_name_hash: issuer_name_hash.into(),
848 issuer_key_hash: issuer_key_hash.into(),
849 serial_number: serial_number.into(),
850 custom_data: None,
851 }
852 }
853
854 #[must_use]
856 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
857 self.custom_data = Some(value);
858 self
859 }
860}
861
862impl Validate for CertificateHashData {
863 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
864 path.push_key("hashAlgorithm");
865 Validate::validate_at(&self.hash_algorithm, path, out);
866 path.pop();
867 path.push_key("issuerNameHash");
868 validate::string(self.issuer_name_hash.as_str(), None, Some(128), path, out);
869 path.pop();
870 path.push_key("issuerKeyHash");
871 validate::string(self.issuer_key_hash.as_str(), None, Some(128), path, out);
872 path.pop();
873 path.push_key("serialNumber");
874 validate::string(self.serial_number.as_str(), None, Some(40), path, out);
875 path.pop();
876 path.push_key("customData");
877 if let Some(value) = &self.custom_data {
878 Validate::validate_at(value, path, out);
879 }
880 path.pop();
881 }
882}
883
884#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
886pub struct CertificateHashDataChain {
887 #[serde(rename = "certificateHashData")]
889 pub certificate_hash_data: CertificateHashData,
890 #[serde(rename = "certificateType")]
892 pub certificate_type: GetCertificateIdUse,
893 #[serde(rename = "childCertificateHashData")]
895 #[serde(default, skip_serializing_if = "Option::is_none")]
896 pub child_certificate_hash_data: Option<Vec<CertificateHashData>>,
897 #[serde(rename = "customData")]
899 #[serde(default, skip_serializing_if = "Option::is_none")]
900 pub custom_data: Option<crate::types::CustomData>,
901}
902
903impl CertificateHashDataChain {
904 #[must_use]
906 pub fn new(
907 certificate_hash_data: CertificateHashData,
908 certificate_type: GetCertificateIdUse,
909 ) -> Self {
910 Self {
911 certificate_hash_data,
912 certificate_type,
913 child_certificate_hash_data: None,
914 custom_data: None,
915 }
916 }
917
918 #[must_use]
920 pub fn with_child_certificate_hash_data(mut self, value: Vec<CertificateHashData>) -> Self {
921 self.child_certificate_hash_data = Some(value);
922 self
923 }
924
925 #[must_use]
927 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
928 self.custom_data = Some(value);
929 self
930 }
931}
932
933impl Validate for CertificateHashDataChain {
934 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
935 path.push_key("certificateHashData");
936 Validate::validate_at(&self.certificate_hash_data, path, out);
937 path.pop();
938 path.push_key("certificateType");
939 Validate::validate_at(&self.certificate_type, path, out);
940 path.pop();
941 path.push_key("childCertificateHashData");
942 if let Some(value) = &self.child_certificate_hash_data {
943 validate::list_len(value.len(), Some(1), Some(4), path, out);
944 for (index, item) in value.iter().enumerate() {
945 path.push_index(index);
946 Validate::validate_at(item, path, out);
947 path.pop();
948 }
949 }
950 path.pop();
951 path.push_key("customData");
952 if let Some(value) = &self.custom_data {
953 Validate::validate_at(value, path, out);
954 }
955 path.pop();
956 }
957}
958
959#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
963pub struct CertificateStatus {
964 #[serde(rename = "certificateHashData")]
966 pub certificate_hash_data: CertificateHashData,
967 pub source: CertificateStatusSource,
969 pub status: CertificateStatusEnum,
971 #[serde(rename = "nextUpdate")]
973 pub next_update: crate::types::DateTime,
974 #[serde(rename = "customData")]
976 #[serde(default, skip_serializing_if = "Option::is_none")]
977 pub custom_data: Option<crate::types::CustomData>,
978}
979
980impl CertificateStatus {
981 #[must_use]
983 pub fn new(
984 certificate_hash_data: CertificateHashData,
985 source: CertificateStatusSource,
986 status: CertificateStatusEnum,
987 next_update: impl Into<crate::types::DateTime>,
988 ) -> Self {
989 Self {
990 certificate_hash_data,
991 source,
992 status,
993 next_update: next_update.into(),
994 custom_data: None,
995 }
996 }
997
998 #[must_use]
1000 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1001 self.custom_data = Some(value);
1002 self
1003 }
1004}
1005
1006impl Validate for CertificateStatus {
1007 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1008 path.push_key("certificateHashData");
1009 Validate::validate_at(&self.certificate_hash_data, path, out);
1010 path.pop();
1011 path.push_key("source");
1012 Validate::validate_at(&self.source, path, out);
1013 path.pop();
1014 path.push_key("status");
1015 Validate::validate_at(&self.status, path, out);
1016 path.pop();
1017 path.push_key("customData");
1018 if let Some(value) = &self.custom_data {
1019 Validate::validate_at(value, path, out);
1020 }
1021 path.pop();
1022 }
1023}
1024
1025#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1029pub struct CertificateStatusRequestInfo {
1030 #[serde(rename = "certificateHashData")]
1032 pub certificate_hash_data: CertificateHashData,
1033 pub source: CertificateStatusSource,
1035 pub urls: Vec<String>,
1037 #[serde(rename = "customData")]
1039 #[serde(default, skip_serializing_if = "Option::is_none")]
1040 pub custom_data: Option<crate::types::CustomData>,
1041}
1042
1043impl CertificateStatusRequestInfo {
1044 #[must_use]
1046 pub fn new(
1047 certificate_hash_data: CertificateHashData,
1048 source: CertificateStatusSource,
1049 urls: impl IntoIterator<Item = impl Into<String>>,
1050 ) -> Self {
1051 Self {
1052 certificate_hash_data,
1053 source,
1054 urls: urls.into_iter().map(Into::into).collect(),
1055 custom_data: None,
1056 }
1057 }
1058
1059 #[must_use]
1061 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1062 self.custom_data = Some(value);
1063 self
1064 }
1065}
1066
1067impl Validate for CertificateStatusRequestInfo {
1068 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1069 path.push_key("certificateHashData");
1070 Validate::validate_at(&self.certificate_hash_data, path, out);
1071 path.pop();
1072 path.push_key("source");
1073 Validate::validate_at(&self.source, path, out);
1074 path.pop();
1075 path.push_key("urls");
1076 validate::list_len(self.urls.len(), Some(1), Some(5), path, out);
1077 for (index, item) in self.urls.iter().enumerate() {
1078 path.push_index(index);
1079 validate::string(item.as_str(), None, Some(2000), path, out);
1080 path.pop();
1081 }
1082 path.pop();
1083 path.push_key("customData");
1084 if let Some(value) = &self.custom_data {
1085 Validate::validate_at(value, path, out);
1086 }
1087 path.pop();
1088 }
1089}
1090
1091#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1093pub struct ChargingLimit {
1094 #[serde(rename = "chargingLimitSource")]
1096 pub charging_limit_source: String,
1097 #[serde(rename = "isLocalGeneration")]
1099 #[serde(default, skip_serializing_if = "Option::is_none")]
1100 pub is_local_generation: Option<bool>,
1101 #[serde(rename = "isGridCritical")]
1103 #[serde(default, skip_serializing_if = "Option::is_none")]
1104 pub is_grid_critical: Option<bool>,
1105 #[serde(rename = "customData")]
1107 #[serde(default, skip_serializing_if = "Option::is_none")]
1108 pub custom_data: Option<crate::types::CustomData>,
1109}
1110
1111impl ChargingLimit {
1112 #[must_use]
1114 pub fn new(charging_limit_source: impl Into<String>) -> Self {
1115 Self {
1116 charging_limit_source: charging_limit_source.into(),
1117 is_local_generation: None,
1118 is_grid_critical: None,
1119 custom_data: None,
1120 }
1121 }
1122
1123 #[must_use]
1125 pub fn with_is_local_generation(mut self, value: bool) -> Self {
1126 self.is_local_generation = Some(value);
1127 self
1128 }
1129
1130 #[must_use]
1132 pub fn with_is_grid_critical(mut self, value: bool) -> Self {
1133 self.is_grid_critical = Some(value);
1134 self
1135 }
1136
1137 #[must_use]
1139 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1140 self.custom_data = Some(value);
1141 self
1142 }
1143}
1144
1145impl Validate for ChargingLimit {
1146 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1147 path.push_key("chargingLimitSource");
1148 validate::string(
1149 self.charging_limit_source.as_str(),
1150 None,
1151 Some(20),
1152 path,
1153 out,
1154 );
1155 path.pop();
1156 path.push_key("customData");
1157 if let Some(value) = &self.custom_data {
1158 Validate::validate_at(value, path, out);
1159 }
1160 path.pop();
1161 }
1162}
1163
1164#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1166pub struct ChargingNeeds {
1167 #[serde(rename = "requestedEnergyTransfer")]
1169 pub requested_energy_transfer: EnergyTransferMode,
1170 #[serde(rename = "acChargingParameters")]
1172 #[serde(default, skip_serializing_if = "Option::is_none")]
1173 pub ac_charging_parameters: Option<ACChargingParameters>,
1174 #[serde(rename = "derChargingParameters")]
1176 #[serde(default, skip_serializing_if = "Option::is_none")]
1177 pub der_charging_parameters: Option<DERChargingParameters>,
1178 #[serde(rename = "evEnergyOffer")]
1180 #[serde(default, skip_serializing_if = "Option::is_none")]
1181 pub ev_energy_offer: Option<EVEnergyOffer>,
1182 #[serde(rename = "dcChargingParameters")]
1184 #[serde(default, skip_serializing_if = "Option::is_none")]
1185 pub dc_charging_parameters: Option<DCChargingParameters>,
1186 #[serde(rename = "v2xChargingParameters")]
1188 #[serde(default, skip_serializing_if = "Option::is_none")]
1189 pub v2x_charging_parameters: Option<V2XChargingParameters>,
1190 #[serde(rename = "availableEnergyTransfer")]
1192 #[serde(default, skip_serializing_if = "Option::is_none")]
1193 pub available_energy_transfer: Option<Vec<EnergyTransferMode>>,
1194 #[serde(rename = "controlMode")]
1196 #[serde(default, skip_serializing_if = "Option::is_none")]
1197 pub control_mode: Option<ControlMode>,
1198 #[serde(rename = "mobilityNeedsMode")]
1200 #[serde(default, skip_serializing_if = "Option::is_none")]
1201 pub mobility_needs_mode: Option<MobilityNeedsMode>,
1202 #[serde(rename = "departureTime")]
1206 #[serde(default, skip_serializing_if = "Option::is_none")]
1207 pub departure_time: Option<crate::types::DateTime>,
1208 #[serde(rename = "customData")]
1210 #[serde(default, skip_serializing_if = "Option::is_none")]
1211 pub custom_data: Option<crate::types::CustomData>,
1212}
1213
1214impl ChargingNeeds {
1215 #[must_use]
1217 pub fn new(requested_energy_transfer: EnergyTransferMode) -> Self {
1218 Self {
1219 requested_energy_transfer,
1220 ac_charging_parameters: None,
1221 der_charging_parameters: None,
1222 ev_energy_offer: None,
1223 dc_charging_parameters: None,
1224 v2x_charging_parameters: None,
1225 available_energy_transfer: None,
1226 control_mode: None,
1227 mobility_needs_mode: None,
1228 departure_time: None,
1229 custom_data: None,
1230 }
1231 }
1232
1233 #[must_use]
1235 pub fn with_ac_charging_parameters(mut self, value: ACChargingParameters) -> Self {
1236 self.ac_charging_parameters = Some(value);
1237 self
1238 }
1239
1240 #[must_use]
1242 pub fn with_der_charging_parameters(mut self, value: DERChargingParameters) -> Self {
1243 self.der_charging_parameters = Some(value);
1244 self
1245 }
1246
1247 #[must_use]
1249 pub fn with_ev_energy_offer(mut self, value: EVEnergyOffer) -> Self {
1250 self.ev_energy_offer = Some(value);
1251 self
1252 }
1253
1254 #[must_use]
1256 pub fn with_dc_charging_parameters(mut self, value: DCChargingParameters) -> Self {
1257 self.dc_charging_parameters = Some(value);
1258 self
1259 }
1260
1261 #[must_use]
1263 pub fn with_v2x_charging_parameters(mut self, value: V2XChargingParameters) -> Self {
1264 self.v2x_charging_parameters = Some(value);
1265 self
1266 }
1267
1268 #[must_use]
1270 pub fn with_available_energy_transfer(mut self, value: Vec<EnergyTransferMode>) -> Self {
1271 self.available_energy_transfer = Some(value);
1272 self
1273 }
1274
1275 #[must_use]
1277 pub fn with_control_mode(mut self, value: ControlMode) -> Self {
1278 self.control_mode = Some(value);
1279 self
1280 }
1281
1282 #[must_use]
1284 pub fn with_mobility_needs_mode(mut self, value: MobilityNeedsMode) -> Self {
1285 self.mobility_needs_mode = Some(value);
1286 self
1287 }
1288
1289 #[must_use]
1291 pub fn with_departure_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1292 self.departure_time = Some(value.into());
1293 self
1294 }
1295
1296 #[must_use]
1298 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1299 self.custom_data = Some(value);
1300 self
1301 }
1302}
1303
1304impl Validate for ChargingNeeds {
1305 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1306 path.push_key("requestedEnergyTransfer");
1307 Validate::validate_at(&self.requested_energy_transfer, path, out);
1308 path.pop();
1309 path.push_key("acChargingParameters");
1310 if let Some(value) = &self.ac_charging_parameters {
1311 Validate::validate_at(value, path, out);
1312 }
1313 path.pop();
1314 path.push_key("derChargingParameters");
1315 if let Some(value) = &self.der_charging_parameters {
1316 Validate::validate_at(value, path, out);
1317 }
1318 path.pop();
1319 path.push_key("evEnergyOffer");
1320 if let Some(value) = &self.ev_energy_offer {
1321 Validate::validate_at(value, path, out);
1322 }
1323 path.pop();
1324 path.push_key("dcChargingParameters");
1325 if let Some(value) = &self.dc_charging_parameters {
1326 Validate::validate_at(value, path, out);
1327 }
1328 path.pop();
1329 path.push_key("v2xChargingParameters");
1330 if let Some(value) = &self.v2x_charging_parameters {
1331 Validate::validate_at(value, path, out);
1332 }
1333 path.pop();
1334 path.push_key("availableEnergyTransfer");
1335 if let Some(value) = &self.available_energy_transfer {
1336 validate::list_len(value.len(), Some(1), None, path, out);
1337 for (index, item) in value.iter().enumerate() {
1338 path.push_index(index);
1339 Validate::validate_at(item, path, out);
1340 path.pop();
1341 }
1342 }
1343 path.pop();
1344 path.push_key("controlMode");
1345 if let Some(value) = &self.control_mode {
1346 Validate::validate_at(value, path, out);
1347 }
1348 path.pop();
1349 path.push_key("mobilityNeedsMode");
1350 if let Some(value) = &self.mobility_needs_mode {
1351 Validate::validate_at(value, path, out);
1352 }
1353 path.pop();
1354 path.push_key("customData");
1355 if let Some(value) = &self.custom_data {
1356 Validate::validate_at(value, path, out);
1357 }
1358 path.pop();
1359 }
1360}
1361
1362#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1366pub struct ChargingPeriod {
1367 #[serde(rename = "startPeriod")]
1369 pub start_period: crate::types::DateTime,
1370 #[serde(default, skip_serializing_if = "Option::is_none")]
1372 pub dimensions: Option<Vec<CostDimension>>,
1373 #[serde(rename = "tariffId")]
1375 #[serde(default, skip_serializing_if = "Option::is_none")]
1376 pub tariff_id: Option<String>,
1377 #[serde(rename = "customData")]
1379 #[serde(default, skip_serializing_if = "Option::is_none")]
1380 pub custom_data: Option<crate::types::CustomData>,
1381}
1382
1383impl ChargingPeriod {
1384 #[must_use]
1386 pub fn new(start_period: impl Into<crate::types::DateTime>) -> Self {
1387 Self {
1388 start_period: start_period.into(),
1389 dimensions: None,
1390 tariff_id: None,
1391 custom_data: None,
1392 }
1393 }
1394
1395 #[must_use]
1397 pub fn with_dimensions(mut self, value: Vec<CostDimension>) -> Self {
1398 self.dimensions = Some(value);
1399 self
1400 }
1401
1402 #[must_use]
1404 pub fn with_tariff_id(mut self, value: impl Into<String>) -> Self {
1405 self.tariff_id = Some(value.into());
1406 self
1407 }
1408
1409 #[must_use]
1411 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1412 self.custom_data = Some(value);
1413 self
1414 }
1415}
1416
1417impl Validate for ChargingPeriod {
1418 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1419 path.push_key("dimensions");
1420 if let Some(value) = &self.dimensions {
1421 validate::list_len(value.len(), Some(1), None, path, out);
1422 for (index, item) in value.iter().enumerate() {
1423 path.push_index(index);
1424 Validate::validate_at(item, path, out);
1425 path.pop();
1426 }
1427 }
1428 path.pop();
1429 path.push_key("tariffId");
1430 if let Some(value) = &self.tariff_id {
1431 validate::string(value.as_str(), None, Some(60), path, out);
1432 }
1433 path.pop();
1434 path.push_key("customData");
1435 if let Some(value) = &self.custom_data {
1436 Validate::validate_at(value, path, out);
1437 }
1438 path.pop();
1439 }
1440}
1441
1442#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1448pub struct ChargingProfile {
1449 #[serde(deserialize_with = "crate::types::integer::one")]
1451 pub id: i32,
1452 #[serde(rename = "stackLevel")]
1454 #[serde(deserialize_with = "crate::types::integer::one")]
1455 pub stack_level: i32,
1456 #[serde(rename = "chargingProfilePurpose")]
1458 pub charging_profile_purpose: ChargingProfilePurpose,
1459 #[serde(rename = "chargingProfileKind")]
1461 pub charging_profile_kind: ChargingProfileKind,
1462 #[serde(rename = "chargingSchedule")]
1464 pub charging_schedule: Vec<ChargingSchedule>,
1465 #[serde(rename = "recurrencyKind")]
1467 #[serde(default, skip_serializing_if = "Option::is_none")]
1468 pub recurrency_kind: Option<RecurrencyKind>,
1469 #[serde(rename = "validFrom")]
1471 #[serde(default, skip_serializing_if = "Option::is_none")]
1472 pub valid_from: Option<crate::types::DateTime>,
1473 #[serde(rename = "validTo")]
1475 #[serde(default, skip_serializing_if = "Option::is_none")]
1476 pub valid_to: Option<crate::types::DateTime>,
1477 #[serde(rename = "transactionId")]
1479 #[serde(default, skip_serializing_if = "Option::is_none")]
1480 pub transaction_id: Option<String>,
1481 #[serde(rename = "maxOfflineDuration")]
1485 #[serde(default, skip_serializing_if = "Option::is_none")]
1486 #[serde(deserialize_with = "crate::types::integer::option")]
1487 pub max_offline_duration: Option<i32>,
1488 #[serde(rename = "invalidAfterOfflineDuration")]
1491 #[serde(default, skip_serializing_if = "Option::is_none")]
1492 pub invalid_after_offline_duration: Option<bool>,
1493 #[serde(rename = "dynUpdateInterval")]
1497 #[serde(default, skip_serializing_if = "Option::is_none")]
1498 #[serde(deserialize_with = "crate::types::integer::option")]
1499 pub dyn_update_interval: Option<i32>,
1500 #[serde(rename = "dynUpdateTime")]
1503 #[serde(default, skip_serializing_if = "Option::is_none")]
1504 pub dyn_update_time: Option<crate::types::DateTime>,
1505 #[serde(rename = "priceScheduleSignature")]
1508 #[serde(default, skip_serializing_if = "Option::is_none")]
1509 pub price_schedule_signature: Option<String>,
1510 #[serde(rename = "customData")]
1512 #[serde(default, skip_serializing_if = "Option::is_none")]
1513 pub custom_data: Option<crate::types::CustomData>,
1514}
1515
1516impl ChargingProfile {
1517 #[must_use]
1519 pub fn new(
1520 id: i32,
1521 stack_level: i32,
1522 charging_profile_purpose: ChargingProfilePurpose,
1523 charging_profile_kind: ChargingProfileKind,
1524 charging_schedule: Vec<ChargingSchedule>,
1525 ) -> Self {
1526 Self {
1527 id,
1528 stack_level,
1529 charging_profile_purpose,
1530 charging_profile_kind,
1531 charging_schedule,
1532 recurrency_kind: None,
1533 valid_from: None,
1534 valid_to: None,
1535 transaction_id: None,
1536 max_offline_duration: None,
1537 invalid_after_offline_duration: None,
1538 dyn_update_interval: None,
1539 dyn_update_time: None,
1540 price_schedule_signature: None,
1541 custom_data: None,
1542 }
1543 }
1544
1545 #[must_use]
1547 pub fn with_recurrency_kind(mut self, value: RecurrencyKind) -> Self {
1548 self.recurrency_kind = Some(value);
1549 self
1550 }
1551
1552 #[must_use]
1554 pub fn with_valid_from(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1555 self.valid_from = Some(value.into());
1556 self
1557 }
1558
1559 #[must_use]
1561 pub fn with_valid_to(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1562 self.valid_to = Some(value.into());
1563 self
1564 }
1565
1566 #[must_use]
1568 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
1569 self.transaction_id = Some(value.into());
1570 self
1571 }
1572
1573 #[must_use]
1575 pub fn with_max_offline_duration(mut self, value: i32) -> Self {
1576 self.max_offline_duration = Some(value);
1577 self
1578 }
1579
1580 #[must_use]
1582 pub fn with_invalid_after_offline_duration(mut self, value: bool) -> Self {
1583 self.invalid_after_offline_duration = Some(value);
1584 self
1585 }
1586
1587 #[must_use]
1589 pub fn with_dyn_update_interval(mut self, value: i32) -> Self {
1590 self.dyn_update_interval = Some(value);
1591 self
1592 }
1593
1594 #[must_use]
1596 pub fn with_dyn_update_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1597 self.dyn_update_time = Some(value.into());
1598 self
1599 }
1600
1601 #[must_use]
1603 pub fn with_price_schedule_signature(mut self, value: impl Into<String>) -> Self {
1604 self.price_schedule_signature = Some(value.into());
1605 self
1606 }
1607
1608 #[must_use]
1610 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1611 self.custom_data = Some(value);
1612 self
1613 }
1614}
1615
1616impl Validate for ChargingProfile {
1617 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1618 path.push_key("stackLevel");
1619 validate::int_range(i64::from(self.stack_level), Some(0), None, path, out);
1620 path.pop();
1621 path.push_key("chargingProfilePurpose");
1622 Validate::validate_at(&self.charging_profile_purpose, path, out);
1623 path.pop();
1624 path.push_key("chargingProfileKind");
1625 Validate::validate_at(&self.charging_profile_kind, path, out);
1626 path.pop();
1627 path.push_key("chargingSchedule");
1628 validate::list_len(self.charging_schedule.len(), Some(1), Some(3), path, out);
1629 for (index, item) in self.charging_schedule.iter().enumerate() {
1630 path.push_index(index);
1631 Validate::validate_at(item, path, out);
1632 path.pop();
1633 }
1634 path.pop();
1635 path.push_key("recurrencyKind");
1636 if let Some(value) = &self.recurrency_kind {
1637 Validate::validate_at(value, path, out);
1638 }
1639 path.pop();
1640 path.push_key("transactionId");
1641 if let Some(value) = &self.transaction_id {
1642 validate::string(value.as_str(), None, Some(36), path, out);
1643 }
1644 path.pop();
1645 path.push_key("priceScheduleSignature");
1646 if let Some(value) = &self.price_schedule_signature {
1647 validate::string(value.as_str(), None, Some(256), path, out);
1648 }
1649 path.pop();
1650 path.push_key("customData");
1651 if let Some(value) = &self.custom_data {
1652 Validate::validate_at(value, path, out);
1653 }
1654 path.pop();
1655 }
1656}
1657
1658#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1662pub struct ChargingProfileCriterion {
1663 #[serde(rename = "chargingProfilePurpose")]
1665 #[serde(default, skip_serializing_if = "Option::is_none")]
1666 pub charging_profile_purpose: Option<ChargingProfilePurpose>,
1667 #[serde(rename = "stackLevel")]
1669 #[serde(default, skip_serializing_if = "Option::is_none")]
1670 #[serde(deserialize_with = "crate::types::integer::option")]
1671 pub stack_level: Option<i32>,
1672 #[serde(rename = "chargingProfileId")]
1674 #[serde(default, skip_serializing_if = "Option::is_none")]
1675 #[serde(deserialize_with = "crate::types::integer::option_list")]
1676 pub charging_profile_id: Option<Vec<i32>>,
1677 #[serde(rename = "chargingLimitSource")]
1679 #[serde(default, skip_serializing_if = "Option::is_none")]
1680 pub charging_limit_source: Option<Vec<String>>,
1681 #[serde(rename = "customData")]
1683 #[serde(default, skip_serializing_if = "Option::is_none")]
1684 pub custom_data: Option<crate::types::CustomData>,
1685}
1686
1687impl ChargingProfileCriterion {
1688 #[must_use]
1690 pub fn new() -> Self {
1691 Self::default()
1692 }
1693
1694 #[must_use]
1696 pub fn with_charging_profile_purpose(mut self, value: ChargingProfilePurpose) -> Self {
1697 self.charging_profile_purpose = Some(value);
1698 self
1699 }
1700
1701 #[must_use]
1703 pub fn with_stack_level(mut self, value: i32) -> Self {
1704 self.stack_level = Some(value);
1705 self
1706 }
1707
1708 #[must_use]
1710 pub fn with_charging_profile_id(mut self, value: Vec<i32>) -> Self {
1711 self.charging_profile_id = Some(value);
1712 self
1713 }
1714
1715 #[must_use]
1717 pub fn with_charging_limit_source(
1718 mut self,
1719 value: impl IntoIterator<Item = impl Into<String>>,
1720 ) -> Self {
1721 self.charging_limit_source = Some(value.into_iter().map(Into::into).collect());
1722 self
1723 }
1724
1725 #[must_use]
1727 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1728 self.custom_data = Some(value);
1729 self
1730 }
1731}
1732
1733impl Validate for ChargingProfileCriterion {
1734 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1735 path.push_key("chargingProfilePurpose");
1736 if let Some(value) = &self.charging_profile_purpose {
1737 Validate::validate_at(value, path, out);
1738 }
1739 path.pop();
1740 path.push_key("stackLevel");
1741 if let Some(value) = &self.stack_level {
1742 validate::int_range(i64::from(*value), Some(0), None, path, out);
1743 }
1744 path.pop();
1745 path.push_key("chargingProfileId");
1746 if let Some(value) = &self.charging_profile_id {
1747 validate::list_len(value.len(), Some(1), None, path, out);
1748 }
1749 path.pop();
1750 path.push_key("chargingLimitSource");
1751 if let Some(value) = &self.charging_limit_source {
1752 validate::list_len(value.len(), Some(1), Some(4), path, out);
1753 for (index, item) in value.iter().enumerate() {
1754 path.push_index(index);
1755 validate::string(item.as_str(), None, Some(20), path, out);
1756 path.pop();
1757 }
1758 }
1759 path.pop();
1760 path.push_key("customData");
1761 if let Some(value) = &self.custom_data {
1762 Validate::validate_at(value, path, out);
1763 }
1764 path.pop();
1765 }
1766}
1767
1768#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1775pub struct ChargingSchedule {
1776 #[serde(deserialize_with = "crate::types::integer::one")]
1778 pub id: i32,
1779 #[serde(rename = "chargingRateUnit")]
1781 pub charging_rate_unit: ChargingRateUnit,
1782 #[serde(rename = "chargingSchedulePeriod")]
1784 pub charging_schedule_period: Vec<ChargingSchedulePeriod>,
1785 #[serde(rename = "limitAtSoC")]
1787 #[serde(default, skip_serializing_if = "Option::is_none")]
1788 pub limit_at_so_c: Option<LimitAtSoC>,
1789 #[serde(rename = "startSchedule")]
1791 #[serde(default, skip_serializing_if = "Option::is_none")]
1792 pub start_schedule: Option<crate::types::DateTime>,
1793 #[serde(default, skip_serializing_if = "Option::is_none")]
1795 #[serde(deserialize_with = "crate::types::integer::option")]
1796 pub duration: Option<i32>,
1797 #[serde(rename = "minChargingRate")]
1799 #[serde(default, skip_serializing_if = "Option::is_none")]
1800 pub min_charging_rate: Option<crate::types::Decimal>,
1801 #[serde(rename = "powerTolerance")]
1803 #[serde(default, skip_serializing_if = "Option::is_none")]
1804 pub power_tolerance: Option<crate::types::Decimal>,
1805 #[serde(rename = "signatureId")]
1807 #[serde(default, skip_serializing_if = "Option::is_none")]
1808 #[serde(deserialize_with = "crate::types::integer::option")]
1809 pub signature_id: Option<i32>,
1810 #[serde(rename = "digestValue")]
1812 #[serde(default, skip_serializing_if = "Option::is_none")]
1813 pub digest_value: Option<String>,
1814 #[serde(rename = "useLocalTime")]
1817 #[serde(default, skip_serializing_if = "Option::is_none")]
1818 pub use_local_time: Option<bool>,
1819 #[serde(rename = "randomizedDelay")]
1821 #[serde(default, skip_serializing_if = "Option::is_none")]
1822 #[serde(deserialize_with = "crate::types::integer::option")]
1823 pub randomized_delay: Option<i32>,
1824 #[serde(rename = "salesTariff")]
1826 #[serde(default, skip_serializing_if = "Option::is_none")]
1827 pub sales_tariff: Option<SalesTariff>,
1828 #[serde(rename = "absolutePriceSchedule")]
1830 #[serde(default, skip_serializing_if = "Option::is_none")]
1831 pub absolute_price_schedule: Option<AbsolutePriceSchedule>,
1832 #[serde(rename = "priceLevelSchedule")]
1834 #[serde(default, skip_serializing_if = "Option::is_none")]
1835 pub price_level_schedule: Option<PriceLevelSchedule>,
1836 #[serde(rename = "customData")]
1838 #[serde(default, skip_serializing_if = "Option::is_none")]
1839 pub custom_data: Option<crate::types::CustomData>,
1840}
1841
1842impl ChargingSchedule {
1843 #[must_use]
1845 pub fn new(
1846 id: i32,
1847 charging_rate_unit: ChargingRateUnit,
1848 charging_schedule_period: Vec<ChargingSchedulePeriod>,
1849 ) -> Self {
1850 Self {
1851 id,
1852 charging_rate_unit,
1853 charging_schedule_period,
1854 limit_at_so_c: None,
1855 start_schedule: None,
1856 duration: None,
1857 min_charging_rate: None,
1858 power_tolerance: None,
1859 signature_id: None,
1860 digest_value: None,
1861 use_local_time: None,
1862 randomized_delay: None,
1863 sales_tariff: None,
1864 absolute_price_schedule: None,
1865 price_level_schedule: None,
1866 custom_data: None,
1867 }
1868 }
1869
1870 #[must_use]
1872 pub fn with_limit_at_so_c(mut self, value: LimitAtSoC) -> Self {
1873 self.limit_at_so_c = Some(value);
1874 self
1875 }
1876
1877 #[must_use]
1879 pub fn with_start_schedule(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1880 self.start_schedule = Some(value.into());
1881 self
1882 }
1883
1884 #[must_use]
1886 pub fn with_duration(mut self, value: i32) -> Self {
1887 self.duration = Some(value);
1888 self
1889 }
1890
1891 #[must_use]
1893 pub fn with_min_charging_rate(mut self, value: impl Into<crate::types::Decimal>) -> Self {
1894 self.min_charging_rate = Some(value.into());
1895 self
1896 }
1897
1898 #[must_use]
1900 pub fn with_power_tolerance(mut self, value: impl Into<crate::types::Decimal>) -> Self {
1901 self.power_tolerance = Some(value.into());
1902 self
1903 }
1904
1905 #[must_use]
1907 pub fn with_signature_id(mut self, value: i32) -> Self {
1908 self.signature_id = Some(value);
1909 self
1910 }
1911
1912 #[must_use]
1914 pub fn with_digest_value(mut self, value: impl Into<String>) -> Self {
1915 self.digest_value = Some(value.into());
1916 self
1917 }
1918
1919 #[must_use]
1921 pub fn with_use_local_time(mut self, value: bool) -> Self {
1922 self.use_local_time = Some(value);
1923 self
1924 }
1925
1926 #[must_use]
1928 pub fn with_randomized_delay(mut self, value: i32) -> Self {
1929 self.randomized_delay = Some(value);
1930 self
1931 }
1932
1933 #[must_use]
1935 pub fn with_sales_tariff(mut self, value: SalesTariff) -> Self {
1936 self.sales_tariff = Some(value);
1937 self
1938 }
1939
1940 #[must_use]
1942 pub fn with_absolute_price_schedule(mut self, value: AbsolutePriceSchedule) -> Self {
1943 self.absolute_price_schedule = Some(value);
1944 self
1945 }
1946
1947 #[must_use]
1949 pub fn with_price_level_schedule(mut self, value: PriceLevelSchedule) -> Self {
1950 self.price_level_schedule = Some(value);
1951 self
1952 }
1953
1954 #[must_use]
1956 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1957 self.custom_data = Some(value);
1958 self
1959 }
1960}
1961
1962impl Validate for ChargingSchedule {
1963 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1964 path.push_key("chargingRateUnit");
1965 Validate::validate_at(&self.charging_rate_unit, path, out);
1966 path.pop();
1967 path.push_key("chargingSchedulePeriod");
1968 validate::list_len(
1969 self.charging_schedule_period.len(),
1970 Some(1),
1971 Some(1024),
1972 path,
1973 out,
1974 );
1975 for (index, item) in self.charging_schedule_period.iter().enumerate() {
1976 path.push_index(index);
1977 Validate::validate_at(item, path, out);
1978 path.pop();
1979 }
1980 path.pop();
1981 path.push_key("limitAtSoC");
1982 if let Some(value) = &self.limit_at_so_c {
1983 Validate::validate_at(value, path, out);
1984 }
1985 path.pop();
1986 path.push_key("signatureId");
1987 if let Some(value) = &self.signature_id {
1988 validate::int_range(i64::from(*value), Some(0), None, path, out);
1989 }
1990 path.pop();
1991 path.push_key("digestValue");
1992 if let Some(value) = &self.digest_value {
1993 validate::string(value.as_str(), None, Some(88), path, out);
1994 }
1995 path.pop();
1996 path.push_key("randomizedDelay");
1997 if let Some(value) = &self.randomized_delay {
1998 validate::int_range(i64::from(*value), Some(0), None, path, out);
1999 }
2000 path.pop();
2001 path.push_key("salesTariff");
2002 if let Some(value) = &self.sales_tariff {
2003 Validate::validate_at(value, path, out);
2004 }
2005 path.pop();
2006 path.push_key("absolutePriceSchedule");
2007 if let Some(value) = &self.absolute_price_schedule {
2008 Validate::validate_at(value, path, out);
2009 }
2010 path.pop();
2011 path.push_key("priceLevelSchedule");
2012 if let Some(value) = &self.price_level_schedule {
2013 Validate::validate_at(value, path, out);
2014 }
2015 path.pop();
2016 path.push_key("customData");
2017 if let Some(value) = &self.custom_data {
2018 Validate::validate_at(value, path, out);
2019 }
2020 path.pop();
2021 }
2022}
2023
2024#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2028pub struct ChargingSchedulePeriod {
2029 #[serde(rename = "startPeriod")]
2031 #[serde(deserialize_with = "crate::types::integer::one")]
2032 pub start_period: i32,
2033 #[serde(default, skip_serializing_if = "Option::is_none")]
2038 pub limit: Option<crate::types::Decimal>,
2039 #[serde(rename = "limit_L2")]
2041 #[serde(default, skip_serializing_if = "Option::is_none")]
2042 pub limit_l2: Option<crate::types::Decimal>,
2043 #[serde(rename = "limit_L3")]
2045 #[serde(default, skip_serializing_if = "Option::is_none")]
2046 pub limit_l3: Option<crate::types::Decimal>,
2047 #[serde(rename = "numberPhases")]
2051 #[serde(default, skip_serializing_if = "Option::is_none")]
2052 #[serde(deserialize_with = "crate::types::integer::option")]
2053 pub number_phases: Option<i32>,
2054 #[serde(rename = "phaseToUse")]
2056 #[serde(default, skip_serializing_if = "Option::is_none")]
2057 #[serde(deserialize_with = "crate::types::integer::option")]
2058 pub phase_to_use: Option<i32>,
2059 #[serde(rename = "dischargeLimit")]
2062 #[serde(default, skip_serializing_if = "Option::is_none")]
2063 pub discharge_limit: Option<crate::types::Decimal>,
2064 #[serde(rename = "dischargeLimit_L2")]
2066 #[serde(default, skip_serializing_if = "Option::is_none")]
2067 pub discharge_limit_l2: Option<crate::types::Decimal>,
2068 #[serde(rename = "dischargeLimit_L3")]
2070 #[serde(default, skip_serializing_if = "Option::is_none")]
2071 pub discharge_limit_l3: Option<crate::types::Decimal>,
2072 #[serde(default, skip_serializing_if = "Option::is_none")]
2076 pub setpoint: Option<crate::types::Decimal>,
2077 #[serde(rename = "setpoint_L2")]
2079 #[serde(default, skip_serializing_if = "Option::is_none")]
2080 pub setpoint_l2: Option<crate::types::Decimal>,
2081 #[serde(rename = "setpoint_L3")]
2083 #[serde(default, skip_serializing_if = "Option::is_none")]
2084 pub setpoint_l3: Option<crate::types::Decimal>,
2085 #[serde(rename = "setpointReactive")]
2088 #[serde(default, skip_serializing_if = "Option::is_none")]
2089 pub setpoint_reactive: Option<crate::types::Decimal>,
2090 #[serde(rename = "setpointReactive_L2")]
2092 #[serde(default, skip_serializing_if = "Option::is_none")]
2093 pub setpoint_reactive_l2: Option<crate::types::Decimal>,
2094 #[serde(rename = "setpointReactive_L3")]
2096 #[serde(default, skip_serializing_if = "Option::is_none")]
2097 pub setpoint_reactive_l3: Option<crate::types::Decimal>,
2098 #[serde(rename = "preconditioningRequest")]
2100 #[serde(default, skip_serializing_if = "Option::is_none")]
2101 pub preconditioning_request: Option<bool>,
2102 #[serde(rename = "evseSleep")]
2104 #[serde(default, skip_serializing_if = "Option::is_none")]
2105 pub evse_sleep: Option<bool>,
2106 #[serde(rename = "v2xBaseline")]
2108 #[serde(default, skip_serializing_if = "Option::is_none")]
2109 pub v2x_baseline: Option<crate::types::Decimal>,
2110 #[serde(rename = "operationMode")]
2112 #[serde(default, skip_serializing_if = "Option::is_none")]
2113 pub operation_mode: Option<OperationMode>,
2114 #[serde(rename = "v2xFreqWattCurve")]
2116 #[serde(default, skip_serializing_if = "Option::is_none")]
2117 pub v2x_freq_watt_curve: Option<Vec<V2XFreqWattPoint>>,
2118 #[serde(rename = "v2xSignalWattCurve")]
2120 #[serde(default, skip_serializing_if = "Option::is_none")]
2121 pub v2x_signal_watt_curve: Option<Vec<V2XSignalWattPoint>>,
2122 #[serde(rename = "customData")]
2124 #[serde(default, skip_serializing_if = "Option::is_none")]
2125 pub custom_data: Option<crate::types::CustomData>,
2126}
2127
2128impl ChargingSchedulePeriod {
2129 #[must_use]
2131 pub fn new(start_period: i32) -> Self {
2132 Self {
2133 start_period,
2134 limit: None,
2135 limit_l2: None,
2136 limit_l3: None,
2137 number_phases: None,
2138 phase_to_use: None,
2139 discharge_limit: None,
2140 discharge_limit_l2: None,
2141 discharge_limit_l3: None,
2142 setpoint: None,
2143 setpoint_l2: None,
2144 setpoint_l3: None,
2145 setpoint_reactive: None,
2146 setpoint_reactive_l2: None,
2147 setpoint_reactive_l3: None,
2148 preconditioning_request: None,
2149 evse_sleep: None,
2150 v2x_baseline: None,
2151 operation_mode: None,
2152 v2x_freq_watt_curve: None,
2153 v2x_signal_watt_curve: None,
2154 custom_data: None,
2155 }
2156 }
2157
2158 #[must_use]
2160 pub fn with_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2161 self.limit = Some(value.into());
2162 self
2163 }
2164
2165 #[must_use]
2167 pub fn with_limit_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2168 self.limit_l2 = Some(value.into());
2169 self
2170 }
2171
2172 #[must_use]
2174 pub fn with_limit_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2175 self.limit_l3 = Some(value.into());
2176 self
2177 }
2178
2179 #[must_use]
2181 pub fn with_number_phases(mut self, value: i32) -> Self {
2182 self.number_phases = Some(value);
2183 self
2184 }
2185
2186 #[must_use]
2188 pub fn with_phase_to_use(mut self, value: i32) -> Self {
2189 self.phase_to_use = Some(value);
2190 self
2191 }
2192
2193 #[must_use]
2195 pub fn with_discharge_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2196 self.discharge_limit = Some(value.into());
2197 self
2198 }
2199
2200 #[must_use]
2202 pub fn with_discharge_limit_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2203 self.discharge_limit_l2 = Some(value.into());
2204 self
2205 }
2206
2207 #[must_use]
2209 pub fn with_discharge_limit_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2210 self.discharge_limit_l3 = Some(value.into());
2211 self
2212 }
2213
2214 #[must_use]
2216 pub fn with_setpoint(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2217 self.setpoint = Some(value.into());
2218 self
2219 }
2220
2221 #[must_use]
2223 pub fn with_setpoint_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2224 self.setpoint_l2 = Some(value.into());
2225 self
2226 }
2227
2228 #[must_use]
2230 pub fn with_setpoint_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2231 self.setpoint_l3 = Some(value.into());
2232 self
2233 }
2234
2235 #[must_use]
2237 pub fn with_setpoint_reactive(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2238 self.setpoint_reactive = Some(value.into());
2239 self
2240 }
2241
2242 #[must_use]
2244 pub fn with_setpoint_reactive_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2245 self.setpoint_reactive_l2 = Some(value.into());
2246 self
2247 }
2248
2249 #[must_use]
2251 pub fn with_setpoint_reactive_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2252 self.setpoint_reactive_l3 = Some(value.into());
2253 self
2254 }
2255
2256 #[must_use]
2258 pub fn with_preconditioning_request(mut self, value: bool) -> Self {
2259 self.preconditioning_request = Some(value);
2260 self
2261 }
2262
2263 #[must_use]
2265 pub fn with_evse_sleep(mut self, value: bool) -> Self {
2266 self.evse_sleep = Some(value);
2267 self
2268 }
2269
2270 #[must_use]
2272 pub fn with_v2x_baseline(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2273 self.v2x_baseline = Some(value.into());
2274 self
2275 }
2276
2277 #[must_use]
2279 pub fn with_operation_mode(mut self, value: OperationMode) -> Self {
2280 self.operation_mode = Some(value);
2281 self
2282 }
2283
2284 #[must_use]
2286 pub fn with_v2x_freq_watt_curve(mut self, value: Vec<V2XFreqWattPoint>) -> Self {
2287 self.v2x_freq_watt_curve = Some(value);
2288 self
2289 }
2290
2291 #[must_use]
2293 pub fn with_v2x_signal_watt_curve(mut self, value: Vec<V2XSignalWattPoint>) -> Self {
2294 self.v2x_signal_watt_curve = Some(value);
2295 self
2296 }
2297
2298 #[must_use]
2300 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2301 self.custom_data = Some(value);
2302 self
2303 }
2304}
2305
2306impl Validate for ChargingSchedulePeriod {
2307 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2308 path.push_key("numberPhases");
2309 if let Some(value) = &self.number_phases {
2310 validate::int_range(i64::from(*value), Some(0), Some(3), path, out);
2311 }
2312 path.pop();
2313 path.push_key("phaseToUse");
2314 if let Some(value) = &self.phase_to_use {
2315 validate::int_range(i64::from(*value), Some(0), Some(3), path, out);
2316 }
2317 path.pop();
2318 path.push_key("dischargeLimit");
2319 if let Some(value) = &self.discharge_limit {
2320 validate::range(
2321 *value,
2322 None,
2323 Some(crate::types::Decimal::new(0, 0)),
2324 path,
2325 out,
2326 );
2327 }
2328 path.pop();
2329 path.push_key("dischargeLimit_L2");
2330 if let Some(value) = &self.discharge_limit_l2 {
2331 validate::range(
2332 *value,
2333 None,
2334 Some(crate::types::Decimal::new(0, 0)),
2335 path,
2336 out,
2337 );
2338 }
2339 path.pop();
2340 path.push_key("dischargeLimit_L3");
2341 if let Some(value) = &self.discharge_limit_l3 {
2342 validate::range(
2343 *value,
2344 None,
2345 Some(crate::types::Decimal::new(0, 0)),
2346 path,
2347 out,
2348 );
2349 }
2350 path.pop();
2351 path.push_key("operationMode");
2352 if let Some(value) = &self.operation_mode {
2353 Validate::validate_at(value, path, out);
2354 }
2355 path.pop();
2356 path.push_key("v2xFreqWattCurve");
2357 if let Some(value) = &self.v2x_freq_watt_curve {
2358 validate::list_len(value.len(), Some(1), Some(20), path, out);
2359 for (index, item) in value.iter().enumerate() {
2360 path.push_index(index);
2361 Validate::validate_at(item, path, out);
2362 path.pop();
2363 }
2364 }
2365 path.pop();
2366 path.push_key("v2xSignalWattCurve");
2367 if let Some(value) = &self.v2x_signal_watt_curve {
2368 validate::list_len(value.len(), Some(1), Some(20), path, out);
2369 for (index, item) in value.iter().enumerate() {
2370 path.push_index(index);
2371 Validate::validate_at(item, path, out);
2372 path.pop();
2373 }
2374 }
2375 path.pop();
2376 path.push_key("customData");
2377 if let Some(value) = &self.custom_data {
2378 Validate::validate_at(value, path, out);
2379 }
2380 path.pop();
2381 }
2382}
2383
2384#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2388pub struct ChargingScheduleUpdate {
2389 #[serde(default, skip_serializing_if = "Option::is_none")]
2394 pub limit: Option<crate::types::Decimal>,
2395 #[serde(rename = "limit_L2")]
2397 #[serde(default, skip_serializing_if = "Option::is_none")]
2398 pub limit_l2: Option<crate::types::Decimal>,
2399 #[serde(rename = "limit_L3")]
2401 #[serde(default, skip_serializing_if = "Option::is_none")]
2402 pub limit_l3: Option<crate::types::Decimal>,
2403 #[serde(rename = "dischargeLimit")]
2406 #[serde(default, skip_serializing_if = "Option::is_none")]
2407 pub discharge_limit: Option<crate::types::Decimal>,
2408 #[serde(rename = "dischargeLimit_L2")]
2410 #[serde(default, skip_serializing_if = "Option::is_none")]
2411 pub discharge_limit_l2: Option<crate::types::Decimal>,
2412 #[serde(rename = "dischargeLimit_L3")]
2414 #[serde(default, skip_serializing_if = "Option::is_none")]
2415 pub discharge_limit_l3: Option<crate::types::Decimal>,
2416 #[serde(default, skip_serializing_if = "Option::is_none")]
2420 pub setpoint: Option<crate::types::Decimal>,
2421 #[serde(rename = "setpoint_L2")]
2423 #[serde(default, skip_serializing_if = "Option::is_none")]
2424 pub setpoint_l2: Option<crate::types::Decimal>,
2425 #[serde(rename = "setpoint_L3")]
2427 #[serde(default, skip_serializing_if = "Option::is_none")]
2428 pub setpoint_l3: Option<crate::types::Decimal>,
2429 #[serde(rename = "setpointReactive")]
2432 #[serde(default, skip_serializing_if = "Option::is_none")]
2433 pub setpoint_reactive: Option<crate::types::Decimal>,
2434 #[serde(rename = "setpointReactive_L2")]
2436 #[serde(default, skip_serializing_if = "Option::is_none")]
2437 pub setpoint_reactive_l2: Option<crate::types::Decimal>,
2438 #[serde(rename = "setpointReactive_L3")]
2440 #[serde(default, skip_serializing_if = "Option::is_none")]
2441 pub setpoint_reactive_l3: Option<crate::types::Decimal>,
2442 #[serde(rename = "customData")]
2444 #[serde(default, skip_serializing_if = "Option::is_none")]
2445 pub custom_data: Option<crate::types::CustomData>,
2446}
2447
2448impl ChargingScheduleUpdate {
2449 #[must_use]
2451 pub fn new() -> Self {
2452 Self::default()
2453 }
2454
2455 #[must_use]
2457 pub fn with_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2458 self.limit = Some(value.into());
2459 self
2460 }
2461
2462 #[must_use]
2464 pub fn with_limit_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2465 self.limit_l2 = Some(value.into());
2466 self
2467 }
2468
2469 #[must_use]
2471 pub fn with_limit_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2472 self.limit_l3 = Some(value.into());
2473 self
2474 }
2475
2476 #[must_use]
2478 pub fn with_discharge_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2479 self.discharge_limit = Some(value.into());
2480 self
2481 }
2482
2483 #[must_use]
2485 pub fn with_discharge_limit_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2486 self.discharge_limit_l2 = Some(value.into());
2487 self
2488 }
2489
2490 #[must_use]
2492 pub fn with_discharge_limit_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2493 self.discharge_limit_l3 = Some(value.into());
2494 self
2495 }
2496
2497 #[must_use]
2499 pub fn with_setpoint(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2500 self.setpoint = Some(value.into());
2501 self
2502 }
2503
2504 #[must_use]
2506 pub fn with_setpoint_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2507 self.setpoint_l2 = Some(value.into());
2508 self
2509 }
2510
2511 #[must_use]
2513 pub fn with_setpoint_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2514 self.setpoint_l3 = Some(value.into());
2515 self
2516 }
2517
2518 #[must_use]
2520 pub fn with_setpoint_reactive(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2521 self.setpoint_reactive = Some(value.into());
2522 self
2523 }
2524
2525 #[must_use]
2527 pub fn with_setpoint_reactive_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2528 self.setpoint_reactive_l2 = Some(value.into());
2529 self
2530 }
2531
2532 #[must_use]
2534 pub fn with_setpoint_reactive_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2535 self.setpoint_reactive_l3 = Some(value.into());
2536 self
2537 }
2538
2539 #[must_use]
2541 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2542 self.custom_data = Some(value);
2543 self
2544 }
2545}
2546
2547impl Validate for ChargingScheduleUpdate {
2548 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2549 path.push_key("dischargeLimit");
2550 if let Some(value) = &self.discharge_limit {
2551 validate::range(
2552 *value,
2553 None,
2554 Some(crate::types::Decimal::new(0, 0)),
2555 path,
2556 out,
2557 );
2558 }
2559 path.pop();
2560 path.push_key("dischargeLimit_L2");
2561 if let Some(value) = &self.discharge_limit_l2 {
2562 validate::range(
2563 *value,
2564 None,
2565 Some(crate::types::Decimal::new(0, 0)),
2566 path,
2567 out,
2568 );
2569 }
2570 path.pop();
2571 path.push_key("dischargeLimit_L3");
2572 if let Some(value) = &self.discharge_limit_l3 {
2573 validate::range(
2574 *value,
2575 None,
2576 Some(crate::types::Decimal::new(0, 0)),
2577 path,
2578 out,
2579 );
2580 }
2581 path.pop();
2582 path.push_key("customData");
2583 if let Some(value) = &self.custom_data {
2584 Validate::validate_at(value, path, out);
2585 }
2586 path.pop();
2587 }
2588}
2589
2590#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2594pub struct ChargingStation {
2595 pub model: String,
2597 #[serde(rename = "vendorName")]
2599 pub vendor_name: String,
2600 #[serde(rename = "serialNumber")]
2602 #[serde(default, skip_serializing_if = "Option::is_none")]
2603 pub serial_number: Option<String>,
2604 #[serde(default, skip_serializing_if = "Option::is_none")]
2606 pub modem: Option<Modem>,
2607 #[serde(rename = "firmwareVersion")]
2609 #[serde(default, skip_serializing_if = "Option::is_none")]
2610 pub firmware_version: Option<String>,
2611 #[serde(rename = "customData")]
2613 #[serde(default, skip_serializing_if = "Option::is_none")]
2614 pub custom_data: Option<crate::types::CustomData>,
2615}
2616
2617impl ChargingStation {
2618 #[must_use]
2620 pub fn new(model: impl Into<String>, vendor_name: impl Into<String>) -> Self {
2621 Self {
2622 model: model.into(),
2623 vendor_name: vendor_name.into(),
2624 serial_number: None,
2625 modem: None,
2626 firmware_version: None,
2627 custom_data: None,
2628 }
2629 }
2630
2631 #[must_use]
2633 pub fn with_serial_number(mut self, value: impl Into<String>) -> Self {
2634 self.serial_number = Some(value.into());
2635 self
2636 }
2637
2638 #[must_use]
2640 pub fn with_modem(mut self, value: Modem) -> Self {
2641 self.modem = Some(value);
2642 self
2643 }
2644
2645 #[must_use]
2647 pub fn with_firmware_version(mut self, value: impl Into<String>) -> Self {
2648 self.firmware_version = Some(value.into());
2649 self
2650 }
2651
2652 #[must_use]
2654 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2655 self.custom_data = Some(value);
2656 self
2657 }
2658}
2659
2660impl Validate for ChargingStation {
2661 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2662 path.push_key("model");
2663 validate::string(self.model.as_str(), None, Some(20), path, out);
2664 path.pop();
2665 path.push_key("vendorName");
2666 validate::string(self.vendor_name.as_str(), None, Some(50), path, out);
2667 path.pop();
2668 path.push_key("serialNumber");
2669 if let Some(value) = &self.serial_number {
2670 validate::string(value.as_str(), None, Some(25), path, out);
2671 }
2672 path.pop();
2673 path.push_key("modem");
2674 if let Some(value) = &self.modem {
2675 Validate::validate_at(value, path, out);
2676 }
2677 path.pop();
2678 path.push_key("firmwareVersion");
2679 if let Some(value) = &self.firmware_version {
2680 validate::string(value.as_str(), None, Some(50), path, out);
2681 }
2682 path.pop();
2683 path.push_key("customData");
2684 if let Some(value) = &self.custom_data {
2685 Validate::validate_at(value, path, out);
2686 }
2687 path.pop();
2688 }
2689}
2690
2691#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2695pub struct ClearChargingProfile {
2696 #[serde(rename = "evseId")]
2698 #[serde(default, skip_serializing_if = "Option::is_none")]
2699 #[serde(deserialize_with = "crate::types::integer::option")]
2700 pub evse_id: Option<i32>,
2701 #[serde(rename = "chargingProfilePurpose")]
2703 #[serde(default, skip_serializing_if = "Option::is_none")]
2704 pub charging_profile_purpose: Option<ChargingProfilePurpose>,
2705 #[serde(rename = "stackLevel")]
2707 #[serde(default, skip_serializing_if = "Option::is_none")]
2708 #[serde(deserialize_with = "crate::types::integer::option")]
2709 pub stack_level: Option<i32>,
2710 #[serde(rename = "customData")]
2712 #[serde(default, skip_serializing_if = "Option::is_none")]
2713 pub custom_data: Option<crate::types::CustomData>,
2714}
2715
2716impl ClearChargingProfile {
2717 #[must_use]
2719 pub fn new() -> Self {
2720 Self::default()
2721 }
2722
2723 #[must_use]
2725 pub fn with_evse_id(mut self, value: i32) -> Self {
2726 self.evse_id = Some(value);
2727 self
2728 }
2729
2730 #[must_use]
2732 pub fn with_charging_profile_purpose(mut self, value: ChargingProfilePurpose) -> Self {
2733 self.charging_profile_purpose = Some(value);
2734 self
2735 }
2736
2737 #[must_use]
2739 pub fn with_stack_level(mut self, value: i32) -> Self {
2740 self.stack_level = Some(value);
2741 self
2742 }
2743
2744 #[must_use]
2746 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2747 self.custom_data = Some(value);
2748 self
2749 }
2750}
2751
2752impl Validate for ClearChargingProfile {
2753 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2754 path.push_key("evseId");
2755 if let Some(value) = &self.evse_id {
2756 validate::int_range(i64::from(*value), Some(0), None, path, out);
2757 }
2758 path.pop();
2759 path.push_key("chargingProfilePurpose");
2760 if let Some(value) = &self.charging_profile_purpose {
2761 Validate::validate_at(value, path, out);
2762 }
2763 path.pop();
2764 path.push_key("stackLevel");
2765 if let Some(value) = &self.stack_level {
2766 validate::int_range(i64::from(*value), Some(0), None, path, out);
2767 }
2768 path.pop();
2769 path.push_key("customData");
2770 if let Some(value) = &self.custom_data {
2771 Validate::validate_at(value, path, out);
2772 }
2773 path.pop();
2774 }
2775}
2776
2777#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2779pub struct ClearMonitoringResult {
2780 pub status: ClearMonitoringStatus,
2782 #[serde(deserialize_with = "crate::types::integer::one")]
2784 pub id: i32,
2785 #[serde(rename = "statusInfo")]
2787 #[serde(default, skip_serializing_if = "Option::is_none")]
2788 pub status_info: Option<StatusInfo>,
2789 #[serde(rename = "customData")]
2791 #[serde(default, skip_serializing_if = "Option::is_none")]
2792 pub custom_data: Option<crate::types::CustomData>,
2793}
2794
2795impl ClearMonitoringResult {
2796 #[must_use]
2798 pub fn new(status: ClearMonitoringStatus, id: i32) -> Self {
2799 Self {
2800 status,
2801 id,
2802 status_info: None,
2803 custom_data: None,
2804 }
2805 }
2806
2807 #[must_use]
2809 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2810 self.status_info = Some(value);
2811 self
2812 }
2813
2814 #[must_use]
2816 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2817 self.custom_data = Some(value);
2818 self
2819 }
2820}
2821
2822impl Validate for ClearMonitoringResult {
2823 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2824 path.push_key("status");
2825 Validate::validate_at(&self.status, path, out);
2826 path.pop();
2827 path.push_key("id");
2828 validate::int_range(i64::from(self.id), Some(0), None, path, out);
2829 path.pop();
2830 path.push_key("statusInfo");
2831 if let Some(value) = &self.status_info {
2832 Validate::validate_at(value, path, out);
2833 }
2834 path.pop();
2835 path.push_key("customData");
2836 if let Some(value) = &self.custom_data {
2837 Validate::validate_at(value, path, out);
2838 }
2839 path.pop();
2840 }
2841}
2842
2843#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2845pub struct ClearTariffsResult {
2846 pub status: TariffClearStatus,
2848 #[serde(rename = "statusInfo")]
2850 #[serde(default, skip_serializing_if = "Option::is_none")]
2851 pub status_info: Option<StatusInfo>,
2852 #[serde(rename = "tariffId")]
2854 #[serde(default, skip_serializing_if = "Option::is_none")]
2855 pub tariff_id: Option<String>,
2856 #[serde(rename = "customData")]
2858 #[serde(default, skip_serializing_if = "Option::is_none")]
2859 pub custom_data: Option<crate::types::CustomData>,
2860}
2861
2862impl ClearTariffsResult {
2863 #[must_use]
2865 pub fn new(status: TariffClearStatus) -> Self {
2866 Self {
2867 status,
2868 status_info: None,
2869 tariff_id: None,
2870 custom_data: None,
2871 }
2872 }
2873
2874 #[must_use]
2876 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2877 self.status_info = Some(value);
2878 self
2879 }
2880
2881 #[must_use]
2883 pub fn with_tariff_id(mut self, value: impl Into<String>) -> Self {
2884 self.tariff_id = Some(value.into());
2885 self
2886 }
2887
2888 #[must_use]
2890 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2891 self.custom_data = Some(value);
2892 self
2893 }
2894}
2895
2896impl Validate for ClearTariffsResult {
2897 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2898 path.push_key("status");
2899 Validate::validate_at(&self.status, path, out);
2900 path.pop();
2901 path.push_key("statusInfo");
2902 if let Some(value) = &self.status_info {
2903 Validate::validate_at(value, path, out);
2904 }
2905 path.pop();
2906 path.push_key("tariffId");
2907 if let Some(value) = &self.tariff_id {
2908 validate::string(value.as_str(), None, Some(60), path, out);
2909 }
2910 path.pop();
2911 path.push_key("customData");
2912 if let Some(value) = &self.custom_data {
2913 Validate::validate_at(value, path, out);
2914 }
2915 path.pop();
2916 }
2917}
2918
2919#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2923pub struct Component {
2924 pub name: String,
2926 #[serde(default, skip_serializing_if = "Option::is_none")]
2928 pub evse: Option<EVSE>,
2929 #[serde(default, skip_serializing_if = "Option::is_none")]
2931 pub instance: Option<String>,
2932 #[serde(rename = "customData")]
2934 #[serde(default, skip_serializing_if = "Option::is_none")]
2935 pub custom_data: Option<crate::types::CustomData>,
2936}
2937
2938impl Component {
2939 #[must_use]
2941 pub fn new(name: impl Into<String>) -> Self {
2942 Self {
2943 name: name.into(),
2944 evse: None,
2945 instance: None,
2946 custom_data: None,
2947 }
2948 }
2949
2950 #[must_use]
2952 pub fn with_evse(mut self, value: EVSE) -> Self {
2953 self.evse = Some(value);
2954 self
2955 }
2956
2957 #[must_use]
2959 pub fn with_instance(mut self, value: impl Into<String>) -> Self {
2960 self.instance = Some(value.into());
2961 self
2962 }
2963
2964 #[must_use]
2966 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2967 self.custom_data = Some(value);
2968 self
2969 }
2970}
2971
2972impl Validate for Component {
2973 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2974 path.push_key("name");
2975 validate::string(self.name.as_str(), None, Some(50), path, out);
2976 path.pop();
2977 path.push_key("evse");
2978 if let Some(value) = &self.evse {
2979 Validate::validate_at(value, path, out);
2980 }
2981 path.pop();
2982 path.push_key("instance");
2983 if let Some(value) = &self.instance {
2984 validate::string(value.as_str(), None, Some(50), path, out);
2985 }
2986 path.pop();
2987 path.push_key("customData");
2988 if let Some(value) = &self.custom_data {
2989 Validate::validate_at(value, path, out);
2990 }
2991 path.pop();
2992 }
2993}
2994
2995#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2999pub struct ComponentVariable {
3000 pub component: Component,
3002 #[serde(default, skip_serializing_if = "Option::is_none")]
3004 pub variable: Option<Variable>,
3005 #[serde(rename = "customData")]
3007 #[serde(default, skip_serializing_if = "Option::is_none")]
3008 pub custom_data: Option<crate::types::CustomData>,
3009}
3010
3011impl ComponentVariable {
3012 #[must_use]
3014 pub fn new(component: Component) -> Self {
3015 Self {
3016 component,
3017 variable: None,
3018 custom_data: None,
3019 }
3020 }
3021
3022 #[must_use]
3024 pub fn with_variable(mut self, value: Variable) -> Self {
3025 self.variable = Some(value);
3026 self
3027 }
3028
3029 #[must_use]
3031 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3032 self.custom_data = Some(value);
3033 self
3034 }
3035}
3036
3037impl Validate for ComponentVariable {
3038 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3039 path.push_key("component");
3040 Validate::validate_at(&self.component, path, out);
3041 path.pop();
3042 path.push_key("variable");
3043 if let Some(value) = &self.variable {
3044 Validate::validate_at(value, path, out);
3045 }
3046 path.pop();
3047 path.push_key("customData");
3048 if let Some(value) = &self.custom_data {
3049 Validate::validate_at(value, path, out);
3050 }
3051 path.pop();
3052 }
3053}
3054
3055#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3057pub struct CompositeSchedule {
3058 #[serde(rename = "evseId")]
3060 #[serde(deserialize_with = "crate::types::integer::one")]
3061 pub evse_id: i32,
3062 #[serde(deserialize_with = "crate::types::integer::one")]
3064 pub duration: i32,
3065 #[serde(rename = "scheduleStart")]
3067 pub schedule_start: crate::types::DateTime,
3068 #[serde(rename = "chargingRateUnit")]
3070 pub charging_rate_unit: ChargingRateUnit,
3071 #[serde(rename = "chargingSchedulePeriod")]
3073 pub charging_schedule_period: Vec<ChargingSchedulePeriod>,
3074 #[serde(rename = "customData")]
3076 #[serde(default, skip_serializing_if = "Option::is_none")]
3077 pub custom_data: Option<crate::types::CustomData>,
3078}
3079
3080impl CompositeSchedule {
3081 #[must_use]
3083 pub fn new(
3084 evse_id: i32,
3085 duration: i32,
3086 schedule_start: impl Into<crate::types::DateTime>,
3087 charging_rate_unit: ChargingRateUnit,
3088 charging_schedule_period: Vec<ChargingSchedulePeriod>,
3089 ) -> Self {
3090 Self {
3091 evse_id,
3092 duration,
3093 schedule_start: schedule_start.into(),
3094 charging_rate_unit,
3095 charging_schedule_period,
3096 custom_data: None,
3097 }
3098 }
3099
3100 #[must_use]
3102 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3103 self.custom_data = Some(value);
3104 self
3105 }
3106}
3107
3108impl Validate for CompositeSchedule {
3109 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3110 path.push_key("evseId");
3111 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
3112 path.pop();
3113 path.push_key("chargingRateUnit");
3114 Validate::validate_at(&self.charging_rate_unit, path, out);
3115 path.pop();
3116 path.push_key("chargingSchedulePeriod");
3117 validate::list_len(
3118 self.charging_schedule_period.len(),
3119 Some(1),
3120 None,
3121 path,
3122 out,
3123 );
3124 for (index, item) in self.charging_schedule_period.iter().enumerate() {
3125 path.push_index(index);
3126 Validate::validate_at(item, path, out);
3127 path.pop();
3128 }
3129 path.pop();
3130 path.push_key("customData");
3131 if let Some(value) = &self.custom_data {
3132 Validate::validate_at(value, path, out);
3133 }
3134 path.pop();
3135 }
3136}
3137
3138#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3140pub struct ConstantStreamData {
3141 #[serde(deserialize_with = "crate::types::integer::one")]
3143 pub id: i32,
3144 pub params: PeriodicEventStreamParams,
3146 #[serde(rename = "variableMonitoringId")]
3148 #[serde(deserialize_with = "crate::types::integer::one")]
3149 pub variable_monitoring_id: i32,
3150 #[serde(rename = "customData")]
3152 #[serde(default, skip_serializing_if = "Option::is_none")]
3153 pub custom_data: Option<crate::types::CustomData>,
3154}
3155
3156impl ConstantStreamData {
3157 #[must_use]
3159 pub fn new(id: i32, params: PeriodicEventStreamParams, variable_monitoring_id: i32) -> Self {
3160 Self {
3161 id,
3162 params,
3163 variable_monitoring_id,
3164 custom_data: None,
3165 }
3166 }
3167
3168 #[must_use]
3170 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3171 self.custom_data = Some(value);
3172 self
3173 }
3174}
3175
3176impl Validate for ConstantStreamData {
3177 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3178 path.push_key("id");
3179 validate::int_range(i64::from(self.id), Some(0), None, path, out);
3180 path.pop();
3181 path.push_key("params");
3182 Validate::validate_at(&self.params, path, out);
3183 path.pop();
3184 path.push_key("variableMonitoringId");
3185 validate::int_range(
3186 i64::from(self.variable_monitoring_id),
3187 Some(0),
3188 None,
3189 path,
3190 out,
3191 );
3192 path.pop();
3193 path.push_key("customData");
3194 if let Some(value) = &self.custom_data {
3195 Validate::validate_at(value, path, out);
3196 }
3197 path.pop();
3198 }
3199}
3200
3201#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3203pub struct ConsumptionCost {
3204 #[serde(rename = "startValue")]
3206 pub start_value: crate::types::Decimal,
3207 pub cost: Vec<Cost>,
3209 #[serde(rename = "customData")]
3211 #[serde(default, skip_serializing_if = "Option::is_none")]
3212 pub custom_data: Option<crate::types::CustomData>,
3213}
3214
3215impl ConsumptionCost {
3216 #[must_use]
3218 pub fn new(start_value: impl Into<crate::types::Decimal>, cost: Vec<Cost>) -> Self {
3219 Self {
3220 start_value: start_value.into(),
3221 cost,
3222 custom_data: None,
3223 }
3224 }
3225
3226 #[must_use]
3228 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3229 self.custom_data = Some(value);
3230 self
3231 }
3232}
3233
3234impl Validate for ConsumptionCost {
3235 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3236 path.push_key("cost");
3237 validate::list_len(self.cost.len(), Some(1), Some(3), path, out);
3238 for (index, item) in self.cost.iter().enumerate() {
3239 path.push_index(index);
3240 Validate::validate_at(item, path, out);
3241 path.pop();
3242 }
3243 path.pop();
3244 path.push_key("customData");
3245 if let Some(value) = &self.custom_data {
3246 Validate::validate_at(value, path, out);
3247 }
3248 path.pop();
3249 }
3250}
3251
3252#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3254pub struct Cost {
3255 #[serde(rename = "costKind")]
3257 pub cost_kind: CostKind,
3258 #[serde(deserialize_with = "crate::types::integer::one")]
3260 pub amount: i32,
3261 #[serde(rename = "amountMultiplier")]
3263 #[serde(default, skip_serializing_if = "Option::is_none")]
3264 #[serde(deserialize_with = "crate::types::integer::option")]
3265 pub amount_multiplier: Option<i32>,
3266 #[serde(rename = "customData")]
3268 #[serde(default, skip_serializing_if = "Option::is_none")]
3269 pub custom_data: Option<crate::types::CustomData>,
3270}
3271
3272impl Cost {
3273 #[must_use]
3275 pub fn new(cost_kind: CostKind, amount: i32) -> Self {
3276 Self {
3277 cost_kind,
3278 amount,
3279 amount_multiplier: None,
3280 custom_data: None,
3281 }
3282 }
3283
3284 #[must_use]
3286 pub fn with_amount_multiplier(mut self, value: i32) -> Self {
3287 self.amount_multiplier = Some(value);
3288 self
3289 }
3290
3291 #[must_use]
3293 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3294 self.custom_data = Some(value);
3295 self
3296 }
3297}
3298
3299impl Validate for Cost {
3300 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3301 path.push_key("costKind");
3302 Validate::validate_at(&self.cost_kind, path, out);
3303 path.pop();
3304 path.push_key("customData");
3305 if let Some(value) = &self.custom_data {
3306 Validate::validate_at(value, path, out);
3307 }
3308 path.pop();
3309 }
3310}
3311
3312#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3318pub struct CostDetails {
3319 #[serde(rename = "totalCost")]
3321 pub total_cost: TotalCost,
3322 #[serde(rename = "totalUsage")]
3324 pub total_usage: TotalUsage,
3325 #[serde(rename = "chargingPeriods")]
3327 #[serde(default, skip_serializing_if = "Option::is_none")]
3328 pub charging_periods: Option<Vec<ChargingPeriod>>,
3329 #[serde(rename = "failureToCalculate")]
3331 #[serde(default, skip_serializing_if = "Option::is_none")]
3332 pub failure_to_calculate: Option<bool>,
3333 #[serde(rename = "failureReason")]
3335 #[serde(default, skip_serializing_if = "Option::is_none")]
3336 pub failure_reason: Option<String>,
3337 #[serde(rename = "customData")]
3339 #[serde(default, skip_serializing_if = "Option::is_none")]
3340 pub custom_data: Option<crate::types::CustomData>,
3341}
3342
3343impl CostDetails {
3344 #[must_use]
3346 pub fn new(total_cost: TotalCost, total_usage: TotalUsage) -> Self {
3347 Self {
3348 total_cost,
3349 total_usage,
3350 charging_periods: None,
3351 failure_to_calculate: None,
3352 failure_reason: None,
3353 custom_data: None,
3354 }
3355 }
3356
3357 #[must_use]
3359 pub fn with_charging_periods(mut self, value: Vec<ChargingPeriod>) -> Self {
3360 self.charging_periods = Some(value);
3361 self
3362 }
3363
3364 #[must_use]
3366 pub fn with_failure_to_calculate(mut self, value: bool) -> Self {
3367 self.failure_to_calculate = Some(value);
3368 self
3369 }
3370
3371 #[must_use]
3373 pub fn with_failure_reason(mut self, value: impl Into<String>) -> Self {
3374 self.failure_reason = Some(value.into());
3375 self
3376 }
3377
3378 #[must_use]
3380 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3381 self.custom_data = Some(value);
3382 self
3383 }
3384}
3385
3386impl Validate for CostDetails {
3387 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3388 path.push_key("totalCost");
3389 Validate::validate_at(&self.total_cost, path, out);
3390 path.pop();
3391 path.push_key("totalUsage");
3392 Validate::validate_at(&self.total_usage, path, out);
3393 path.pop();
3394 path.push_key("chargingPeriods");
3395 if let Some(value) = &self.charging_periods {
3396 validate::list_len(value.len(), Some(1), None, path, out);
3397 for (index, item) in value.iter().enumerate() {
3398 path.push_index(index);
3399 Validate::validate_at(item, path, out);
3400 path.pop();
3401 }
3402 }
3403 path.pop();
3404 path.push_key("failureReason");
3405 if let Some(value) = &self.failure_reason {
3406 validate::string(value.as_str(), None, Some(500), path, out);
3407 }
3408 path.pop();
3409 path.push_key("customData");
3410 if let Some(value) = &self.custom_data {
3411 Validate::validate_at(value, path, out);
3412 }
3413 path.pop();
3414 }
3415}
3416
3417#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3421pub struct CostDimension {
3422 pub r#type: CostDimensionEnum,
3424 pub volume: crate::types::Decimal,
3426 #[serde(rename = "customData")]
3428 #[serde(default, skip_serializing_if = "Option::is_none")]
3429 pub custom_data: Option<crate::types::CustomData>,
3430}
3431
3432impl CostDimension {
3433 #[must_use]
3435 pub fn new(r#type: CostDimensionEnum, volume: impl Into<crate::types::Decimal>) -> Self {
3436 Self {
3437 r#type,
3438 volume: volume.into(),
3439 custom_data: None,
3440 }
3441 }
3442
3443 #[must_use]
3445 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3446 self.custom_data = Some(value);
3447 self
3448 }
3449}
3450
3451impl Validate for CostDimension {
3452 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3453 path.push_key("type");
3454 Validate::validate_at(&self.r#type, path, out);
3455 path.pop();
3456 path.push_key("customData");
3457 if let Some(value) = &self.custom_data {
3458 Validate::validate_at(value, path, out);
3459 }
3460 path.pop();
3461 }
3462}
3463
3464#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3468pub struct DCChargingParameters {
3469 #[serde(rename = "evMaxCurrent")]
3473 pub ev_max_current: crate::types::Decimal,
3474 #[serde(rename = "evMaxVoltage")]
3478 pub ev_max_voltage: crate::types::Decimal,
3479 #[serde(rename = "evMaxPower")]
3483 #[serde(default, skip_serializing_if = "Option::is_none")]
3484 pub ev_max_power: Option<crate::types::Decimal>,
3485 #[serde(rename = "evEnergyCapacity")]
3489 #[serde(default, skip_serializing_if = "Option::is_none")]
3490 pub ev_energy_capacity: Option<crate::types::Decimal>,
3491 #[serde(rename = "energyAmount")]
3495 #[serde(default, skip_serializing_if = "Option::is_none")]
3496 pub energy_amount: Option<crate::types::Decimal>,
3497 #[serde(rename = "stateOfCharge")]
3501 #[serde(default, skip_serializing_if = "Option::is_none")]
3502 #[serde(deserialize_with = "crate::types::integer::option")]
3503 pub state_of_charge: Option<i32>,
3504 #[serde(rename = "fullSoC")]
3508 #[serde(default, skip_serializing_if = "Option::is_none")]
3509 #[serde(deserialize_with = "crate::types::integer::option")]
3510 pub full_so_c: Option<i32>,
3511 #[serde(rename = "bulkSoC")]
3515 #[serde(default, skip_serializing_if = "Option::is_none")]
3516 #[serde(deserialize_with = "crate::types::integer::option")]
3517 pub bulk_so_c: Option<i32>,
3518 #[serde(rename = "customData")]
3520 #[serde(default, skip_serializing_if = "Option::is_none")]
3521 pub custom_data: Option<crate::types::CustomData>,
3522}
3523
3524impl DCChargingParameters {
3525 #[must_use]
3527 pub fn new(
3528 ev_max_current: impl Into<crate::types::Decimal>,
3529 ev_max_voltage: impl Into<crate::types::Decimal>,
3530 ) -> Self {
3531 Self {
3532 ev_max_current: ev_max_current.into(),
3533 ev_max_voltage: ev_max_voltage.into(),
3534 ev_max_power: None,
3535 ev_energy_capacity: None,
3536 energy_amount: None,
3537 state_of_charge: None,
3538 full_so_c: None,
3539 bulk_so_c: None,
3540 custom_data: None,
3541 }
3542 }
3543
3544 #[must_use]
3546 pub fn with_ev_max_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
3547 self.ev_max_power = Some(value.into());
3548 self
3549 }
3550
3551 #[must_use]
3553 pub fn with_ev_energy_capacity(mut self, value: impl Into<crate::types::Decimal>) -> Self {
3554 self.ev_energy_capacity = Some(value.into());
3555 self
3556 }
3557
3558 #[must_use]
3560 pub fn with_energy_amount(mut self, value: impl Into<crate::types::Decimal>) -> Self {
3561 self.energy_amount = Some(value.into());
3562 self
3563 }
3564
3565 #[must_use]
3567 pub fn with_state_of_charge(mut self, value: i32) -> Self {
3568 self.state_of_charge = Some(value);
3569 self
3570 }
3571
3572 #[must_use]
3574 pub fn with_full_so_c(mut self, value: i32) -> Self {
3575 self.full_so_c = Some(value);
3576 self
3577 }
3578
3579 #[must_use]
3581 pub fn with_bulk_so_c(mut self, value: i32) -> Self {
3582 self.bulk_so_c = Some(value);
3583 self
3584 }
3585
3586 #[must_use]
3588 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3589 self.custom_data = Some(value);
3590 self
3591 }
3592}
3593
3594impl Validate for DCChargingParameters {
3595 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3596 path.push_key("stateOfCharge");
3597 if let Some(value) = &self.state_of_charge {
3598 validate::int_range(i64::from(*value), Some(0), Some(100), path, out);
3599 }
3600 path.pop();
3601 path.push_key("fullSoC");
3602 if let Some(value) = &self.full_so_c {
3603 validate::int_range(i64::from(*value), Some(0), Some(100), path, out);
3604 }
3605 path.pop();
3606 path.push_key("bulkSoC");
3607 if let Some(value) = &self.bulk_so_c {
3608 validate::int_range(i64::from(*value), Some(0), Some(100), path, out);
3609 }
3610 path.pop();
3611 path.push_key("customData");
3612 if let Some(value) = &self.custom_data {
3613 Validate::validate_at(value, path, out);
3614 }
3615 path.pop();
3616 }
3617}
3618
3619#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
3630pub struct DERChargingParameters {
3631 #[serde(rename = "evSupportedDERControl")]
3634 #[serde(default, skip_serializing_if = "Option::is_none")]
3635 pub ev_supported_der_control: Option<Vec<DERControl>>,
3636 #[serde(rename = "evOverExcitedMaxDischargePower")]
3641 #[serde(default, skip_serializing_if = "Option::is_none")]
3642 pub ev_over_excited_max_discharge_power: Option<crate::types::Decimal>,
3643 #[serde(rename = "evOverExcitedPowerFactor")]
3647 #[serde(default, skip_serializing_if = "Option::is_none")]
3648 pub ev_over_excited_power_factor: Option<crate::types::Decimal>,
3649 #[serde(rename = "evUnderExcitedMaxDischargePower")]
3655 #[serde(default, skip_serializing_if = "Option::is_none")]
3656 pub ev_under_excited_max_discharge_power: Option<crate::types::Decimal>,
3657 #[serde(rename = "evUnderExcitedPowerFactor")]
3661 #[serde(default, skip_serializing_if = "Option::is_none")]
3662 pub ev_under_excited_power_factor: Option<crate::types::Decimal>,
3663 #[serde(rename = "maxApparentPower")]
3667 #[serde(default, skip_serializing_if = "Option::is_none")]
3668 pub max_apparent_power: Option<crate::types::Decimal>,
3669 #[serde(rename = "maxChargeApparentPower")]
3675 #[serde(default, skip_serializing_if = "Option::is_none")]
3676 pub max_charge_apparent_power: Option<crate::types::Decimal>,
3677 #[serde(rename = "maxChargeApparentPower_L2")]
3681 #[serde(default, skip_serializing_if = "Option::is_none")]
3682 pub max_charge_apparent_power_l2: Option<crate::types::Decimal>,
3683 #[serde(rename = "maxChargeApparentPower_L3")]
3687 #[serde(default, skip_serializing_if = "Option::is_none")]
3688 pub max_charge_apparent_power_l3: Option<crate::types::Decimal>,
3689 #[serde(rename = "maxDischargeApparentPower")]
3695 #[serde(default, skip_serializing_if = "Option::is_none")]
3696 pub max_discharge_apparent_power: Option<crate::types::Decimal>,
3697 #[serde(rename = "maxDischargeApparentPower_L2")]
3701 #[serde(default, skip_serializing_if = "Option::is_none")]
3702 pub max_discharge_apparent_power_l2: Option<crate::types::Decimal>,
3703 #[serde(rename = "maxDischargeApparentPower_L3")]
3707 #[serde(default, skip_serializing_if = "Option::is_none")]
3708 pub max_discharge_apparent_power_l3: Option<crate::types::Decimal>,
3709 #[serde(rename = "maxChargeReactivePower")]
3715 #[serde(default, skip_serializing_if = "Option::is_none")]
3716 pub max_charge_reactive_power: Option<crate::types::Decimal>,
3717 #[serde(rename = "maxChargeReactivePower_L2")]
3721 #[serde(default, skip_serializing_if = "Option::is_none")]
3722 pub max_charge_reactive_power_l2: Option<crate::types::Decimal>,
3723 #[serde(rename = "maxChargeReactivePower_L3")]
3727 #[serde(default, skip_serializing_if = "Option::is_none")]
3728 pub max_charge_reactive_power_l3: Option<crate::types::Decimal>,
3729 #[serde(rename = "minChargeReactivePower")]
3734 #[serde(default, skip_serializing_if = "Option::is_none")]
3735 pub min_charge_reactive_power: Option<crate::types::Decimal>,
3736 #[serde(rename = "minChargeReactivePower_L2")]
3739 #[serde(default, skip_serializing_if = "Option::is_none")]
3740 pub min_charge_reactive_power_l2: Option<crate::types::Decimal>,
3741 #[serde(rename = "minChargeReactivePower_L3")]
3744 #[serde(default, skip_serializing_if = "Option::is_none")]
3745 pub min_charge_reactive_power_l3: Option<crate::types::Decimal>,
3746 #[serde(rename = "maxDischargeReactivePower")]
3752 #[serde(default, skip_serializing_if = "Option::is_none")]
3753 pub max_discharge_reactive_power: Option<crate::types::Decimal>,
3754 #[serde(rename = "maxDischargeReactivePower_L2")]
3758 #[serde(default, skip_serializing_if = "Option::is_none")]
3759 pub max_discharge_reactive_power_l2: Option<crate::types::Decimal>,
3760 #[serde(rename = "maxDischargeReactivePower_L3")]
3764 #[serde(default, skip_serializing_if = "Option::is_none")]
3765 pub max_discharge_reactive_power_l3: Option<crate::types::Decimal>,
3766 #[serde(rename = "minDischargeReactivePower")]
3771 #[serde(default, skip_serializing_if = "Option::is_none")]
3772 pub min_discharge_reactive_power: Option<crate::types::Decimal>,
3773 #[serde(rename = "minDischargeReactivePower_L2")]
3776 #[serde(default, skip_serializing_if = "Option::is_none")]
3777 pub min_discharge_reactive_power_l2: Option<crate::types::Decimal>,
3778 #[serde(rename = "minDischargeReactivePower_L3")]
3781 #[serde(default, skip_serializing_if = "Option::is_none")]
3782 pub min_discharge_reactive_power_l3: Option<crate::types::Decimal>,
3783 #[serde(rename = "nominalVoltage")]
3786 #[serde(default, skip_serializing_if = "Option::is_none")]
3787 pub nominal_voltage: Option<crate::types::Decimal>,
3788 #[serde(rename = "nominalVoltageOffset")]
3791 #[serde(default, skip_serializing_if = "Option::is_none")]
3792 pub nominal_voltage_offset: Option<crate::types::Decimal>,
3793 #[serde(rename = "maxNominalVoltage")]
3796 #[serde(default, skip_serializing_if = "Option::is_none")]
3797 pub max_nominal_voltage: Option<crate::types::Decimal>,
3798 #[serde(rename = "minNominalVoltage")]
3801 #[serde(default, skip_serializing_if = "Option::is_none")]
3802 pub min_nominal_voltage: Option<crate::types::Decimal>,
3803 #[serde(rename = "evInverterManufacturer")]
3806 #[serde(default, skip_serializing_if = "Option::is_none")]
3807 pub ev_inverter_manufacturer: Option<String>,
3808 #[serde(rename = "evInverterModel")]
3811 #[serde(default, skip_serializing_if = "Option::is_none")]
3812 pub ev_inverter_model: Option<String>,
3813 #[serde(rename = "evInverterSerialNumber")]
3816 #[serde(default, skip_serializing_if = "Option::is_none")]
3817 pub ev_inverter_serial_number: Option<String>,
3818 #[serde(rename = "evInverterSwVersion")]
3821 #[serde(default, skip_serializing_if = "Option::is_none")]
3822 pub ev_inverter_sw_version: Option<String>,
3823 #[serde(rename = "evInverterHwVersion")]
3826 #[serde(default, skip_serializing_if = "Option::is_none")]
3827 pub ev_inverter_hw_version: Option<String>,
3828 #[serde(rename = "evIslandingDetectionMethod")]
3831 #[serde(default, skip_serializing_if = "Option::is_none")]
3832 pub ev_islanding_detection_method: Option<Vec<IslandingDetection>>,
3833 #[serde(rename = "evIslandingTripTime")]
3836 #[serde(default, skip_serializing_if = "Option::is_none")]
3837 pub ev_islanding_trip_time: Option<crate::types::Decimal>,
3838 #[serde(rename = "evMaximumLevel1DCInjection")]
3841 #[serde(default, skip_serializing_if = "Option::is_none")]
3842 pub ev_maximum_level1_dc_injection: Option<crate::types::Decimal>,
3843 #[serde(rename = "evDurationLevel1DCInjection")]
3846 #[serde(default, skip_serializing_if = "Option::is_none")]
3847 pub ev_duration_level1_dc_injection: Option<crate::types::Decimal>,
3848 #[serde(rename = "evMaximumLevel2DCInjection")]
3851 #[serde(default, skip_serializing_if = "Option::is_none")]
3852 pub ev_maximum_level2_dc_injection: Option<crate::types::Decimal>,
3853 #[serde(rename = "evDurationLevel2DCInjection")]
3856 #[serde(default, skip_serializing_if = "Option::is_none")]
3857 pub ev_duration_level2_dc_injection: Option<crate::types::Decimal>,
3858 #[serde(rename = "evReactiveSusceptance")]
3861 #[serde(default, skip_serializing_if = "Option::is_none")]
3862 pub ev_reactive_susceptance: Option<crate::types::Decimal>,
3863 #[serde(rename = "evSessionTotalDischargeEnergyAvailable")]
3866 #[serde(default, skip_serializing_if = "Option::is_none")]
3867 pub ev_session_total_discharge_energy_available: Option<crate::types::Decimal>,
3868 #[serde(rename = "customData")]
3870 #[serde(default, skip_serializing_if = "Option::is_none")]
3871 pub custom_data: Option<crate::types::CustomData>,
3872}
3873
3874impl DERChargingParameters {
3875 #[must_use]
3877 pub fn new() -> Self {
3878 Self::default()
3879 }
3880
3881 #[must_use]
3883 pub fn with_ev_supported_der_control(mut self, value: Vec<DERControl>) -> Self {
3884 self.ev_supported_der_control = Some(value);
3885 self
3886 }
3887
3888 #[must_use]
3890 pub fn with_ev_over_excited_max_discharge_power(
3891 mut self,
3892 value: impl Into<crate::types::Decimal>,
3893 ) -> Self {
3894 self.ev_over_excited_max_discharge_power = Some(value.into());
3895 self
3896 }
3897
3898 #[must_use]
3900 pub fn with_ev_over_excited_power_factor(
3901 mut self,
3902 value: impl Into<crate::types::Decimal>,
3903 ) -> Self {
3904 self.ev_over_excited_power_factor = Some(value.into());
3905 self
3906 }
3907
3908 #[must_use]
3910 pub fn with_ev_under_excited_max_discharge_power(
3911 mut self,
3912 value: impl Into<crate::types::Decimal>,
3913 ) -> Self {
3914 self.ev_under_excited_max_discharge_power = Some(value.into());
3915 self
3916 }
3917
3918 #[must_use]
3920 pub fn with_ev_under_excited_power_factor(
3921 mut self,
3922 value: impl Into<crate::types::Decimal>,
3923 ) -> Self {
3924 self.ev_under_excited_power_factor = Some(value.into());
3925 self
3926 }
3927
3928 #[must_use]
3930 pub fn with_max_apparent_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
3931 self.max_apparent_power = Some(value.into());
3932 self
3933 }
3934
3935 #[must_use]
3937 pub fn with_max_charge_apparent_power(
3938 mut self,
3939 value: impl Into<crate::types::Decimal>,
3940 ) -> Self {
3941 self.max_charge_apparent_power = Some(value.into());
3942 self
3943 }
3944
3945 #[must_use]
3947 pub fn with_max_charge_apparent_power_l2(
3948 mut self,
3949 value: impl Into<crate::types::Decimal>,
3950 ) -> Self {
3951 self.max_charge_apparent_power_l2 = Some(value.into());
3952 self
3953 }
3954
3955 #[must_use]
3957 pub fn with_max_charge_apparent_power_l3(
3958 mut self,
3959 value: impl Into<crate::types::Decimal>,
3960 ) -> Self {
3961 self.max_charge_apparent_power_l3 = Some(value.into());
3962 self
3963 }
3964
3965 #[must_use]
3967 pub fn with_max_discharge_apparent_power(
3968 mut self,
3969 value: impl Into<crate::types::Decimal>,
3970 ) -> Self {
3971 self.max_discharge_apparent_power = Some(value.into());
3972 self
3973 }
3974
3975 #[must_use]
3977 pub fn with_max_discharge_apparent_power_l2(
3978 mut self,
3979 value: impl Into<crate::types::Decimal>,
3980 ) -> Self {
3981 self.max_discharge_apparent_power_l2 = Some(value.into());
3982 self
3983 }
3984
3985 #[must_use]
3987 pub fn with_max_discharge_apparent_power_l3(
3988 mut self,
3989 value: impl Into<crate::types::Decimal>,
3990 ) -> Self {
3991 self.max_discharge_apparent_power_l3 = Some(value.into());
3992 self
3993 }
3994
3995 #[must_use]
3997 pub fn with_max_charge_reactive_power(
3998 mut self,
3999 value: impl Into<crate::types::Decimal>,
4000 ) -> Self {
4001 self.max_charge_reactive_power = Some(value.into());
4002 self
4003 }
4004
4005 #[must_use]
4007 pub fn with_max_charge_reactive_power_l2(
4008 mut self,
4009 value: impl Into<crate::types::Decimal>,
4010 ) -> Self {
4011 self.max_charge_reactive_power_l2 = Some(value.into());
4012 self
4013 }
4014
4015 #[must_use]
4017 pub fn with_max_charge_reactive_power_l3(
4018 mut self,
4019 value: impl Into<crate::types::Decimal>,
4020 ) -> Self {
4021 self.max_charge_reactive_power_l3 = Some(value.into());
4022 self
4023 }
4024
4025 #[must_use]
4027 pub fn with_min_charge_reactive_power(
4028 mut self,
4029 value: impl Into<crate::types::Decimal>,
4030 ) -> Self {
4031 self.min_charge_reactive_power = Some(value.into());
4032 self
4033 }
4034
4035 #[must_use]
4037 pub fn with_min_charge_reactive_power_l2(
4038 mut self,
4039 value: impl Into<crate::types::Decimal>,
4040 ) -> Self {
4041 self.min_charge_reactive_power_l2 = Some(value.into());
4042 self
4043 }
4044
4045 #[must_use]
4047 pub fn with_min_charge_reactive_power_l3(
4048 mut self,
4049 value: impl Into<crate::types::Decimal>,
4050 ) -> Self {
4051 self.min_charge_reactive_power_l3 = Some(value.into());
4052 self
4053 }
4054
4055 #[must_use]
4057 pub fn with_max_discharge_reactive_power(
4058 mut self,
4059 value: impl Into<crate::types::Decimal>,
4060 ) -> Self {
4061 self.max_discharge_reactive_power = Some(value.into());
4062 self
4063 }
4064
4065 #[must_use]
4067 pub fn with_max_discharge_reactive_power_l2(
4068 mut self,
4069 value: impl Into<crate::types::Decimal>,
4070 ) -> Self {
4071 self.max_discharge_reactive_power_l2 = Some(value.into());
4072 self
4073 }
4074
4075 #[must_use]
4077 pub fn with_max_discharge_reactive_power_l3(
4078 mut self,
4079 value: impl Into<crate::types::Decimal>,
4080 ) -> Self {
4081 self.max_discharge_reactive_power_l3 = Some(value.into());
4082 self
4083 }
4084
4085 #[must_use]
4087 pub fn with_min_discharge_reactive_power(
4088 mut self,
4089 value: impl Into<crate::types::Decimal>,
4090 ) -> Self {
4091 self.min_discharge_reactive_power = Some(value.into());
4092 self
4093 }
4094
4095 #[must_use]
4097 pub fn with_min_discharge_reactive_power_l2(
4098 mut self,
4099 value: impl Into<crate::types::Decimal>,
4100 ) -> Self {
4101 self.min_discharge_reactive_power_l2 = Some(value.into());
4102 self
4103 }
4104
4105 #[must_use]
4107 pub fn with_min_discharge_reactive_power_l3(
4108 mut self,
4109 value: impl Into<crate::types::Decimal>,
4110 ) -> Self {
4111 self.min_discharge_reactive_power_l3 = Some(value.into());
4112 self
4113 }
4114
4115 #[must_use]
4117 pub fn with_nominal_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4118 self.nominal_voltage = Some(value.into());
4119 self
4120 }
4121
4122 #[must_use]
4124 pub fn with_nominal_voltage_offset(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4125 self.nominal_voltage_offset = Some(value.into());
4126 self
4127 }
4128
4129 #[must_use]
4131 pub fn with_max_nominal_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4132 self.max_nominal_voltage = Some(value.into());
4133 self
4134 }
4135
4136 #[must_use]
4138 pub fn with_min_nominal_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4139 self.min_nominal_voltage = Some(value.into());
4140 self
4141 }
4142
4143 #[must_use]
4145 pub fn with_ev_inverter_manufacturer(mut self, value: impl Into<String>) -> Self {
4146 self.ev_inverter_manufacturer = Some(value.into());
4147 self
4148 }
4149
4150 #[must_use]
4152 pub fn with_ev_inverter_model(mut self, value: impl Into<String>) -> Self {
4153 self.ev_inverter_model = Some(value.into());
4154 self
4155 }
4156
4157 #[must_use]
4159 pub fn with_ev_inverter_serial_number(mut self, value: impl Into<String>) -> Self {
4160 self.ev_inverter_serial_number = Some(value.into());
4161 self
4162 }
4163
4164 #[must_use]
4166 pub fn with_ev_inverter_sw_version(mut self, value: impl Into<String>) -> Self {
4167 self.ev_inverter_sw_version = Some(value.into());
4168 self
4169 }
4170
4171 #[must_use]
4173 pub fn with_ev_inverter_hw_version(mut self, value: impl Into<String>) -> Self {
4174 self.ev_inverter_hw_version = Some(value.into());
4175 self
4176 }
4177
4178 #[must_use]
4180 pub fn with_ev_islanding_detection_method(mut self, value: Vec<IslandingDetection>) -> Self {
4181 self.ev_islanding_detection_method = Some(value);
4182 self
4183 }
4184
4185 #[must_use]
4187 pub fn with_ev_islanding_trip_time(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4188 self.ev_islanding_trip_time = Some(value.into());
4189 self
4190 }
4191
4192 #[must_use]
4194 pub fn with_ev_maximum_level1_dc_injection(
4195 mut self,
4196 value: impl Into<crate::types::Decimal>,
4197 ) -> Self {
4198 self.ev_maximum_level1_dc_injection = Some(value.into());
4199 self
4200 }
4201
4202 #[must_use]
4204 pub fn with_ev_duration_level1_dc_injection(
4205 mut self,
4206 value: impl Into<crate::types::Decimal>,
4207 ) -> Self {
4208 self.ev_duration_level1_dc_injection = Some(value.into());
4209 self
4210 }
4211
4212 #[must_use]
4214 pub fn with_ev_maximum_level2_dc_injection(
4215 mut self,
4216 value: impl Into<crate::types::Decimal>,
4217 ) -> Self {
4218 self.ev_maximum_level2_dc_injection = Some(value.into());
4219 self
4220 }
4221
4222 #[must_use]
4224 pub fn with_ev_duration_level2_dc_injection(
4225 mut self,
4226 value: impl Into<crate::types::Decimal>,
4227 ) -> Self {
4228 self.ev_duration_level2_dc_injection = Some(value.into());
4229 self
4230 }
4231
4232 #[must_use]
4234 pub fn with_ev_reactive_susceptance(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4235 self.ev_reactive_susceptance = Some(value.into());
4236 self
4237 }
4238
4239 #[must_use]
4241 pub fn with_ev_session_total_discharge_energy_available(
4242 mut self,
4243 value: impl Into<crate::types::Decimal>,
4244 ) -> Self {
4245 self.ev_session_total_discharge_energy_available = Some(value.into());
4246 self
4247 }
4248
4249 #[must_use]
4251 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4252 self.custom_data = Some(value);
4253 self
4254 }
4255}
4256
4257impl Validate for DERChargingParameters {
4258 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4259 path.push_key("evSupportedDERControl");
4260 if let Some(value) = &self.ev_supported_der_control {
4261 validate::list_len(value.len(), Some(1), None, path, out);
4262 for (index, item) in value.iter().enumerate() {
4263 path.push_index(index);
4264 Validate::validate_at(item, path, out);
4265 path.pop();
4266 }
4267 }
4268 path.pop();
4269 path.push_key("evInverterManufacturer");
4270 if let Some(value) = &self.ev_inverter_manufacturer {
4271 validate::string(value.as_str(), None, Some(50), path, out);
4272 }
4273 path.pop();
4274 path.push_key("evInverterModel");
4275 if let Some(value) = &self.ev_inverter_model {
4276 validate::string(value.as_str(), None, Some(50), path, out);
4277 }
4278 path.pop();
4279 path.push_key("evInverterSerialNumber");
4280 if let Some(value) = &self.ev_inverter_serial_number {
4281 validate::string(value.as_str(), None, Some(50), path, out);
4282 }
4283 path.pop();
4284 path.push_key("evInverterSwVersion");
4285 if let Some(value) = &self.ev_inverter_sw_version {
4286 validate::string(value.as_str(), None, Some(50), path, out);
4287 }
4288 path.pop();
4289 path.push_key("evInverterHwVersion");
4290 if let Some(value) = &self.ev_inverter_hw_version {
4291 validate::string(value.as_str(), None, Some(50), path, out);
4292 }
4293 path.pop();
4294 path.push_key("evIslandingDetectionMethod");
4295 if let Some(value) = &self.ev_islanding_detection_method {
4296 validate::list_len(value.len(), Some(1), None, path, out);
4297 for (index, item) in value.iter().enumerate() {
4298 path.push_index(index);
4299 Validate::validate_at(item, path, out);
4300 path.pop();
4301 }
4302 }
4303 path.pop();
4304 path.push_key("customData");
4305 if let Some(value) = &self.custom_data {
4306 Validate::validate_at(value, path, out);
4307 }
4308 path.pop();
4309 }
4310}
4311
4312#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4314pub struct DERCurve {
4315 #[serde(rename = "curveData")]
4317 pub curve_data: Vec<DERCurvePoints>,
4318 #[serde(deserialize_with = "crate::types::integer::one")]
4320 pub priority: i32,
4321 #[serde(rename = "yUnit")]
4323 pub y_unit: DERUnit,
4324 #[serde(default, skip_serializing_if = "Option::is_none")]
4326 pub hysteresis: Option<Hysteresis>,
4327 #[serde(rename = "reactivePowerParams")]
4329 #[serde(default, skip_serializing_if = "Option::is_none")]
4330 pub reactive_power_params: Option<ReactivePowerParams>,
4331 #[serde(rename = "voltageParams")]
4333 #[serde(default, skip_serializing_if = "Option::is_none")]
4334 pub voltage_params: Option<VoltageParams>,
4335 #[serde(rename = "responseTime")]
4337 #[serde(default, skip_serializing_if = "Option::is_none")]
4338 pub response_time: Option<crate::types::Decimal>,
4339 #[serde(rename = "startTime")]
4341 #[serde(default, skip_serializing_if = "Option::is_none")]
4342 pub start_time: Option<crate::types::DateTime>,
4343 #[serde(default, skip_serializing_if = "Option::is_none")]
4345 pub duration: Option<crate::types::Decimal>,
4346 #[serde(rename = "customData")]
4348 #[serde(default, skip_serializing_if = "Option::is_none")]
4349 pub custom_data: Option<crate::types::CustomData>,
4350}
4351
4352impl DERCurve {
4353 #[must_use]
4355 pub fn new(curve_data: Vec<DERCurvePoints>, priority: i32, y_unit: DERUnit) -> Self {
4356 Self {
4357 curve_data,
4358 priority,
4359 y_unit,
4360 hysteresis: None,
4361 reactive_power_params: None,
4362 voltage_params: None,
4363 response_time: None,
4364 start_time: None,
4365 duration: None,
4366 custom_data: None,
4367 }
4368 }
4369
4370 #[must_use]
4372 pub fn with_hysteresis(mut self, value: Hysteresis) -> Self {
4373 self.hysteresis = Some(value);
4374 self
4375 }
4376
4377 #[must_use]
4379 pub fn with_reactive_power_params(mut self, value: ReactivePowerParams) -> Self {
4380 self.reactive_power_params = Some(value);
4381 self
4382 }
4383
4384 #[must_use]
4386 pub fn with_voltage_params(mut self, value: VoltageParams) -> Self {
4387 self.voltage_params = Some(value);
4388 self
4389 }
4390
4391 #[must_use]
4393 pub fn with_response_time(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4394 self.response_time = Some(value.into());
4395 self
4396 }
4397
4398 #[must_use]
4400 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
4401 self.start_time = Some(value.into());
4402 self
4403 }
4404
4405 #[must_use]
4407 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4408 self.duration = Some(value.into());
4409 self
4410 }
4411
4412 #[must_use]
4414 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4415 self.custom_data = Some(value);
4416 self
4417 }
4418}
4419
4420impl Validate for DERCurve {
4421 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4422 path.push_key("curveData");
4423 validate::list_len(self.curve_data.len(), Some(1), Some(10), path, out);
4424 for (index, item) in self.curve_data.iter().enumerate() {
4425 path.push_index(index);
4426 Validate::validate_at(item, path, out);
4427 path.pop();
4428 }
4429 path.pop();
4430 path.push_key("priority");
4431 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
4432 path.pop();
4433 path.push_key("yUnit");
4434 Validate::validate_at(&self.y_unit, path, out);
4435 path.pop();
4436 path.push_key("hysteresis");
4437 if let Some(value) = &self.hysteresis {
4438 Validate::validate_at(value, path, out);
4439 }
4440 path.pop();
4441 path.push_key("reactivePowerParams");
4442 if let Some(value) = &self.reactive_power_params {
4443 Validate::validate_at(value, path, out);
4444 }
4445 path.pop();
4446 path.push_key("voltageParams");
4447 if let Some(value) = &self.voltage_params {
4448 Validate::validate_at(value, path, out);
4449 }
4450 path.pop();
4451 path.push_key("customData");
4452 if let Some(value) = &self.custom_data {
4453 Validate::validate_at(value, path, out);
4454 }
4455 path.pop();
4456 }
4457}
4458
4459#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4461pub struct DERCurveGet {
4462 pub curve: DERCurve,
4464 pub id: String,
4466 #[serde(rename = "curveType")]
4468 pub curve_type: DERControl,
4469 #[serde(rename = "isDefault")]
4471 pub is_default: bool,
4472 #[serde(rename = "isSuperseded")]
4474 pub is_superseded: bool,
4475 #[serde(rename = "customData")]
4477 #[serde(default, skip_serializing_if = "Option::is_none")]
4478 pub custom_data: Option<crate::types::CustomData>,
4479}
4480
4481impl DERCurveGet {
4482 #[must_use]
4484 pub fn new(
4485 curve: DERCurve,
4486 id: impl Into<String>,
4487 curve_type: DERControl,
4488 is_default: bool,
4489 is_superseded: bool,
4490 ) -> Self {
4491 Self {
4492 curve,
4493 id: id.into(),
4494 curve_type,
4495 is_default,
4496 is_superseded,
4497 custom_data: None,
4498 }
4499 }
4500
4501 #[must_use]
4503 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4504 self.custom_data = Some(value);
4505 self
4506 }
4507}
4508
4509impl Validate for DERCurveGet {
4510 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4511 path.push_key("curve");
4512 Validate::validate_at(&self.curve, path, out);
4513 path.pop();
4514 path.push_key("id");
4515 validate::string(self.id.as_str(), None, Some(36), path, out);
4516 path.pop();
4517 path.push_key("curveType");
4518 Validate::validate_at(&self.curve_type, path, out);
4519 path.pop();
4520 path.push_key("customData");
4521 if let Some(value) = &self.custom_data {
4522 Validate::validate_at(value, path, out);
4523 }
4524 path.pop();
4525 }
4526}
4527
4528#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4530pub struct DERCurvePoints {
4531 pub x: crate::types::Decimal,
4533 pub y: crate::types::Decimal,
4535 #[serde(rename = "customData")]
4537 #[serde(default, skip_serializing_if = "Option::is_none")]
4538 pub custom_data: Option<crate::types::CustomData>,
4539}
4540
4541impl DERCurvePoints {
4542 #[must_use]
4544 pub fn new(x: impl Into<crate::types::Decimal>, y: impl Into<crate::types::Decimal>) -> Self {
4545 Self {
4546 x: x.into(),
4547 y: y.into(),
4548 custom_data: None,
4549 }
4550 }
4551
4552 #[must_use]
4554 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4555 self.custom_data = Some(value);
4556 self
4557 }
4558}
4559
4560impl Validate for DERCurvePoints {
4561 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4562 path.push_key("customData");
4563 if let Some(value) = &self.custom_data {
4564 Validate::validate_at(value, path, out);
4565 }
4566 path.pop();
4567 }
4568}
4569
4570#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4574pub struct EVAbsolutePriceSchedule {
4575 #[serde(rename = "timeAnchor")]
4577 pub time_anchor: crate::types::DateTime,
4578 pub currency: String,
4580 #[serde(rename = "evAbsolutePriceScheduleEntries")]
4582 pub ev_absolute_price_schedule_entries: Vec<EVAbsolutePriceScheduleEntry>,
4583 #[serde(rename = "priceAlgorithm")]
4585 pub price_algorithm: String,
4586 #[serde(rename = "customData")]
4588 #[serde(default, skip_serializing_if = "Option::is_none")]
4589 pub custom_data: Option<crate::types::CustomData>,
4590}
4591
4592impl EVAbsolutePriceSchedule {
4593 #[must_use]
4595 pub fn new(
4596 time_anchor: impl Into<crate::types::DateTime>,
4597 currency: impl Into<String>,
4598 ev_absolute_price_schedule_entries: Vec<EVAbsolutePriceScheduleEntry>,
4599 price_algorithm: impl Into<String>,
4600 ) -> Self {
4601 Self {
4602 time_anchor: time_anchor.into(),
4603 currency: currency.into(),
4604 ev_absolute_price_schedule_entries,
4605 price_algorithm: price_algorithm.into(),
4606 custom_data: None,
4607 }
4608 }
4609
4610 #[must_use]
4612 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4613 self.custom_data = Some(value);
4614 self
4615 }
4616}
4617
4618impl Validate for EVAbsolutePriceSchedule {
4619 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4620 path.push_key("currency");
4621 validate::string(self.currency.as_str(), None, Some(3), path, out);
4622 path.pop();
4623 path.push_key("evAbsolutePriceScheduleEntries");
4624 validate::list_len(
4625 self.ev_absolute_price_schedule_entries.len(),
4626 Some(1),
4627 Some(1024),
4628 path,
4629 out,
4630 );
4631 for (index, item) in self.ev_absolute_price_schedule_entries.iter().enumerate() {
4632 path.push_index(index);
4633 Validate::validate_at(item, path, out);
4634 path.pop();
4635 }
4636 path.pop();
4637 path.push_key("priceAlgorithm");
4638 validate::string(self.price_algorithm.as_str(), None, Some(2000), path, out);
4639 path.pop();
4640 path.push_key("customData");
4641 if let Some(value) = &self.custom_data {
4642 Validate::validate_at(value, path, out);
4643 }
4644 path.pop();
4645 }
4646}
4647
4648#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4652pub struct EVAbsolutePriceScheduleEntry {
4653 #[serde(deserialize_with = "crate::types::integer::one")]
4655 pub duration: i32,
4656 #[serde(rename = "evPriceRule")]
4658 pub ev_price_rule: Vec<EVPriceRule>,
4659 #[serde(rename = "customData")]
4661 #[serde(default, skip_serializing_if = "Option::is_none")]
4662 pub custom_data: Option<crate::types::CustomData>,
4663}
4664
4665impl EVAbsolutePriceScheduleEntry {
4666 #[must_use]
4668 pub fn new(duration: i32, ev_price_rule: Vec<EVPriceRule>) -> Self {
4669 Self {
4670 duration,
4671 ev_price_rule,
4672 custom_data: None,
4673 }
4674 }
4675
4676 #[must_use]
4678 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4679 self.custom_data = Some(value);
4680 self
4681 }
4682}
4683
4684impl Validate for EVAbsolutePriceScheduleEntry {
4685 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4686 path.push_key("evPriceRule");
4687 validate::list_len(self.ev_price_rule.len(), Some(1), Some(8), path, out);
4688 for (index, item) in self.ev_price_rule.iter().enumerate() {
4689 path.push_index(index);
4690 Validate::validate_at(item, path, out);
4691 path.pop();
4692 }
4693 path.pop();
4694 path.push_key("customData");
4695 if let Some(value) = &self.custom_data {
4696 Validate::validate_at(value, path, out);
4697 }
4698 path.pop();
4699 }
4700}
4701
4702#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4706pub struct EVEnergyOffer {
4707 #[serde(rename = "evPowerSchedule")]
4709 pub ev_power_schedule: EVPowerSchedule,
4710 #[serde(rename = "evAbsolutePriceSchedule")]
4712 #[serde(default, skip_serializing_if = "Option::is_none")]
4713 pub ev_absolute_price_schedule: Option<EVAbsolutePriceSchedule>,
4714 #[serde(rename = "customData")]
4716 #[serde(default, skip_serializing_if = "Option::is_none")]
4717 pub custom_data: Option<crate::types::CustomData>,
4718}
4719
4720impl EVEnergyOffer {
4721 #[must_use]
4723 pub fn new(ev_power_schedule: EVPowerSchedule) -> Self {
4724 Self {
4725 ev_power_schedule,
4726 ev_absolute_price_schedule: None,
4727 custom_data: None,
4728 }
4729 }
4730
4731 #[must_use]
4733 pub fn with_ev_absolute_price_schedule(mut self, value: EVAbsolutePriceSchedule) -> Self {
4734 self.ev_absolute_price_schedule = Some(value);
4735 self
4736 }
4737
4738 #[must_use]
4740 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4741 self.custom_data = Some(value);
4742 self
4743 }
4744}
4745
4746impl Validate for EVEnergyOffer {
4747 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4748 path.push_key("evPowerSchedule");
4749 Validate::validate_at(&self.ev_power_schedule, path, out);
4750 path.pop();
4751 path.push_key("evAbsolutePriceSchedule");
4752 if let Some(value) = &self.ev_absolute_price_schedule {
4753 Validate::validate_at(value, path, out);
4754 }
4755 path.pop();
4756 path.push_key("customData");
4757 if let Some(value) = &self.custom_data {
4758 Validate::validate_at(value, path, out);
4759 }
4760 path.pop();
4761 }
4762}
4763
4764#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4768pub struct EVPowerSchedule {
4769 #[serde(rename = "evPowerScheduleEntries")]
4771 pub ev_power_schedule_entries: Vec<EVPowerScheduleEntry>,
4772 #[serde(rename = "timeAnchor")]
4774 pub time_anchor: crate::types::DateTime,
4775 #[serde(rename = "customData")]
4777 #[serde(default, skip_serializing_if = "Option::is_none")]
4778 pub custom_data: Option<crate::types::CustomData>,
4779}
4780
4781impl EVPowerSchedule {
4782 #[must_use]
4784 pub fn new(
4785 ev_power_schedule_entries: Vec<EVPowerScheduleEntry>,
4786 time_anchor: impl Into<crate::types::DateTime>,
4787 ) -> Self {
4788 Self {
4789 ev_power_schedule_entries,
4790 time_anchor: time_anchor.into(),
4791 custom_data: None,
4792 }
4793 }
4794
4795 #[must_use]
4797 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4798 self.custom_data = Some(value);
4799 self
4800 }
4801}
4802
4803impl Validate for EVPowerSchedule {
4804 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4805 path.push_key("evPowerScheduleEntries");
4806 validate::list_len(
4807 self.ev_power_schedule_entries.len(),
4808 Some(1),
4809 Some(1024),
4810 path,
4811 out,
4812 );
4813 for (index, item) in self.ev_power_schedule_entries.iter().enumerate() {
4814 path.push_index(index);
4815 Validate::validate_at(item, path, out);
4816 path.pop();
4817 }
4818 path.pop();
4819 path.push_key("customData");
4820 if let Some(value) = &self.custom_data {
4821 Validate::validate_at(value, path, out);
4822 }
4823 path.pop();
4824 }
4825}
4826
4827#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4831pub struct EVPowerScheduleEntry {
4832 #[serde(deserialize_with = "crate::types::integer::one")]
4834 pub duration: i32,
4835 pub power: crate::types::Decimal,
4837 #[serde(rename = "customData")]
4839 #[serde(default, skip_serializing_if = "Option::is_none")]
4840 pub custom_data: Option<crate::types::CustomData>,
4841}
4842
4843impl EVPowerScheduleEntry {
4844 #[must_use]
4846 pub fn new(duration: i32, power: impl Into<crate::types::Decimal>) -> Self {
4847 Self {
4848 duration,
4849 power: power.into(),
4850 custom_data: None,
4851 }
4852 }
4853
4854 #[must_use]
4856 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4857 self.custom_data = Some(value);
4858 self
4859 }
4860}
4861
4862impl Validate for EVPowerScheduleEntry {
4863 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4864 path.push_key("customData");
4865 if let Some(value) = &self.custom_data {
4866 Validate::validate_at(value, path, out);
4867 }
4868 path.pop();
4869 }
4870}
4871
4872#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4876pub struct EVPriceRule {
4877 #[serde(rename = "energyFee")]
4879 pub energy_fee: crate::types::Decimal,
4880 #[serde(rename = "powerRangeStart")]
4882 pub power_range_start: crate::types::Decimal,
4883 #[serde(rename = "customData")]
4885 #[serde(default, skip_serializing_if = "Option::is_none")]
4886 pub custom_data: Option<crate::types::CustomData>,
4887}
4888
4889impl EVPriceRule {
4890 #[must_use]
4892 pub fn new(
4893 energy_fee: impl Into<crate::types::Decimal>,
4894 power_range_start: impl Into<crate::types::Decimal>,
4895 ) -> Self {
4896 Self {
4897 energy_fee: energy_fee.into(),
4898 power_range_start: power_range_start.into(),
4899 custom_data: None,
4900 }
4901 }
4902
4903 #[must_use]
4905 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4906 self.custom_data = Some(value);
4907 self
4908 }
4909}
4910
4911impl Validate for EVPriceRule {
4912 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4913 path.push_key("customData");
4914 if let Some(value) = &self.custom_data {
4915 Validate::validate_at(value, path, out);
4916 }
4917 path.pop();
4918 }
4919}
4920
4921#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4925pub struct EVSE {
4926 #[serde(deserialize_with = "crate::types::integer::one")]
4928 pub id: i32,
4929 #[serde(rename = "connectorId")]
4931 #[serde(default, skip_serializing_if = "Option::is_none")]
4932 #[serde(deserialize_with = "crate::types::integer::option")]
4933 pub connector_id: Option<i32>,
4934 #[serde(rename = "customData")]
4936 #[serde(default, skip_serializing_if = "Option::is_none")]
4937 pub custom_data: Option<crate::types::CustomData>,
4938}
4939
4940impl EVSE {
4941 #[must_use]
4943 pub fn new(id: i32) -> Self {
4944 Self {
4945 id,
4946 connector_id: None,
4947 custom_data: None,
4948 }
4949 }
4950
4951 #[must_use]
4953 pub fn with_connector_id(mut self, value: i32) -> Self {
4954 self.connector_id = Some(value);
4955 self
4956 }
4957
4958 #[must_use]
4960 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4961 self.custom_data = Some(value);
4962 self
4963 }
4964}
4965
4966impl Validate for EVSE {
4967 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4968 path.push_key("id");
4969 validate::int_range(i64::from(self.id), Some(0), None, path, out);
4970 path.pop();
4971 path.push_key("connectorId");
4972 if let Some(value) = &self.connector_id {
4973 validate::int_range(i64::from(*value), Some(0), None, path, out);
4974 }
4975 path.pop();
4976 path.push_key("customData");
4977 if let Some(value) = &self.custom_data {
4978 Validate::validate_at(value, path, out);
4979 }
4980 path.pop();
4981 }
4982}
4983
4984#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4986pub struct EnterService {
4987 #[serde(deserialize_with = "crate::types::integer::one")]
4989 pub priority: i32,
4990 #[serde(rename = "highVoltage")]
4992 pub high_voltage: crate::types::Decimal,
4993 #[serde(rename = "lowVoltage")]
4995 pub low_voltage: crate::types::Decimal,
4996 #[serde(rename = "highFreq")]
4998 pub high_freq: crate::types::Decimal,
4999 #[serde(rename = "lowFreq")]
5001 pub low_freq: crate::types::Decimal,
5002 #[serde(default, skip_serializing_if = "Option::is_none")]
5004 pub delay: Option<crate::types::Decimal>,
5005 #[serde(rename = "randomDelay")]
5007 #[serde(default, skip_serializing_if = "Option::is_none")]
5008 pub random_delay: Option<crate::types::Decimal>,
5009 #[serde(rename = "rampRate")]
5011 #[serde(default, skip_serializing_if = "Option::is_none")]
5012 pub ramp_rate: Option<crate::types::Decimal>,
5013 #[serde(rename = "customData")]
5015 #[serde(default, skip_serializing_if = "Option::is_none")]
5016 pub custom_data: Option<crate::types::CustomData>,
5017}
5018
5019impl EnterService {
5020 #[must_use]
5022 pub fn new(
5023 priority: i32,
5024 high_voltage: impl Into<crate::types::Decimal>,
5025 low_voltage: impl Into<crate::types::Decimal>,
5026 high_freq: impl Into<crate::types::Decimal>,
5027 low_freq: impl Into<crate::types::Decimal>,
5028 ) -> Self {
5029 Self {
5030 priority,
5031 high_voltage: high_voltage.into(),
5032 low_voltage: low_voltage.into(),
5033 high_freq: high_freq.into(),
5034 low_freq: low_freq.into(),
5035 delay: None,
5036 random_delay: None,
5037 ramp_rate: None,
5038 custom_data: None,
5039 }
5040 }
5041
5042 #[must_use]
5044 pub fn with_delay(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5045 self.delay = Some(value.into());
5046 self
5047 }
5048
5049 #[must_use]
5051 pub fn with_random_delay(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5052 self.random_delay = Some(value.into());
5053 self
5054 }
5055
5056 #[must_use]
5058 pub fn with_ramp_rate(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5059 self.ramp_rate = Some(value.into());
5060 self
5061 }
5062
5063 #[must_use]
5065 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5066 self.custom_data = Some(value);
5067 self
5068 }
5069}
5070
5071impl Validate for EnterService {
5072 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5073 path.push_key("priority");
5074 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
5075 path.pop();
5076 path.push_key("customData");
5077 if let Some(value) = &self.custom_data {
5078 Validate::validate_at(value, path, out);
5079 }
5080 path.pop();
5081 }
5082}
5083
5084#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5086pub struct EnterServiceGet {
5087 #[serde(rename = "enterService")]
5089 pub enter_service: EnterService,
5090 pub id: String,
5092 #[serde(rename = "customData")]
5094 #[serde(default, skip_serializing_if = "Option::is_none")]
5095 pub custom_data: Option<crate::types::CustomData>,
5096}
5097
5098impl EnterServiceGet {
5099 #[must_use]
5101 pub fn new(enter_service: EnterService, id: impl Into<String>) -> Self {
5102 Self {
5103 enter_service,
5104 id: id.into(),
5105 custom_data: None,
5106 }
5107 }
5108
5109 #[must_use]
5111 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5112 self.custom_data = Some(value);
5113 self
5114 }
5115}
5116
5117impl Validate for EnterServiceGet {
5118 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5119 path.push_key("enterService");
5120 Validate::validate_at(&self.enter_service, path, out);
5121 path.pop();
5122 path.push_key("id");
5123 validate::string(self.id.as_str(), None, Some(36), path, out);
5124 path.pop();
5125 path.push_key("customData");
5126 if let Some(value) = &self.custom_data {
5127 Validate::validate_at(value, path, out);
5128 }
5129 path.pop();
5130 }
5131}
5132
5133#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5137pub struct EventData {
5138 #[serde(rename = "eventId")]
5140 #[serde(deserialize_with = "crate::types::integer::one")]
5141 pub event_id: i32,
5142 pub timestamp: crate::types::DateTime,
5144 pub trigger: EventTrigger,
5146 #[serde(rename = "actualValue")]
5150 pub actual_value: String,
5151 pub component: Component,
5153 #[serde(rename = "eventNotificationType")]
5155 pub event_notification_type: EventNotification,
5156 pub variable: Variable,
5158 #[serde(default, skip_serializing_if = "Option::is_none")]
5160 #[serde(deserialize_with = "crate::types::integer::option")]
5161 pub cause: Option<i32>,
5162 #[serde(rename = "techCode")]
5164 #[serde(default, skip_serializing_if = "Option::is_none")]
5165 pub tech_code: Option<String>,
5166 #[serde(rename = "techInfo")]
5168 #[serde(default, skip_serializing_if = "Option::is_none")]
5169 pub tech_info: Option<String>,
5170 #[serde(default, skip_serializing_if = "Option::is_none")]
5172 pub cleared: Option<bool>,
5173 #[serde(rename = "transactionId")]
5175 #[serde(default, skip_serializing_if = "Option::is_none")]
5176 pub transaction_id: Option<String>,
5177 #[serde(rename = "variableMonitoringId")]
5179 #[serde(default, skip_serializing_if = "Option::is_none")]
5180 #[serde(deserialize_with = "crate::types::integer::option")]
5181 pub variable_monitoring_id: Option<i32>,
5182 #[serde(default, skip_serializing_if = "Option::is_none")]
5184 #[serde(deserialize_with = "crate::types::integer::option")]
5185 pub severity: Option<i32>,
5186 #[serde(rename = "customData")]
5188 #[serde(default, skip_serializing_if = "Option::is_none")]
5189 pub custom_data: Option<crate::types::CustomData>,
5190}
5191
5192impl EventData {
5193 #[must_use]
5195 pub fn new(
5196 event_id: i32,
5197 timestamp: impl Into<crate::types::DateTime>,
5198 trigger: EventTrigger,
5199 actual_value: impl Into<String>,
5200 component: Component,
5201 event_notification_type: EventNotification,
5202 variable: Variable,
5203 ) -> Self {
5204 Self {
5205 event_id,
5206 timestamp: timestamp.into(),
5207 trigger,
5208 actual_value: actual_value.into(),
5209 component,
5210 event_notification_type,
5211 variable,
5212 cause: None,
5213 tech_code: None,
5214 tech_info: None,
5215 cleared: None,
5216 transaction_id: None,
5217 variable_monitoring_id: None,
5218 severity: None,
5219 custom_data: None,
5220 }
5221 }
5222
5223 #[must_use]
5225 pub fn with_cause(mut self, value: i32) -> Self {
5226 self.cause = Some(value);
5227 self
5228 }
5229
5230 #[must_use]
5232 pub fn with_tech_code(mut self, value: impl Into<String>) -> Self {
5233 self.tech_code = Some(value.into());
5234 self
5235 }
5236
5237 #[must_use]
5239 pub fn with_tech_info(mut self, value: impl Into<String>) -> Self {
5240 self.tech_info = Some(value.into());
5241 self
5242 }
5243
5244 #[must_use]
5246 pub fn with_cleared(mut self, value: bool) -> Self {
5247 self.cleared = Some(value);
5248 self
5249 }
5250
5251 #[must_use]
5253 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
5254 self.transaction_id = Some(value.into());
5255 self
5256 }
5257
5258 #[must_use]
5260 pub fn with_variable_monitoring_id(mut self, value: i32) -> Self {
5261 self.variable_monitoring_id = Some(value);
5262 self
5263 }
5264
5265 #[must_use]
5267 pub fn with_severity(mut self, value: i32) -> Self {
5268 self.severity = Some(value);
5269 self
5270 }
5271
5272 #[must_use]
5274 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5275 self.custom_data = Some(value);
5276 self
5277 }
5278}
5279
5280impl Validate for EventData {
5281 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5282 path.push_key("eventId");
5283 validate::int_range(i64::from(self.event_id), Some(0), None, path, out);
5284 path.pop();
5285 path.push_key("trigger");
5286 Validate::validate_at(&self.trigger, path, out);
5287 path.pop();
5288 path.push_key("actualValue");
5289 validate::string(self.actual_value.as_str(), None, Some(2500), path, out);
5290 path.pop();
5291 path.push_key("component");
5292 Validate::validate_at(&self.component, path, out);
5293 path.pop();
5294 path.push_key("eventNotificationType");
5295 Validate::validate_at(&self.event_notification_type, path, out);
5296 path.pop();
5297 path.push_key("variable");
5298 Validate::validate_at(&self.variable, path, out);
5299 path.pop();
5300 path.push_key("cause");
5301 if let Some(value) = &self.cause {
5302 validate::int_range(i64::from(*value), Some(0), None, path, out);
5303 }
5304 path.pop();
5305 path.push_key("techCode");
5306 if let Some(value) = &self.tech_code {
5307 validate::string(value.as_str(), None, Some(50), path, out);
5308 }
5309 path.pop();
5310 path.push_key("techInfo");
5311 if let Some(value) = &self.tech_info {
5312 validate::string(value.as_str(), None, Some(500), path, out);
5313 }
5314 path.pop();
5315 path.push_key("transactionId");
5316 if let Some(value) = &self.transaction_id {
5317 validate::string(value.as_str(), None, Some(36), path, out);
5318 }
5319 path.pop();
5320 path.push_key("variableMonitoringId");
5321 if let Some(value) = &self.variable_monitoring_id {
5322 validate::int_range(i64::from(*value), Some(0), None, path, out);
5323 }
5324 path.pop();
5325 path.push_key("severity");
5326 if let Some(value) = &self.severity {
5327 validate::int_range(i64::from(*value), Some(0), None, path, out);
5328 }
5329 path.pop();
5330 path.push_key("customData");
5331 if let Some(value) = &self.custom_data {
5332 Validate::validate_at(value, path, out);
5333 }
5334 path.pop();
5335 }
5336}
5337
5338#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5342pub struct Firmware {
5343 pub location: String,
5345 #[serde(rename = "retrieveDateTime")]
5347 pub retrieve_date_time: crate::types::DateTime,
5348 #[serde(rename = "installDateTime")]
5350 #[serde(default, skip_serializing_if = "Option::is_none")]
5351 pub install_date_time: Option<crate::types::DateTime>,
5352 #[serde(rename = "signingCertificate")]
5355 #[serde(default, skip_serializing_if = "Option::is_none")]
5356 pub signing_certificate: Option<String>,
5357 #[serde(default, skip_serializing_if = "Option::is_none")]
5359 pub signature: Option<String>,
5360 #[serde(rename = "customData")]
5362 #[serde(default, skip_serializing_if = "Option::is_none")]
5363 pub custom_data: Option<crate::types::CustomData>,
5364}
5365
5366impl Firmware {
5367 #[must_use]
5369 pub fn new(
5370 location: impl Into<String>,
5371 retrieve_date_time: impl Into<crate::types::DateTime>,
5372 ) -> Self {
5373 Self {
5374 location: location.into(),
5375 retrieve_date_time: retrieve_date_time.into(),
5376 install_date_time: None,
5377 signing_certificate: None,
5378 signature: None,
5379 custom_data: None,
5380 }
5381 }
5382
5383 #[must_use]
5385 pub fn with_install_date_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
5386 self.install_date_time = Some(value.into());
5387 self
5388 }
5389
5390 #[must_use]
5392 pub fn with_signing_certificate(mut self, value: impl Into<String>) -> Self {
5393 self.signing_certificate = Some(value.into());
5394 self
5395 }
5396
5397 #[must_use]
5399 pub fn with_signature(mut self, value: impl Into<String>) -> Self {
5400 self.signature = Some(value.into());
5401 self
5402 }
5403
5404 #[must_use]
5406 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5407 self.custom_data = Some(value);
5408 self
5409 }
5410}
5411
5412impl Validate for Firmware {
5413 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5414 path.push_key("location");
5415 validate::string(self.location.as_str(), None, Some(2000), path, out);
5416 path.pop();
5417 path.push_key("signingCertificate");
5418 if let Some(value) = &self.signing_certificate {
5419 validate::string(value.as_str(), None, Some(5500), path, out);
5420 }
5421 path.pop();
5422 path.push_key("signature");
5423 if let Some(value) = &self.signature {
5424 validate::string(value.as_str(), None, Some(800), path, out);
5425 }
5426 path.pop();
5427 path.push_key("customData");
5428 if let Some(value) = &self.custom_data {
5429 Validate::validate_at(value, path, out);
5430 }
5431 path.pop();
5432 }
5433}
5434
5435#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5437pub struct FixedPF {
5438 #[serde(deserialize_with = "crate::types::integer::one")]
5440 pub priority: i32,
5441 pub displacement: crate::types::Decimal,
5443 pub excitation: bool,
5445 #[serde(rename = "startTime")]
5447 #[serde(default, skip_serializing_if = "Option::is_none")]
5448 pub start_time: Option<crate::types::DateTime>,
5449 #[serde(default, skip_serializing_if = "Option::is_none")]
5451 pub duration: Option<crate::types::Decimal>,
5452 #[serde(rename = "customData")]
5454 #[serde(default, skip_serializing_if = "Option::is_none")]
5455 pub custom_data: Option<crate::types::CustomData>,
5456}
5457
5458impl FixedPF {
5459 #[must_use]
5461 pub fn new(
5462 priority: i32,
5463 displacement: impl Into<crate::types::Decimal>,
5464 excitation: bool,
5465 ) -> Self {
5466 Self {
5467 priority,
5468 displacement: displacement.into(),
5469 excitation,
5470 start_time: None,
5471 duration: None,
5472 custom_data: None,
5473 }
5474 }
5475
5476 #[must_use]
5478 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
5479 self.start_time = Some(value.into());
5480 self
5481 }
5482
5483 #[must_use]
5485 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5486 self.duration = Some(value.into());
5487 self
5488 }
5489
5490 #[must_use]
5492 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5493 self.custom_data = Some(value);
5494 self
5495 }
5496}
5497
5498impl Validate for FixedPF {
5499 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5500 path.push_key("priority");
5501 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
5502 path.pop();
5503 path.push_key("customData");
5504 if let Some(value) = &self.custom_data {
5505 Validate::validate_at(value, path, out);
5506 }
5507 path.pop();
5508 }
5509}
5510
5511#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5513pub struct FixedPFGet {
5514 #[serde(rename = "fixedPF")]
5516 pub fixed_pf: FixedPF,
5517 pub id: String,
5519 #[serde(rename = "isDefault")]
5521 pub is_default: bool,
5522 #[serde(rename = "isSuperseded")]
5524 pub is_superseded: bool,
5525 #[serde(rename = "customData")]
5527 #[serde(default, skip_serializing_if = "Option::is_none")]
5528 pub custom_data: Option<crate::types::CustomData>,
5529}
5530
5531impl FixedPFGet {
5532 #[must_use]
5534 pub fn new(
5535 fixed_pf: FixedPF,
5536 id: impl Into<String>,
5537 is_default: bool,
5538 is_superseded: bool,
5539 ) -> Self {
5540 Self {
5541 fixed_pf,
5542 id: id.into(),
5543 is_default,
5544 is_superseded,
5545 custom_data: None,
5546 }
5547 }
5548
5549 #[must_use]
5551 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5552 self.custom_data = Some(value);
5553 self
5554 }
5555}
5556
5557impl Validate for FixedPFGet {
5558 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5559 path.push_key("fixedPF");
5560 Validate::validate_at(&self.fixed_pf, path, out);
5561 path.pop();
5562 path.push_key("id");
5563 validate::string(self.id.as_str(), None, Some(36), path, out);
5564 path.pop();
5565 path.push_key("customData");
5566 if let Some(value) = &self.custom_data {
5567 Validate::validate_at(value, path, out);
5568 }
5569 path.pop();
5570 }
5571}
5572
5573#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5575pub struct FixedVar {
5576 #[serde(deserialize_with = "crate::types::integer::one")]
5578 pub priority: i32,
5579 pub setpoint: crate::types::Decimal,
5583 pub unit: DERUnit,
5585 #[serde(rename = "startTime")]
5587 #[serde(default, skip_serializing_if = "Option::is_none")]
5588 pub start_time: Option<crate::types::DateTime>,
5589 #[serde(default, skip_serializing_if = "Option::is_none")]
5591 pub duration: Option<crate::types::Decimal>,
5592 #[serde(rename = "customData")]
5594 #[serde(default, skip_serializing_if = "Option::is_none")]
5595 pub custom_data: Option<crate::types::CustomData>,
5596}
5597
5598impl FixedVar {
5599 #[must_use]
5601 pub fn new(priority: i32, setpoint: impl Into<crate::types::Decimal>, unit: DERUnit) -> Self {
5602 Self {
5603 priority,
5604 setpoint: setpoint.into(),
5605 unit,
5606 start_time: None,
5607 duration: None,
5608 custom_data: None,
5609 }
5610 }
5611
5612 #[must_use]
5614 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
5615 self.start_time = Some(value.into());
5616 self
5617 }
5618
5619 #[must_use]
5621 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5622 self.duration = Some(value.into());
5623 self
5624 }
5625
5626 #[must_use]
5628 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5629 self.custom_data = Some(value);
5630 self
5631 }
5632}
5633
5634impl Validate for FixedVar {
5635 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5636 path.push_key("priority");
5637 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
5638 path.pop();
5639 path.push_key("unit");
5640 Validate::validate_at(&self.unit, path, out);
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
5650#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5652pub struct FixedVarGet {
5653 #[serde(rename = "fixedVar")]
5655 pub fixed_var: FixedVar,
5656 pub id: String,
5658 #[serde(rename = "isDefault")]
5660 pub is_default: bool,
5661 #[serde(rename = "isSuperseded")]
5663 pub is_superseded: bool,
5664 #[serde(rename = "customData")]
5666 #[serde(default, skip_serializing_if = "Option::is_none")]
5667 pub custom_data: Option<crate::types::CustomData>,
5668}
5669
5670impl FixedVarGet {
5671 #[must_use]
5673 pub fn new(
5674 fixed_var: FixedVar,
5675 id: impl Into<String>,
5676 is_default: bool,
5677 is_superseded: bool,
5678 ) -> Self {
5679 Self {
5680 fixed_var,
5681 id: id.into(),
5682 is_default,
5683 is_superseded,
5684 custom_data: None,
5685 }
5686 }
5687
5688 #[must_use]
5690 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5691 self.custom_data = Some(value);
5692 self
5693 }
5694}
5695
5696impl Validate for FixedVarGet {
5697 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5698 path.push_key("fixedVar");
5699 Validate::validate_at(&self.fixed_var, path, out);
5700 path.pop();
5701 path.push_key("id");
5702 validate::string(self.id.as_str(), None, Some(36), path, out);
5703 path.pop();
5704 path.push_key("customData");
5705 if let Some(value) = &self.custom_data {
5706 Validate::validate_at(value, path, out);
5707 }
5708 path.pop();
5709 }
5710}
5711
5712#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5714pub struct FreqDroop {
5715 #[serde(deserialize_with = "crate::types::integer::one")]
5717 pub priority: i32,
5718 #[serde(rename = "overFreq")]
5720 pub over_freq: crate::types::Decimal,
5721 #[serde(rename = "underFreq")]
5723 pub under_freq: crate::types::Decimal,
5724 #[serde(rename = "overDroop")]
5726 pub over_droop: crate::types::Decimal,
5727 #[serde(rename = "underDroop")]
5729 pub under_droop: crate::types::Decimal,
5730 #[serde(rename = "responseTime")]
5732 pub response_time: crate::types::Decimal,
5733 #[serde(rename = "startTime")]
5735 #[serde(default, skip_serializing_if = "Option::is_none")]
5736 pub start_time: Option<crate::types::DateTime>,
5737 #[serde(default, skip_serializing_if = "Option::is_none")]
5739 pub duration: Option<crate::types::Decimal>,
5740 #[serde(rename = "customData")]
5742 #[serde(default, skip_serializing_if = "Option::is_none")]
5743 pub custom_data: Option<crate::types::CustomData>,
5744}
5745
5746impl FreqDroop {
5747 #[must_use]
5749 pub fn new(
5750 priority: i32,
5751 over_freq: impl Into<crate::types::Decimal>,
5752 under_freq: impl Into<crate::types::Decimal>,
5753 over_droop: impl Into<crate::types::Decimal>,
5754 under_droop: impl Into<crate::types::Decimal>,
5755 response_time: impl Into<crate::types::Decimal>,
5756 ) -> Self {
5757 Self {
5758 priority,
5759 over_freq: over_freq.into(),
5760 under_freq: under_freq.into(),
5761 over_droop: over_droop.into(),
5762 under_droop: under_droop.into(),
5763 response_time: response_time.into(),
5764 start_time: None,
5765 duration: None,
5766 custom_data: None,
5767 }
5768 }
5769
5770 #[must_use]
5772 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
5773 self.start_time = Some(value.into());
5774 self
5775 }
5776
5777 #[must_use]
5779 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5780 self.duration = Some(value.into());
5781 self
5782 }
5783
5784 #[must_use]
5786 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5787 self.custom_data = Some(value);
5788 self
5789 }
5790}
5791
5792impl Validate for FreqDroop {
5793 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5794 path.push_key("priority");
5795 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
5796 path.pop();
5797 path.push_key("customData");
5798 if let Some(value) = &self.custom_data {
5799 Validate::validate_at(value, path, out);
5800 }
5801 path.pop();
5802 }
5803}
5804
5805#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5807pub struct FreqDroopGet {
5808 #[serde(rename = "freqDroop")]
5810 pub freq_droop: FreqDroop,
5811 pub id: String,
5813 #[serde(rename = "isDefault")]
5815 pub is_default: bool,
5816 #[serde(rename = "isSuperseded")]
5818 pub is_superseded: bool,
5819 #[serde(rename = "customData")]
5821 #[serde(default, skip_serializing_if = "Option::is_none")]
5822 pub custom_data: Option<crate::types::CustomData>,
5823}
5824
5825impl FreqDroopGet {
5826 #[must_use]
5828 pub fn new(
5829 freq_droop: FreqDroop,
5830 id: impl Into<String>,
5831 is_default: bool,
5832 is_superseded: bool,
5833 ) -> Self {
5834 Self {
5835 freq_droop,
5836 id: id.into(),
5837 is_default,
5838 is_superseded,
5839 custom_data: None,
5840 }
5841 }
5842
5843 #[must_use]
5845 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5846 self.custom_data = Some(value);
5847 self
5848 }
5849}
5850
5851impl Validate for FreqDroopGet {
5852 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5853 path.push_key("freqDroop");
5854 Validate::validate_at(&self.freq_droop, path, out);
5855 path.pop();
5856 path.push_key("id");
5857 validate::string(self.id.as_str(), None, Some(36), path, out);
5858 path.pop();
5859 path.push_key("customData");
5860 if let Some(value) = &self.custom_data {
5861 Validate::validate_at(value, path, out);
5862 }
5863 path.pop();
5864 }
5865}
5866
5867#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5871pub struct GetVariableData {
5872 pub component: Component,
5874 pub variable: Variable,
5876 #[serde(rename = "attributeType")]
5878 #[serde(default, skip_serializing_if = "Option::is_none")]
5879 pub attribute_type: Option<Attribute>,
5880 #[serde(rename = "customData")]
5882 #[serde(default, skip_serializing_if = "Option::is_none")]
5883 pub custom_data: Option<crate::types::CustomData>,
5884}
5885
5886impl GetVariableData {
5887 #[must_use]
5889 pub fn new(component: Component, variable: Variable) -> Self {
5890 Self {
5891 component,
5892 variable,
5893 attribute_type: None,
5894 custom_data: None,
5895 }
5896 }
5897
5898 #[must_use]
5900 pub fn with_attribute_type(mut self, value: Attribute) -> Self {
5901 self.attribute_type = Some(value);
5902 self
5903 }
5904
5905 #[must_use]
5907 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5908 self.custom_data = Some(value);
5909 self
5910 }
5911}
5912
5913impl Validate for GetVariableData {
5914 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5915 path.push_key("component");
5916 Validate::validate_at(&self.component, path, out);
5917 path.pop();
5918 path.push_key("variable");
5919 Validate::validate_at(&self.variable, path, out);
5920 path.pop();
5921 path.push_key("attributeType");
5922 if let Some(value) = &self.attribute_type {
5923 Validate::validate_at(value, path, out);
5924 }
5925 path.pop();
5926 path.push_key("customData");
5927 if let Some(value) = &self.custom_data {
5928 Validate::validate_at(value, path, out);
5929 }
5930 path.pop();
5931 }
5932}
5933
5934#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5938pub struct GetVariableResult {
5939 #[serde(rename = "attributeStatus")]
5941 pub attribute_status: GetVariableStatus,
5942 pub component: Component,
5944 pub variable: Variable,
5946 #[serde(rename = "attributeStatusInfo")]
5948 #[serde(default, skip_serializing_if = "Option::is_none")]
5949 pub attribute_status_info: Option<StatusInfo>,
5950 #[serde(rename = "attributeType")]
5952 #[serde(default, skip_serializing_if = "Option::is_none")]
5953 pub attribute_type: Option<Attribute>,
5954 #[serde(rename = "attributeValue")]
5958 #[serde(default, skip_serializing_if = "Option::is_none")]
5959 pub attribute_value: Option<String>,
5960 #[serde(rename = "customData")]
5962 #[serde(default, skip_serializing_if = "Option::is_none")]
5963 pub custom_data: Option<crate::types::CustomData>,
5964}
5965
5966impl GetVariableResult {
5967 #[must_use]
5969 pub fn new(
5970 attribute_status: GetVariableStatus,
5971 component: Component,
5972 variable: Variable,
5973 ) -> Self {
5974 Self {
5975 attribute_status,
5976 component,
5977 variable,
5978 attribute_status_info: None,
5979 attribute_type: None,
5980 attribute_value: None,
5981 custom_data: None,
5982 }
5983 }
5984
5985 #[must_use]
5987 pub fn with_attribute_status_info(mut self, value: StatusInfo) -> Self {
5988 self.attribute_status_info = Some(value);
5989 self
5990 }
5991
5992 #[must_use]
5994 pub fn with_attribute_type(mut self, value: Attribute) -> Self {
5995 self.attribute_type = Some(value);
5996 self
5997 }
5998
5999 #[must_use]
6001 pub fn with_attribute_value(mut self, value: impl Into<String>) -> Self {
6002 self.attribute_value = Some(value.into());
6003 self
6004 }
6005
6006 #[must_use]
6008 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6009 self.custom_data = Some(value);
6010 self
6011 }
6012}
6013
6014impl Validate for GetVariableResult {
6015 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6016 path.push_key("attributeStatus");
6017 Validate::validate_at(&self.attribute_status, path, out);
6018 path.pop();
6019 path.push_key("component");
6020 Validate::validate_at(&self.component, path, out);
6021 path.pop();
6022 path.push_key("variable");
6023 Validate::validate_at(&self.variable, path, out);
6024 path.pop();
6025 path.push_key("attributeStatusInfo");
6026 if let Some(value) = &self.attribute_status_info {
6027 Validate::validate_at(value, path, out);
6028 }
6029 path.pop();
6030 path.push_key("attributeType");
6031 if let Some(value) = &self.attribute_type {
6032 Validate::validate_at(value, path, out);
6033 }
6034 path.pop();
6035 path.push_key("attributeValue");
6036 if let Some(value) = &self.attribute_value {
6037 validate::string(value.as_str(), None, Some(2500), path, out);
6038 }
6039 path.pop();
6040 path.push_key("customData");
6041 if let Some(value) = &self.custom_data {
6042 Validate::validate_at(value, path, out);
6043 }
6044 path.pop();
6045 }
6046}
6047
6048#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6050pub struct Gradient {
6051 #[serde(deserialize_with = "crate::types::integer::one")]
6053 pub priority: i32,
6054 pub gradient: crate::types::Decimal,
6056 #[serde(rename = "softGradient")]
6058 pub soft_gradient: crate::types::Decimal,
6059 #[serde(rename = "customData")]
6061 #[serde(default, skip_serializing_if = "Option::is_none")]
6062 pub custom_data: Option<crate::types::CustomData>,
6063}
6064
6065impl Gradient {
6066 #[must_use]
6068 pub fn new(
6069 priority: i32,
6070 gradient: impl Into<crate::types::Decimal>,
6071 soft_gradient: impl Into<crate::types::Decimal>,
6072 ) -> Self {
6073 Self {
6074 priority,
6075 gradient: gradient.into(),
6076 soft_gradient: soft_gradient.into(),
6077 custom_data: None,
6078 }
6079 }
6080
6081 #[must_use]
6083 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6084 self.custom_data = Some(value);
6085 self
6086 }
6087}
6088
6089impl Validate for Gradient {
6090 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6091 path.push_key("priority");
6092 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
6093 path.pop();
6094 path.push_key("customData");
6095 if let Some(value) = &self.custom_data {
6096 Validate::validate_at(value, path, out);
6097 }
6098 path.pop();
6099 }
6100}
6101
6102#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6104pub struct GradientGet {
6105 pub gradient: Gradient,
6107 pub id: String,
6109 #[serde(rename = "customData")]
6111 #[serde(default, skip_serializing_if = "Option::is_none")]
6112 pub custom_data: Option<crate::types::CustomData>,
6113}
6114
6115impl GradientGet {
6116 #[must_use]
6118 pub fn new(gradient: Gradient, id: impl Into<String>) -> Self {
6119 Self {
6120 gradient,
6121 id: id.into(),
6122 custom_data: None,
6123 }
6124 }
6125
6126 #[must_use]
6128 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6129 self.custom_data = Some(value);
6130 self
6131 }
6132}
6133
6134impl Validate for GradientGet {
6135 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6136 path.push_key("gradient");
6137 Validate::validate_at(&self.gradient, path, out);
6138 path.pop();
6139 path.push_key("id");
6140 validate::string(self.id.as_str(), None, Some(36), path, out);
6141 path.pop();
6142 path.push_key("customData");
6143 if let Some(value) = &self.custom_data {
6144 Validate::validate_at(value, path, out);
6145 }
6146 path.pop();
6147 }
6148}
6149
6150#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
6152pub struct Hysteresis {
6153 #[serde(rename = "hysteresisHigh")]
6155 #[serde(default, skip_serializing_if = "Option::is_none")]
6156 pub hysteresis_high: Option<crate::types::Decimal>,
6157 #[serde(rename = "hysteresisLow")]
6159 #[serde(default, skip_serializing_if = "Option::is_none")]
6160 pub hysteresis_low: Option<crate::types::Decimal>,
6161 #[serde(rename = "hysteresisDelay")]
6163 #[serde(default, skip_serializing_if = "Option::is_none")]
6164 pub hysteresis_delay: Option<crate::types::Decimal>,
6165 #[serde(rename = "hysteresisGradient")]
6167 #[serde(default, skip_serializing_if = "Option::is_none")]
6168 pub hysteresis_gradient: Option<crate::types::Decimal>,
6169 #[serde(rename = "customData")]
6171 #[serde(default, skip_serializing_if = "Option::is_none")]
6172 pub custom_data: Option<crate::types::CustomData>,
6173}
6174
6175impl Hysteresis {
6176 #[must_use]
6178 pub fn new() -> Self {
6179 Self::default()
6180 }
6181
6182 #[must_use]
6184 pub fn with_hysteresis_high(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6185 self.hysteresis_high = Some(value.into());
6186 self
6187 }
6188
6189 #[must_use]
6191 pub fn with_hysteresis_low(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6192 self.hysteresis_low = Some(value.into());
6193 self
6194 }
6195
6196 #[must_use]
6198 pub fn with_hysteresis_delay(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6199 self.hysteresis_delay = Some(value.into());
6200 self
6201 }
6202
6203 #[must_use]
6205 pub fn with_hysteresis_gradient(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6206 self.hysteresis_gradient = Some(value.into());
6207 self
6208 }
6209
6210 #[must_use]
6212 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6213 self.custom_data = Some(value);
6214 self
6215 }
6216}
6217
6218impl Validate for Hysteresis {
6219 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6220 path.push_key("customData");
6221 if let Some(value) = &self.custom_data {
6222 Validate::validate_at(value, path, out);
6223 }
6224 path.pop();
6225 }
6226}
6227
6228#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6232pub struct IdToken {
6233 #[serde(rename = "idToken")]
6235 pub id_token: String,
6236 pub r#type: String,
6238 #[serde(rename = "additionalInfo")]
6240 #[serde(default, skip_serializing_if = "Option::is_none")]
6241 pub additional_info: Option<Vec<AdditionalInfo>>,
6242 #[serde(rename = "customData")]
6244 #[serde(default, skip_serializing_if = "Option::is_none")]
6245 pub custom_data: Option<crate::types::CustomData>,
6246}
6247
6248impl IdToken {
6249 #[must_use]
6251 pub fn new(id_token: impl Into<String>, r#type: impl Into<String>) -> Self {
6252 Self {
6253 id_token: id_token.into(),
6254 r#type: r#type.into(),
6255 additional_info: None,
6256 custom_data: None,
6257 }
6258 }
6259
6260 #[must_use]
6262 pub fn with_additional_info(mut self, value: Vec<AdditionalInfo>) -> Self {
6263 self.additional_info = Some(value);
6264 self
6265 }
6266
6267 #[must_use]
6269 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6270 self.custom_data = Some(value);
6271 self
6272 }
6273}
6274
6275impl Validate for IdToken {
6276 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6277 path.push_key("idToken");
6278 validate::string(self.id_token.as_str(), None, Some(255), path, out);
6279 path.pop();
6280 path.push_key("type");
6281 validate::string(self.r#type.as_str(), None, Some(20), path, out);
6282 path.pop();
6283 path.push_key("additionalInfo");
6284 if let Some(value) = &self.additional_info {
6285 validate::list_len(value.len(), Some(1), None, path, out);
6286 for (index, item) in value.iter().enumerate() {
6287 path.push_index(index);
6288 Validate::validate_at(item, path, out);
6289 path.pop();
6290 }
6291 }
6292 path.pop();
6293 path.push_key("customData");
6294 if let Some(value) = &self.custom_data {
6295 Validate::validate_at(value, path, out);
6296 }
6297 path.pop();
6298 }
6299}
6300
6301#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6306pub struct IdTokenInfo {
6307 pub status: AuthorizationStatus,
6309 #[serde(rename = "cacheExpiryDateTime")]
6311 #[serde(default, skip_serializing_if = "Option::is_none")]
6312 pub cache_expiry_date_time: Option<crate::types::DateTime>,
6313 #[serde(rename = "chargingPriority")]
6315 #[serde(default, skip_serializing_if = "Option::is_none")]
6316 #[serde(deserialize_with = "crate::types::integer::option")]
6317 pub charging_priority: Option<i32>,
6318 #[serde(rename = "groupIdToken")]
6320 #[serde(default, skip_serializing_if = "Option::is_none")]
6321 pub group_id_token: Option<IdToken>,
6322 #[serde(default, skip_serializing_if = "Option::is_none")]
6324 pub language1: Option<String>,
6325 #[serde(default, skip_serializing_if = "Option::is_none")]
6327 pub language2: Option<String>,
6328 #[serde(rename = "evseId")]
6330 #[serde(default, skip_serializing_if = "Option::is_none")]
6331 #[serde(deserialize_with = "crate::types::integer::option_list")]
6332 pub evse_id: Option<Vec<i32>>,
6333 #[serde(rename = "personalMessage")]
6335 #[serde(default, skip_serializing_if = "Option::is_none")]
6336 pub personal_message: Option<MessageContent>,
6337 #[serde(rename = "customData")]
6339 #[serde(default, skip_serializing_if = "Option::is_none")]
6340 pub custom_data: Option<crate::types::CustomData>,
6341}
6342
6343impl IdTokenInfo {
6344 #[must_use]
6346 pub fn new(status: AuthorizationStatus) -> Self {
6347 Self {
6348 status,
6349 cache_expiry_date_time: None,
6350 charging_priority: None,
6351 group_id_token: None,
6352 language1: None,
6353 language2: None,
6354 evse_id: None,
6355 personal_message: None,
6356 custom_data: None,
6357 }
6358 }
6359
6360 #[must_use]
6362 pub fn with_cache_expiry_date_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6363 self.cache_expiry_date_time = Some(value.into());
6364 self
6365 }
6366
6367 #[must_use]
6369 pub fn with_charging_priority(mut self, value: i32) -> Self {
6370 self.charging_priority = Some(value);
6371 self
6372 }
6373
6374 #[must_use]
6376 pub fn with_group_id_token(mut self, value: IdToken) -> Self {
6377 self.group_id_token = Some(value);
6378 self
6379 }
6380
6381 #[must_use]
6383 pub fn with_language1(mut self, value: impl Into<String>) -> Self {
6384 self.language1 = Some(value.into());
6385 self
6386 }
6387
6388 #[must_use]
6390 pub fn with_language2(mut self, value: impl Into<String>) -> Self {
6391 self.language2 = Some(value.into());
6392 self
6393 }
6394
6395 #[must_use]
6397 pub fn with_evse_id(mut self, value: Vec<i32>) -> Self {
6398 self.evse_id = Some(value);
6399 self
6400 }
6401
6402 #[must_use]
6404 pub fn with_personal_message(mut self, value: MessageContent) -> Self {
6405 self.personal_message = Some(value);
6406 self
6407 }
6408
6409 #[must_use]
6411 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6412 self.custom_data = Some(value);
6413 self
6414 }
6415}
6416
6417impl Validate for IdTokenInfo {
6418 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6419 path.push_key("status");
6420 Validate::validate_at(&self.status, path, out);
6421 path.pop();
6422 path.push_key("groupIdToken");
6423 if let Some(value) = &self.group_id_token {
6424 Validate::validate_at(value, path, out);
6425 }
6426 path.pop();
6427 path.push_key("language1");
6428 if let Some(value) = &self.language1 {
6429 validate::string(value.as_str(), None, Some(8), path, out);
6430 }
6431 path.pop();
6432 path.push_key("language2");
6433 if let Some(value) = &self.language2 {
6434 validate::string(value.as_str(), None, Some(8), path, out);
6435 }
6436 path.pop();
6437 path.push_key("evseId");
6438 if let Some(value) = &self.evse_id {
6439 validate::list_len(value.len(), Some(1), None, path, out);
6440 for (index, item) in value.iter().enumerate() {
6441 path.push_index(index);
6442 validate::int_range(i64::from(*item), Some(0), None, path, out);
6443 path.pop();
6444 }
6445 }
6446 path.pop();
6447 path.push_key("personalMessage");
6448 if let Some(value) = &self.personal_message {
6449 Validate::validate_at(value, path, out);
6450 }
6451 path.pop();
6452 path.push_key("customData");
6453 if let Some(value) = &self.custom_data {
6454 Validate::validate_at(value, path, out);
6455 }
6456 path.pop();
6457 }
6458}
6459
6460#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6462pub struct LimitAtSoC {
6463 #[serde(deserialize_with = "crate::types::integer::one")]
6465 pub soc: i32,
6466 pub limit: crate::types::Decimal,
6469 #[serde(rename = "customData")]
6471 #[serde(default, skip_serializing_if = "Option::is_none")]
6472 pub custom_data: Option<crate::types::CustomData>,
6473}
6474
6475impl LimitAtSoC {
6476 #[must_use]
6478 pub fn new(soc: i32, limit: impl Into<crate::types::Decimal>) -> Self {
6479 Self {
6480 soc,
6481 limit: limit.into(),
6482 custom_data: None,
6483 }
6484 }
6485
6486 #[must_use]
6488 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6489 self.custom_data = Some(value);
6490 self
6491 }
6492}
6493
6494impl Validate for LimitAtSoC {
6495 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6496 path.push_key("soc");
6497 validate::int_range(i64::from(self.soc), Some(0), Some(100), path, out);
6498 path.pop();
6499 path.push_key("customData");
6500 if let Some(value) = &self.custom_data {
6501 Validate::validate_at(value, path, out);
6502 }
6503 path.pop();
6504 }
6505}
6506
6507#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6509pub struct LimitMaxDischarge {
6510 #[serde(deserialize_with = "crate::types::integer::one")]
6512 pub priority: i32,
6513 #[serde(rename = "pctMaxDischargePower")]
6517 #[serde(default, skip_serializing_if = "Option::is_none")]
6518 pub pct_max_discharge_power: Option<crate::types::Decimal>,
6519 #[serde(rename = "powerMonitoringMustTrip")]
6521 #[serde(default, skip_serializing_if = "Option::is_none")]
6522 pub power_monitoring_must_trip: Option<DERCurve>,
6523 #[serde(rename = "startTime")]
6525 #[serde(default, skip_serializing_if = "Option::is_none")]
6526 pub start_time: Option<crate::types::DateTime>,
6527 #[serde(default, skip_serializing_if = "Option::is_none")]
6529 pub duration: Option<crate::types::Decimal>,
6530 #[serde(rename = "customData")]
6532 #[serde(default, skip_serializing_if = "Option::is_none")]
6533 pub custom_data: Option<crate::types::CustomData>,
6534}
6535
6536impl LimitMaxDischarge {
6537 #[must_use]
6539 pub fn new(priority: i32) -> Self {
6540 Self {
6541 priority,
6542 pct_max_discharge_power: None,
6543 power_monitoring_must_trip: None,
6544 start_time: None,
6545 duration: None,
6546 custom_data: None,
6547 }
6548 }
6549
6550 #[must_use]
6552 pub fn with_pct_max_discharge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6553 self.pct_max_discharge_power = Some(value.into());
6554 self
6555 }
6556
6557 #[must_use]
6559 pub fn with_power_monitoring_must_trip(mut self, value: DERCurve) -> Self {
6560 self.power_monitoring_must_trip = Some(value);
6561 self
6562 }
6563
6564 #[must_use]
6566 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6567 self.start_time = Some(value.into());
6568 self
6569 }
6570
6571 #[must_use]
6573 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6574 self.duration = Some(value.into());
6575 self
6576 }
6577
6578 #[must_use]
6580 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6581 self.custom_data = Some(value);
6582 self
6583 }
6584}
6585
6586impl Validate for LimitMaxDischarge {
6587 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6588 path.push_key("priority");
6589 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
6590 path.pop();
6591 path.push_key("powerMonitoringMustTrip");
6592 if let Some(value) = &self.power_monitoring_must_trip {
6593 Validate::validate_at(value, path, out);
6594 }
6595 path.pop();
6596 path.push_key("customData");
6597 if let Some(value) = &self.custom_data {
6598 Validate::validate_at(value, path, out);
6599 }
6600 path.pop();
6601 }
6602}
6603
6604#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6606pub struct LimitMaxDischargeGet {
6607 pub id: String,
6609 #[serde(rename = "isDefault")]
6611 pub is_default: bool,
6612 #[serde(rename = "isSuperseded")]
6614 pub is_superseded: bool,
6615 #[serde(rename = "limitMaxDischarge")]
6617 pub limit_max_discharge: LimitMaxDischarge,
6618 #[serde(rename = "customData")]
6620 #[serde(default, skip_serializing_if = "Option::is_none")]
6621 pub custom_data: Option<crate::types::CustomData>,
6622}
6623
6624impl LimitMaxDischargeGet {
6625 #[must_use]
6627 pub fn new(
6628 id: impl Into<String>,
6629 is_default: bool,
6630 is_superseded: bool,
6631 limit_max_discharge: LimitMaxDischarge,
6632 ) -> Self {
6633 Self {
6634 id: id.into(),
6635 is_default,
6636 is_superseded,
6637 limit_max_discharge,
6638 custom_data: None,
6639 }
6640 }
6641
6642 #[must_use]
6644 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6645 self.custom_data = Some(value);
6646 self
6647 }
6648}
6649
6650impl Validate for LimitMaxDischargeGet {
6651 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6652 path.push_key("id");
6653 validate::string(self.id.as_str(), None, Some(36), path, out);
6654 path.pop();
6655 path.push_key("limitMaxDischarge");
6656 Validate::validate_at(&self.limit_max_discharge, path, out);
6657 path.pop();
6658 path.push_key("customData");
6659 if let Some(value) = &self.custom_data {
6660 Validate::validate_at(value, path, out);
6661 }
6662 path.pop();
6663 }
6664}
6665
6666#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6670pub struct LogParameters {
6671 #[serde(rename = "remoteLocation")]
6673 pub remote_location: String,
6674 #[serde(rename = "oldestTimestamp")]
6676 #[serde(default, skip_serializing_if = "Option::is_none")]
6677 pub oldest_timestamp: Option<crate::types::DateTime>,
6678 #[serde(rename = "latestTimestamp")]
6680 #[serde(default, skip_serializing_if = "Option::is_none")]
6681 pub latest_timestamp: Option<crate::types::DateTime>,
6682 #[serde(rename = "customData")]
6684 #[serde(default, skip_serializing_if = "Option::is_none")]
6685 pub custom_data: Option<crate::types::CustomData>,
6686}
6687
6688impl LogParameters {
6689 #[must_use]
6691 pub fn new(remote_location: impl Into<String>) -> Self {
6692 Self {
6693 remote_location: remote_location.into(),
6694 oldest_timestamp: None,
6695 latest_timestamp: None,
6696 custom_data: None,
6697 }
6698 }
6699
6700 #[must_use]
6702 pub fn with_oldest_timestamp(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6703 self.oldest_timestamp = Some(value.into());
6704 self
6705 }
6706
6707 #[must_use]
6709 pub fn with_latest_timestamp(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6710 self.latest_timestamp = Some(value.into());
6711 self
6712 }
6713
6714 #[must_use]
6716 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6717 self.custom_data = Some(value);
6718 self
6719 }
6720}
6721
6722impl Validate for LogParameters {
6723 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6724 path.push_key("remoteLocation");
6725 validate::string(self.remote_location.as_str(), None, Some(2000), path, out);
6726 path.pop();
6727 path.push_key("customData");
6728 if let Some(value) = &self.custom_data {
6729 Validate::validate_at(value, path, out);
6730 }
6731 path.pop();
6732 }
6733}
6734
6735#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6739pub struct MessageContent {
6740 pub format: MessageFormat,
6742 pub content: String,
6746 #[serde(default, skip_serializing_if = "Option::is_none")]
6748 pub language: Option<String>,
6749 #[serde(rename = "customData")]
6751 #[serde(default, skip_serializing_if = "Option::is_none")]
6752 pub custom_data: Option<crate::types::CustomData>,
6753}
6754
6755impl MessageContent {
6756 #[must_use]
6758 pub fn new(format: MessageFormat, content: impl Into<String>) -> Self {
6759 Self {
6760 format,
6761 content: content.into(),
6762 language: None,
6763 custom_data: None,
6764 }
6765 }
6766
6767 #[must_use]
6769 pub fn with_language(mut self, value: impl Into<String>) -> Self {
6770 self.language = Some(value.into());
6771 self
6772 }
6773
6774 #[must_use]
6776 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6777 self.custom_data = Some(value);
6778 self
6779 }
6780}
6781
6782impl Validate for MessageContent {
6783 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6784 path.push_key("format");
6785 Validate::validate_at(&self.format, path, out);
6786 path.pop();
6787 path.push_key("content");
6788 validate::string(self.content.as_str(), None, Some(1024), path, out);
6789 path.pop();
6790 path.push_key("language");
6791 if let Some(value) = &self.language {
6792 validate::string(value.as_str(), None, Some(8), path, out);
6793 }
6794 path.pop();
6795 path.push_key("customData");
6796 if let Some(value) = &self.custom_data {
6797 Validate::validate_at(value, path, out);
6798 }
6799 path.pop();
6800 }
6801}
6802
6803#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6807pub struct MessageInfo {
6808 #[serde(deserialize_with = "crate::types::integer::one")]
6810 pub id: i32,
6811 pub priority: MessagePriority,
6813 pub message: MessageContent,
6815 #[serde(default, skip_serializing_if = "Option::is_none")]
6817 pub display: Option<Component>,
6818 #[serde(default, skip_serializing_if = "Option::is_none")]
6820 pub state: Option<MessageState>,
6821 #[serde(rename = "startDateTime")]
6823 #[serde(default, skip_serializing_if = "Option::is_none")]
6824 pub start_date_time: Option<crate::types::DateTime>,
6825 #[serde(rename = "endDateTime")]
6827 #[serde(default, skip_serializing_if = "Option::is_none")]
6828 pub end_date_time: Option<crate::types::DateTime>,
6829 #[serde(rename = "transactionId")]
6833 #[serde(default, skip_serializing_if = "Option::is_none")]
6834 pub transaction_id: Option<String>,
6835 #[serde(rename = "messageExtra")]
6837 #[serde(default, skip_serializing_if = "Option::is_none")]
6838 pub message_extra: Option<Vec<MessageContent>>,
6839 #[serde(rename = "customData")]
6841 #[serde(default, skip_serializing_if = "Option::is_none")]
6842 pub custom_data: Option<crate::types::CustomData>,
6843}
6844
6845impl MessageInfo {
6846 #[must_use]
6848 pub fn new(id: i32, priority: MessagePriority, message: MessageContent) -> Self {
6849 Self {
6850 id,
6851 priority,
6852 message,
6853 display: None,
6854 state: None,
6855 start_date_time: None,
6856 end_date_time: None,
6857 transaction_id: None,
6858 message_extra: None,
6859 custom_data: None,
6860 }
6861 }
6862
6863 #[must_use]
6865 pub fn with_display(mut self, value: Component) -> Self {
6866 self.display = Some(value);
6867 self
6868 }
6869
6870 #[must_use]
6872 pub fn with_state(mut self, value: MessageState) -> Self {
6873 self.state = Some(value);
6874 self
6875 }
6876
6877 #[must_use]
6879 pub fn with_start_date_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6880 self.start_date_time = Some(value.into());
6881 self
6882 }
6883
6884 #[must_use]
6886 pub fn with_end_date_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6887 self.end_date_time = Some(value.into());
6888 self
6889 }
6890
6891 #[must_use]
6893 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
6894 self.transaction_id = Some(value.into());
6895 self
6896 }
6897
6898 #[must_use]
6900 pub fn with_message_extra(mut self, value: Vec<MessageContent>) -> Self {
6901 self.message_extra = Some(value);
6902 self
6903 }
6904
6905 #[must_use]
6907 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6908 self.custom_data = Some(value);
6909 self
6910 }
6911}
6912
6913impl Validate for MessageInfo {
6914 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6915 path.push_key("id");
6916 validate::int_range(i64::from(self.id), Some(0), None, path, out);
6917 path.pop();
6918 path.push_key("priority");
6919 Validate::validate_at(&self.priority, path, out);
6920 path.pop();
6921 path.push_key("message");
6922 Validate::validate_at(&self.message, path, out);
6923 path.pop();
6924 path.push_key("display");
6925 if let Some(value) = &self.display {
6926 Validate::validate_at(value, path, out);
6927 }
6928 path.pop();
6929 path.push_key("state");
6930 if let Some(value) = &self.state {
6931 Validate::validate_at(value, path, out);
6932 }
6933 path.pop();
6934 path.push_key("transactionId");
6935 if let Some(value) = &self.transaction_id {
6936 validate::string(value.as_str(), None, Some(36), path, out);
6937 }
6938 path.pop();
6939 path.push_key("messageExtra");
6940 if let Some(value) = &self.message_extra {
6941 validate::list_len(value.len(), Some(1), Some(4), path, out);
6942 for (index, item) in value.iter().enumerate() {
6943 path.push_index(index);
6944 Validate::validate_at(item, path, out);
6945 path.pop();
6946 }
6947 }
6948 path.pop();
6949 path.push_key("customData");
6950 if let Some(value) = &self.custom_data {
6951 Validate::validate_at(value, path, out);
6952 }
6953 path.pop();
6954 }
6955}
6956
6957#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6961pub struct MeterValue {
6962 #[serde(rename = "sampledValue")]
6964 pub sampled_value: Vec<SampledValue>,
6965 pub timestamp: crate::types::DateTime,
6967 #[serde(rename = "customData")]
6969 #[serde(default, skip_serializing_if = "Option::is_none")]
6970 pub custom_data: Option<crate::types::CustomData>,
6971}
6972
6973impl MeterValue {
6974 #[must_use]
6976 pub fn new(
6977 sampled_value: Vec<SampledValue>,
6978 timestamp: impl Into<crate::types::DateTime>,
6979 ) -> Self {
6980 Self {
6981 sampled_value,
6982 timestamp: timestamp.into(),
6983 custom_data: None,
6984 }
6985 }
6986
6987 #[must_use]
6989 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6990 self.custom_data = Some(value);
6991 self
6992 }
6993}
6994
6995impl Validate for MeterValue {
6996 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6997 path.push_key("sampledValue");
6998 validate::list_len(self.sampled_value.len(), Some(1), None, path, out);
6999 for (index, item) in self.sampled_value.iter().enumerate() {
7000 path.push_index(index);
7001 Validate::validate_at(item, path, out);
7002 path.pop();
7003 }
7004 path.pop();
7005 path.push_key("customData");
7006 if let Some(value) = &self.custom_data {
7007 Validate::validate_at(value, path, out);
7008 }
7009 path.pop();
7010 }
7011}
7012
7013#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7017pub struct Modem {
7018 #[serde(default, skip_serializing_if = "Option::is_none")]
7020 pub iccid: Option<String>,
7021 #[serde(default, skip_serializing_if = "Option::is_none")]
7023 pub imsi: Option<String>,
7024 #[serde(rename = "customData")]
7026 #[serde(default, skip_serializing_if = "Option::is_none")]
7027 pub custom_data: Option<crate::types::CustomData>,
7028}
7029
7030impl Modem {
7031 #[must_use]
7033 pub fn new() -> Self {
7034 Self::default()
7035 }
7036
7037 #[must_use]
7039 pub fn with_iccid(mut self, value: impl Into<String>) -> Self {
7040 self.iccid = Some(value.into());
7041 self
7042 }
7043
7044 #[must_use]
7046 pub fn with_imsi(mut self, value: impl Into<String>) -> Self {
7047 self.imsi = Some(value.into());
7048 self
7049 }
7050
7051 #[must_use]
7053 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7054 self.custom_data = Some(value);
7055 self
7056 }
7057}
7058
7059impl Validate for Modem {
7060 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7061 path.push_key("iccid");
7062 if let Some(value) = &self.iccid {
7063 validate::string(value.as_str(), None, Some(20), path, out);
7064 }
7065 path.pop();
7066 path.push_key("imsi");
7067 if let Some(value) = &self.imsi {
7068 validate::string(value.as_str(), None, Some(20), path, out);
7069 }
7070 path.pop();
7071 path.push_key("customData");
7072 if let Some(value) = &self.custom_data {
7073 Validate::validate_at(value, path, out);
7074 }
7075 path.pop();
7076 }
7077}
7078
7079#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7083pub struct MonitoringData {
7084 pub component: Component,
7086 pub variable: Variable,
7088 #[serde(rename = "variableMonitoring")]
7090 pub variable_monitoring: Vec<VariableMonitoring>,
7091 #[serde(rename = "customData")]
7093 #[serde(default, skip_serializing_if = "Option::is_none")]
7094 pub custom_data: Option<crate::types::CustomData>,
7095}
7096
7097impl MonitoringData {
7098 #[must_use]
7100 pub fn new(
7101 component: Component,
7102 variable: Variable,
7103 variable_monitoring: Vec<VariableMonitoring>,
7104 ) -> Self {
7105 Self {
7106 component,
7107 variable,
7108 variable_monitoring,
7109 custom_data: None,
7110 }
7111 }
7112
7113 #[must_use]
7115 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7116 self.custom_data = Some(value);
7117 self
7118 }
7119}
7120
7121impl Validate for MonitoringData {
7122 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7123 path.push_key("component");
7124 Validate::validate_at(&self.component, path, out);
7125 path.pop();
7126 path.push_key("variable");
7127 Validate::validate_at(&self.variable, path, out);
7128 path.pop();
7129 path.push_key("variableMonitoring");
7130 validate::list_len(self.variable_monitoring.len(), Some(1), None, path, out);
7131 for (index, item) in self.variable_monitoring.iter().enumerate() {
7132 path.push_index(index);
7133 Validate::validate_at(item, path, out);
7134 path.pop();
7135 }
7136 path.pop();
7137 path.push_key("customData");
7138 if let Some(value) = &self.custom_data {
7139 Validate::validate_at(value, path, out);
7140 }
7141 path.pop();
7142 }
7143}
7144
7145#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7149pub struct NetworkConnectionProfile {
7150 #[serde(rename = "ocppInterface")]
7152 pub ocpp_interface: OCPPInterface,
7153 #[serde(rename = "ocppTransport")]
7155 pub ocpp_transport: OCPPTransport,
7156 #[serde(rename = "messageTimeout")]
7160 #[serde(deserialize_with = "crate::types::integer::one")]
7161 pub message_timeout: i32,
7162 #[serde(rename = "ocppCsmsUrl")]
7165 pub ocpp_csms_url: String,
7166 #[serde(rename = "securityProfile")]
7168 #[serde(deserialize_with = "crate::types::integer::one")]
7169 pub security_profile: i32,
7170 #[serde(default, skip_serializing_if = "Option::is_none")]
7172 pub apn: Option<APN>,
7173 #[serde(rename = "ocppVersion")]
7175 #[serde(default, skip_serializing_if = "Option::is_none")]
7176 pub ocpp_version: Option<OCPPVersion>,
7177 #[serde(default, skip_serializing_if = "Option::is_none")]
7179 pub identity: Option<String>,
7180 #[serde(rename = "basicAuthPassword")]
7182 #[serde(default, skip_serializing_if = "Option::is_none")]
7183 pub basic_auth_password: Option<String>,
7184 #[serde(default, skip_serializing_if = "Option::is_none")]
7186 pub vpn: Option<VPN>,
7187 #[serde(rename = "customData")]
7189 #[serde(default, skip_serializing_if = "Option::is_none")]
7190 pub custom_data: Option<crate::types::CustomData>,
7191}
7192
7193impl NetworkConnectionProfile {
7194 #[must_use]
7196 pub fn new(
7197 ocpp_interface: OCPPInterface,
7198 ocpp_transport: OCPPTransport,
7199 message_timeout: i32,
7200 ocpp_csms_url: impl Into<String>,
7201 security_profile: i32,
7202 ) -> Self {
7203 Self {
7204 ocpp_interface,
7205 ocpp_transport,
7206 message_timeout,
7207 ocpp_csms_url: ocpp_csms_url.into(),
7208 security_profile,
7209 apn: None,
7210 ocpp_version: None,
7211 identity: None,
7212 basic_auth_password: None,
7213 vpn: None,
7214 custom_data: None,
7215 }
7216 }
7217
7218 #[must_use]
7220 pub fn with_apn(mut self, value: APN) -> Self {
7221 self.apn = Some(value);
7222 self
7223 }
7224
7225 #[must_use]
7227 pub fn with_ocpp_version(mut self, value: OCPPVersion) -> Self {
7228 self.ocpp_version = Some(value);
7229 self
7230 }
7231
7232 #[must_use]
7234 pub fn with_identity(mut self, value: impl Into<String>) -> Self {
7235 self.identity = Some(value.into());
7236 self
7237 }
7238
7239 #[must_use]
7241 pub fn with_basic_auth_password(mut self, value: impl Into<String>) -> Self {
7242 self.basic_auth_password = Some(value.into());
7243 self
7244 }
7245
7246 #[must_use]
7248 pub fn with_vpn(mut self, value: VPN) -> Self {
7249 self.vpn = Some(value);
7250 self
7251 }
7252
7253 #[must_use]
7255 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7256 self.custom_data = Some(value);
7257 self
7258 }
7259}
7260
7261impl Validate for NetworkConnectionProfile {
7262 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7263 path.push_key("ocppInterface");
7264 Validate::validate_at(&self.ocpp_interface, path, out);
7265 path.pop();
7266 path.push_key("ocppTransport");
7267 Validate::validate_at(&self.ocpp_transport, path, out);
7268 path.pop();
7269 path.push_key("ocppCsmsUrl");
7270 validate::string(self.ocpp_csms_url.as_str(), None, Some(2000), path, out);
7271 path.pop();
7272 path.push_key("securityProfile");
7273 validate::int_range(i64::from(self.security_profile), Some(0), None, path, out);
7274 path.pop();
7275 path.push_key("apn");
7276 if let Some(value) = &self.apn {
7277 Validate::validate_at(value, path, out);
7278 }
7279 path.pop();
7280 path.push_key("ocppVersion");
7281 if let Some(value) = &self.ocpp_version {
7282 Validate::validate_at(value, path, out);
7283 }
7284 path.pop();
7285 path.push_key("identity");
7286 if let Some(value) = &self.identity {
7287 validate::string(value.as_str(), None, Some(48), path, out);
7288 }
7289 path.pop();
7290 path.push_key("basicAuthPassword");
7291 if let Some(value) = &self.basic_auth_password {
7292 validate::string(value.as_str(), None, Some(64), path, out);
7293 }
7294 path.pop();
7295 path.push_key("vpn");
7296 if let Some(value) = &self.vpn {
7297 Validate::validate_at(value, path, out);
7298 }
7299 path.pop();
7300 path.push_key("customData");
7301 if let Some(value) = &self.custom_data {
7302 Validate::validate_at(value, path, out);
7303 }
7304 path.pop();
7305 }
7306}
7307
7308#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7312pub struct OCSPRequestData {
7313 #[serde(rename = "hashAlgorithm")]
7315 pub hash_algorithm: HashAlgorithm,
7316 #[serde(rename = "issuerNameHash")]
7321 pub issuer_name_hash: String,
7322 #[serde(rename = "issuerKeyHash")]
7326 pub issuer_key_hash: String,
7327 #[serde(rename = "serialNumber")]
7331 pub serial_number: String,
7332 #[serde(rename = "responderURL")]
7334 pub responder_url: String,
7335 #[serde(rename = "customData")]
7337 #[serde(default, skip_serializing_if = "Option::is_none")]
7338 pub custom_data: Option<crate::types::CustomData>,
7339}
7340
7341impl OCSPRequestData {
7342 #[must_use]
7344 pub fn new(
7345 hash_algorithm: HashAlgorithm,
7346 issuer_name_hash: impl Into<String>,
7347 issuer_key_hash: impl Into<String>,
7348 serial_number: impl Into<String>,
7349 responder_url: impl Into<String>,
7350 ) -> Self {
7351 Self {
7352 hash_algorithm,
7353 issuer_name_hash: issuer_name_hash.into(),
7354 issuer_key_hash: issuer_key_hash.into(),
7355 serial_number: serial_number.into(),
7356 responder_url: responder_url.into(),
7357 custom_data: None,
7358 }
7359 }
7360
7361 #[must_use]
7363 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7364 self.custom_data = Some(value);
7365 self
7366 }
7367}
7368
7369impl Validate for OCSPRequestData {
7370 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7371 path.push_key("hashAlgorithm");
7372 Validate::validate_at(&self.hash_algorithm, path, out);
7373 path.pop();
7374 path.push_key("issuerNameHash");
7375 validate::string(self.issuer_name_hash.as_str(), None, Some(128), path, out);
7376 path.pop();
7377 path.push_key("issuerKeyHash");
7378 validate::string(self.issuer_key_hash.as_str(), None, Some(128), path, out);
7379 path.pop();
7380 path.push_key("serialNumber");
7381 validate::string(self.serial_number.as_str(), None, Some(40), path, out);
7382 path.pop();
7383 path.push_key("responderURL");
7384 validate::string(self.responder_url.as_str(), None, Some(2000), path, out);
7385 path.pop();
7386 path.push_key("customData");
7387 if let Some(value) = &self.custom_data {
7388 Validate::validate_at(value, path, out);
7389 }
7390 path.pop();
7391 }
7392}
7393
7394#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7398pub struct OverstayRule {
7399 #[serde(rename = "overstayFee")]
7401 pub overstay_fee: RationalNumber,
7402 #[serde(rename = "startTime")]
7404 #[serde(deserialize_with = "crate::types::integer::one")]
7405 pub start_time: i32,
7406 #[serde(rename = "overstayFeePeriod")]
7408 #[serde(deserialize_with = "crate::types::integer::one")]
7409 pub overstay_fee_period: i32,
7410 #[serde(rename = "overstayRuleDescription")]
7412 #[serde(default, skip_serializing_if = "Option::is_none")]
7413 pub overstay_rule_description: Option<String>,
7414 #[serde(rename = "customData")]
7416 #[serde(default, skip_serializing_if = "Option::is_none")]
7417 pub custom_data: Option<crate::types::CustomData>,
7418}
7419
7420impl OverstayRule {
7421 #[must_use]
7423 pub fn new(overstay_fee: RationalNumber, start_time: i32, overstay_fee_period: i32) -> Self {
7424 Self {
7425 overstay_fee,
7426 start_time,
7427 overstay_fee_period,
7428 overstay_rule_description: None,
7429 custom_data: None,
7430 }
7431 }
7432
7433 #[must_use]
7435 pub fn with_overstay_rule_description(mut self, value: impl Into<String>) -> Self {
7436 self.overstay_rule_description = Some(value.into());
7437 self
7438 }
7439
7440 #[must_use]
7442 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7443 self.custom_data = Some(value);
7444 self
7445 }
7446}
7447
7448impl Validate for OverstayRule {
7449 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7450 path.push_key("overstayFee");
7451 Validate::validate_at(&self.overstay_fee, path, out);
7452 path.pop();
7453 path.push_key("overstayRuleDescription");
7454 if let Some(value) = &self.overstay_rule_description {
7455 validate::string(value.as_str(), None, Some(32), path, out);
7456 }
7457 path.pop();
7458 path.push_key("customData");
7459 if let Some(value) = &self.custom_data {
7460 Validate::validate_at(value, path, out);
7461 }
7462 path.pop();
7463 }
7464}
7465
7466#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7470pub struct OverstayRuleList {
7471 #[serde(rename = "overstayRule")]
7473 pub overstay_rule: Vec<OverstayRule>,
7474 #[serde(rename = "overstayPowerThreshold")]
7476 #[serde(default, skip_serializing_if = "Option::is_none")]
7477 pub overstay_power_threshold: Option<RationalNumber>,
7478 #[serde(rename = "overstayTimeThreshold")]
7480 #[serde(default, skip_serializing_if = "Option::is_none")]
7481 #[serde(deserialize_with = "crate::types::integer::option")]
7482 pub overstay_time_threshold: Option<i32>,
7483 #[serde(rename = "customData")]
7485 #[serde(default, skip_serializing_if = "Option::is_none")]
7486 pub custom_data: Option<crate::types::CustomData>,
7487}
7488
7489impl OverstayRuleList {
7490 #[must_use]
7492 pub fn new(overstay_rule: Vec<OverstayRule>) -> Self {
7493 Self {
7494 overstay_rule,
7495 overstay_power_threshold: None,
7496 overstay_time_threshold: None,
7497 custom_data: None,
7498 }
7499 }
7500
7501 #[must_use]
7503 pub fn with_overstay_power_threshold(mut self, value: RationalNumber) -> Self {
7504 self.overstay_power_threshold = Some(value);
7505 self
7506 }
7507
7508 #[must_use]
7510 pub fn with_overstay_time_threshold(mut self, value: i32) -> Self {
7511 self.overstay_time_threshold = Some(value);
7512 self
7513 }
7514
7515 #[must_use]
7517 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7518 self.custom_data = Some(value);
7519 self
7520 }
7521}
7522
7523impl Validate for OverstayRuleList {
7524 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7525 path.push_key("overstayRule");
7526 validate::list_len(self.overstay_rule.len(), Some(1), Some(5), path, out);
7527 for (index, item) in self.overstay_rule.iter().enumerate() {
7528 path.push_index(index);
7529 Validate::validate_at(item, path, out);
7530 path.pop();
7531 }
7532 path.pop();
7533 path.push_key("overstayPowerThreshold");
7534 if let Some(value) = &self.overstay_power_threshold {
7535 Validate::validate_at(value, path, out);
7536 }
7537 path.pop();
7538 path.push_key("customData");
7539 if let Some(value) = &self.custom_data {
7540 Validate::validate_at(value, path, out);
7541 }
7542 path.pop();
7543 }
7544}
7545
7546#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7548pub struct PeriodicEventStreamParams {
7549 #[serde(default, skip_serializing_if = "Option::is_none")]
7551 #[serde(deserialize_with = "crate::types::integer::option")]
7552 pub interval: Option<i32>,
7553 #[serde(default, skip_serializing_if = "Option::is_none")]
7555 #[serde(deserialize_with = "crate::types::integer::option")]
7556 pub values: Option<i32>,
7557 #[serde(rename = "customData")]
7559 #[serde(default, skip_serializing_if = "Option::is_none")]
7560 pub custom_data: Option<crate::types::CustomData>,
7561}
7562
7563impl PeriodicEventStreamParams {
7564 #[must_use]
7566 pub fn new() -> Self {
7567 Self::default()
7568 }
7569
7570 #[must_use]
7572 pub fn with_interval(mut self, value: i32) -> Self {
7573 self.interval = Some(value);
7574 self
7575 }
7576
7577 #[must_use]
7579 pub fn with_values(mut self, value: i32) -> Self {
7580 self.values = Some(value);
7581 self
7582 }
7583
7584 #[must_use]
7586 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7587 self.custom_data = Some(value);
7588 self
7589 }
7590}
7591
7592impl Validate for PeriodicEventStreamParams {
7593 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7594 path.push_key("interval");
7595 if let Some(value) = &self.interval {
7596 validate::int_range(i64::from(*value), Some(0), None, path, out);
7597 }
7598 path.pop();
7599 path.push_key("values");
7600 if let Some(value) = &self.values {
7601 validate::int_range(i64::from(*value), Some(0), None, path, out);
7602 }
7603 path.pop();
7604 path.push_key("customData");
7605 if let Some(value) = &self.custom_data {
7606 Validate::validate_at(value, path, out);
7607 }
7608 path.pop();
7609 }
7610}
7611
7612#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7616pub struct Price {
7617 #[serde(rename = "exclTax")]
7619 #[serde(default, skip_serializing_if = "Option::is_none")]
7620 pub excl_tax: Option<crate::types::Decimal>,
7621 #[serde(rename = "inclTax")]
7623 #[serde(default, skip_serializing_if = "Option::is_none")]
7624 pub incl_tax: Option<crate::types::Decimal>,
7625 #[serde(rename = "taxRates")]
7627 #[serde(default, skip_serializing_if = "Option::is_none")]
7628 pub tax_rates: Option<Vec<TaxRate>>,
7629 #[serde(rename = "customData")]
7631 #[serde(default, skip_serializing_if = "Option::is_none")]
7632 pub custom_data: Option<crate::types::CustomData>,
7633}
7634
7635impl Price {
7636 #[must_use]
7638 pub fn new() -> Self {
7639 Self::default()
7640 }
7641
7642 #[must_use]
7644 pub fn with_excl_tax(mut self, value: impl Into<crate::types::Decimal>) -> Self {
7645 self.excl_tax = Some(value.into());
7646 self
7647 }
7648
7649 #[must_use]
7651 pub fn with_incl_tax(mut self, value: impl Into<crate::types::Decimal>) -> Self {
7652 self.incl_tax = Some(value.into());
7653 self
7654 }
7655
7656 #[must_use]
7658 pub fn with_tax_rates(mut self, value: Vec<TaxRate>) -> Self {
7659 self.tax_rates = Some(value);
7660 self
7661 }
7662
7663 #[must_use]
7665 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7666 self.custom_data = Some(value);
7667 self
7668 }
7669}
7670
7671impl Validate for Price {
7672 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7673 path.push_key("taxRates");
7674 if let Some(value) = &self.tax_rates {
7675 validate::list_len(value.len(), Some(1), Some(5), path, out);
7676 for (index, item) in value.iter().enumerate() {
7677 path.push_index(index);
7678 Validate::validate_at(item, path, out);
7679 path.pop();
7680 }
7681 }
7682 path.pop();
7683 path.push_key("customData");
7684 if let Some(value) = &self.custom_data {
7685 Validate::validate_at(value, path, out);
7686 }
7687 path.pop();
7688 }
7689}
7690
7691#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7695pub struct PriceLevelSchedule {
7696 #[serde(rename = "priceLevelScheduleEntries")]
7698 pub price_level_schedule_entries: Vec<PriceLevelScheduleEntry>,
7699 #[serde(rename = "timeAnchor")]
7701 pub time_anchor: crate::types::DateTime,
7702 #[serde(rename = "priceScheduleId")]
7704 #[serde(deserialize_with = "crate::types::integer::one")]
7705 pub price_schedule_id: i32,
7706 #[serde(rename = "numberOfPriceLevels")]
7708 #[serde(deserialize_with = "crate::types::integer::one")]
7709 pub number_of_price_levels: i32,
7710 #[serde(rename = "priceScheduleDescription")]
7712 #[serde(default, skip_serializing_if = "Option::is_none")]
7713 pub price_schedule_description: Option<String>,
7714 #[serde(rename = "customData")]
7716 #[serde(default, skip_serializing_if = "Option::is_none")]
7717 pub custom_data: Option<crate::types::CustomData>,
7718}
7719
7720impl PriceLevelSchedule {
7721 #[must_use]
7723 pub fn new(
7724 price_level_schedule_entries: Vec<PriceLevelScheduleEntry>,
7725 time_anchor: impl Into<crate::types::DateTime>,
7726 price_schedule_id: i32,
7727 number_of_price_levels: i32,
7728 ) -> Self {
7729 Self {
7730 price_level_schedule_entries,
7731 time_anchor: time_anchor.into(),
7732 price_schedule_id,
7733 number_of_price_levels,
7734 price_schedule_description: None,
7735 custom_data: None,
7736 }
7737 }
7738
7739 #[must_use]
7741 pub fn with_price_schedule_description(mut self, value: impl Into<String>) -> Self {
7742 self.price_schedule_description = Some(value.into());
7743 self
7744 }
7745
7746 #[must_use]
7748 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7749 self.custom_data = Some(value);
7750 self
7751 }
7752}
7753
7754impl Validate for PriceLevelSchedule {
7755 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7756 path.push_key("priceLevelScheduleEntries");
7757 validate::list_len(
7758 self.price_level_schedule_entries.len(),
7759 Some(1),
7760 Some(100),
7761 path,
7762 out,
7763 );
7764 for (index, item) in self.price_level_schedule_entries.iter().enumerate() {
7765 path.push_index(index);
7766 Validate::validate_at(item, path, out);
7767 path.pop();
7768 }
7769 path.pop();
7770 path.push_key("priceScheduleId");
7771 validate::int_range(i64::from(self.price_schedule_id), Some(0), None, path, out);
7772 path.pop();
7773 path.push_key("numberOfPriceLevels");
7774 validate::int_range(
7775 i64::from(self.number_of_price_levels),
7776 Some(0),
7777 None,
7778 path,
7779 out,
7780 );
7781 path.pop();
7782 path.push_key("priceScheduleDescription");
7783 if let Some(value) = &self.price_schedule_description {
7784 validate::string(value.as_str(), None, Some(32), path, out);
7785 }
7786 path.pop();
7787 path.push_key("customData");
7788 if let Some(value) = &self.custom_data {
7789 Validate::validate_at(value, path, out);
7790 }
7791 path.pop();
7792 }
7793}
7794
7795#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7799pub struct PriceLevelScheduleEntry {
7800 #[serde(deserialize_with = "crate::types::integer::one")]
7802 pub duration: i32,
7803 #[serde(rename = "priceLevel")]
7805 #[serde(deserialize_with = "crate::types::integer::one")]
7806 pub price_level: i32,
7807 #[serde(rename = "customData")]
7809 #[serde(default, skip_serializing_if = "Option::is_none")]
7810 pub custom_data: Option<crate::types::CustomData>,
7811}
7812
7813impl PriceLevelScheduleEntry {
7814 #[must_use]
7816 pub fn new(duration: i32, price_level: i32) -> Self {
7817 Self {
7818 duration,
7819 price_level,
7820 custom_data: None,
7821 }
7822 }
7823
7824 #[must_use]
7826 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7827 self.custom_data = Some(value);
7828 self
7829 }
7830}
7831
7832impl Validate for PriceLevelScheduleEntry {
7833 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7834 path.push_key("priceLevel");
7835 validate::int_range(i64::from(self.price_level), Some(0), None, path, out);
7836 path.pop();
7837 path.push_key("customData");
7838 if let Some(value) = &self.custom_data {
7839 Validate::validate_at(value, path, out);
7840 }
7841 path.pop();
7842 }
7843}
7844
7845#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7849pub struct PriceRule {
7850 #[serde(rename = "energyFee")]
7852 pub energy_fee: RationalNumber,
7853 #[serde(rename = "powerRangeStart")]
7855 pub power_range_start: RationalNumber,
7856 #[serde(rename = "parkingFeePeriod")]
7859 #[serde(default, skip_serializing_if = "Option::is_none")]
7860 #[serde(deserialize_with = "crate::types::integer::option")]
7861 pub parking_fee_period: Option<i32>,
7862 #[serde(rename = "carbonDioxideEmission")]
7864 #[serde(default, skip_serializing_if = "Option::is_none")]
7865 #[serde(deserialize_with = "crate::types::integer::option")]
7866 pub carbon_dioxide_emission: Option<i32>,
7867 #[serde(rename = "renewableGenerationPercentage")]
7869 #[serde(default, skip_serializing_if = "Option::is_none")]
7870 #[serde(deserialize_with = "crate::types::integer::option")]
7871 pub renewable_generation_percentage: Option<i32>,
7872 #[serde(rename = "parkingFee")]
7874 #[serde(default, skip_serializing_if = "Option::is_none")]
7875 pub parking_fee: Option<RationalNumber>,
7876 #[serde(rename = "customData")]
7878 #[serde(default, skip_serializing_if = "Option::is_none")]
7879 pub custom_data: Option<crate::types::CustomData>,
7880}
7881
7882impl PriceRule {
7883 #[must_use]
7885 pub fn new(energy_fee: RationalNumber, power_range_start: RationalNumber) -> Self {
7886 Self {
7887 energy_fee,
7888 power_range_start,
7889 parking_fee_period: None,
7890 carbon_dioxide_emission: None,
7891 renewable_generation_percentage: None,
7892 parking_fee: None,
7893 custom_data: None,
7894 }
7895 }
7896
7897 #[must_use]
7899 pub fn with_parking_fee_period(mut self, value: i32) -> Self {
7900 self.parking_fee_period = Some(value);
7901 self
7902 }
7903
7904 #[must_use]
7906 pub fn with_carbon_dioxide_emission(mut self, value: i32) -> Self {
7907 self.carbon_dioxide_emission = Some(value);
7908 self
7909 }
7910
7911 #[must_use]
7913 pub fn with_renewable_generation_percentage(mut self, value: i32) -> Self {
7914 self.renewable_generation_percentage = Some(value);
7915 self
7916 }
7917
7918 #[must_use]
7920 pub fn with_parking_fee(mut self, value: RationalNumber) -> Self {
7921 self.parking_fee = Some(value);
7922 self
7923 }
7924
7925 #[must_use]
7927 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7928 self.custom_data = Some(value);
7929 self
7930 }
7931}
7932
7933impl Validate for PriceRule {
7934 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7935 path.push_key("energyFee");
7936 Validate::validate_at(&self.energy_fee, path, out);
7937 path.pop();
7938 path.push_key("powerRangeStart");
7939 Validate::validate_at(&self.power_range_start, path, out);
7940 path.pop();
7941 path.push_key("carbonDioxideEmission");
7942 if let Some(value) = &self.carbon_dioxide_emission {
7943 validate::int_range(i64::from(*value), Some(0), None, path, out);
7944 }
7945 path.pop();
7946 path.push_key("renewableGenerationPercentage");
7947 if let Some(value) = &self.renewable_generation_percentage {
7948 validate::int_range(i64::from(*value), Some(0), Some(100), path, out);
7949 }
7950 path.pop();
7951 path.push_key("parkingFee");
7952 if let Some(value) = &self.parking_fee {
7953 Validate::validate_at(value, path, out);
7954 }
7955 path.pop();
7956 path.push_key("customData");
7957 if let Some(value) = &self.custom_data {
7958 Validate::validate_at(value, path, out);
7959 }
7960 path.pop();
7961 }
7962}
7963
7964#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7968pub struct PriceRuleStack {
7969 #[serde(deserialize_with = "crate::types::integer::one")]
7971 pub duration: i32,
7972 #[serde(rename = "priceRule")]
7974 pub price_rule: Vec<PriceRule>,
7975 #[serde(rename = "customData")]
7977 #[serde(default, skip_serializing_if = "Option::is_none")]
7978 pub custom_data: Option<crate::types::CustomData>,
7979}
7980
7981impl PriceRuleStack {
7982 #[must_use]
7984 pub fn new(duration: i32, price_rule: Vec<PriceRule>) -> Self {
7985 Self {
7986 duration,
7987 price_rule,
7988 custom_data: None,
7989 }
7990 }
7991
7992 #[must_use]
7994 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7995 self.custom_data = Some(value);
7996 self
7997 }
7998}
7999
8000impl Validate for PriceRuleStack {
8001 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8002 path.push_key("priceRule");
8003 validate::list_len(self.price_rule.len(), Some(1), Some(8), path, out);
8004 for (index, item) in self.price_rule.iter().enumerate() {
8005 path.push_index(index);
8006 Validate::validate_at(item, path, out);
8007 path.pop();
8008 }
8009 path.pop();
8010 path.push_key("customData");
8011 if let Some(value) = &self.custom_data {
8012 Validate::validate_at(value, path, out);
8013 }
8014 path.pop();
8015 }
8016}
8017
8018#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8022pub struct RationalNumber {
8023 #[serde(deserialize_with = "crate::types::integer::one")]
8025 pub exponent: i32,
8026 #[serde(deserialize_with = "crate::types::integer::one")]
8028 pub value: i32,
8029 #[serde(rename = "customData")]
8031 #[serde(default, skip_serializing_if = "Option::is_none")]
8032 pub custom_data: Option<crate::types::CustomData>,
8033}
8034
8035impl RationalNumber {
8036 #[must_use]
8038 pub fn new(exponent: i32, value: i32) -> Self {
8039 Self {
8040 exponent,
8041 value,
8042 custom_data: None,
8043 }
8044 }
8045
8046 #[must_use]
8048 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8049 self.custom_data = Some(value);
8050 self
8051 }
8052}
8053
8054impl Validate for RationalNumber {
8055 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8056 path.push_key("customData");
8057 if let Some(value) = &self.custom_data {
8058 Validate::validate_at(value, path, out);
8059 }
8060 path.pop();
8061 }
8062}
8063
8064#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
8066pub struct ReactivePowerParams {
8067 #[serde(rename = "vRef")]
8069 #[serde(default, skip_serializing_if = "Option::is_none")]
8070 pub v_ref: Option<crate::types::Decimal>,
8071 #[serde(rename = "autonomousVRefEnable")]
8073 #[serde(default, skip_serializing_if = "Option::is_none")]
8074 pub autonomous_v_ref_enable: Option<bool>,
8075 #[serde(rename = "autonomousVRefTimeConstant")]
8077 #[serde(default, skip_serializing_if = "Option::is_none")]
8078 pub autonomous_v_ref_time_constant: Option<crate::types::Decimal>,
8079 #[serde(rename = "customData")]
8081 #[serde(default, skip_serializing_if = "Option::is_none")]
8082 pub custom_data: Option<crate::types::CustomData>,
8083}
8084
8085impl ReactivePowerParams {
8086 #[must_use]
8088 pub fn new() -> Self {
8089 Self::default()
8090 }
8091
8092 #[must_use]
8094 pub fn with_v_ref(mut self, value: impl Into<crate::types::Decimal>) -> Self {
8095 self.v_ref = Some(value.into());
8096 self
8097 }
8098
8099 #[must_use]
8101 pub fn with_autonomous_v_ref_enable(mut self, value: bool) -> Self {
8102 self.autonomous_v_ref_enable = Some(value);
8103 self
8104 }
8105
8106 #[must_use]
8108 pub fn with_autonomous_v_ref_time_constant(
8109 mut self,
8110 value: impl Into<crate::types::Decimal>,
8111 ) -> Self {
8112 self.autonomous_v_ref_time_constant = Some(value.into());
8113 self
8114 }
8115
8116 #[must_use]
8118 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8119 self.custom_data = Some(value);
8120 self
8121 }
8122}
8123
8124impl Validate for ReactivePowerParams {
8125 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8126 path.push_key("customData");
8127 if let Some(value) = &self.custom_data {
8128 Validate::validate_at(value, path, out);
8129 }
8130 path.pop();
8131 }
8132}
8133
8134#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8136pub struct RelativeTimeInterval {
8137 #[serde(deserialize_with = "crate::types::integer::one")]
8139 pub start: i32,
8140 #[serde(default, skip_serializing_if = "Option::is_none")]
8142 #[serde(deserialize_with = "crate::types::integer::option")]
8143 pub duration: Option<i32>,
8144 #[serde(rename = "customData")]
8146 #[serde(default, skip_serializing_if = "Option::is_none")]
8147 pub custom_data: Option<crate::types::CustomData>,
8148}
8149
8150impl RelativeTimeInterval {
8151 #[must_use]
8153 pub fn new(start: i32) -> Self {
8154 Self {
8155 start,
8156 duration: None,
8157 custom_data: None,
8158 }
8159 }
8160
8161 #[must_use]
8163 pub fn with_duration(mut self, value: i32) -> Self {
8164 self.duration = Some(value);
8165 self
8166 }
8167
8168 #[must_use]
8170 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8171 self.custom_data = Some(value);
8172 self
8173 }
8174}
8175
8176impl Validate for RelativeTimeInterval {
8177 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8178 path.push_key("customData");
8179 if let Some(value) = &self.custom_data {
8180 Validate::validate_at(value, path, out);
8181 }
8182 path.pop();
8183 }
8184}
8185
8186#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8190pub struct ReportData {
8191 pub component: Component,
8193 pub variable: Variable,
8195 #[serde(rename = "variableAttribute")]
8197 pub variable_attribute: Vec<VariableAttribute>,
8198 #[serde(rename = "variableCharacteristics")]
8200 #[serde(default, skip_serializing_if = "Option::is_none")]
8201 pub variable_characteristics: Option<VariableCharacteristics>,
8202 #[serde(rename = "customData")]
8204 #[serde(default, skip_serializing_if = "Option::is_none")]
8205 pub custom_data: Option<crate::types::CustomData>,
8206}
8207
8208impl ReportData {
8209 #[must_use]
8211 pub fn new(
8212 component: Component,
8213 variable: Variable,
8214 variable_attribute: Vec<VariableAttribute>,
8215 ) -> Self {
8216 Self {
8217 component,
8218 variable,
8219 variable_attribute,
8220 variable_characteristics: None,
8221 custom_data: None,
8222 }
8223 }
8224
8225 #[must_use]
8227 pub fn with_variable_characteristics(mut self, value: VariableCharacteristics) -> Self {
8228 self.variable_characteristics = Some(value);
8229 self
8230 }
8231
8232 #[must_use]
8234 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8235 self.custom_data = Some(value);
8236 self
8237 }
8238}
8239
8240impl Validate for ReportData {
8241 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8242 path.push_key("component");
8243 Validate::validate_at(&self.component, path, out);
8244 path.pop();
8245 path.push_key("variable");
8246 Validate::validate_at(&self.variable, path, out);
8247 path.pop();
8248 path.push_key("variableAttribute");
8249 validate::list_len(self.variable_attribute.len(), Some(1), Some(4), path, out);
8250 for (index, item) in self.variable_attribute.iter().enumerate() {
8251 path.push_index(index);
8252 Validate::validate_at(item, path, out);
8253 path.pop();
8254 }
8255 path.pop();
8256 path.push_key("variableCharacteristics");
8257 if let Some(value) = &self.variable_characteristics {
8258 Validate::validate_at(value, path, out);
8259 }
8260 path.pop();
8261 path.push_key("customData");
8262 if let Some(value) = &self.custom_data {
8263 Validate::validate_at(value, path, out);
8264 }
8265 path.pop();
8266 }
8267}
8268
8269#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8274pub struct SalesTariff {
8275 #[serde(deserialize_with = "crate::types::integer::one")]
8277 pub id: i32,
8278 #[serde(rename = "salesTariffEntry")]
8280 pub sales_tariff_entry: Vec<SalesTariffEntry>,
8281 #[serde(rename = "salesTariffDescription")]
8283 #[serde(default, skip_serializing_if = "Option::is_none")]
8284 pub sales_tariff_description: Option<String>,
8285 #[serde(rename = "numEPriceLevels")]
8287 #[serde(default, skip_serializing_if = "Option::is_none")]
8288 #[serde(deserialize_with = "crate::types::integer::option")]
8289 pub num_e_price_levels: Option<i32>,
8290 #[serde(rename = "customData")]
8292 #[serde(default, skip_serializing_if = "Option::is_none")]
8293 pub custom_data: Option<crate::types::CustomData>,
8294}
8295
8296impl SalesTariff {
8297 #[must_use]
8299 pub fn new(id: i32, sales_tariff_entry: Vec<SalesTariffEntry>) -> Self {
8300 Self {
8301 id,
8302 sales_tariff_entry,
8303 sales_tariff_description: None,
8304 num_e_price_levels: None,
8305 custom_data: None,
8306 }
8307 }
8308
8309 #[must_use]
8311 pub fn with_sales_tariff_description(mut self, value: impl Into<String>) -> Self {
8312 self.sales_tariff_description = Some(value.into());
8313 self
8314 }
8315
8316 #[must_use]
8318 pub fn with_num_e_price_levels(mut self, value: i32) -> Self {
8319 self.num_e_price_levels = Some(value);
8320 self
8321 }
8322
8323 #[must_use]
8325 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8326 self.custom_data = Some(value);
8327 self
8328 }
8329}
8330
8331impl Validate for SalesTariff {
8332 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8333 path.push_key("id");
8334 validate::int_range(i64::from(self.id), Some(0), None, path, out);
8335 path.pop();
8336 path.push_key("salesTariffEntry");
8337 validate::list_len(
8338 self.sales_tariff_entry.len(),
8339 Some(1),
8340 Some(1024),
8341 path,
8342 out,
8343 );
8344 for (index, item) in self.sales_tariff_entry.iter().enumerate() {
8345 path.push_index(index);
8346 Validate::validate_at(item, path, out);
8347 path.pop();
8348 }
8349 path.pop();
8350 path.push_key("salesTariffDescription");
8351 if let Some(value) = &self.sales_tariff_description {
8352 validate::string(value.as_str(), None, Some(32), path, out);
8353 }
8354 path.pop();
8355 path.push_key("numEPriceLevels");
8356 if let Some(value) = &self.num_e_price_levels {
8357 validate::int_range(i64::from(*value), Some(0), None, path, out);
8358 }
8359 path.pop();
8360 path.push_key("customData");
8361 if let Some(value) = &self.custom_data {
8362 Validate::validate_at(value, path, out);
8363 }
8364 path.pop();
8365 }
8366}
8367
8368#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8370pub struct SalesTariffEntry {
8371 #[serde(rename = "relativeTimeInterval")]
8373 pub relative_time_interval: RelativeTimeInterval,
8374 #[serde(rename = "ePriceLevel")]
8376 #[serde(default, skip_serializing_if = "Option::is_none")]
8377 #[serde(deserialize_with = "crate::types::integer::option")]
8378 pub e_price_level: Option<i32>,
8379 #[serde(rename = "consumptionCost")]
8381 #[serde(default, skip_serializing_if = "Option::is_none")]
8382 pub consumption_cost: Option<Vec<ConsumptionCost>>,
8383 #[serde(rename = "customData")]
8385 #[serde(default, skip_serializing_if = "Option::is_none")]
8386 pub custom_data: Option<crate::types::CustomData>,
8387}
8388
8389impl SalesTariffEntry {
8390 #[must_use]
8392 pub fn new(relative_time_interval: RelativeTimeInterval) -> Self {
8393 Self {
8394 relative_time_interval,
8395 e_price_level: None,
8396 consumption_cost: None,
8397 custom_data: None,
8398 }
8399 }
8400
8401 #[must_use]
8403 pub fn with_e_price_level(mut self, value: i32) -> Self {
8404 self.e_price_level = Some(value);
8405 self
8406 }
8407
8408 #[must_use]
8410 pub fn with_consumption_cost(mut self, value: Vec<ConsumptionCost>) -> Self {
8411 self.consumption_cost = Some(value);
8412 self
8413 }
8414
8415 #[must_use]
8417 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8418 self.custom_data = Some(value);
8419 self
8420 }
8421}
8422
8423impl Validate for SalesTariffEntry {
8424 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8425 path.push_key("relativeTimeInterval");
8426 Validate::validate_at(&self.relative_time_interval, path, out);
8427 path.pop();
8428 path.push_key("ePriceLevel");
8429 if let Some(value) = &self.e_price_level {
8430 validate::int_range(i64::from(*value), Some(0), None, path, out);
8431 }
8432 path.pop();
8433 path.push_key("consumptionCost");
8434 if let Some(value) = &self.consumption_cost {
8435 validate::list_len(value.len(), Some(1), Some(3), path, out);
8436 for (index, item) in value.iter().enumerate() {
8437 path.push_index(index);
8438 Validate::validate_at(item, path, out);
8439 path.pop();
8440 }
8441 }
8442 path.pop();
8443 path.push_key("customData");
8444 if let Some(value) = &self.custom_data {
8445 Validate::validate_at(value, path, out);
8446 }
8447 path.pop();
8448 }
8449}
8450
8451#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8457pub struct SampledValue {
8458 pub value: crate::types::Decimal,
8460 #[serde(default, skip_serializing_if = "Option::is_none")]
8462 pub measurand: Option<Measurand>,
8463 #[serde(default, skip_serializing_if = "Option::is_none")]
8465 pub context: Option<ReadingContext>,
8466 #[serde(default, skip_serializing_if = "Option::is_none")]
8468 pub phase: Option<Phase>,
8469 #[serde(default, skip_serializing_if = "Option::is_none")]
8471 pub location: Option<Location>,
8472 #[serde(rename = "signedMeterValue")]
8474 #[serde(default, skip_serializing_if = "Option::is_none")]
8475 pub signed_meter_value: Option<SignedMeterValue>,
8476 #[serde(rename = "unitOfMeasure")]
8478 #[serde(default, skip_serializing_if = "Option::is_none")]
8479 pub unit_of_measure: Option<UnitOfMeasure>,
8480 #[serde(rename = "customData")]
8482 #[serde(default, skip_serializing_if = "Option::is_none")]
8483 pub custom_data: Option<crate::types::CustomData>,
8484}
8485
8486impl SampledValue {
8487 #[must_use]
8489 pub fn new(value: impl Into<crate::types::Decimal>) -> Self {
8490 Self {
8491 value: value.into(),
8492 measurand: None,
8493 context: None,
8494 phase: None,
8495 location: None,
8496 signed_meter_value: None,
8497 unit_of_measure: None,
8498 custom_data: None,
8499 }
8500 }
8501
8502 #[must_use]
8504 pub fn with_measurand(mut self, value: Measurand) -> Self {
8505 self.measurand = Some(value);
8506 self
8507 }
8508
8509 #[must_use]
8511 pub fn with_context(mut self, value: ReadingContext) -> Self {
8512 self.context = Some(value);
8513 self
8514 }
8515
8516 #[must_use]
8518 pub fn with_phase(mut self, value: Phase) -> Self {
8519 self.phase = Some(value);
8520 self
8521 }
8522
8523 #[must_use]
8525 pub fn with_location(mut self, value: Location) -> Self {
8526 self.location = Some(value);
8527 self
8528 }
8529
8530 #[must_use]
8532 pub fn with_signed_meter_value(mut self, value: SignedMeterValue) -> Self {
8533 self.signed_meter_value = Some(value);
8534 self
8535 }
8536
8537 #[must_use]
8539 pub fn with_unit_of_measure(mut self, value: UnitOfMeasure) -> Self {
8540 self.unit_of_measure = Some(value);
8541 self
8542 }
8543
8544 #[must_use]
8546 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8547 self.custom_data = Some(value);
8548 self
8549 }
8550}
8551
8552impl Validate for SampledValue {
8553 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8554 path.push_key("measurand");
8555 if let Some(value) = &self.measurand {
8556 Validate::validate_at(value, path, out);
8557 }
8558 path.pop();
8559 path.push_key("context");
8560 if let Some(value) = &self.context {
8561 Validate::validate_at(value, path, out);
8562 }
8563 path.pop();
8564 path.push_key("phase");
8565 if let Some(value) = &self.phase {
8566 Validate::validate_at(value, path, out);
8567 }
8568 path.pop();
8569 path.push_key("location");
8570 if let Some(value) = &self.location {
8571 Validate::validate_at(value, path, out);
8572 }
8573 path.pop();
8574 path.push_key("signedMeterValue");
8575 if let Some(value) = &self.signed_meter_value {
8576 Validate::validate_at(value, path, out);
8577 }
8578 path.pop();
8579 path.push_key("unitOfMeasure");
8580 if let Some(value) = &self.unit_of_measure {
8581 Validate::validate_at(value, path, out);
8582 }
8583 path.pop();
8584 path.push_key("customData");
8585 if let Some(value) = &self.custom_data {
8586 Validate::validate_at(value, path, out);
8587 }
8588 path.pop();
8589 }
8590}
8591
8592#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8596pub struct SetMonitoringData {
8597 pub value: crate::types::Decimal,
8600 pub r#type: Monitor,
8602 #[serde(deserialize_with = "crate::types::integer::one")]
8626 pub severity: i32,
8627 pub component: Component,
8629 pub variable: Variable,
8631 #[serde(default, skip_serializing_if = "Option::is_none")]
8633 #[serde(deserialize_with = "crate::types::integer::option")]
8634 pub id: Option<i32>,
8635 #[serde(rename = "periodicEventStream")]
8637 #[serde(default, skip_serializing_if = "Option::is_none")]
8638 pub periodic_event_stream: Option<PeriodicEventStreamParams>,
8639 #[serde(default, skip_serializing_if = "Option::is_none")]
8642 pub transaction: Option<bool>,
8643 #[serde(rename = "customData")]
8645 #[serde(default, skip_serializing_if = "Option::is_none")]
8646 pub custom_data: Option<crate::types::CustomData>,
8647}
8648
8649impl SetMonitoringData {
8650 #[must_use]
8652 pub fn new(
8653 value: impl Into<crate::types::Decimal>,
8654 r#type: Monitor,
8655 severity: i32,
8656 component: Component,
8657 variable: Variable,
8658 ) -> Self {
8659 Self {
8660 value: value.into(),
8661 r#type,
8662 severity,
8663 component,
8664 variable,
8665 id: None,
8666 periodic_event_stream: None,
8667 transaction: None,
8668 custom_data: None,
8669 }
8670 }
8671
8672 #[must_use]
8674 pub fn with_id(mut self, value: i32) -> Self {
8675 self.id = Some(value);
8676 self
8677 }
8678
8679 #[must_use]
8681 pub fn with_periodic_event_stream(mut self, value: PeriodicEventStreamParams) -> Self {
8682 self.periodic_event_stream = Some(value);
8683 self
8684 }
8685
8686 #[must_use]
8688 pub fn with_transaction(mut self, value: bool) -> Self {
8689 self.transaction = Some(value);
8690 self
8691 }
8692
8693 #[must_use]
8695 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8696 self.custom_data = Some(value);
8697 self
8698 }
8699}
8700
8701impl Validate for SetMonitoringData {
8702 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8703 path.push_key("type");
8704 Validate::validate_at(&self.r#type, path, out);
8705 path.pop();
8706 path.push_key("severity");
8707 validate::int_range(i64::from(self.severity), Some(0), None, path, out);
8708 path.pop();
8709 path.push_key("component");
8710 Validate::validate_at(&self.component, path, out);
8711 path.pop();
8712 path.push_key("variable");
8713 Validate::validate_at(&self.variable, path, out);
8714 path.pop();
8715 path.push_key("id");
8716 if let Some(value) = &self.id {
8717 validate::int_range(i64::from(*value), Some(0), None, path, out);
8718 }
8719 path.pop();
8720 path.push_key("periodicEventStream");
8721 if let Some(value) = &self.periodic_event_stream {
8722 Validate::validate_at(value, path, out);
8723 }
8724 path.pop();
8725 path.push_key("customData");
8726 if let Some(value) = &self.custom_data {
8727 Validate::validate_at(value, path, out);
8728 }
8729 path.pop();
8730 }
8731}
8732
8733#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8737pub struct SetMonitoringResult {
8738 pub status: SetMonitoringStatus,
8740 pub r#type: Monitor,
8742 pub component: Component,
8744 pub variable: Variable,
8746 #[serde(deserialize_with = "crate::types::integer::one")]
8770 pub severity: i32,
8771 #[serde(default, skip_serializing_if = "Option::is_none")]
8773 #[serde(deserialize_with = "crate::types::integer::option")]
8774 pub id: Option<i32>,
8775 #[serde(rename = "statusInfo")]
8777 #[serde(default, skip_serializing_if = "Option::is_none")]
8778 pub status_info: Option<StatusInfo>,
8779 #[serde(rename = "customData")]
8781 #[serde(default, skip_serializing_if = "Option::is_none")]
8782 pub custom_data: Option<crate::types::CustomData>,
8783}
8784
8785impl SetMonitoringResult {
8786 #[must_use]
8788 pub fn new(
8789 status: SetMonitoringStatus,
8790 r#type: Monitor,
8791 component: Component,
8792 variable: Variable,
8793 severity: i32,
8794 ) -> Self {
8795 Self {
8796 status,
8797 r#type,
8798 component,
8799 variable,
8800 severity,
8801 id: None,
8802 status_info: None,
8803 custom_data: None,
8804 }
8805 }
8806
8807 #[must_use]
8809 pub fn with_id(mut self, value: i32) -> Self {
8810 self.id = Some(value);
8811 self
8812 }
8813
8814 #[must_use]
8816 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
8817 self.status_info = Some(value);
8818 self
8819 }
8820
8821 #[must_use]
8823 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8824 self.custom_data = Some(value);
8825 self
8826 }
8827}
8828
8829impl Validate for SetMonitoringResult {
8830 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8831 path.push_key("status");
8832 Validate::validate_at(&self.status, path, out);
8833 path.pop();
8834 path.push_key("type");
8835 Validate::validate_at(&self.r#type, path, out);
8836 path.pop();
8837 path.push_key("component");
8838 Validate::validate_at(&self.component, path, out);
8839 path.pop();
8840 path.push_key("variable");
8841 Validate::validate_at(&self.variable, path, out);
8842 path.pop();
8843 path.push_key("severity");
8844 validate::int_range(i64::from(self.severity), Some(0), None, path, out);
8845 path.pop();
8846 path.push_key("id");
8847 if let Some(value) = &self.id {
8848 validate::int_range(i64::from(*value), Some(0), None, path, out);
8849 }
8850 path.pop();
8851 path.push_key("statusInfo");
8852 if let Some(value) = &self.status_info {
8853 Validate::validate_at(value, path, out);
8854 }
8855 path.pop();
8856 path.push_key("customData");
8857 if let Some(value) = &self.custom_data {
8858 Validate::validate_at(value, path, out);
8859 }
8860 path.pop();
8861 }
8862}
8863
8864#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8866pub struct SetVariableData {
8867 #[serde(rename = "attributeValue")]
8872 pub attribute_value: String,
8873 pub component: Component,
8875 pub variable: Variable,
8877 #[serde(rename = "attributeType")]
8879 #[serde(default, skip_serializing_if = "Option::is_none")]
8880 pub attribute_type: Option<Attribute>,
8881 #[serde(rename = "customData")]
8883 #[serde(default, skip_serializing_if = "Option::is_none")]
8884 pub custom_data: Option<crate::types::CustomData>,
8885}
8886
8887impl SetVariableData {
8888 #[must_use]
8890 pub fn new(
8891 attribute_value: impl Into<String>,
8892 component: Component,
8893 variable: Variable,
8894 ) -> Self {
8895 Self {
8896 attribute_value: attribute_value.into(),
8897 component,
8898 variable,
8899 attribute_type: None,
8900 custom_data: None,
8901 }
8902 }
8903
8904 #[must_use]
8906 pub fn with_attribute_type(mut self, value: Attribute) -> Self {
8907 self.attribute_type = Some(value);
8908 self
8909 }
8910
8911 #[must_use]
8913 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8914 self.custom_data = Some(value);
8915 self
8916 }
8917}
8918
8919impl Validate for SetVariableData {
8920 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8921 path.push_key("attributeValue");
8922 validate::string(self.attribute_value.as_str(), None, Some(2500), path, out);
8923 path.pop();
8924 path.push_key("component");
8925 Validate::validate_at(&self.component, path, out);
8926 path.pop();
8927 path.push_key("variable");
8928 Validate::validate_at(&self.variable, path, out);
8929 path.pop();
8930 path.push_key("attributeType");
8931 if let Some(value) = &self.attribute_type {
8932 Validate::validate_at(value, path, out);
8933 }
8934 path.pop();
8935 path.push_key("customData");
8936 if let Some(value) = &self.custom_data {
8937 Validate::validate_at(value, path, out);
8938 }
8939 path.pop();
8940 }
8941}
8942
8943#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8945pub struct SetVariableResult {
8946 #[serde(rename = "attributeStatus")]
8948 pub attribute_status: SetVariableStatus,
8949 pub component: Component,
8951 pub variable: Variable,
8953 #[serde(rename = "attributeType")]
8955 #[serde(default, skip_serializing_if = "Option::is_none")]
8956 pub attribute_type: Option<Attribute>,
8957 #[serde(rename = "attributeStatusInfo")]
8959 #[serde(default, skip_serializing_if = "Option::is_none")]
8960 pub attribute_status_info: Option<StatusInfo>,
8961 #[serde(rename = "customData")]
8963 #[serde(default, skip_serializing_if = "Option::is_none")]
8964 pub custom_data: Option<crate::types::CustomData>,
8965}
8966
8967impl SetVariableResult {
8968 #[must_use]
8970 pub fn new(
8971 attribute_status: SetVariableStatus,
8972 component: Component,
8973 variable: Variable,
8974 ) -> Self {
8975 Self {
8976 attribute_status,
8977 component,
8978 variable,
8979 attribute_type: None,
8980 attribute_status_info: None,
8981 custom_data: None,
8982 }
8983 }
8984
8985 #[must_use]
8987 pub fn with_attribute_type(mut self, value: Attribute) -> Self {
8988 self.attribute_type = Some(value);
8989 self
8990 }
8991
8992 #[must_use]
8994 pub fn with_attribute_status_info(mut self, value: StatusInfo) -> Self {
8995 self.attribute_status_info = Some(value);
8996 self
8997 }
8998
8999 #[must_use]
9001 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9002 self.custom_data = Some(value);
9003 self
9004 }
9005}
9006
9007impl Validate for SetVariableResult {
9008 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9009 path.push_key("attributeStatus");
9010 Validate::validate_at(&self.attribute_status, path, out);
9011 path.pop();
9012 path.push_key("component");
9013 Validate::validate_at(&self.component, path, out);
9014 path.pop();
9015 path.push_key("variable");
9016 Validate::validate_at(&self.variable, path, out);
9017 path.pop();
9018 path.push_key("attributeType");
9019 if let Some(value) = &self.attribute_type {
9020 Validate::validate_at(value, path, out);
9021 }
9022 path.pop();
9023 path.push_key("attributeStatusInfo");
9024 if let Some(value) = &self.attribute_status_info {
9025 Validate::validate_at(value, path, out);
9026 }
9027 path.pop();
9028 path.push_key("customData");
9029 if let Some(value) = &self.custom_data {
9030 Validate::validate_at(value, path, out);
9031 }
9032 path.pop();
9033 }
9034}
9035
9036#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9040pub struct SignedMeterValue {
9041 #[serde(rename = "signedMeterData")]
9043 pub signed_meter_data: String,
9044 #[serde(rename = "encodingMethod")]
9046 pub encoding_method: String,
9047 #[serde(rename = "signingMethod")]
9049 #[serde(default, skip_serializing_if = "Option::is_none")]
9050 pub signing_method: Option<String>,
9051 #[serde(rename = "publicKey")]
9053 #[serde(default, skip_serializing_if = "Option::is_none")]
9054 pub public_key: Option<String>,
9055 #[serde(rename = "customData")]
9057 #[serde(default, skip_serializing_if = "Option::is_none")]
9058 pub custom_data: Option<crate::types::CustomData>,
9059}
9060
9061impl SignedMeterValue {
9062 #[must_use]
9064 pub fn new(signed_meter_data: impl Into<String>, encoding_method: impl Into<String>) -> Self {
9065 Self {
9066 signed_meter_data: signed_meter_data.into(),
9067 encoding_method: encoding_method.into(),
9068 signing_method: None,
9069 public_key: None,
9070 custom_data: None,
9071 }
9072 }
9073
9074 #[must_use]
9076 pub fn with_signing_method(mut self, value: impl Into<String>) -> Self {
9077 self.signing_method = Some(value.into());
9078 self
9079 }
9080
9081 #[must_use]
9083 pub fn with_public_key(mut self, value: impl Into<String>) -> Self {
9084 self.public_key = Some(value.into());
9085 self
9086 }
9087
9088 #[must_use]
9090 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9091 self.custom_data = Some(value);
9092 self
9093 }
9094}
9095
9096impl Validate for SignedMeterValue {
9097 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9098 path.push_key("signedMeterData");
9099 validate::string(
9100 self.signed_meter_data.as_str(),
9101 None,
9102 Some(32768),
9103 path,
9104 out,
9105 );
9106 path.pop();
9107 path.push_key("encodingMethod");
9108 validate::string(self.encoding_method.as_str(), None, Some(50), path, out);
9109 path.pop();
9110 path.push_key("signingMethod");
9111 if let Some(value) = &self.signing_method {
9112 validate::string(value.as_str(), None, Some(50), path, out);
9113 }
9114 path.pop();
9115 path.push_key("publicKey");
9116 if let Some(value) = &self.public_key {
9117 validate::string(value.as_str(), None, Some(2500), path, out);
9118 }
9119 path.pop();
9120 path.push_key("customData");
9121 if let Some(value) = &self.custom_data {
9122 Validate::validate_at(value, path, out);
9123 }
9124 path.pop();
9125 }
9126}
9127
9128#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9132pub struct StatusInfo {
9133 #[serde(rename = "reasonCode")]
9135 pub reason_code: String,
9136 #[serde(rename = "additionalInfo")]
9138 #[serde(default, skip_serializing_if = "Option::is_none")]
9139 pub additional_info: Option<String>,
9140 #[serde(rename = "customData")]
9142 #[serde(default, skip_serializing_if = "Option::is_none")]
9143 pub custom_data: Option<crate::types::CustomData>,
9144}
9145
9146impl StatusInfo {
9147 #[must_use]
9149 pub fn new(reason_code: impl Into<String>) -> Self {
9150 Self {
9151 reason_code: reason_code.into(),
9152 additional_info: None,
9153 custom_data: None,
9154 }
9155 }
9156
9157 #[must_use]
9159 pub fn with_additional_info(mut self, value: impl Into<String>) -> Self {
9160 self.additional_info = Some(value.into());
9161 self
9162 }
9163
9164 #[must_use]
9166 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9167 self.custom_data = Some(value);
9168 self
9169 }
9170}
9171
9172impl Validate for StatusInfo {
9173 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9174 path.push_key("reasonCode");
9175 validate::string(self.reason_code.as_str(), None, Some(20), path, out);
9176 path.pop();
9177 path.push_key("additionalInfo");
9178 if let Some(value) = &self.additional_info {
9179 validate::string(value.as_str(), None, Some(1024), path, out);
9180 }
9181 path.pop();
9182 path.push_key("customData");
9183 if let Some(value) = &self.custom_data {
9184 Validate::validate_at(value, path, out);
9185 }
9186 path.pop();
9187 }
9188}
9189
9190#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9192pub struct StreamDataElement {
9193 pub t: crate::types::Decimal,
9195 pub v: String,
9197 #[serde(rename = "customData")]
9199 #[serde(default, skip_serializing_if = "Option::is_none")]
9200 pub custom_data: Option<crate::types::CustomData>,
9201}
9202
9203impl StreamDataElement {
9204 #[must_use]
9206 pub fn new(t: impl Into<crate::types::Decimal>, v: impl Into<String>) -> Self {
9207 Self {
9208 t: t.into(),
9209 v: v.into(),
9210 custom_data: None,
9211 }
9212 }
9213
9214 #[must_use]
9216 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9217 self.custom_data = Some(value);
9218 self
9219 }
9220}
9221
9222impl Validate for StreamDataElement {
9223 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9224 path.push_key("v");
9225 validate::string(self.v.as_str(), None, Some(2500), path, out);
9226 path.pop();
9227 path.push_key("customData");
9228 if let Some(value) = &self.custom_data {
9229 Validate::validate_at(value, path, out);
9230 }
9231 path.pop();
9232 }
9233}
9234
9235#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9248pub struct Tariff {
9249 #[serde(rename = "tariffId")]
9251 pub tariff_id: String,
9252 pub currency: String,
9254 #[serde(default, skip_serializing_if = "Option::is_none")]
9256 pub description: Option<Vec<MessageContent>>,
9257 #[serde(default, skip_serializing_if = "Option::is_none")]
9259 pub energy: Option<TariffEnergy>,
9260 #[serde(rename = "validFrom")]
9262 #[serde(default, skip_serializing_if = "Option::is_none")]
9263 pub valid_from: Option<crate::types::DateTime>,
9264 #[serde(rename = "chargingTime")]
9266 #[serde(default, skip_serializing_if = "Option::is_none")]
9267 pub charging_time: Option<TariffTime>,
9268 #[serde(rename = "idleTime")]
9270 #[serde(default, skip_serializing_if = "Option::is_none")]
9271 pub idle_time: Option<TariffTime>,
9272 #[serde(rename = "fixedFee")]
9274 #[serde(default, skip_serializing_if = "Option::is_none")]
9275 pub fixed_fee: Option<TariffFixed>,
9276 #[serde(rename = "reservationTime")]
9278 #[serde(default, skip_serializing_if = "Option::is_none")]
9279 pub reservation_time: Option<TariffTime>,
9280 #[serde(rename = "reservationFixed")]
9282 #[serde(default, skip_serializing_if = "Option::is_none")]
9283 pub reservation_fixed: Option<TariffFixed>,
9284 #[serde(rename = "minCost")]
9286 #[serde(default, skip_serializing_if = "Option::is_none")]
9287 pub min_cost: Option<Price>,
9288 #[serde(rename = "maxCost")]
9290 #[serde(default, skip_serializing_if = "Option::is_none")]
9291 pub max_cost: Option<Price>,
9292 #[serde(rename = "customData")]
9294 #[serde(default, skip_serializing_if = "Option::is_none")]
9295 pub custom_data: Option<crate::types::CustomData>,
9296}
9297
9298impl Tariff {
9299 #[must_use]
9301 pub fn new(tariff_id: impl Into<String>, currency: impl Into<String>) -> Self {
9302 Self {
9303 tariff_id: tariff_id.into(),
9304 currency: currency.into(),
9305 description: None,
9306 energy: None,
9307 valid_from: None,
9308 charging_time: None,
9309 idle_time: None,
9310 fixed_fee: None,
9311 reservation_time: None,
9312 reservation_fixed: None,
9313 min_cost: None,
9314 max_cost: None,
9315 custom_data: None,
9316 }
9317 }
9318
9319 #[must_use]
9321 pub fn with_description(mut self, value: Vec<MessageContent>) -> Self {
9322 self.description = Some(value);
9323 self
9324 }
9325
9326 #[must_use]
9328 pub fn with_energy(mut self, value: TariffEnergy) -> Self {
9329 self.energy = Some(value);
9330 self
9331 }
9332
9333 #[must_use]
9335 pub fn with_valid_from(mut self, value: impl Into<crate::types::DateTime>) -> Self {
9336 self.valid_from = Some(value.into());
9337 self
9338 }
9339
9340 #[must_use]
9342 pub fn with_charging_time(mut self, value: TariffTime) -> Self {
9343 self.charging_time = Some(value);
9344 self
9345 }
9346
9347 #[must_use]
9349 pub fn with_idle_time(mut self, value: TariffTime) -> Self {
9350 self.idle_time = Some(value);
9351 self
9352 }
9353
9354 #[must_use]
9356 pub fn with_fixed_fee(mut self, value: TariffFixed) -> Self {
9357 self.fixed_fee = Some(value);
9358 self
9359 }
9360
9361 #[must_use]
9363 pub fn with_reservation_time(mut self, value: TariffTime) -> Self {
9364 self.reservation_time = Some(value);
9365 self
9366 }
9367
9368 #[must_use]
9370 pub fn with_reservation_fixed(mut self, value: TariffFixed) -> Self {
9371 self.reservation_fixed = Some(value);
9372 self
9373 }
9374
9375 #[must_use]
9377 pub fn with_min_cost(mut self, value: Price) -> Self {
9378 self.min_cost = Some(value);
9379 self
9380 }
9381
9382 #[must_use]
9384 pub fn with_max_cost(mut self, value: Price) -> Self {
9385 self.max_cost = Some(value);
9386 self
9387 }
9388
9389 #[must_use]
9391 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9392 self.custom_data = Some(value);
9393 self
9394 }
9395}
9396
9397impl Validate for Tariff {
9398 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9399 path.push_key("tariffId");
9400 validate::string(self.tariff_id.as_str(), None, Some(60), path, out);
9401 path.pop();
9402 path.push_key("currency");
9403 validate::string(self.currency.as_str(), None, Some(3), path, out);
9404 path.pop();
9405 path.push_key("description");
9406 if let Some(value) = &self.description {
9407 validate::list_len(value.len(), Some(1), Some(10), path, out);
9408 for (index, item) in value.iter().enumerate() {
9409 path.push_index(index);
9410 Validate::validate_at(item, path, out);
9411 path.pop();
9412 }
9413 }
9414 path.pop();
9415 path.push_key("energy");
9416 if let Some(value) = &self.energy {
9417 Validate::validate_at(value, path, out);
9418 }
9419 path.pop();
9420 path.push_key("chargingTime");
9421 if let Some(value) = &self.charging_time {
9422 Validate::validate_at(value, path, out);
9423 }
9424 path.pop();
9425 path.push_key("idleTime");
9426 if let Some(value) = &self.idle_time {
9427 Validate::validate_at(value, path, out);
9428 }
9429 path.pop();
9430 path.push_key("fixedFee");
9431 if let Some(value) = &self.fixed_fee {
9432 Validate::validate_at(value, path, out);
9433 }
9434 path.pop();
9435 path.push_key("reservationTime");
9436 if let Some(value) = &self.reservation_time {
9437 Validate::validate_at(value, path, out);
9438 }
9439 path.pop();
9440 path.push_key("reservationFixed");
9441 if let Some(value) = &self.reservation_fixed {
9442 Validate::validate_at(value, path, out);
9443 }
9444 path.pop();
9445 path.push_key("minCost");
9446 if let Some(value) = &self.min_cost {
9447 Validate::validate_at(value, path, out);
9448 }
9449 path.pop();
9450 path.push_key("maxCost");
9451 if let Some(value) = &self.max_cost {
9452 Validate::validate_at(value, path, out);
9453 }
9454 path.pop();
9455 path.push_key("customData");
9456 if let Some(value) = &self.custom_data {
9457 Validate::validate_at(value, path, out);
9458 }
9459 path.pop();
9460 }
9461}
9462
9463#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9467pub struct TariffAssignment {
9468 #[serde(rename = "tariffId")]
9470 pub tariff_id: String,
9471 #[serde(rename = "tariffKind")]
9473 pub tariff_kind: TariffKind,
9474 #[serde(rename = "validFrom")]
9476 #[serde(default, skip_serializing_if = "Option::is_none")]
9477 pub valid_from: Option<crate::types::DateTime>,
9478 #[serde(rename = "evseIds")]
9480 #[serde(default, skip_serializing_if = "Option::is_none")]
9481 #[serde(deserialize_with = "crate::types::integer::option_list")]
9482 pub evse_ids: Option<Vec<i32>>,
9483 #[serde(rename = "idTokens")]
9485 #[serde(default, skip_serializing_if = "Option::is_none")]
9486 pub id_tokens: Option<Vec<String>>,
9487 #[serde(rename = "customData")]
9489 #[serde(default, skip_serializing_if = "Option::is_none")]
9490 pub custom_data: Option<crate::types::CustomData>,
9491}
9492
9493impl TariffAssignment {
9494 #[must_use]
9496 pub fn new(tariff_id: impl Into<String>, tariff_kind: TariffKind) -> Self {
9497 Self {
9498 tariff_id: tariff_id.into(),
9499 tariff_kind,
9500 valid_from: None,
9501 evse_ids: None,
9502 id_tokens: None,
9503 custom_data: None,
9504 }
9505 }
9506
9507 #[must_use]
9509 pub fn with_valid_from(mut self, value: impl Into<crate::types::DateTime>) -> Self {
9510 self.valid_from = Some(value.into());
9511 self
9512 }
9513
9514 #[must_use]
9516 pub fn with_evse_ids(mut self, value: Vec<i32>) -> Self {
9517 self.evse_ids = Some(value);
9518 self
9519 }
9520
9521 #[must_use]
9523 pub fn with_id_tokens(mut self, value: impl IntoIterator<Item = impl Into<String>>) -> Self {
9524 self.id_tokens = Some(value.into_iter().map(Into::into).collect());
9525 self
9526 }
9527
9528 #[must_use]
9530 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9531 self.custom_data = Some(value);
9532 self
9533 }
9534}
9535
9536impl Validate for TariffAssignment {
9537 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9538 path.push_key("tariffId");
9539 validate::string(self.tariff_id.as_str(), None, Some(60), path, out);
9540 path.pop();
9541 path.push_key("tariffKind");
9542 Validate::validate_at(&self.tariff_kind, path, out);
9543 path.pop();
9544 path.push_key("evseIds");
9545 if let Some(value) = &self.evse_ids {
9546 validate::list_len(value.len(), Some(1), None, path, out);
9547 for (index, item) in value.iter().enumerate() {
9548 path.push_index(index);
9549 validate::int_range(i64::from(*item), Some(0), None, path, out);
9550 path.pop();
9551 }
9552 }
9553 path.pop();
9554 path.push_key("idTokens");
9555 if let Some(value) = &self.id_tokens {
9556 validate::list_len(value.len(), Some(1), None, path, out);
9557 for (index, item) in value.iter().enumerate() {
9558 path.push_index(index);
9559 validate::string(item.as_str(), None, Some(255), path, out);
9560 path.pop();
9561 }
9562 }
9563 path.pop();
9564 path.push_key("customData");
9565 if let Some(value) = &self.custom_data {
9566 Validate::validate_at(value, path, out);
9567 }
9568 path.pop();
9569 }
9570}
9571
9572#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
9585pub struct TariffConditions {
9586 #[serde(rename = "startTimeOfDay")]
9591 #[serde(default, skip_serializing_if = "Option::is_none")]
9592 pub start_time_of_day: Option<String>,
9593 #[serde(rename = "endTimeOfDay")]
9597 #[serde(default, skip_serializing_if = "Option::is_none")]
9598 pub end_time_of_day: Option<String>,
9599 #[serde(rename = "dayOfWeek")]
9601 #[serde(default, skip_serializing_if = "Option::is_none")]
9602 pub day_of_week: Option<Vec<DayOfWeek>>,
9603 #[serde(rename = "validFromDate")]
9609 #[serde(default, skip_serializing_if = "Option::is_none")]
9610 pub valid_from_date: Option<String>,
9611 #[serde(rename = "validToDate")]
9614 #[serde(default, skip_serializing_if = "Option::is_none")]
9615 pub valid_to_date: Option<String>,
9616 #[serde(rename = "evseKind")]
9618 #[serde(default, skip_serializing_if = "Option::is_none")]
9619 pub evse_kind: Option<EvseKind>,
9620 #[serde(rename = "minEnergy")]
9623 #[serde(default, skip_serializing_if = "Option::is_none")]
9624 pub min_energy: Option<crate::types::Decimal>,
9625 #[serde(rename = "maxEnergy")]
9628 #[serde(default, skip_serializing_if = "Option::is_none")]
9629 pub max_energy: Option<crate::types::Decimal>,
9630 #[serde(rename = "minCurrent")]
9634 #[serde(default, skip_serializing_if = "Option::is_none")]
9635 pub min_current: Option<crate::types::Decimal>,
9636 #[serde(rename = "maxCurrent")]
9640 #[serde(default, skip_serializing_if = "Option::is_none")]
9641 pub max_current: Option<crate::types::Decimal>,
9642 #[serde(rename = "minPower")]
9647 #[serde(default, skip_serializing_if = "Option::is_none")]
9648 pub min_power: Option<crate::types::Decimal>,
9649 #[serde(rename = "maxPower")]
9654 #[serde(default, skip_serializing_if = "Option::is_none")]
9655 pub max_power: Option<crate::types::Decimal>,
9656 #[serde(rename = "minTime")]
9660 #[serde(default, skip_serializing_if = "Option::is_none")]
9661 #[serde(deserialize_with = "crate::types::integer::option")]
9662 pub min_time: Option<i32>,
9663 #[serde(rename = "maxTime")]
9667 #[serde(default, skip_serializing_if = "Option::is_none")]
9668 #[serde(deserialize_with = "crate::types::integer::option")]
9669 pub max_time: Option<i32>,
9670 #[serde(rename = "minChargingTime")]
9674 #[serde(default, skip_serializing_if = "Option::is_none")]
9675 #[serde(deserialize_with = "crate::types::integer::option")]
9676 pub min_charging_time: Option<i32>,
9677 #[serde(rename = "maxChargingTime")]
9681 #[serde(default, skip_serializing_if = "Option::is_none")]
9682 #[serde(deserialize_with = "crate::types::integer::option")]
9683 pub max_charging_time: Option<i32>,
9684 #[serde(rename = "minIdleTime")]
9688 #[serde(default, skip_serializing_if = "Option::is_none")]
9689 #[serde(deserialize_with = "crate::types::integer::option")]
9690 pub min_idle_time: Option<i32>,
9691 #[serde(rename = "maxIdleTime")]
9695 #[serde(default, skip_serializing_if = "Option::is_none")]
9696 #[serde(deserialize_with = "crate::types::integer::option")]
9697 pub max_idle_time: Option<i32>,
9698 #[serde(rename = "customData")]
9700 #[serde(default, skip_serializing_if = "Option::is_none")]
9701 pub custom_data: Option<crate::types::CustomData>,
9702}
9703
9704impl TariffConditions {
9705 #[must_use]
9707 pub fn new() -> Self {
9708 Self::default()
9709 }
9710
9711 #[must_use]
9713 pub fn with_start_time_of_day(mut self, value: impl Into<String>) -> Self {
9714 self.start_time_of_day = Some(value.into());
9715 self
9716 }
9717
9718 #[must_use]
9720 pub fn with_end_time_of_day(mut self, value: impl Into<String>) -> Self {
9721 self.end_time_of_day = Some(value.into());
9722 self
9723 }
9724
9725 #[must_use]
9727 pub fn with_day_of_week(mut self, value: Vec<DayOfWeek>) -> Self {
9728 self.day_of_week = Some(value);
9729 self
9730 }
9731
9732 #[must_use]
9734 pub fn with_valid_from_date(mut self, value: impl Into<String>) -> Self {
9735 self.valid_from_date = Some(value.into());
9736 self
9737 }
9738
9739 #[must_use]
9741 pub fn with_valid_to_date(mut self, value: impl Into<String>) -> Self {
9742 self.valid_to_date = Some(value.into());
9743 self
9744 }
9745
9746 #[must_use]
9748 pub fn with_evse_kind(mut self, value: EvseKind) -> Self {
9749 self.evse_kind = Some(value);
9750 self
9751 }
9752
9753 #[must_use]
9755 pub fn with_min_energy(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9756 self.min_energy = Some(value.into());
9757 self
9758 }
9759
9760 #[must_use]
9762 pub fn with_max_energy(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9763 self.max_energy = Some(value.into());
9764 self
9765 }
9766
9767 #[must_use]
9769 pub fn with_min_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9770 self.min_current = Some(value.into());
9771 self
9772 }
9773
9774 #[must_use]
9776 pub fn with_max_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9777 self.max_current = Some(value.into());
9778 self
9779 }
9780
9781 #[must_use]
9783 pub fn with_min_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9784 self.min_power = Some(value.into());
9785 self
9786 }
9787
9788 #[must_use]
9790 pub fn with_max_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9791 self.max_power = Some(value.into());
9792 self
9793 }
9794
9795 #[must_use]
9797 pub fn with_min_time(mut self, value: i32) -> Self {
9798 self.min_time = Some(value);
9799 self
9800 }
9801
9802 #[must_use]
9804 pub fn with_max_time(mut self, value: i32) -> Self {
9805 self.max_time = Some(value);
9806 self
9807 }
9808
9809 #[must_use]
9811 pub fn with_min_charging_time(mut self, value: i32) -> Self {
9812 self.min_charging_time = Some(value);
9813 self
9814 }
9815
9816 #[must_use]
9818 pub fn with_max_charging_time(mut self, value: i32) -> Self {
9819 self.max_charging_time = Some(value);
9820 self
9821 }
9822
9823 #[must_use]
9825 pub fn with_min_idle_time(mut self, value: i32) -> Self {
9826 self.min_idle_time = Some(value);
9827 self
9828 }
9829
9830 #[must_use]
9832 pub fn with_max_idle_time(mut self, value: i32) -> Self {
9833 self.max_idle_time = Some(value);
9834 self
9835 }
9836
9837 #[must_use]
9839 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9840 self.custom_data = Some(value);
9841 self
9842 }
9843}
9844
9845impl Validate for TariffConditions {
9846 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9847 path.push_key("dayOfWeek");
9848 if let Some(value) = &self.day_of_week {
9849 validate::list_len(value.len(), Some(1), Some(7), path, out);
9850 for (index, item) in value.iter().enumerate() {
9851 path.push_index(index);
9852 Validate::validate_at(item, path, out);
9853 path.pop();
9854 }
9855 }
9856 path.pop();
9857 path.push_key("evseKind");
9858 if let Some(value) = &self.evse_kind {
9859 Validate::validate_at(value, path, out);
9860 }
9861 path.pop();
9862 path.push_key("customData");
9863 if let Some(value) = &self.custom_data {
9864 Validate::validate_at(value, path, out);
9865 }
9866 path.pop();
9867 }
9868}
9869
9870#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
9879pub struct TariffConditionsFixed {
9880 #[serde(rename = "startTimeOfDay")]
9885 #[serde(default, skip_serializing_if = "Option::is_none")]
9886 pub start_time_of_day: Option<String>,
9887 #[serde(rename = "endTimeOfDay")]
9891 #[serde(default, skip_serializing_if = "Option::is_none")]
9892 pub end_time_of_day: Option<String>,
9893 #[serde(rename = "dayOfWeek")]
9895 #[serde(default, skip_serializing_if = "Option::is_none")]
9896 pub day_of_week: Option<Vec<DayOfWeek>>,
9897 #[serde(rename = "validFromDate")]
9903 #[serde(default, skip_serializing_if = "Option::is_none")]
9904 pub valid_from_date: Option<String>,
9905 #[serde(rename = "validToDate")]
9908 #[serde(default, skip_serializing_if = "Option::is_none")]
9909 pub valid_to_date: Option<String>,
9910 #[serde(rename = "evseKind")]
9912 #[serde(default, skip_serializing_if = "Option::is_none")]
9913 pub evse_kind: Option<EvseKind>,
9914 #[serde(rename = "paymentBrand")]
9917 #[serde(default, skip_serializing_if = "Option::is_none")]
9918 pub payment_brand: Option<String>,
9919 #[serde(rename = "paymentRecognition")]
9922 #[serde(default, skip_serializing_if = "Option::is_none")]
9923 pub payment_recognition: Option<String>,
9924 #[serde(rename = "customData")]
9926 #[serde(default, skip_serializing_if = "Option::is_none")]
9927 pub custom_data: Option<crate::types::CustomData>,
9928}
9929
9930impl TariffConditionsFixed {
9931 #[must_use]
9933 pub fn new() -> Self {
9934 Self::default()
9935 }
9936
9937 #[must_use]
9939 pub fn with_start_time_of_day(mut self, value: impl Into<String>) -> Self {
9940 self.start_time_of_day = Some(value.into());
9941 self
9942 }
9943
9944 #[must_use]
9946 pub fn with_end_time_of_day(mut self, value: impl Into<String>) -> Self {
9947 self.end_time_of_day = Some(value.into());
9948 self
9949 }
9950
9951 #[must_use]
9953 pub fn with_day_of_week(mut self, value: Vec<DayOfWeek>) -> Self {
9954 self.day_of_week = Some(value);
9955 self
9956 }
9957
9958 #[must_use]
9960 pub fn with_valid_from_date(mut self, value: impl Into<String>) -> Self {
9961 self.valid_from_date = Some(value.into());
9962 self
9963 }
9964
9965 #[must_use]
9967 pub fn with_valid_to_date(mut self, value: impl Into<String>) -> Self {
9968 self.valid_to_date = Some(value.into());
9969 self
9970 }
9971
9972 #[must_use]
9974 pub fn with_evse_kind(mut self, value: EvseKind) -> Self {
9975 self.evse_kind = Some(value);
9976 self
9977 }
9978
9979 #[must_use]
9981 pub fn with_payment_brand(mut self, value: impl Into<String>) -> Self {
9982 self.payment_brand = Some(value.into());
9983 self
9984 }
9985
9986 #[must_use]
9988 pub fn with_payment_recognition(mut self, value: impl Into<String>) -> Self {
9989 self.payment_recognition = Some(value.into());
9990 self
9991 }
9992
9993 #[must_use]
9995 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9996 self.custom_data = Some(value);
9997 self
9998 }
9999}
10000
10001impl Validate for TariffConditionsFixed {
10002 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10003 path.push_key("dayOfWeek");
10004 if let Some(value) = &self.day_of_week {
10005 validate::list_len(value.len(), Some(1), Some(7), path, out);
10006 for (index, item) in value.iter().enumerate() {
10007 path.push_index(index);
10008 Validate::validate_at(item, path, out);
10009 path.pop();
10010 }
10011 }
10012 path.pop();
10013 path.push_key("evseKind");
10014 if let Some(value) = &self.evse_kind {
10015 Validate::validate_at(value, path, out);
10016 }
10017 path.pop();
10018 path.push_key("paymentBrand");
10019 if let Some(value) = &self.payment_brand {
10020 validate::string(value.as_str(), None, Some(20), path, out);
10021 }
10022 path.pop();
10023 path.push_key("paymentRecognition");
10024 if let Some(value) = &self.payment_recognition {
10025 validate::string(value.as_str(), None, Some(20), path, out);
10026 }
10027 path.pop();
10028 path.push_key("customData");
10029 if let Some(value) = &self.custom_data {
10030 Validate::validate_at(value, path, out);
10031 }
10032 path.pop();
10033 }
10034}
10035
10036#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10040pub struct TariffEnergy {
10041 pub prices: Vec<TariffEnergyPrice>,
10043 #[serde(rename = "taxRates")]
10045 #[serde(default, skip_serializing_if = "Option::is_none")]
10046 pub tax_rates: Option<Vec<TaxRate>>,
10047 #[serde(rename = "customData")]
10049 #[serde(default, skip_serializing_if = "Option::is_none")]
10050 pub custom_data: Option<crate::types::CustomData>,
10051}
10052
10053impl TariffEnergy {
10054 #[must_use]
10056 pub fn new(prices: Vec<TariffEnergyPrice>) -> Self {
10057 Self {
10058 prices,
10059 tax_rates: None,
10060 custom_data: None,
10061 }
10062 }
10063
10064 #[must_use]
10066 pub fn with_tax_rates(mut self, value: Vec<TaxRate>) -> Self {
10067 self.tax_rates = Some(value);
10068 self
10069 }
10070
10071 #[must_use]
10073 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10074 self.custom_data = Some(value);
10075 self
10076 }
10077}
10078
10079impl Validate for TariffEnergy {
10080 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10081 path.push_key("prices");
10082 validate::list_len(self.prices.len(), Some(1), None, path, out);
10083 for (index, item) in self.prices.iter().enumerate() {
10084 path.push_index(index);
10085 Validate::validate_at(item, path, out);
10086 path.pop();
10087 }
10088 path.pop();
10089 path.push_key("taxRates");
10090 if let Some(value) = &self.tax_rates {
10091 validate::list_len(value.len(), Some(1), Some(5), path, out);
10092 for (index, item) in value.iter().enumerate() {
10093 path.push_index(index);
10094 Validate::validate_at(item, path, out);
10095 path.pop();
10096 }
10097 }
10098 path.pop();
10099 path.push_key("customData");
10100 if let Some(value) = &self.custom_data {
10101 Validate::validate_at(value, path, out);
10102 }
10103 path.pop();
10104 }
10105}
10106
10107#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10111pub struct TariffEnergyPrice {
10112 #[serde(rename = "priceKwh")]
10114 pub price_kwh: crate::types::Decimal,
10115 #[serde(default, skip_serializing_if = "Option::is_none")]
10117 pub conditions: Option<TariffConditions>,
10118 #[serde(rename = "customData")]
10120 #[serde(default, skip_serializing_if = "Option::is_none")]
10121 pub custom_data: Option<crate::types::CustomData>,
10122}
10123
10124impl TariffEnergyPrice {
10125 #[must_use]
10127 pub fn new(price_kwh: impl Into<crate::types::Decimal>) -> Self {
10128 Self {
10129 price_kwh: price_kwh.into(),
10130 conditions: None,
10131 custom_data: None,
10132 }
10133 }
10134
10135 #[must_use]
10137 pub fn with_conditions(mut self, value: TariffConditions) -> Self {
10138 self.conditions = Some(value);
10139 self
10140 }
10141
10142 #[must_use]
10144 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10145 self.custom_data = Some(value);
10146 self
10147 }
10148}
10149
10150impl Validate for TariffEnergyPrice {
10151 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10152 path.push_key("conditions");
10153 if let Some(value) = &self.conditions {
10154 Validate::validate_at(value, path, out);
10155 }
10156 path.pop();
10157 path.push_key("customData");
10158 if let Some(value) = &self.custom_data {
10159 Validate::validate_at(value, path, out);
10160 }
10161 path.pop();
10162 }
10163}
10164
10165#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10167pub struct TariffFixed {
10168 pub prices: Vec<TariffFixedPrice>,
10170 #[serde(rename = "taxRates")]
10172 #[serde(default, skip_serializing_if = "Option::is_none")]
10173 pub tax_rates: Option<Vec<TaxRate>>,
10174 #[serde(rename = "customData")]
10176 #[serde(default, skip_serializing_if = "Option::is_none")]
10177 pub custom_data: Option<crate::types::CustomData>,
10178}
10179
10180impl TariffFixed {
10181 #[must_use]
10183 pub fn new(prices: Vec<TariffFixedPrice>) -> Self {
10184 Self {
10185 prices,
10186 tax_rates: None,
10187 custom_data: None,
10188 }
10189 }
10190
10191 #[must_use]
10193 pub fn with_tax_rates(mut self, value: Vec<TaxRate>) -> Self {
10194 self.tax_rates = Some(value);
10195 self
10196 }
10197
10198 #[must_use]
10200 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10201 self.custom_data = Some(value);
10202 self
10203 }
10204}
10205
10206impl Validate for TariffFixed {
10207 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10208 path.push_key("prices");
10209 validate::list_len(self.prices.len(), Some(1), None, path, out);
10210 for (index, item) in self.prices.iter().enumerate() {
10211 path.push_index(index);
10212 Validate::validate_at(item, path, out);
10213 path.pop();
10214 }
10215 path.pop();
10216 path.push_key("taxRates");
10217 if let Some(value) = &self.tax_rates {
10218 validate::list_len(value.len(), Some(1), Some(5), path, out);
10219 for (index, item) in value.iter().enumerate() {
10220 path.push_index(index);
10221 Validate::validate_at(item, path, out);
10222 path.pop();
10223 }
10224 }
10225 path.pop();
10226 path.push_key("customData");
10227 if let Some(value) = &self.custom_data {
10228 Validate::validate_at(value, path, out);
10229 }
10230 path.pop();
10231 }
10232}
10233
10234#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10238pub struct TariffFixedPrice {
10239 #[serde(rename = "priceFixed")]
10241 pub price_fixed: crate::types::Decimal,
10242 #[serde(default, skip_serializing_if = "Option::is_none")]
10244 pub conditions: Option<TariffConditionsFixed>,
10245 #[serde(rename = "customData")]
10247 #[serde(default, skip_serializing_if = "Option::is_none")]
10248 pub custom_data: Option<crate::types::CustomData>,
10249}
10250
10251impl TariffFixedPrice {
10252 #[must_use]
10254 pub fn new(price_fixed: impl Into<crate::types::Decimal>) -> Self {
10255 Self {
10256 price_fixed: price_fixed.into(),
10257 conditions: None,
10258 custom_data: None,
10259 }
10260 }
10261
10262 #[must_use]
10264 pub fn with_conditions(mut self, value: TariffConditionsFixed) -> Self {
10265 self.conditions = Some(value);
10266 self
10267 }
10268
10269 #[must_use]
10271 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10272 self.custom_data = Some(value);
10273 self
10274 }
10275}
10276
10277impl Validate for TariffFixedPrice {
10278 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10279 path.push_key("conditions");
10280 if let Some(value) = &self.conditions {
10281 Validate::validate_at(value, path, out);
10282 }
10283 path.pop();
10284 path.push_key("customData");
10285 if let Some(value) = &self.custom_data {
10286 Validate::validate_at(value, path, out);
10287 }
10288 path.pop();
10289 }
10290}
10291
10292#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10296pub struct TariffTime {
10297 pub prices: Vec<TariffTimePrice>,
10299 #[serde(rename = "taxRates")]
10301 #[serde(default, skip_serializing_if = "Option::is_none")]
10302 pub tax_rates: Option<Vec<TaxRate>>,
10303 #[serde(rename = "customData")]
10305 #[serde(default, skip_serializing_if = "Option::is_none")]
10306 pub custom_data: Option<crate::types::CustomData>,
10307}
10308
10309impl TariffTime {
10310 #[must_use]
10312 pub fn new(prices: Vec<TariffTimePrice>) -> Self {
10313 Self {
10314 prices,
10315 tax_rates: None,
10316 custom_data: None,
10317 }
10318 }
10319
10320 #[must_use]
10322 pub fn with_tax_rates(mut self, value: Vec<TaxRate>) -> Self {
10323 self.tax_rates = Some(value);
10324 self
10325 }
10326
10327 #[must_use]
10329 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10330 self.custom_data = Some(value);
10331 self
10332 }
10333}
10334
10335impl Validate for TariffTime {
10336 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10337 path.push_key("prices");
10338 validate::list_len(self.prices.len(), Some(1), None, path, out);
10339 for (index, item) in self.prices.iter().enumerate() {
10340 path.push_index(index);
10341 Validate::validate_at(item, path, out);
10342 path.pop();
10343 }
10344 path.pop();
10345 path.push_key("taxRates");
10346 if let Some(value) = &self.tax_rates {
10347 validate::list_len(value.len(), Some(1), Some(5), path, out);
10348 for (index, item) in value.iter().enumerate() {
10349 path.push_index(index);
10350 Validate::validate_at(item, path, out);
10351 path.pop();
10352 }
10353 }
10354 path.pop();
10355 path.push_key("customData");
10356 if let Some(value) = &self.custom_data {
10357 Validate::validate_at(value, path, out);
10358 }
10359 path.pop();
10360 }
10361}
10362
10363#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10367pub struct TariffTimePrice {
10368 #[serde(rename = "priceMinute")]
10370 pub price_minute: crate::types::Decimal,
10371 #[serde(default, skip_serializing_if = "Option::is_none")]
10373 pub conditions: Option<TariffConditions>,
10374 #[serde(rename = "customData")]
10376 #[serde(default, skip_serializing_if = "Option::is_none")]
10377 pub custom_data: Option<crate::types::CustomData>,
10378}
10379
10380impl TariffTimePrice {
10381 #[must_use]
10383 pub fn new(price_minute: impl Into<crate::types::Decimal>) -> Self {
10384 Self {
10385 price_minute: price_minute.into(),
10386 conditions: None,
10387 custom_data: None,
10388 }
10389 }
10390
10391 #[must_use]
10393 pub fn with_conditions(mut self, value: TariffConditions) -> Self {
10394 self.conditions = Some(value);
10395 self
10396 }
10397
10398 #[must_use]
10400 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10401 self.custom_data = Some(value);
10402 self
10403 }
10404}
10405
10406impl Validate for TariffTimePrice {
10407 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10408 path.push_key("conditions");
10409 if let Some(value) = &self.conditions {
10410 Validate::validate_at(value, path, out);
10411 }
10412 path.pop();
10413 path.push_key("customData");
10414 if let Some(value) = &self.custom_data {
10415 Validate::validate_at(value, path, out);
10416 }
10417 path.pop();
10418 }
10419}
10420
10421#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10425pub struct TaxRate {
10426 pub r#type: String,
10428 pub tax: crate::types::Decimal,
10430 #[serde(default, skip_serializing_if = "Option::is_none")]
10435 #[serde(deserialize_with = "crate::types::integer::option")]
10436 pub stack: Option<i32>,
10437 #[serde(rename = "customData")]
10439 #[serde(default, skip_serializing_if = "Option::is_none")]
10440 pub custom_data: Option<crate::types::CustomData>,
10441}
10442
10443impl TaxRate {
10444 #[must_use]
10446 pub fn new(r#type: impl Into<String>, tax: impl Into<crate::types::Decimal>) -> Self {
10447 Self {
10448 r#type: r#type.into(),
10449 tax: tax.into(),
10450 stack: None,
10451 custom_data: None,
10452 }
10453 }
10454
10455 #[must_use]
10457 pub fn with_stack(mut self, value: i32) -> Self {
10458 self.stack = Some(value);
10459 self
10460 }
10461
10462 #[must_use]
10464 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10465 self.custom_data = Some(value);
10466 self
10467 }
10468}
10469
10470impl Validate for TaxRate {
10471 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10472 path.push_key("type");
10473 validate::string(self.r#type.as_str(), None, Some(20), path, out);
10474 path.pop();
10475 path.push_key("stack");
10476 if let Some(value) = &self.stack {
10477 validate::int_range(i64::from(*value), Some(0), None, path, out);
10478 }
10479 path.pop();
10480 path.push_key("customData");
10481 if let Some(value) = &self.custom_data {
10482 Validate::validate_at(value, path, out);
10483 }
10484 path.pop();
10485 }
10486}
10487
10488#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10492pub struct TaxRule {
10493 #[serde(rename = "taxRuleID")]
10495 #[serde(deserialize_with = "crate::types::integer::one")]
10496 pub tax_rule_id: i32,
10497 #[serde(rename = "appliesToEnergyFee")]
10499 pub applies_to_energy_fee: bool,
10500 #[serde(rename = "appliesToParkingFee")]
10502 pub applies_to_parking_fee: bool,
10503 #[serde(rename = "appliesToOverstayFee")]
10505 pub applies_to_overstay_fee: bool,
10506 #[serde(rename = "appliesToMinimumMaximumCost")]
10508 pub applies_to_minimum_maximum_cost: bool,
10509 #[serde(rename = "taxRate")]
10511 pub tax_rate: RationalNumber,
10512 #[serde(rename = "taxRuleName")]
10514 #[serde(default, skip_serializing_if = "Option::is_none")]
10515 pub tax_rule_name: Option<String>,
10516 #[serde(rename = "taxIncludedInPrice")]
10518 #[serde(default, skip_serializing_if = "Option::is_none")]
10519 pub tax_included_in_price: Option<bool>,
10520 #[serde(rename = "customData")]
10522 #[serde(default, skip_serializing_if = "Option::is_none")]
10523 pub custom_data: Option<crate::types::CustomData>,
10524}
10525
10526impl TaxRule {
10527 #[must_use]
10529 pub fn new(
10530 tax_rule_id: i32,
10531 applies_to_energy_fee: bool,
10532 applies_to_parking_fee: bool,
10533 applies_to_overstay_fee: bool,
10534 applies_to_minimum_maximum_cost: bool,
10535 tax_rate: RationalNumber,
10536 ) -> Self {
10537 Self {
10538 tax_rule_id,
10539 applies_to_energy_fee,
10540 applies_to_parking_fee,
10541 applies_to_overstay_fee,
10542 applies_to_minimum_maximum_cost,
10543 tax_rate,
10544 tax_rule_name: None,
10545 tax_included_in_price: None,
10546 custom_data: None,
10547 }
10548 }
10549
10550 #[must_use]
10552 pub fn with_tax_rule_name(mut self, value: impl Into<String>) -> Self {
10553 self.tax_rule_name = Some(value.into());
10554 self
10555 }
10556
10557 #[must_use]
10559 pub fn with_tax_included_in_price(mut self, value: bool) -> Self {
10560 self.tax_included_in_price = Some(value);
10561 self
10562 }
10563
10564 #[must_use]
10566 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10567 self.custom_data = Some(value);
10568 self
10569 }
10570}
10571
10572impl Validate for TaxRule {
10573 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10574 path.push_key("taxRuleID");
10575 validate::int_range(i64::from(self.tax_rule_id), Some(0), None, path, out);
10576 path.pop();
10577 path.push_key("taxRate");
10578 Validate::validate_at(&self.tax_rate, path, out);
10579 path.pop();
10580 path.push_key("taxRuleName");
10581 if let Some(value) = &self.tax_rule_name {
10582 validate::string(value.as_str(), None, Some(100), path, out);
10583 }
10584 path.pop();
10585 path.push_key("customData");
10586 if let Some(value) = &self.custom_data {
10587 Validate::validate_at(value, path, out);
10588 }
10589 path.pop();
10590 }
10591}
10592
10593#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10597pub struct TotalCost {
10598 pub currency: String,
10600 #[serde(rename = "typeOfCost")]
10602 pub type_of_cost: TariffCost,
10603 pub total: TotalPrice,
10605 #[serde(default, skip_serializing_if = "Option::is_none")]
10607 pub fixed: Option<Price>,
10608 #[serde(default, skip_serializing_if = "Option::is_none")]
10610 pub energy: Option<Price>,
10611 #[serde(rename = "chargingTime")]
10613 #[serde(default, skip_serializing_if = "Option::is_none")]
10614 pub charging_time: Option<Price>,
10615 #[serde(rename = "idleTime")]
10617 #[serde(default, skip_serializing_if = "Option::is_none")]
10618 pub idle_time: Option<Price>,
10619 #[serde(rename = "reservationTime")]
10621 #[serde(default, skip_serializing_if = "Option::is_none")]
10622 pub reservation_time: Option<Price>,
10623 #[serde(rename = "reservationFixed")]
10625 #[serde(default, skip_serializing_if = "Option::is_none")]
10626 pub reservation_fixed: Option<Price>,
10627 #[serde(rename = "customData")]
10629 #[serde(default, skip_serializing_if = "Option::is_none")]
10630 pub custom_data: Option<crate::types::CustomData>,
10631}
10632
10633impl TotalCost {
10634 #[must_use]
10636 pub fn new(currency: impl Into<String>, type_of_cost: TariffCost, total: TotalPrice) -> Self {
10637 Self {
10638 currency: currency.into(),
10639 type_of_cost,
10640 total,
10641 fixed: None,
10642 energy: None,
10643 charging_time: None,
10644 idle_time: None,
10645 reservation_time: None,
10646 reservation_fixed: None,
10647 custom_data: None,
10648 }
10649 }
10650
10651 #[must_use]
10653 pub fn with_fixed(mut self, value: Price) -> Self {
10654 self.fixed = Some(value);
10655 self
10656 }
10657
10658 #[must_use]
10660 pub fn with_energy(mut self, value: Price) -> Self {
10661 self.energy = Some(value);
10662 self
10663 }
10664
10665 #[must_use]
10667 pub fn with_charging_time(mut self, value: Price) -> Self {
10668 self.charging_time = Some(value);
10669 self
10670 }
10671
10672 #[must_use]
10674 pub fn with_idle_time(mut self, value: Price) -> Self {
10675 self.idle_time = Some(value);
10676 self
10677 }
10678
10679 #[must_use]
10681 pub fn with_reservation_time(mut self, value: Price) -> Self {
10682 self.reservation_time = Some(value);
10683 self
10684 }
10685
10686 #[must_use]
10688 pub fn with_reservation_fixed(mut self, value: Price) -> Self {
10689 self.reservation_fixed = Some(value);
10690 self
10691 }
10692
10693 #[must_use]
10695 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10696 self.custom_data = Some(value);
10697 self
10698 }
10699}
10700
10701impl Validate for TotalCost {
10702 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10703 path.push_key("currency");
10704 validate::string(self.currency.as_str(), None, Some(3), path, out);
10705 path.pop();
10706 path.push_key("typeOfCost");
10707 Validate::validate_at(&self.type_of_cost, path, out);
10708 path.pop();
10709 path.push_key("total");
10710 Validate::validate_at(&self.total, path, out);
10711 path.pop();
10712 path.push_key("fixed");
10713 if let Some(value) = &self.fixed {
10714 Validate::validate_at(value, path, out);
10715 }
10716 path.pop();
10717 path.push_key("energy");
10718 if let Some(value) = &self.energy {
10719 Validate::validate_at(value, path, out);
10720 }
10721 path.pop();
10722 path.push_key("chargingTime");
10723 if let Some(value) = &self.charging_time {
10724 Validate::validate_at(value, path, out);
10725 }
10726 path.pop();
10727 path.push_key("idleTime");
10728 if let Some(value) = &self.idle_time {
10729 Validate::validate_at(value, path, out);
10730 }
10731 path.pop();
10732 path.push_key("reservationTime");
10733 if let Some(value) = &self.reservation_time {
10734 Validate::validate_at(value, path, out);
10735 }
10736 path.pop();
10737 path.push_key("reservationFixed");
10738 if let Some(value) = &self.reservation_fixed {
10739 Validate::validate_at(value, path, out);
10740 }
10741 path.pop();
10742 path.push_key("customData");
10743 if let Some(value) = &self.custom_data {
10744 Validate::validate_at(value, path, out);
10745 }
10746 path.pop();
10747 }
10748}
10749
10750#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
10754pub struct TotalPrice {
10755 #[serde(rename = "exclTax")]
10757 #[serde(default, skip_serializing_if = "Option::is_none")]
10758 pub excl_tax: Option<crate::types::Decimal>,
10759 #[serde(rename = "inclTax")]
10761 #[serde(default, skip_serializing_if = "Option::is_none")]
10762 pub incl_tax: Option<crate::types::Decimal>,
10763 #[serde(rename = "customData")]
10765 #[serde(default, skip_serializing_if = "Option::is_none")]
10766 pub custom_data: Option<crate::types::CustomData>,
10767}
10768
10769impl TotalPrice {
10770 #[must_use]
10772 pub fn new() -> Self {
10773 Self::default()
10774 }
10775
10776 #[must_use]
10778 pub fn with_excl_tax(mut self, value: impl Into<crate::types::Decimal>) -> Self {
10779 self.excl_tax = Some(value.into());
10780 self
10781 }
10782
10783 #[must_use]
10785 pub fn with_incl_tax(mut self, value: impl Into<crate::types::Decimal>) -> Self {
10786 self.incl_tax = Some(value.into());
10787 self
10788 }
10789
10790 #[must_use]
10792 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10793 self.custom_data = Some(value);
10794 self
10795 }
10796}
10797
10798impl Validate for TotalPrice {
10799 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10800 path.push_key("customData");
10801 if let Some(value) = &self.custom_data {
10802 Validate::validate_at(value, path, out);
10803 }
10804 path.pop();
10805 }
10806}
10807
10808#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10812pub struct TotalUsage {
10813 pub energy: crate::types::Decimal,
10815 #[serde(rename = "chargingTime")]
10817 #[serde(deserialize_with = "crate::types::integer::one")]
10818 pub charging_time: i32,
10819 #[serde(rename = "idleTime")]
10821 #[serde(deserialize_with = "crate::types::integer::one")]
10822 pub idle_time: i32,
10823 #[serde(rename = "reservationTime")]
10825 #[serde(default, skip_serializing_if = "Option::is_none")]
10826 #[serde(deserialize_with = "crate::types::integer::option")]
10827 pub reservation_time: Option<i32>,
10828 #[serde(rename = "customData")]
10830 #[serde(default, skip_serializing_if = "Option::is_none")]
10831 pub custom_data: Option<crate::types::CustomData>,
10832}
10833
10834impl TotalUsage {
10835 #[must_use]
10837 pub fn new(
10838 energy: impl Into<crate::types::Decimal>,
10839 charging_time: i32,
10840 idle_time: i32,
10841 ) -> Self {
10842 Self {
10843 energy: energy.into(),
10844 charging_time,
10845 idle_time,
10846 reservation_time: None,
10847 custom_data: None,
10848 }
10849 }
10850
10851 #[must_use]
10853 pub fn with_reservation_time(mut self, value: i32) -> Self {
10854 self.reservation_time = Some(value);
10855 self
10856 }
10857
10858 #[must_use]
10860 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10861 self.custom_data = Some(value);
10862 self
10863 }
10864}
10865
10866impl Validate for TotalUsage {
10867 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10868 path.push_key("customData");
10869 if let Some(value) = &self.custom_data {
10870 Validate::validate_at(value, path, out);
10871 }
10872 path.pop();
10873 }
10874}
10875
10876#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10878pub struct Transaction {
10879 #[serde(rename = "transactionId")]
10881 pub transaction_id: String,
10882 #[serde(rename = "chargingState")]
10884 #[serde(default, skip_serializing_if = "Option::is_none")]
10885 pub charging_state: Option<ChargingState>,
10886 #[serde(rename = "timeSpentCharging")]
10888 #[serde(default, skip_serializing_if = "Option::is_none")]
10889 #[serde(deserialize_with = "crate::types::integer::option")]
10890 pub time_spent_charging: Option<i32>,
10891 #[serde(rename = "stoppedReason")]
10893 #[serde(default, skip_serializing_if = "Option::is_none")]
10894 pub stopped_reason: Option<Reason>,
10895 #[serde(rename = "remoteStartId")]
10897 #[serde(default, skip_serializing_if = "Option::is_none")]
10898 #[serde(deserialize_with = "crate::types::integer::option")]
10899 pub remote_start_id: Option<i32>,
10900 #[serde(rename = "operationMode")]
10902 #[serde(default, skip_serializing_if = "Option::is_none")]
10903 pub operation_mode: Option<OperationMode>,
10904 #[serde(rename = "tariffId")]
10906 #[serde(default, skip_serializing_if = "Option::is_none")]
10907 pub tariff_id: Option<String>,
10908 #[serde(rename = "transactionLimit")]
10910 #[serde(default, skip_serializing_if = "Option::is_none")]
10911 pub transaction_limit: Option<TransactionLimit>,
10912 #[serde(rename = "customData")]
10914 #[serde(default, skip_serializing_if = "Option::is_none")]
10915 pub custom_data: Option<crate::types::CustomData>,
10916}
10917
10918impl Transaction {
10919 #[must_use]
10921 pub fn new(transaction_id: impl Into<String>) -> Self {
10922 Self {
10923 transaction_id: transaction_id.into(),
10924 charging_state: None,
10925 time_spent_charging: None,
10926 stopped_reason: None,
10927 remote_start_id: None,
10928 operation_mode: None,
10929 tariff_id: None,
10930 transaction_limit: None,
10931 custom_data: None,
10932 }
10933 }
10934
10935 #[must_use]
10937 pub fn with_charging_state(mut self, value: ChargingState) -> Self {
10938 self.charging_state = Some(value);
10939 self
10940 }
10941
10942 #[must_use]
10944 pub fn with_time_spent_charging(mut self, value: i32) -> Self {
10945 self.time_spent_charging = Some(value);
10946 self
10947 }
10948
10949 #[must_use]
10951 pub fn with_stopped_reason(mut self, value: Reason) -> Self {
10952 self.stopped_reason = Some(value);
10953 self
10954 }
10955
10956 #[must_use]
10958 pub fn with_remote_start_id(mut self, value: i32) -> Self {
10959 self.remote_start_id = Some(value);
10960 self
10961 }
10962
10963 #[must_use]
10965 pub fn with_operation_mode(mut self, value: OperationMode) -> Self {
10966 self.operation_mode = Some(value);
10967 self
10968 }
10969
10970 #[must_use]
10972 pub fn with_tariff_id(mut self, value: impl Into<String>) -> Self {
10973 self.tariff_id = Some(value.into());
10974 self
10975 }
10976
10977 #[must_use]
10979 pub fn with_transaction_limit(mut self, value: TransactionLimit) -> Self {
10980 self.transaction_limit = Some(value);
10981 self
10982 }
10983
10984 #[must_use]
10986 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10987 self.custom_data = Some(value);
10988 self
10989 }
10990}
10991
10992impl Validate for Transaction {
10993 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10994 path.push_key("transactionId");
10995 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
10996 path.pop();
10997 path.push_key("chargingState");
10998 if let Some(value) = &self.charging_state {
10999 Validate::validate_at(value, path, out);
11000 }
11001 path.pop();
11002 path.push_key("stoppedReason");
11003 if let Some(value) = &self.stopped_reason {
11004 Validate::validate_at(value, path, out);
11005 }
11006 path.pop();
11007 path.push_key("operationMode");
11008 if let Some(value) = &self.operation_mode {
11009 Validate::validate_at(value, path, out);
11010 }
11011 path.pop();
11012 path.push_key("tariffId");
11013 if let Some(value) = &self.tariff_id {
11014 validate::string(value.as_str(), None, Some(60), path, out);
11015 }
11016 path.pop();
11017 path.push_key("transactionLimit");
11018 if let Some(value) = &self.transaction_limit {
11019 Validate::validate_at(value, path, out);
11020 }
11021 path.pop();
11022 path.push_key("customData");
11023 if let Some(value) = &self.custom_data {
11024 Validate::validate_at(value, path, out);
11025 }
11026 path.pop();
11027 }
11028}
11029
11030#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
11034pub struct TransactionLimit {
11035 #[serde(rename = "maxCost")]
11037 #[serde(default, skip_serializing_if = "Option::is_none")]
11038 pub max_cost: Option<crate::types::Decimal>,
11039 #[serde(rename = "maxEnergy")]
11041 #[serde(default, skip_serializing_if = "Option::is_none")]
11042 pub max_energy: Option<crate::types::Decimal>,
11043 #[serde(rename = "maxTime")]
11045 #[serde(default, skip_serializing_if = "Option::is_none")]
11046 #[serde(deserialize_with = "crate::types::integer::option")]
11047 pub max_time: Option<i32>,
11048 #[serde(rename = "maxSoC")]
11050 #[serde(default, skip_serializing_if = "Option::is_none")]
11051 #[serde(deserialize_with = "crate::types::integer::option")]
11052 pub max_so_c: Option<i32>,
11053 #[serde(rename = "customData")]
11055 #[serde(default, skip_serializing_if = "Option::is_none")]
11056 pub custom_data: Option<crate::types::CustomData>,
11057}
11058
11059impl TransactionLimit {
11060 #[must_use]
11062 pub fn new() -> Self {
11063 Self::default()
11064 }
11065
11066 #[must_use]
11068 pub fn with_max_cost(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11069 self.max_cost = Some(value.into());
11070 self
11071 }
11072
11073 #[must_use]
11075 pub fn with_max_energy(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11076 self.max_energy = Some(value.into());
11077 self
11078 }
11079
11080 #[must_use]
11082 pub fn with_max_time(mut self, value: i32) -> Self {
11083 self.max_time = Some(value);
11084 self
11085 }
11086
11087 #[must_use]
11089 pub fn with_max_so_c(mut self, value: i32) -> Self {
11090 self.max_so_c = Some(value);
11091 self
11092 }
11093
11094 #[must_use]
11096 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11097 self.custom_data = Some(value);
11098 self
11099 }
11100}
11101
11102impl Validate for TransactionLimit {
11103 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11104 path.push_key("maxSoC");
11105 if let Some(value) = &self.max_so_c {
11106 validate::int_range(i64::from(*value), Some(0), Some(100), path, out);
11107 }
11108 path.pop();
11109 path.push_key("customData");
11110 if let Some(value) = &self.custom_data {
11111 Validate::validate_at(value, path, out);
11112 }
11113 path.pop();
11114 }
11115}
11116
11117#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
11121pub struct UnitOfMeasure {
11122 #[serde(default, skip_serializing_if = "Option::is_none")]
11127 pub unit: Option<String>,
11128 #[serde(default, skip_serializing_if = "Option::is_none")]
11132 #[serde(deserialize_with = "crate::types::integer::option")]
11133 pub multiplier: Option<i32>,
11134 #[serde(rename = "customData")]
11136 #[serde(default, skip_serializing_if = "Option::is_none")]
11137 pub custom_data: Option<crate::types::CustomData>,
11138}
11139
11140impl UnitOfMeasure {
11141 #[must_use]
11143 pub fn new() -> Self {
11144 Self::default()
11145 }
11146
11147 #[must_use]
11149 pub fn with_unit(mut self, value: impl Into<String>) -> Self {
11150 self.unit = Some(value.into());
11151 self
11152 }
11153
11154 #[must_use]
11156 pub fn with_multiplier(mut self, value: i32) -> Self {
11157 self.multiplier = Some(value);
11158 self
11159 }
11160
11161 #[must_use]
11163 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11164 self.custom_data = Some(value);
11165 self
11166 }
11167}
11168
11169impl Validate for UnitOfMeasure {
11170 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11171 path.push_key("unit");
11172 if let Some(value) = &self.unit {
11173 validate::string(value.as_str(), None, Some(20), path, out);
11174 }
11175 path.pop();
11176 path.push_key("customData");
11177 if let Some(value) = &self.custom_data {
11178 Validate::validate_at(value, path, out);
11179 }
11180 path.pop();
11181 }
11182}
11183
11184#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
11189pub struct V2XChargingParameters {
11190 #[serde(rename = "minChargePower")]
11195 #[serde(default, skip_serializing_if = "Option::is_none")]
11196 pub min_charge_power: Option<crate::types::Decimal>,
11197 #[serde(rename = "minChargePower_L2")]
11201 #[serde(default, skip_serializing_if = "Option::is_none")]
11202 pub min_charge_power_l2: Option<crate::types::Decimal>,
11203 #[serde(rename = "minChargePower_L3")]
11207 #[serde(default, skip_serializing_if = "Option::is_none")]
11208 pub min_charge_power_l3: Option<crate::types::Decimal>,
11209 #[serde(rename = "maxChargePower")]
11217 #[serde(default, skip_serializing_if = "Option::is_none")]
11218 pub max_charge_power: Option<crate::types::Decimal>,
11219 #[serde(rename = "maxChargePower_L2")]
11223 #[serde(default, skip_serializing_if = "Option::is_none")]
11224 pub max_charge_power_l2: Option<crate::types::Decimal>,
11225 #[serde(rename = "maxChargePower_L3")]
11229 #[serde(default, skip_serializing_if = "Option::is_none")]
11230 pub max_charge_power_l3: Option<crate::types::Decimal>,
11231 #[serde(rename = "minDischargePower")]
11239 #[serde(default, skip_serializing_if = "Option::is_none")]
11240 pub min_discharge_power: Option<crate::types::Decimal>,
11241 #[serde(rename = "minDischargePower_L2")]
11245 #[serde(default, skip_serializing_if = "Option::is_none")]
11246 pub min_discharge_power_l2: Option<crate::types::Decimal>,
11247 #[serde(rename = "minDischargePower_L3")]
11251 #[serde(default, skip_serializing_if = "Option::is_none")]
11252 pub min_discharge_power_l3: Option<crate::types::Decimal>,
11253 #[serde(rename = "maxDischargePower")]
11258 #[serde(default, skip_serializing_if = "Option::is_none")]
11259 pub max_discharge_power: Option<crate::types::Decimal>,
11260 #[serde(rename = "maxDischargePower_L2")]
11264 #[serde(default, skip_serializing_if = "Option::is_none")]
11265 pub max_discharge_power_l2: Option<crate::types::Decimal>,
11266 #[serde(rename = "maxDischargePower_L3")]
11270 #[serde(default, skip_serializing_if = "Option::is_none")]
11271 pub max_discharge_power_l3: Option<crate::types::Decimal>,
11272 #[serde(rename = "minChargeCurrent")]
11276 #[serde(default, skip_serializing_if = "Option::is_none")]
11277 pub min_charge_current: Option<crate::types::Decimal>,
11278 #[serde(rename = "maxChargeCurrent")]
11282 #[serde(default, skip_serializing_if = "Option::is_none")]
11283 pub max_charge_current: Option<crate::types::Decimal>,
11284 #[serde(rename = "minDischargeCurrent")]
11288 #[serde(default, skip_serializing_if = "Option::is_none")]
11289 pub min_discharge_current: Option<crate::types::Decimal>,
11290 #[serde(rename = "maxDischargeCurrent")]
11294 #[serde(default, skip_serializing_if = "Option::is_none")]
11295 pub max_discharge_current: Option<crate::types::Decimal>,
11296 #[serde(rename = "minVoltage")]
11300 #[serde(default, skip_serializing_if = "Option::is_none")]
11301 pub min_voltage: Option<crate::types::Decimal>,
11302 #[serde(rename = "maxVoltage")]
11306 #[serde(default, skip_serializing_if = "Option::is_none")]
11307 pub max_voltage: Option<crate::types::Decimal>,
11308 #[serde(rename = "evTargetEnergyRequest")]
11312 #[serde(default, skip_serializing_if = "Option::is_none")]
11313 pub ev_target_energy_request: Option<crate::types::Decimal>,
11314 #[serde(rename = "evMinEnergyRequest")]
11318 #[serde(default, skip_serializing_if = "Option::is_none")]
11319 pub ev_min_energy_request: Option<crate::types::Decimal>,
11320 #[serde(rename = "evMaxEnergyRequest")]
11324 #[serde(default, skip_serializing_if = "Option::is_none")]
11325 pub ev_max_energy_request: Option<crate::types::Decimal>,
11326 #[serde(rename = "evMinV2XEnergyRequest")]
11331 #[serde(default, skip_serializing_if = "Option::is_none")]
11332 pub ev_min_v2_x_energy_request: Option<crate::types::Decimal>,
11333 #[serde(rename = "evMaxV2XEnergyRequest")]
11338 #[serde(default, skip_serializing_if = "Option::is_none")]
11339 pub ev_max_v2_x_energy_request: Option<crate::types::Decimal>,
11340 #[serde(rename = "targetSoC")]
11344 #[serde(default, skip_serializing_if = "Option::is_none")]
11345 #[serde(deserialize_with = "crate::types::integer::option")]
11346 pub target_so_c: Option<i32>,
11347 #[serde(rename = "customData")]
11349 #[serde(default, skip_serializing_if = "Option::is_none")]
11350 pub custom_data: Option<crate::types::CustomData>,
11351}
11352
11353impl V2XChargingParameters {
11354 #[must_use]
11356 pub fn new() -> Self {
11357 Self::default()
11358 }
11359
11360 #[must_use]
11362 pub fn with_min_charge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11363 self.min_charge_power = Some(value.into());
11364 self
11365 }
11366
11367 #[must_use]
11369 pub fn with_min_charge_power_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11370 self.min_charge_power_l2 = Some(value.into());
11371 self
11372 }
11373
11374 #[must_use]
11376 pub fn with_min_charge_power_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11377 self.min_charge_power_l3 = Some(value.into());
11378 self
11379 }
11380
11381 #[must_use]
11383 pub fn with_max_charge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11384 self.max_charge_power = Some(value.into());
11385 self
11386 }
11387
11388 #[must_use]
11390 pub fn with_max_charge_power_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11391 self.max_charge_power_l2 = Some(value.into());
11392 self
11393 }
11394
11395 #[must_use]
11397 pub fn with_max_charge_power_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11398 self.max_charge_power_l3 = Some(value.into());
11399 self
11400 }
11401
11402 #[must_use]
11404 pub fn with_min_discharge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11405 self.min_discharge_power = Some(value.into());
11406 self
11407 }
11408
11409 #[must_use]
11411 pub fn with_min_discharge_power_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11412 self.min_discharge_power_l2 = Some(value.into());
11413 self
11414 }
11415
11416 #[must_use]
11418 pub fn with_min_discharge_power_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11419 self.min_discharge_power_l3 = Some(value.into());
11420 self
11421 }
11422
11423 #[must_use]
11425 pub fn with_max_discharge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11426 self.max_discharge_power = Some(value.into());
11427 self
11428 }
11429
11430 #[must_use]
11432 pub fn with_max_discharge_power_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11433 self.max_discharge_power_l2 = Some(value.into());
11434 self
11435 }
11436
11437 #[must_use]
11439 pub fn with_max_discharge_power_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11440 self.max_discharge_power_l3 = Some(value.into());
11441 self
11442 }
11443
11444 #[must_use]
11446 pub fn with_min_charge_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11447 self.min_charge_current = Some(value.into());
11448 self
11449 }
11450
11451 #[must_use]
11453 pub fn with_max_charge_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11454 self.max_charge_current = Some(value.into());
11455 self
11456 }
11457
11458 #[must_use]
11460 pub fn with_min_discharge_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11461 self.min_discharge_current = Some(value.into());
11462 self
11463 }
11464
11465 #[must_use]
11467 pub fn with_max_discharge_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11468 self.max_discharge_current = Some(value.into());
11469 self
11470 }
11471
11472 #[must_use]
11474 pub fn with_min_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11475 self.min_voltage = Some(value.into());
11476 self
11477 }
11478
11479 #[must_use]
11481 pub fn with_max_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11482 self.max_voltage = Some(value.into());
11483 self
11484 }
11485
11486 #[must_use]
11488 pub fn with_ev_target_energy_request(
11489 mut self,
11490 value: impl Into<crate::types::Decimal>,
11491 ) -> Self {
11492 self.ev_target_energy_request = Some(value.into());
11493 self
11494 }
11495
11496 #[must_use]
11498 pub fn with_ev_min_energy_request(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11499 self.ev_min_energy_request = Some(value.into());
11500 self
11501 }
11502
11503 #[must_use]
11505 pub fn with_ev_max_energy_request(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11506 self.ev_max_energy_request = Some(value.into());
11507 self
11508 }
11509
11510 #[must_use]
11512 pub fn with_ev_min_v2_x_energy_request(
11513 mut self,
11514 value: impl Into<crate::types::Decimal>,
11515 ) -> Self {
11516 self.ev_min_v2_x_energy_request = Some(value.into());
11517 self
11518 }
11519
11520 #[must_use]
11522 pub fn with_ev_max_v2_x_energy_request(
11523 mut self,
11524 value: impl Into<crate::types::Decimal>,
11525 ) -> Self {
11526 self.ev_max_v2_x_energy_request = Some(value.into());
11527 self
11528 }
11529
11530 #[must_use]
11532 pub fn with_target_so_c(mut self, value: i32) -> Self {
11533 self.target_so_c = Some(value);
11534 self
11535 }
11536
11537 #[must_use]
11539 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11540 self.custom_data = Some(value);
11541 self
11542 }
11543}
11544
11545impl Validate for V2XChargingParameters {
11546 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11547 path.push_key("targetSoC");
11548 if let Some(value) = &self.target_so_c {
11549 validate::int_range(i64::from(*value), Some(0), Some(100), path, out);
11550 }
11551 path.pop();
11552 path.push_key("customData");
11553 if let Some(value) = &self.custom_data {
11554 Validate::validate_at(value, path, out);
11555 }
11556 path.pop();
11557 }
11558}
11559
11560#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11564pub struct V2XFreqWattPoint {
11565 pub frequency: crate::types::Decimal,
11567 pub power: crate::types::Decimal,
11569 #[serde(rename = "customData")]
11571 #[serde(default, skip_serializing_if = "Option::is_none")]
11572 pub custom_data: Option<crate::types::CustomData>,
11573}
11574
11575impl V2XFreqWattPoint {
11576 #[must_use]
11578 pub fn new(
11579 frequency: impl Into<crate::types::Decimal>,
11580 power: impl Into<crate::types::Decimal>,
11581 ) -> Self {
11582 Self {
11583 frequency: frequency.into(),
11584 power: power.into(),
11585 custom_data: None,
11586 }
11587 }
11588
11589 #[must_use]
11591 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11592 self.custom_data = Some(value);
11593 self
11594 }
11595}
11596
11597impl Validate for V2XFreqWattPoint {
11598 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11599 path.push_key("customData");
11600 if let Some(value) = &self.custom_data {
11601 Validate::validate_at(value, path, out);
11602 }
11603 path.pop();
11604 }
11605}
11606
11607#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11611pub struct V2XSignalWattPoint {
11612 #[serde(deserialize_with = "crate::types::integer::one")]
11614 pub signal: i32,
11615 pub power: crate::types::Decimal,
11617 #[serde(rename = "customData")]
11619 #[serde(default, skip_serializing_if = "Option::is_none")]
11620 pub custom_data: Option<crate::types::CustomData>,
11621}
11622
11623impl V2XSignalWattPoint {
11624 #[must_use]
11626 pub fn new(signal: i32, power: impl Into<crate::types::Decimal>) -> Self {
11627 Self {
11628 signal,
11629 power: power.into(),
11630 custom_data: None,
11631 }
11632 }
11633
11634 #[must_use]
11636 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11637 self.custom_data = Some(value);
11638 self
11639 }
11640}
11641
11642impl Validate for V2XSignalWattPoint {
11643 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11644 path.push_key("customData");
11645 if let Some(value) = &self.custom_data {
11646 Validate::validate_at(value, path, out);
11647 }
11648 path.pop();
11649 }
11650}
11651
11652#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11656pub struct VPN {
11657 pub server: String,
11659 pub user: String,
11661 pub password: String,
11663 pub key: String,
11665 pub r#type: VPNEnum,
11667 #[serde(default, skip_serializing_if = "Option::is_none")]
11669 pub group: Option<String>,
11670 #[serde(rename = "customData")]
11672 #[serde(default, skip_serializing_if = "Option::is_none")]
11673 pub custom_data: Option<crate::types::CustomData>,
11674}
11675
11676impl VPN {
11677 #[must_use]
11679 pub fn new(
11680 server: impl Into<String>,
11681 user: impl Into<String>,
11682 password: impl Into<String>,
11683 key: impl Into<String>,
11684 r#type: VPNEnum,
11685 ) -> Self {
11686 Self {
11687 server: server.into(),
11688 user: user.into(),
11689 password: password.into(),
11690 key: key.into(),
11691 r#type,
11692 group: None,
11693 custom_data: None,
11694 }
11695 }
11696
11697 #[must_use]
11699 pub fn with_group(mut self, value: impl Into<String>) -> Self {
11700 self.group = Some(value.into());
11701 self
11702 }
11703
11704 #[must_use]
11706 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11707 self.custom_data = Some(value);
11708 self
11709 }
11710}
11711
11712impl Validate for VPN {
11713 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11714 path.push_key("server");
11715 validate::string(self.server.as_str(), None, Some(2000), path, out);
11716 path.pop();
11717 path.push_key("user");
11718 validate::string(self.user.as_str(), None, Some(50), path, out);
11719 path.pop();
11720 path.push_key("password");
11721 validate::string(self.password.as_str(), None, Some(64), path, out);
11722 path.pop();
11723 path.push_key("key");
11724 validate::string(self.key.as_str(), None, Some(255), path, out);
11725 path.pop();
11726 path.push_key("type");
11727 Validate::validate_at(&self.r#type, path, out);
11728 path.pop();
11729 path.push_key("group");
11730 if let Some(value) = &self.group {
11731 validate::string(value.as_str(), None, Some(50), path, out);
11732 }
11733 path.pop();
11734 path.push_key("customData");
11735 if let Some(value) = &self.custom_data {
11736 Validate::validate_at(value, path, out);
11737 }
11738 path.pop();
11739 }
11740}
11741
11742#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11746pub struct Variable {
11747 pub name: String,
11749 #[serde(default, skip_serializing_if = "Option::is_none")]
11751 pub instance: Option<String>,
11752 #[serde(rename = "customData")]
11754 #[serde(default, skip_serializing_if = "Option::is_none")]
11755 pub custom_data: Option<crate::types::CustomData>,
11756}
11757
11758impl Variable {
11759 #[must_use]
11761 pub fn new(name: impl Into<String>) -> Self {
11762 Self {
11763 name: name.into(),
11764 instance: None,
11765 custom_data: None,
11766 }
11767 }
11768
11769 #[must_use]
11771 pub fn with_instance(mut self, value: impl Into<String>) -> Self {
11772 self.instance = Some(value.into());
11773 self
11774 }
11775
11776 #[must_use]
11778 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11779 self.custom_data = Some(value);
11780 self
11781 }
11782}
11783
11784impl Validate for Variable {
11785 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11786 path.push_key("name");
11787 validate::string(self.name.as_str(), None, Some(50), path, out);
11788 path.pop();
11789 path.push_key("instance");
11790 if let Some(value) = &self.instance {
11791 validate::string(value.as_str(), None, Some(50), path, out);
11792 }
11793 path.pop();
11794 path.push_key("customData");
11795 if let Some(value) = &self.custom_data {
11796 Validate::validate_at(value, path, out);
11797 }
11798 path.pop();
11799 }
11800}
11801
11802#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
11806pub struct VariableAttribute {
11807 #[serde(default, skip_serializing_if = "Option::is_none")]
11809 pub r#type: Option<Attribute>,
11810 #[serde(default, skip_serializing_if = "Option::is_none")]
11814 pub value: Option<String>,
11815 #[serde(default, skip_serializing_if = "Option::is_none")]
11817 pub mutability: Option<Mutability>,
11818 #[serde(default, skip_serializing_if = "Option::is_none")]
11821 pub persistent: Option<bool>,
11822 #[serde(default, skip_serializing_if = "Option::is_none")]
11825 pub constant: Option<bool>,
11826 #[serde(rename = "customData")]
11828 #[serde(default, skip_serializing_if = "Option::is_none")]
11829 pub custom_data: Option<crate::types::CustomData>,
11830}
11831
11832impl VariableAttribute {
11833 #[must_use]
11835 pub fn new() -> Self {
11836 Self::default()
11837 }
11838
11839 #[must_use]
11841 pub fn with_type(mut self, value: Attribute) -> Self {
11842 self.r#type = Some(value);
11843 self
11844 }
11845
11846 #[must_use]
11848 pub fn with_value(mut self, value: impl Into<String>) -> Self {
11849 self.value = Some(value.into());
11850 self
11851 }
11852
11853 #[must_use]
11855 pub fn with_mutability(mut self, value: Mutability) -> Self {
11856 self.mutability = Some(value);
11857 self
11858 }
11859
11860 #[must_use]
11862 pub fn with_persistent(mut self, value: bool) -> Self {
11863 self.persistent = Some(value);
11864 self
11865 }
11866
11867 #[must_use]
11869 pub fn with_constant(mut self, value: bool) -> Self {
11870 self.constant = Some(value);
11871 self
11872 }
11873
11874 #[must_use]
11876 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11877 self.custom_data = Some(value);
11878 self
11879 }
11880}
11881
11882impl Validate for VariableAttribute {
11883 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11884 path.push_key("type");
11885 if let Some(value) = &self.r#type {
11886 Validate::validate_at(value, path, out);
11887 }
11888 path.pop();
11889 path.push_key("value");
11890 if let Some(value) = &self.value {
11891 validate::string(value.as_str(), None, Some(2500), path, out);
11892 }
11893 path.pop();
11894 path.push_key("mutability");
11895 if let Some(value) = &self.mutability {
11896 Validate::validate_at(value, path, out);
11897 }
11898 path.pop();
11899 path.push_key("customData");
11900 if let Some(value) = &self.custom_data {
11901 Validate::validate_at(value, path, out);
11902 }
11903 path.pop();
11904 }
11905}
11906
11907#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11911pub struct VariableCharacteristics {
11912 #[serde(rename = "dataType")]
11914 pub data_type: Data,
11915 #[serde(rename = "supportsMonitoring")]
11917 pub supports_monitoring: bool,
11918 #[serde(default, skip_serializing_if = "Option::is_none")]
11920 pub unit: Option<String>,
11921 #[serde(rename = "minLimit")]
11923 #[serde(default, skip_serializing_if = "Option::is_none")]
11924 pub min_limit: Option<crate::types::Decimal>,
11925 #[serde(rename = "maxLimit")]
11927 #[serde(default, skip_serializing_if = "Option::is_none")]
11928 pub max_limit: Option<crate::types::Decimal>,
11929 #[serde(rename = "maxElements")]
11931 #[serde(default, skip_serializing_if = "Option::is_none")]
11932 #[serde(deserialize_with = "crate::types::integer::option")]
11933 pub max_elements: Option<i32>,
11934 #[serde(rename = "valuesList")]
11948 #[serde(default, skip_serializing_if = "Option::is_none")]
11949 pub values_list: Option<String>,
11950 #[serde(rename = "customData")]
11952 #[serde(default, skip_serializing_if = "Option::is_none")]
11953 pub custom_data: Option<crate::types::CustomData>,
11954}
11955
11956impl VariableCharacteristics {
11957 #[must_use]
11959 pub fn new(data_type: Data, supports_monitoring: bool) -> Self {
11960 Self {
11961 data_type,
11962 supports_monitoring,
11963 unit: None,
11964 min_limit: None,
11965 max_limit: None,
11966 max_elements: None,
11967 values_list: None,
11968 custom_data: None,
11969 }
11970 }
11971
11972 #[must_use]
11974 pub fn with_unit(mut self, value: impl Into<String>) -> Self {
11975 self.unit = Some(value.into());
11976 self
11977 }
11978
11979 #[must_use]
11981 pub fn with_min_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11982 self.min_limit = Some(value.into());
11983 self
11984 }
11985
11986 #[must_use]
11988 pub fn with_max_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11989 self.max_limit = Some(value.into());
11990 self
11991 }
11992
11993 #[must_use]
11995 pub fn with_max_elements(mut self, value: i32) -> Self {
11996 self.max_elements = Some(value);
11997 self
11998 }
11999
12000 #[must_use]
12002 pub fn with_values_list(mut self, value: impl Into<String>) -> Self {
12003 self.values_list = Some(value.into());
12004 self
12005 }
12006
12007 #[must_use]
12009 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12010 self.custom_data = Some(value);
12011 self
12012 }
12013}
12014
12015impl Validate for VariableCharacteristics {
12016 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12017 path.push_key("dataType");
12018 Validate::validate_at(&self.data_type, path, out);
12019 path.pop();
12020 path.push_key("unit");
12021 if let Some(value) = &self.unit {
12022 validate::string(value.as_str(), None, Some(16), path, out);
12023 }
12024 path.pop();
12025 path.push_key("maxElements");
12026 if let Some(value) = &self.max_elements {
12027 validate::int_range(i64::from(*value), Some(1), None, path, out);
12028 }
12029 path.pop();
12030 path.push_key("valuesList");
12031 if let Some(value) = &self.values_list {
12032 validate::string(value.as_str(), None, Some(1000), path, out);
12033 }
12034 path.pop();
12035 path.push_key("customData");
12036 if let Some(value) = &self.custom_data {
12037 Validate::validate_at(value, path, out);
12038 }
12039 path.pop();
12040 }
12041}
12042
12043#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12047pub struct VariableMonitoring {
12048 #[serde(deserialize_with = "crate::types::integer::one")]
12050 pub id: i32,
12051 pub transaction: bool,
12053 pub value: crate::types::Decimal,
12056 pub r#type: Monitor,
12058 #[serde(deserialize_with = "crate::types::integer::one")]
12082 pub severity: i32,
12083 #[serde(rename = "eventNotificationType")]
12085 pub event_notification_type: EventNotification,
12086 #[serde(rename = "customData")]
12088 #[serde(default, skip_serializing_if = "Option::is_none")]
12089 pub custom_data: Option<crate::types::CustomData>,
12090}
12091
12092impl VariableMonitoring {
12093 #[must_use]
12095 pub fn new(
12096 id: i32,
12097 transaction: bool,
12098 value: impl Into<crate::types::Decimal>,
12099 r#type: Monitor,
12100 severity: i32,
12101 event_notification_type: EventNotification,
12102 ) -> Self {
12103 Self {
12104 id,
12105 transaction,
12106 value: value.into(),
12107 r#type,
12108 severity,
12109 event_notification_type,
12110 custom_data: None,
12111 }
12112 }
12113
12114 #[must_use]
12116 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12117 self.custom_data = Some(value);
12118 self
12119 }
12120}
12121
12122impl Validate for VariableMonitoring {
12123 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12124 path.push_key("id");
12125 validate::int_range(i64::from(self.id), Some(0), None, path, out);
12126 path.pop();
12127 path.push_key("type");
12128 Validate::validate_at(&self.r#type, path, out);
12129 path.pop();
12130 path.push_key("severity");
12131 validate::int_range(i64::from(self.severity), Some(0), None, path, out);
12132 path.pop();
12133 path.push_key("eventNotificationType");
12134 Validate::validate_at(&self.event_notification_type, path, out);
12135 path.pop();
12136 path.push_key("customData");
12137 if let Some(value) = &self.custom_data {
12138 Validate::validate_at(value, path, out);
12139 }
12140 path.pop();
12141 }
12142}
12143
12144#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
12146pub struct VoltageParams {
12147 #[serde(rename = "hv10MinMeanValue")]
12153 #[serde(default, skip_serializing_if = "Option::is_none")]
12154 pub hv10_min_mean_value: Option<crate::types::Decimal>,
12155 #[serde(rename = "hv10MinMeanTripDelay")]
12159 #[serde(default, skip_serializing_if = "Option::is_none")]
12160 pub hv10_min_mean_trip_delay: Option<crate::types::Decimal>,
12161 #[serde(rename = "powerDuringCessation")]
12163 #[serde(default, skip_serializing_if = "Option::is_none")]
12164 pub power_during_cessation: Option<PowerDuringCessation>,
12165 #[serde(rename = "customData")]
12167 #[serde(default, skip_serializing_if = "Option::is_none")]
12168 pub custom_data: Option<crate::types::CustomData>,
12169}
12170
12171impl VoltageParams {
12172 #[must_use]
12174 pub fn new() -> Self {
12175 Self::default()
12176 }
12177
12178 #[must_use]
12180 pub fn with_hv10_min_mean_value(mut self, value: impl Into<crate::types::Decimal>) -> Self {
12181 self.hv10_min_mean_value = Some(value.into());
12182 self
12183 }
12184
12185 #[must_use]
12187 pub fn with_hv10_min_mean_trip_delay(
12188 mut self,
12189 value: impl Into<crate::types::Decimal>,
12190 ) -> Self {
12191 self.hv10_min_mean_trip_delay = Some(value.into());
12192 self
12193 }
12194
12195 #[must_use]
12197 pub fn with_power_during_cessation(mut self, value: PowerDuringCessation) -> Self {
12198 self.power_during_cessation = Some(value);
12199 self
12200 }
12201
12202 #[must_use]
12204 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12205 self.custom_data = Some(value);
12206 self
12207 }
12208}
12209
12210impl Validate for VoltageParams {
12211 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12212 path.push_key("powerDuringCessation");
12213 if let Some(value) = &self.power_during_cessation {
12214 Validate::validate_at(value, path, out);
12215 }
12216 path.pop();
12217 path.push_key("customData");
12218 if let Some(value) = &self.custom_data {
12219 Validate::validate_at(value, path, out);
12220 }
12221 path.pop();
12222 }
12223}