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 pub sim_pin: Option<i32>,
114 #[serde(rename = "preferredNetwork")]
116 #[serde(default, skip_serializing_if = "Option::is_none")]
117 pub preferred_network: Option<String>,
118 #[serde(rename = "useOnlyPreferredNetwork")]
122 #[serde(default, skip_serializing_if = "Option::is_none")]
123 pub use_only_preferred_network: Option<bool>,
124 #[serde(rename = "customData")]
126 #[serde(default, skip_serializing_if = "Option::is_none")]
127 pub custom_data: Option<crate::types::CustomData>,
128}
129
130impl APN {
131 #[must_use]
133 pub fn new(apn: impl Into<String>, apn_authentication: APNAuthentication) -> Self {
134 Self {
135 apn: apn.into(),
136 apn_authentication,
137 apn_user_name: None,
138 apn_password: None,
139 sim_pin: None,
140 preferred_network: None,
141 use_only_preferred_network: None,
142 custom_data: None,
143 }
144 }
145
146 #[must_use]
148 pub fn with_apn_user_name(mut self, value: impl Into<String>) -> Self {
149 self.apn_user_name = Some(value.into());
150 self
151 }
152
153 #[must_use]
155 pub fn with_apn_password(mut self, value: impl Into<String>) -> Self {
156 self.apn_password = Some(value.into());
157 self
158 }
159
160 #[must_use]
162 pub fn with_sim_pin(mut self, value: i32) -> Self {
163 self.sim_pin = Some(value);
164 self
165 }
166
167 #[must_use]
169 pub fn with_preferred_network(mut self, value: impl Into<String>) -> Self {
170 self.preferred_network = Some(value.into());
171 self
172 }
173
174 #[must_use]
176 pub fn with_use_only_preferred_network(mut self, value: bool) -> Self {
177 self.use_only_preferred_network = Some(value);
178 self
179 }
180
181 #[must_use]
183 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
184 self.custom_data = Some(value);
185 self
186 }
187}
188
189impl Validate for APN {
190 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
191 path.push_key("apn");
192 validate::string(self.apn.as_str(), None, Some(2000), path, out);
193 path.pop();
194 path.push_key("apnAuthentication");
195 Validate::validate_at(&self.apn_authentication, path, out);
196 path.pop();
197 path.push_key("apnUserName");
198 if let Some(value) = &self.apn_user_name {
199 validate::string(value.as_str(), None, Some(50), path, out);
200 }
201 path.pop();
202 path.push_key("apnPassword");
203 if let Some(value) = &self.apn_password {
204 validate::string(value.as_str(), None, Some(64), path, out);
205 }
206 path.pop();
207 path.push_key("preferredNetwork");
208 if let Some(value) = &self.preferred_network {
209 validate::string(value.as_str(), None, Some(6), path, out);
210 }
211 path.pop();
212 path.push_key("customData");
213 if let Some(value) = &self.custom_data {
214 Validate::validate_at(value, path, out);
215 }
216 path.pop();
217 }
218}
219
220#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
226pub struct AbsolutePriceSchedule {
227 #[serde(rename = "timeAnchor")]
229 pub time_anchor: crate::types::DateTime,
230 #[serde(rename = "priceScheduleID")]
232 pub price_schedule_id: i32,
233 pub currency: String,
235 pub language: String,
237 #[serde(rename = "priceAlgorithm")]
239 pub price_algorithm: String,
240 #[serde(rename = "priceRuleStacks")]
242 pub price_rule_stacks: Vec<PriceRuleStack>,
243 #[serde(rename = "priceScheduleDescription")]
245 #[serde(default, skip_serializing_if = "Option::is_none")]
246 pub price_schedule_description: Option<String>,
247 #[serde(rename = "minimumCost")]
249 #[serde(default, skip_serializing_if = "Option::is_none")]
250 pub minimum_cost: Option<RationalNumber>,
251 #[serde(rename = "maximumCost")]
253 #[serde(default, skip_serializing_if = "Option::is_none")]
254 pub maximum_cost: Option<RationalNumber>,
255 #[serde(rename = "taxRules")]
257 #[serde(default, skip_serializing_if = "Option::is_none")]
258 pub tax_rules: Option<Vec<TaxRule>>,
259 #[serde(rename = "overstayRuleList")]
261 #[serde(default, skip_serializing_if = "Option::is_none")]
262 pub overstay_rule_list: Option<OverstayRuleList>,
263 #[serde(rename = "additionalSelectedServices")]
265 #[serde(default, skip_serializing_if = "Option::is_none")]
266 pub additional_selected_services: Option<Vec<AdditionalSelectedServices>>,
267 #[serde(rename = "customData")]
269 #[serde(default, skip_serializing_if = "Option::is_none")]
270 pub custom_data: Option<crate::types::CustomData>,
271}
272
273impl AbsolutePriceSchedule {
274 #[must_use]
276 pub fn new(
277 time_anchor: impl Into<crate::types::DateTime>,
278 price_schedule_id: i32,
279 currency: impl Into<String>,
280 language: impl Into<String>,
281 price_algorithm: impl Into<String>,
282 price_rule_stacks: Vec<PriceRuleStack>,
283 ) -> Self {
284 Self {
285 time_anchor: time_anchor.into(),
286 price_schedule_id,
287 currency: currency.into(),
288 language: language.into(),
289 price_algorithm: price_algorithm.into(),
290 price_rule_stacks,
291 price_schedule_description: None,
292 minimum_cost: None,
293 maximum_cost: None,
294 tax_rules: None,
295 overstay_rule_list: None,
296 additional_selected_services: None,
297 custom_data: None,
298 }
299 }
300
301 #[must_use]
303 pub fn with_price_schedule_description(mut self, value: impl Into<String>) -> Self {
304 self.price_schedule_description = Some(value.into());
305 self
306 }
307
308 #[must_use]
310 pub fn with_minimum_cost(mut self, value: RationalNumber) -> Self {
311 self.minimum_cost = Some(value);
312 self
313 }
314
315 #[must_use]
317 pub fn with_maximum_cost(mut self, value: RationalNumber) -> Self {
318 self.maximum_cost = Some(value);
319 self
320 }
321
322 #[must_use]
324 pub fn with_tax_rules(mut self, value: Vec<TaxRule>) -> Self {
325 self.tax_rules = Some(value);
326 self
327 }
328
329 #[must_use]
331 pub fn with_overstay_rule_list(mut self, value: OverstayRuleList) -> Self {
332 self.overstay_rule_list = Some(value);
333 self
334 }
335
336 #[must_use]
338 pub fn with_additional_selected_services(
339 mut self,
340 value: Vec<AdditionalSelectedServices>,
341 ) -> Self {
342 self.additional_selected_services = Some(value);
343 self
344 }
345
346 #[must_use]
348 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
349 self.custom_data = Some(value);
350 self
351 }
352}
353
354impl Validate for AbsolutePriceSchedule {
355 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
356 path.push_key("priceScheduleID");
357 validate::int_range(i64::from(self.price_schedule_id), Some(0), None, path, out);
358 path.pop();
359 path.push_key("currency");
360 validate::string(self.currency.as_str(), None, Some(3), path, out);
361 path.pop();
362 path.push_key("language");
363 validate::string(self.language.as_str(), None, Some(8), path, out);
364 path.pop();
365 path.push_key("priceAlgorithm");
366 validate::string(self.price_algorithm.as_str(), None, Some(2000), path, out);
367 path.pop();
368 path.push_key("priceRuleStacks");
369 validate::list_len(self.price_rule_stacks.len(), Some(1), Some(1024), path, out);
370 for (index, item) in self.price_rule_stacks.iter().enumerate() {
371 path.push_index(index);
372 Validate::validate_at(item, path, out);
373 path.pop();
374 }
375 path.pop();
376 path.push_key("priceScheduleDescription");
377 if let Some(value) = &self.price_schedule_description {
378 validate::string(value.as_str(), None, Some(160), path, out);
379 }
380 path.pop();
381 path.push_key("minimumCost");
382 if let Some(value) = &self.minimum_cost {
383 Validate::validate_at(value, path, out);
384 }
385 path.pop();
386 path.push_key("maximumCost");
387 if let Some(value) = &self.maximum_cost {
388 Validate::validate_at(value, path, out);
389 }
390 path.pop();
391 path.push_key("taxRules");
392 if let Some(value) = &self.tax_rules {
393 validate::list_len(value.len(), Some(1), Some(10), path, out);
394 for (index, item) in value.iter().enumerate() {
395 path.push_index(index);
396 Validate::validate_at(item, path, out);
397 path.pop();
398 }
399 }
400 path.pop();
401 path.push_key("overstayRuleList");
402 if let Some(value) = &self.overstay_rule_list {
403 Validate::validate_at(value, path, out);
404 }
405 path.pop();
406 path.push_key("additionalSelectedServices");
407 if let Some(value) = &self.additional_selected_services {
408 validate::list_len(value.len(), Some(1), Some(5), path, out);
409 for (index, item) in value.iter().enumerate() {
410 path.push_index(index);
411 Validate::validate_at(item, path, out);
412 path.pop();
413 }
414 }
415 path.pop();
416 path.push_key("customData");
417 if let Some(value) = &self.custom_data {
418 Validate::validate_at(value, path, out);
419 }
420 path.pop();
421 }
422}
423
424#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
428pub struct AdditionalInfo {
429 #[serde(rename = "additionalIdToken")]
431 pub additional_id_token: String,
432 pub r#type: String,
434 #[serde(rename = "customData")]
436 #[serde(default, skip_serializing_if = "Option::is_none")]
437 pub custom_data: Option<crate::types::CustomData>,
438}
439
440impl AdditionalInfo {
441 #[must_use]
443 pub fn new(additional_id_token: impl Into<String>, r#type: impl Into<String>) -> Self {
444 Self {
445 additional_id_token: additional_id_token.into(),
446 r#type: r#type.into(),
447 custom_data: None,
448 }
449 }
450
451 #[must_use]
453 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
454 self.custom_data = Some(value);
455 self
456 }
457}
458
459impl Validate for AdditionalInfo {
460 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
461 path.push_key("additionalIdToken");
462 validate::string(
463 self.additional_id_token.as_str(),
464 None,
465 Some(255),
466 path,
467 out,
468 );
469 path.pop();
470 path.push_key("type");
471 validate::string(self.r#type.as_str(), None, Some(50), path, out);
472 path.pop();
473 path.push_key("customData");
474 if let Some(value) = &self.custom_data {
475 Validate::validate_at(value, path, out);
476 }
477 path.pop();
478 }
479}
480
481#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
485pub struct AdditionalSelectedServices {
486 #[serde(rename = "serviceFee")]
488 pub service_fee: RationalNumber,
489 #[serde(rename = "serviceName")]
491 pub service_name: String,
492 #[serde(rename = "customData")]
494 #[serde(default, skip_serializing_if = "Option::is_none")]
495 pub custom_data: Option<crate::types::CustomData>,
496}
497
498impl AdditionalSelectedServices {
499 #[must_use]
501 pub fn new(service_fee: RationalNumber, service_name: impl Into<String>) -> Self {
502 Self {
503 service_fee,
504 service_name: service_name.into(),
505 custom_data: None,
506 }
507 }
508
509 #[must_use]
511 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
512 self.custom_data = Some(value);
513 self
514 }
515}
516
517impl Validate for AdditionalSelectedServices {
518 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
519 path.push_key("serviceFee");
520 Validate::validate_at(&self.service_fee, path, out);
521 path.pop();
522 path.push_key("serviceName");
523 validate::string(self.service_name.as_str(), None, Some(80), path, out);
524 path.pop();
525 path.push_key("customData");
526 if let Some(value) = &self.custom_data {
527 Validate::validate_at(value, path, out);
528 }
529 path.pop();
530 }
531}
532
533#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
537pub struct Address {
538 pub name: String,
540 pub address1: String,
542 pub city: String,
544 pub country: String,
546 #[serde(default, skip_serializing_if = "Option::is_none")]
548 pub address2: Option<String>,
549 #[serde(rename = "postalCode")]
551 #[serde(default, skip_serializing_if = "Option::is_none")]
552 pub postal_code: Option<String>,
553 #[serde(rename = "customData")]
555 #[serde(default, skip_serializing_if = "Option::is_none")]
556 pub custom_data: Option<crate::types::CustomData>,
557}
558
559impl Address {
560 #[must_use]
562 pub fn new(
563 name: impl Into<String>,
564 address1: impl Into<String>,
565 city: impl Into<String>,
566 country: impl Into<String>,
567 ) -> Self {
568 Self {
569 name: name.into(),
570 address1: address1.into(),
571 city: city.into(),
572 country: country.into(),
573 address2: None,
574 postal_code: None,
575 custom_data: None,
576 }
577 }
578
579 #[must_use]
581 pub fn with_address2(mut self, value: impl Into<String>) -> Self {
582 self.address2 = Some(value.into());
583 self
584 }
585
586 #[must_use]
588 pub fn with_postal_code(mut self, value: impl Into<String>) -> Self {
589 self.postal_code = Some(value.into());
590 self
591 }
592
593 #[must_use]
595 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
596 self.custom_data = Some(value);
597 self
598 }
599}
600
601impl Validate for Address {
602 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
603 path.push_key("name");
604 validate::string(self.name.as_str(), None, Some(50), path, out);
605 path.pop();
606 path.push_key("address1");
607 validate::string(self.address1.as_str(), None, Some(100), path, out);
608 path.pop();
609 path.push_key("city");
610 validate::string(self.city.as_str(), None, Some(100), path, out);
611 path.pop();
612 path.push_key("country");
613 validate::string(self.country.as_str(), None, Some(50), path, out);
614 path.pop();
615 path.push_key("address2");
616 if let Some(value) = &self.address2 {
617 validate::string(value.as_str(), None, Some(100), path, out);
618 }
619 path.pop();
620 path.push_key("postalCode");
621 if let Some(value) = &self.postal_code {
622 validate::string(value.as_str(), None, Some(20), path, out);
623 }
624 path.pop();
625 path.push_key("customData");
626 if let Some(value) = &self.custom_data {
627 Validate::validate_at(value, path, out);
628 }
629 path.pop();
630 }
631}
632
633#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
637pub struct AuthorizationData {
638 #[serde(rename = "idToken")]
640 pub id_token: IdToken,
641 #[serde(rename = "idTokenInfo")]
643 #[serde(default, skip_serializing_if = "Option::is_none")]
644 pub id_token_info: Option<IdTokenInfo>,
645 #[serde(rename = "customData")]
647 #[serde(default, skip_serializing_if = "Option::is_none")]
648 pub custom_data: Option<crate::types::CustomData>,
649}
650
651impl AuthorizationData {
652 #[must_use]
654 pub fn new(id_token: IdToken) -> Self {
655 Self {
656 id_token,
657 id_token_info: None,
658 custom_data: None,
659 }
660 }
661
662 #[must_use]
664 pub fn with_id_token_info(mut self, value: IdTokenInfo) -> Self {
665 self.id_token_info = Some(value);
666 self
667 }
668
669 #[must_use]
671 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
672 self.custom_data = Some(value);
673 self
674 }
675}
676
677impl Validate for AuthorizationData {
678 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
679 path.push_key("idToken");
680 Validate::validate_at(&self.id_token, path, out);
681 path.pop();
682 path.push_key("idTokenInfo");
683 if let Some(value) = &self.id_token_info {
684 Validate::validate_at(value, path, out);
685 }
686 path.pop();
687 path.push_key("customData");
688 if let Some(value) = &self.custom_data {
689 Validate::validate_at(value, path, out);
690 }
691 path.pop();
692 }
693}
694
695#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
697pub struct BatteryData {
698 #[serde(rename = "evseId")]
700 pub evse_id: i32,
701 #[serde(rename = "serialNumber")]
703 pub serial_number: String,
704 #[serde(rename = "soC")]
706 pub so_c: crate::types::Decimal,
707 #[serde(rename = "soH")]
709 pub so_h: crate::types::Decimal,
710 #[serde(rename = "productionDate")]
712 #[serde(default, skip_serializing_if = "Option::is_none")]
713 pub production_date: Option<crate::types::DateTime>,
714 #[serde(rename = "vendorInfo")]
716 #[serde(default, skip_serializing_if = "Option::is_none")]
717 pub vendor_info: Option<String>,
718 #[serde(rename = "customData")]
720 #[serde(default, skip_serializing_if = "Option::is_none")]
721 pub custom_data: Option<crate::types::CustomData>,
722}
723
724impl BatteryData {
725 #[must_use]
727 pub fn new(
728 evse_id: i32,
729 serial_number: impl Into<String>,
730 so_c: impl Into<crate::types::Decimal>,
731 so_h: impl Into<crate::types::Decimal>,
732 ) -> Self {
733 Self {
734 evse_id,
735 serial_number: serial_number.into(),
736 so_c: so_c.into(),
737 so_h: so_h.into(),
738 production_date: None,
739 vendor_info: None,
740 custom_data: None,
741 }
742 }
743
744 #[must_use]
746 pub fn with_production_date(mut self, value: impl Into<crate::types::DateTime>) -> Self {
747 self.production_date = Some(value.into());
748 self
749 }
750
751 #[must_use]
753 pub fn with_vendor_info(mut self, value: impl Into<String>) -> Self {
754 self.vendor_info = Some(value.into());
755 self
756 }
757
758 #[must_use]
760 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
761 self.custom_data = Some(value);
762 self
763 }
764}
765
766impl Validate for BatteryData {
767 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
768 path.push_key("evseId");
769 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
770 path.pop();
771 path.push_key("serialNumber");
772 validate::string(self.serial_number.as_str(), None, Some(50), path, out);
773 path.pop();
774 path.push_key("soC");
775 validate::range(
776 self.so_c,
777 Some(crate::types::Decimal::new(0, 0)),
778 Some(crate::types::Decimal::new(100, 0)),
779 path,
780 out,
781 );
782 path.pop();
783 path.push_key("soH");
784 validate::range(
785 self.so_h,
786 Some(crate::types::Decimal::new(0, 0)),
787 Some(crate::types::Decimal::new(100, 0)),
788 path,
789 out,
790 );
791 path.pop();
792 path.push_key("vendorInfo");
793 if let Some(value) = &self.vendor_info {
794 validate::string(value.as_str(), None, Some(500), path, out);
795 }
796 path.pop();
797 path.push_key("customData");
798 if let Some(value) = &self.custom_data {
799 Validate::validate_at(value, path, out);
800 }
801 path.pop();
802 }
803}
804
805#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
807pub struct CertificateHashData {
808 #[serde(rename = "hashAlgorithm")]
810 pub hash_algorithm: HashAlgorithm,
811 #[serde(rename = "issuerNameHash")]
816 pub issuer_name_hash: String,
817 #[serde(rename = "issuerKeyHash")]
821 pub issuer_key_hash: String,
822 #[serde(rename = "serialNumber")]
826 pub serial_number: String,
827 #[serde(rename = "customData")]
829 #[serde(default, skip_serializing_if = "Option::is_none")]
830 pub custom_data: Option<crate::types::CustomData>,
831}
832
833impl CertificateHashData {
834 #[must_use]
836 pub fn new(
837 hash_algorithm: HashAlgorithm,
838 issuer_name_hash: impl Into<String>,
839 issuer_key_hash: impl Into<String>,
840 serial_number: impl Into<String>,
841 ) -> Self {
842 Self {
843 hash_algorithm,
844 issuer_name_hash: issuer_name_hash.into(),
845 issuer_key_hash: issuer_key_hash.into(),
846 serial_number: serial_number.into(),
847 custom_data: None,
848 }
849 }
850
851 #[must_use]
853 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
854 self.custom_data = Some(value);
855 self
856 }
857}
858
859impl Validate for CertificateHashData {
860 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
861 path.push_key("hashAlgorithm");
862 Validate::validate_at(&self.hash_algorithm, path, out);
863 path.pop();
864 path.push_key("issuerNameHash");
865 validate::string(self.issuer_name_hash.as_str(), None, Some(128), path, out);
866 path.pop();
867 path.push_key("issuerKeyHash");
868 validate::string(self.issuer_key_hash.as_str(), None, Some(128), path, out);
869 path.pop();
870 path.push_key("serialNumber");
871 validate::string(self.serial_number.as_str(), None, Some(40), path, out);
872 path.pop();
873 path.push_key("customData");
874 if let Some(value) = &self.custom_data {
875 Validate::validate_at(value, path, out);
876 }
877 path.pop();
878 }
879}
880
881#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
883pub struct CertificateHashDataChain {
884 #[serde(rename = "certificateHashData")]
886 pub certificate_hash_data: CertificateHashData,
887 #[serde(rename = "certificateType")]
889 pub certificate_type: GetCertificateIdUse,
890 #[serde(rename = "childCertificateHashData")]
892 #[serde(default, skip_serializing_if = "Option::is_none")]
893 pub child_certificate_hash_data: Option<Vec<CertificateHashData>>,
894 #[serde(rename = "customData")]
896 #[serde(default, skip_serializing_if = "Option::is_none")]
897 pub custom_data: Option<crate::types::CustomData>,
898}
899
900impl CertificateHashDataChain {
901 #[must_use]
903 pub fn new(
904 certificate_hash_data: CertificateHashData,
905 certificate_type: GetCertificateIdUse,
906 ) -> Self {
907 Self {
908 certificate_hash_data,
909 certificate_type,
910 child_certificate_hash_data: None,
911 custom_data: None,
912 }
913 }
914
915 #[must_use]
917 pub fn with_child_certificate_hash_data(mut self, value: Vec<CertificateHashData>) -> Self {
918 self.child_certificate_hash_data = Some(value);
919 self
920 }
921
922 #[must_use]
924 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
925 self.custom_data = Some(value);
926 self
927 }
928}
929
930impl Validate for CertificateHashDataChain {
931 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
932 path.push_key("certificateHashData");
933 Validate::validate_at(&self.certificate_hash_data, path, out);
934 path.pop();
935 path.push_key("certificateType");
936 Validate::validate_at(&self.certificate_type, path, out);
937 path.pop();
938 path.push_key("childCertificateHashData");
939 if let Some(value) = &self.child_certificate_hash_data {
940 validate::list_len(value.len(), Some(1), Some(4), path, out);
941 for (index, item) in value.iter().enumerate() {
942 path.push_index(index);
943 Validate::validate_at(item, path, out);
944 path.pop();
945 }
946 }
947 path.pop();
948 path.push_key("customData");
949 if let Some(value) = &self.custom_data {
950 Validate::validate_at(value, path, out);
951 }
952 path.pop();
953 }
954}
955
956#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
960pub struct CertificateStatus {
961 #[serde(rename = "certificateHashData")]
963 pub certificate_hash_data: CertificateHashData,
964 pub source: CertificateStatusSource,
966 pub status: CertificateStatusEnum,
968 #[serde(rename = "nextUpdate")]
970 pub next_update: crate::types::DateTime,
971 #[serde(rename = "customData")]
973 #[serde(default, skip_serializing_if = "Option::is_none")]
974 pub custom_data: Option<crate::types::CustomData>,
975}
976
977impl CertificateStatus {
978 #[must_use]
980 pub fn new(
981 certificate_hash_data: CertificateHashData,
982 source: CertificateStatusSource,
983 status: CertificateStatusEnum,
984 next_update: impl Into<crate::types::DateTime>,
985 ) -> Self {
986 Self {
987 certificate_hash_data,
988 source,
989 status,
990 next_update: next_update.into(),
991 custom_data: None,
992 }
993 }
994
995 #[must_use]
997 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
998 self.custom_data = Some(value);
999 self
1000 }
1001}
1002
1003impl Validate for CertificateStatus {
1004 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1005 path.push_key("certificateHashData");
1006 Validate::validate_at(&self.certificate_hash_data, path, out);
1007 path.pop();
1008 path.push_key("source");
1009 Validate::validate_at(&self.source, path, out);
1010 path.pop();
1011 path.push_key("status");
1012 Validate::validate_at(&self.status, path, out);
1013 path.pop();
1014 path.push_key("customData");
1015 if let Some(value) = &self.custom_data {
1016 Validate::validate_at(value, path, out);
1017 }
1018 path.pop();
1019 }
1020}
1021
1022#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1026pub struct CertificateStatusRequestInfo {
1027 #[serde(rename = "certificateHashData")]
1029 pub certificate_hash_data: CertificateHashData,
1030 pub source: CertificateStatusSource,
1032 pub urls: Vec<String>,
1034 #[serde(rename = "customData")]
1036 #[serde(default, skip_serializing_if = "Option::is_none")]
1037 pub custom_data: Option<crate::types::CustomData>,
1038}
1039
1040impl CertificateStatusRequestInfo {
1041 #[must_use]
1043 pub fn new(
1044 certificate_hash_data: CertificateHashData,
1045 source: CertificateStatusSource,
1046 urls: impl IntoIterator<Item = impl Into<String>>,
1047 ) -> Self {
1048 Self {
1049 certificate_hash_data,
1050 source,
1051 urls: urls.into_iter().map(Into::into).collect(),
1052 custom_data: None,
1053 }
1054 }
1055
1056 #[must_use]
1058 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1059 self.custom_data = Some(value);
1060 self
1061 }
1062}
1063
1064impl Validate for CertificateStatusRequestInfo {
1065 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1066 path.push_key("certificateHashData");
1067 Validate::validate_at(&self.certificate_hash_data, path, out);
1068 path.pop();
1069 path.push_key("source");
1070 Validate::validate_at(&self.source, path, out);
1071 path.pop();
1072 path.push_key("urls");
1073 validate::list_len(self.urls.len(), Some(1), Some(5), path, out);
1074 for (index, item) in self.urls.iter().enumerate() {
1075 path.push_index(index);
1076 validate::string(item.as_str(), None, Some(2000), path, out);
1077 path.pop();
1078 }
1079 path.pop();
1080 path.push_key("customData");
1081 if let Some(value) = &self.custom_data {
1082 Validate::validate_at(value, path, out);
1083 }
1084 path.pop();
1085 }
1086}
1087
1088#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1090pub struct ChargingLimit {
1091 #[serde(rename = "chargingLimitSource")]
1093 pub charging_limit_source: String,
1094 #[serde(rename = "isLocalGeneration")]
1096 #[serde(default, skip_serializing_if = "Option::is_none")]
1097 pub is_local_generation: Option<bool>,
1098 #[serde(rename = "isGridCritical")]
1100 #[serde(default, skip_serializing_if = "Option::is_none")]
1101 pub is_grid_critical: Option<bool>,
1102 #[serde(rename = "customData")]
1104 #[serde(default, skip_serializing_if = "Option::is_none")]
1105 pub custom_data: Option<crate::types::CustomData>,
1106}
1107
1108impl ChargingLimit {
1109 #[must_use]
1111 pub fn new(charging_limit_source: impl Into<String>) -> Self {
1112 Self {
1113 charging_limit_source: charging_limit_source.into(),
1114 is_local_generation: None,
1115 is_grid_critical: None,
1116 custom_data: None,
1117 }
1118 }
1119
1120 #[must_use]
1122 pub fn with_is_local_generation(mut self, value: bool) -> Self {
1123 self.is_local_generation = Some(value);
1124 self
1125 }
1126
1127 #[must_use]
1129 pub fn with_is_grid_critical(mut self, value: bool) -> Self {
1130 self.is_grid_critical = Some(value);
1131 self
1132 }
1133
1134 #[must_use]
1136 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1137 self.custom_data = Some(value);
1138 self
1139 }
1140}
1141
1142impl Validate for ChargingLimit {
1143 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1144 path.push_key("chargingLimitSource");
1145 validate::string(
1146 self.charging_limit_source.as_str(),
1147 None,
1148 Some(20),
1149 path,
1150 out,
1151 );
1152 path.pop();
1153 path.push_key("customData");
1154 if let Some(value) = &self.custom_data {
1155 Validate::validate_at(value, path, out);
1156 }
1157 path.pop();
1158 }
1159}
1160
1161#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1163pub struct ChargingNeeds {
1164 #[serde(rename = "requestedEnergyTransfer")]
1166 pub requested_energy_transfer: EnergyTransferMode,
1167 #[serde(rename = "acChargingParameters")]
1169 #[serde(default, skip_serializing_if = "Option::is_none")]
1170 pub ac_charging_parameters: Option<ACChargingParameters>,
1171 #[serde(rename = "derChargingParameters")]
1173 #[serde(default, skip_serializing_if = "Option::is_none")]
1174 pub der_charging_parameters: Option<DERChargingParameters>,
1175 #[serde(rename = "evEnergyOffer")]
1177 #[serde(default, skip_serializing_if = "Option::is_none")]
1178 pub ev_energy_offer: Option<EVEnergyOffer>,
1179 #[serde(rename = "dcChargingParameters")]
1181 #[serde(default, skip_serializing_if = "Option::is_none")]
1182 pub dc_charging_parameters: Option<DCChargingParameters>,
1183 #[serde(rename = "v2xChargingParameters")]
1185 #[serde(default, skip_serializing_if = "Option::is_none")]
1186 pub v2x_charging_parameters: Option<V2XChargingParameters>,
1187 #[serde(rename = "availableEnergyTransfer")]
1189 #[serde(default, skip_serializing_if = "Option::is_none")]
1190 pub available_energy_transfer: Option<Vec<EnergyTransferMode>>,
1191 #[serde(rename = "controlMode")]
1193 #[serde(default, skip_serializing_if = "Option::is_none")]
1194 pub control_mode: Option<ControlMode>,
1195 #[serde(rename = "mobilityNeedsMode")]
1197 #[serde(default, skip_serializing_if = "Option::is_none")]
1198 pub mobility_needs_mode: Option<MobilityNeedsMode>,
1199 #[serde(rename = "departureTime")]
1203 #[serde(default, skip_serializing_if = "Option::is_none")]
1204 pub departure_time: Option<crate::types::DateTime>,
1205 #[serde(rename = "customData")]
1207 #[serde(default, skip_serializing_if = "Option::is_none")]
1208 pub custom_data: Option<crate::types::CustomData>,
1209}
1210
1211impl ChargingNeeds {
1212 #[must_use]
1214 pub fn new(requested_energy_transfer: EnergyTransferMode) -> Self {
1215 Self {
1216 requested_energy_transfer,
1217 ac_charging_parameters: None,
1218 der_charging_parameters: None,
1219 ev_energy_offer: None,
1220 dc_charging_parameters: None,
1221 v2x_charging_parameters: None,
1222 available_energy_transfer: None,
1223 control_mode: None,
1224 mobility_needs_mode: None,
1225 departure_time: None,
1226 custom_data: None,
1227 }
1228 }
1229
1230 #[must_use]
1232 pub fn with_ac_charging_parameters(mut self, value: ACChargingParameters) -> Self {
1233 self.ac_charging_parameters = Some(value);
1234 self
1235 }
1236
1237 #[must_use]
1239 pub fn with_der_charging_parameters(mut self, value: DERChargingParameters) -> Self {
1240 self.der_charging_parameters = Some(value);
1241 self
1242 }
1243
1244 #[must_use]
1246 pub fn with_ev_energy_offer(mut self, value: EVEnergyOffer) -> Self {
1247 self.ev_energy_offer = Some(value);
1248 self
1249 }
1250
1251 #[must_use]
1253 pub fn with_dc_charging_parameters(mut self, value: DCChargingParameters) -> Self {
1254 self.dc_charging_parameters = Some(value);
1255 self
1256 }
1257
1258 #[must_use]
1260 pub fn with_v2x_charging_parameters(mut self, value: V2XChargingParameters) -> Self {
1261 self.v2x_charging_parameters = Some(value);
1262 self
1263 }
1264
1265 #[must_use]
1267 pub fn with_available_energy_transfer(mut self, value: Vec<EnergyTransferMode>) -> Self {
1268 self.available_energy_transfer = Some(value);
1269 self
1270 }
1271
1272 #[must_use]
1274 pub fn with_control_mode(mut self, value: ControlMode) -> Self {
1275 self.control_mode = Some(value);
1276 self
1277 }
1278
1279 #[must_use]
1281 pub fn with_mobility_needs_mode(mut self, value: MobilityNeedsMode) -> Self {
1282 self.mobility_needs_mode = Some(value);
1283 self
1284 }
1285
1286 #[must_use]
1288 pub fn with_departure_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1289 self.departure_time = Some(value.into());
1290 self
1291 }
1292
1293 #[must_use]
1295 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1296 self.custom_data = Some(value);
1297 self
1298 }
1299}
1300
1301impl Validate for ChargingNeeds {
1302 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1303 path.push_key("requestedEnergyTransfer");
1304 Validate::validate_at(&self.requested_energy_transfer, path, out);
1305 path.pop();
1306 path.push_key("acChargingParameters");
1307 if let Some(value) = &self.ac_charging_parameters {
1308 Validate::validate_at(value, path, out);
1309 }
1310 path.pop();
1311 path.push_key("derChargingParameters");
1312 if let Some(value) = &self.der_charging_parameters {
1313 Validate::validate_at(value, path, out);
1314 }
1315 path.pop();
1316 path.push_key("evEnergyOffer");
1317 if let Some(value) = &self.ev_energy_offer {
1318 Validate::validate_at(value, path, out);
1319 }
1320 path.pop();
1321 path.push_key("dcChargingParameters");
1322 if let Some(value) = &self.dc_charging_parameters {
1323 Validate::validate_at(value, path, out);
1324 }
1325 path.pop();
1326 path.push_key("v2xChargingParameters");
1327 if let Some(value) = &self.v2x_charging_parameters {
1328 Validate::validate_at(value, path, out);
1329 }
1330 path.pop();
1331 path.push_key("availableEnergyTransfer");
1332 if let Some(value) = &self.available_energy_transfer {
1333 validate::list_len(value.len(), Some(1), None, path, out);
1334 for (index, item) in value.iter().enumerate() {
1335 path.push_index(index);
1336 Validate::validate_at(item, path, out);
1337 path.pop();
1338 }
1339 }
1340 path.pop();
1341 path.push_key("controlMode");
1342 if let Some(value) = &self.control_mode {
1343 Validate::validate_at(value, path, out);
1344 }
1345 path.pop();
1346 path.push_key("mobilityNeedsMode");
1347 if let Some(value) = &self.mobility_needs_mode {
1348 Validate::validate_at(value, path, out);
1349 }
1350 path.pop();
1351 path.push_key("customData");
1352 if let Some(value) = &self.custom_data {
1353 Validate::validate_at(value, path, out);
1354 }
1355 path.pop();
1356 }
1357}
1358
1359#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1363pub struct ChargingPeriod {
1364 #[serde(rename = "startPeriod")]
1366 pub start_period: crate::types::DateTime,
1367 #[serde(default, skip_serializing_if = "Option::is_none")]
1369 pub dimensions: Option<Vec<CostDimension>>,
1370 #[serde(rename = "tariffId")]
1372 #[serde(default, skip_serializing_if = "Option::is_none")]
1373 pub tariff_id: Option<String>,
1374 #[serde(rename = "customData")]
1376 #[serde(default, skip_serializing_if = "Option::is_none")]
1377 pub custom_data: Option<crate::types::CustomData>,
1378}
1379
1380impl ChargingPeriod {
1381 #[must_use]
1383 pub fn new(start_period: impl Into<crate::types::DateTime>) -> Self {
1384 Self {
1385 start_period: start_period.into(),
1386 dimensions: None,
1387 tariff_id: None,
1388 custom_data: None,
1389 }
1390 }
1391
1392 #[must_use]
1394 pub fn with_dimensions(mut self, value: Vec<CostDimension>) -> Self {
1395 self.dimensions = Some(value);
1396 self
1397 }
1398
1399 #[must_use]
1401 pub fn with_tariff_id(mut self, value: impl Into<String>) -> Self {
1402 self.tariff_id = Some(value.into());
1403 self
1404 }
1405
1406 #[must_use]
1408 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1409 self.custom_data = Some(value);
1410 self
1411 }
1412}
1413
1414impl Validate for ChargingPeriod {
1415 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1416 path.push_key("dimensions");
1417 if let Some(value) = &self.dimensions {
1418 validate::list_len(value.len(), Some(1), None, path, out);
1419 for (index, item) in value.iter().enumerate() {
1420 path.push_index(index);
1421 Validate::validate_at(item, path, out);
1422 path.pop();
1423 }
1424 }
1425 path.pop();
1426 path.push_key("tariffId");
1427 if let Some(value) = &self.tariff_id {
1428 validate::string(value.as_str(), None, Some(60), path, out);
1429 }
1430 path.pop();
1431 path.push_key("customData");
1432 if let Some(value) = &self.custom_data {
1433 Validate::validate_at(value, path, out);
1434 }
1435 path.pop();
1436 }
1437}
1438
1439#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1445pub struct ChargingProfile {
1446 pub id: i32,
1448 #[serde(rename = "stackLevel")]
1450 pub stack_level: i32,
1451 #[serde(rename = "chargingProfilePurpose")]
1453 pub charging_profile_purpose: ChargingProfilePurpose,
1454 #[serde(rename = "chargingProfileKind")]
1456 pub charging_profile_kind: ChargingProfileKind,
1457 #[serde(rename = "chargingSchedule")]
1459 pub charging_schedule: Vec<ChargingSchedule>,
1460 #[serde(rename = "recurrencyKind")]
1462 #[serde(default, skip_serializing_if = "Option::is_none")]
1463 pub recurrency_kind: Option<RecurrencyKind>,
1464 #[serde(rename = "validFrom")]
1466 #[serde(default, skip_serializing_if = "Option::is_none")]
1467 pub valid_from: Option<crate::types::DateTime>,
1468 #[serde(rename = "validTo")]
1470 #[serde(default, skip_serializing_if = "Option::is_none")]
1471 pub valid_to: Option<crate::types::DateTime>,
1472 #[serde(rename = "transactionId")]
1474 #[serde(default, skip_serializing_if = "Option::is_none")]
1475 pub transaction_id: Option<String>,
1476 #[serde(rename = "maxOfflineDuration")]
1480 #[serde(default, skip_serializing_if = "Option::is_none")]
1481 pub max_offline_duration: Option<i32>,
1482 #[serde(rename = "invalidAfterOfflineDuration")]
1485 #[serde(default, skip_serializing_if = "Option::is_none")]
1486 pub invalid_after_offline_duration: Option<bool>,
1487 #[serde(rename = "dynUpdateInterval")]
1491 #[serde(default, skip_serializing_if = "Option::is_none")]
1492 pub dyn_update_interval: Option<i32>,
1493 #[serde(rename = "dynUpdateTime")]
1496 #[serde(default, skip_serializing_if = "Option::is_none")]
1497 pub dyn_update_time: Option<crate::types::DateTime>,
1498 #[serde(rename = "priceScheduleSignature")]
1501 #[serde(default, skip_serializing_if = "Option::is_none")]
1502 pub price_schedule_signature: Option<String>,
1503 #[serde(rename = "customData")]
1505 #[serde(default, skip_serializing_if = "Option::is_none")]
1506 pub custom_data: Option<crate::types::CustomData>,
1507}
1508
1509impl ChargingProfile {
1510 #[must_use]
1512 pub fn new(
1513 id: i32,
1514 stack_level: i32,
1515 charging_profile_purpose: ChargingProfilePurpose,
1516 charging_profile_kind: ChargingProfileKind,
1517 charging_schedule: Vec<ChargingSchedule>,
1518 ) -> Self {
1519 Self {
1520 id,
1521 stack_level,
1522 charging_profile_purpose,
1523 charging_profile_kind,
1524 charging_schedule,
1525 recurrency_kind: None,
1526 valid_from: None,
1527 valid_to: None,
1528 transaction_id: None,
1529 max_offline_duration: None,
1530 invalid_after_offline_duration: None,
1531 dyn_update_interval: None,
1532 dyn_update_time: None,
1533 price_schedule_signature: None,
1534 custom_data: None,
1535 }
1536 }
1537
1538 #[must_use]
1540 pub fn with_recurrency_kind(mut self, value: RecurrencyKind) -> Self {
1541 self.recurrency_kind = Some(value);
1542 self
1543 }
1544
1545 #[must_use]
1547 pub fn with_valid_from(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1548 self.valid_from = Some(value.into());
1549 self
1550 }
1551
1552 #[must_use]
1554 pub fn with_valid_to(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1555 self.valid_to = Some(value.into());
1556 self
1557 }
1558
1559 #[must_use]
1561 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
1562 self.transaction_id = Some(value.into());
1563 self
1564 }
1565
1566 #[must_use]
1568 pub fn with_max_offline_duration(mut self, value: i32) -> Self {
1569 self.max_offline_duration = Some(value);
1570 self
1571 }
1572
1573 #[must_use]
1575 pub fn with_invalid_after_offline_duration(mut self, value: bool) -> Self {
1576 self.invalid_after_offline_duration = Some(value);
1577 self
1578 }
1579
1580 #[must_use]
1582 pub fn with_dyn_update_interval(mut self, value: i32) -> Self {
1583 self.dyn_update_interval = Some(value);
1584 self
1585 }
1586
1587 #[must_use]
1589 pub fn with_dyn_update_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1590 self.dyn_update_time = Some(value.into());
1591 self
1592 }
1593
1594 #[must_use]
1596 pub fn with_price_schedule_signature(mut self, value: impl Into<String>) -> Self {
1597 self.price_schedule_signature = Some(value.into());
1598 self
1599 }
1600
1601 #[must_use]
1603 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1604 self.custom_data = Some(value);
1605 self
1606 }
1607}
1608
1609impl Validate for ChargingProfile {
1610 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1611 path.push_key("stackLevel");
1612 validate::int_range(i64::from(self.stack_level), Some(0), None, path, out);
1613 path.pop();
1614 path.push_key("chargingProfilePurpose");
1615 Validate::validate_at(&self.charging_profile_purpose, path, out);
1616 path.pop();
1617 path.push_key("chargingProfileKind");
1618 Validate::validate_at(&self.charging_profile_kind, path, out);
1619 path.pop();
1620 path.push_key("chargingSchedule");
1621 validate::list_len(self.charging_schedule.len(), Some(1), Some(3), path, out);
1622 for (index, item) in self.charging_schedule.iter().enumerate() {
1623 path.push_index(index);
1624 Validate::validate_at(item, path, out);
1625 path.pop();
1626 }
1627 path.pop();
1628 path.push_key("recurrencyKind");
1629 if let Some(value) = &self.recurrency_kind {
1630 Validate::validate_at(value, path, out);
1631 }
1632 path.pop();
1633 path.push_key("transactionId");
1634 if let Some(value) = &self.transaction_id {
1635 validate::string(value.as_str(), None, Some(36), path, out);
1636 }
1637 path.pop();
1638 path.push_key("priceScheduleSignature");
1639 if let Some(value) = &self.price_schedule_signature {
1640 validate::string(value.as_str(), None, Some(256), path, out);
1641 }
1642 path.pop();
1643 path.push_key("customData");
1644 if let Some(value) = &self.custom_data {
1645 Validate::validate_at(value, path, out);
1646 }
1647 path.pop();
1648 }
1649}
1650
1651#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1655pub struct ChargingProfileCriterion {
1656 #[serde(rename = "chargingProfilePurpose")]
1658 #[serde(default, skip_serializing_if = "Option::is_none")]
1659 pub charging_profile_purpose: Option<ChargingProfilePurpose>,
1660 #[serde(rename = "stackLevel")]
1662 #[serde(default, skip_serializing_if = "Option::is_none")]
1663 pub stack_level: Option<i32>,
1664 #[serde(rename = "chargingProfileId")]
1666 #[serde(default, skip_serializing_if = "Option::is_none")]
1667 pub charging_profile_id: Option<Vec<i32>>,
1668 #[serde(rename = "chargingLimitSource")]
1670 #[serde(default, skip_serializing_if = "Option::is_none")]
1671 pub charging_limit_source: Option<Vec<String>>,
1672 #[serde(rename = "customData")]
1674 #[serde(default, skip_serializing_if = "Option::is_none")]
1675 pub custom_data: Option<crate::types::CustomData>,
1676}
1677
1678impl ChargingProfileCriterion {
1679 #[must_use]
1681 pub fn new() -> Self {
1682 Self::default()
1683 }
1684
1685 #[must_use]
1687 pub fn with_charging_profile_purpose(mut self, value: ChargingProfilePurpose) -> Self {
1688 self.charging_profile_purpose = Some(value);
1689 self
1690 }
1691
1692 #[must_use]
1694 pub fn with_stack_level(mut self, value: i32) -> Self {
1695 self.stack_level = Some(value);
1696 self
1697 }
1698
1699 #[must_use]
1701 pub fn with_charging_profile_id(mut self, value: Vec<i32>) -> Self {
1702 self.charging_profile_id = Some(value);
1703 self
1704 }
1705
1706 #[must_use]
1708 pub fn with_charging_limit_source(
1709 mut self,
1710 value: impl IntoIterator<Item = impl Into<String>>,
1711 ) -> Self {
1712 self.charging_limit_source = Some(value.into_iter().map(Into::into).collect());
1713 self
1714 }
1715
1716 #[must_use]
1718 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1719 self.custom_data = Some(value);
1720 self
1721 }
1722}
1723
1724impl Validate for ChargingProfileCriterion {
1725 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1726 path.push_key("chargingProfilePurpose");
1727 if let Some(value) = &self.charging_profile_purpose {
1728 Validate::validate_at(value, path, out);
1729 }
1730 path.pop();
1731 path.push_key("stackLevel");
1732 if let Some(value) = &self.stack_level {
1733 validate::int_range(i64::from(*value), Some(0), None, path, out);
1734 }
1735 path.pop();
1736 path.push_key("chargingProfileId");
1737 if let Some(value) = &self.charging_profile_id {
1738 validate::list_len(value.len(), Some(1), None, path, out);
1739 }
1740 path.pop();
1741 path.push_key("chargingLimitSource");
1742 if let Some(value) = &self.charging_limit_source {
1743 validate::list_len(value.len(), Some(1), Some(4), path, out);
1744 for (index, item) in value.iter().enumerate() {
1745 path.push_index(index);
1746 validate::string(item.as_str(), None, Some(20), path, out);
1747 path.pop();
1748 }
1749 }
1750 path.pop();
1751 path.push_key("customData");
1752 if let Some(value) = &self.custom_data {
1753 Validate::validate_at(value, path, out);
1754 }
1755 path.pop();
1756 }
1757}
1758
1759#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1766pub struct ChargingSchedule {
1767 pub id: i32,
1769 #[serde(rename = "chargingRateUnit")]
1771 pub charging_rate_unit: ChargingRateUnit,
1772 #[serde(rename = "chargingSchedulePeriod")]
1774 pub charging_schedule_period: Vec<ChargingSchedulePeriod>,
1775 #[serde(rename = "limitAtSoC")]
1777 #[serde(default, skip_serializing_if = "Option::is_none")]
1778 pub limit_at_so_c: Option<LimitAtSoC>,
1779 #[serde(rename = "startSchedule")]
1781 #[serde(default, skip_serializing_if = "Option::is_none")]
1782 pub start_schedule: Option<crate::types::DateTime>,
1783 #[serde(default, skip_serializing_if = "Option::is_none")]
1785 pub duration: Option<i32>,
1786 #[serde(rename = "minChargingRate")]
1788 #[serde(default, skip_serializing_if = "Option::is_none")]
1789 pub min_charging_rate: Option<crate::types::Decimal>,
1790 #[serde(rename = "powerTolerance")]
1792 #[serde(default, skip_serializing_if = "Option::is_none")]
1793 pub power_tolerance: Option<crate::types::Decimal>,
1794 #[serde(rename = "signatureId")]
1796 #[serde(default, skip_serializing_if = "Option::is_none")]
1797 pub signature_id: Option<i32>,
1798 #[serde(rename = "digestValue")]
1800 #[serde(default, skip_serializing_if = "Option::is_none")]
1801 pub digest_value: Option<String>,
1802 #[serde(rename = "useLocalTime")]
1805 #[serde(default, skip_serializing_if = "Option::is_none")]
1806 pub use_local_time: Option<bool>,
1807 #[serde(rename = "randomizedDelay")]
1809 #[serde(default, skip_serializing_if = "Option::is_none")]
1810 pub randomized_delay: Option<i32>,
1811 #[serde(rename = "salesTariff")]
1813 #[serde(default, skip_serializing_if = "Option::is_none")]
1814 pub sales_tariff: Option<SalesTariff>,
1815 #[serde(rename = "absolutePriceSchedule")]
1817 #[serde(default, skip_serializing_if = "Option::is_none")]
1818 pub absolute_price_schedule: Option<AbsolutePriceSchedule>,
1819 #[serde(rename = "priceLevelSchedule")]
1821 #[serde(default, skip_serializing_if = "Option::is_none")]
1822 pub price_level_schedule: Option<PriceLevelSchedule>,
1823 #[serde(rename = "customData")]
1825 #[serde(default, skip_serializing_if = "Option::is_none")]
1826 pub custom_data: Option<crate::types::CustomData>,
1827}
1828
1829impl ChargingSchedule {
1830 #[must_use]
1832 pub fn new(
1833 id: i32,
1834 charging_rate_unit: ChargingRateUnit,
1835 charging_schedule_period: Vec<ChargingSchedulePeriod>,
1836 ) -> Self {
1837 Self {
1838 id,
1839 charging_rate_unit,
1840 charging_schedule_period,
1841 limit_at_so_c: None,
1842 start_schedule: None,
1843 duration: None,
1844 min_charging_rate: None,
1845 power_tolerance: None,
1846 signature_id: None,
1847 digest_value: None,
1848 use_local_time: None,
1849 randomized_delay: None,
1850 sales_tariff: None,
1851 absolute_price_schedule: None,
1852 price_level_schedule: None,
1853 custom_data: None,
1854 }
1855 }
1856
1857 #[must_use]
1859 pub fn with_limit_at_so_c(mut self, value: LimitAtSoC) -> Self {
1860 self.limit_at_so_c = Some(value);
1861 self
1862 }
1863
1864 #[must_use]
1866 pub fn with_start_schedule(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1867 self.start_schedule = Some(value.into());
1868 self
1869 }
1870
1871 #[must_use]
1873 pub fn with_duration(mut self, value: i32) -> Self {
1874 self.duration = Some(value);
1875 self
1876 }
1877
1878 #[must_use]
1880 pub fn with_min_charging_rate(mut self, value: impl Into<crate::types::Decimal>) -> Self {
1881 self.min_charging_rate = Some(value.into());
1882 self
1883 }
1884
1885 #[must_use]
1887 pub fn with_power_tolerance(mut self, value: impl Into<crate::types::Decimal>) -> Self {
1888 self.power_tolerance = Some(value.into());
1889 self
1890 }
1891
1892 #[must_use]
1894 pub fn with_signature_id(mut self, value: i32) -> Self {
1895 self.signature_id = Some(value);
1896 self
1897 }
1898
1899 #[must_use]
1901 pub fn with_digest_value(mut self, value: impl Into<String>) -> Self {
1902 self.digest_value = Some(value.into());
1903 self
1904 }
1905
1906 #[must_use]
1908 pub fn with_use_local_time(mut self, value: bool) -> Self {
1909 self.use_local_time = Some(value);
1910 self
1911 }
1912
1913 #[must_use]
1915 pub fn with_randomized_delay(mut self, value: i32) -> Self {
1916 self.randomized_delay = Some(value);
1917 self
1918 }
1919
1920 #[must_use]
1922 pub fn with_sales_tariff(mut self, value: SalesTariff) -> Self {
1923 self.sales_tariff = Some(value);
1924 self
1925 }
1926
1927 #[must_use]
1929 pub fn with_absolute_price_schedule(mut self, value: AbsolutePriceSchedule) -> Self {
1930 self.absolute_price_schedule = Some(value);
1931 self
1932 }
1933
1934 #[must_use]
1936 pub fn with_price_level_schedule(mut self, value: PriceLevelSchedule) -> Self {
1937 self.price_level_schedule = Some(value);
1938 self
1939 }
1940
1941 #[must_use]
1943 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1944 self.custom_data = Some(value);
1945 self
1946 }
1947}
1948
1949impl Validate for ChargingSchedule {
1950 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1951 path.push_key("chargingRateUnit");
1952 Validate::validate_at(&self.charging_rate_unit, path, out);
1953 path.pop();
1954 path.push_key("chargingSchedulePeriod");
1955 validate::list_len(
1956 self.charging_schedule_period.len(),
1957 Some(1),
1958 Some(1024),
1959 path,
1960 out,
1961 );
1962 for (index, item) in self.charging_schedule_period.iter().enumerate() {
1963 path.push_index(index);
1964 Validate::validate_at(item, path, out);
1965 path.pop();
1966 }
1967 path.pop();
1968 path.push_key("limitAtSoC");
1969 if let Some(value) = &self.limit_at_so_c {
1970 Validate::validate_at(value, path, out);
1971 }
1972 path.pop();
1973 path.push_key("signatureId");
1974 if let Some(value) = &self.signature_id {
1975 validate::int_range(i64::from(*value), Some(0), None, path, out);
1976 }
1977 path.pop();
1978 path.push_key("digestValue");
1979 if let Some(value) = &self.digest_value {
1980 validate::string(value.as_str(), None, Some(88), path, out);
1981 }
1982 path.pop();
1983 path.push_key("randomizedDelay");
1984 if let Some(value) = &self.randomized_delay {
1985 validate::int_range(i64::from(*value), Some(0), None, path, out);
1986 }
1987 path.pop();
1988 path.push_key("salesTariff");
1989 if let Some(value) = &self.sales_tariff {
1990 Validate::validate_at(value, path, out);
1991 }
1992 path.pop();
1993 path.push_key("absolutePriceSchedule");
1994 if let Some(value) = &self.absolute_price_schedule {
1995 Validate::validate_at(value, path, out);
1996 }
1997 path.pop();
1998 path.push_key("priceLevelSchedule");
1999 if let Some(value) = &self.price_level_schedule {
2000 Validate::validate_at(value, path, out);
2001 }
2002 path.pop();
2003 path.push_key("customData");
2004 if let Some(value) = &self.custom_data {
2005 Validate::validate_at(value, path, out);
2006 }
2007 path.pop();
2008 }
2009}
2010
2011#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2015pub struct ChargingSchedulePeriod {
2016 #[serde(rename = "startPeriod")]
2018 pub start_period: i32,
2019 #[serde(default, skip_serializing_if = "Option::is_none")]
2024 pub limit: Option<crate::types::Decimal>,
2025 #[serde(rename = "limit_L2")]
2027 #[serde(default, skip_serializing_if = "Option::is_none")]
2028 pub limit_l2: Option<crate::types::Decimal>,
2029 #[serde(rename = "limit_L3")]
2031 #[serde(default, skip_serializing_if = "Option::is_none")]
2032 pub limit_l3: Option<crate::types::Decimal>,
2033 #[serde(rename = "numberPhases")]
2037 #[serde(default, skip_serializing_if = "Option::is_none")]
2038 pub number_phases: Option<i32>,
2039 #[serde(rename = "phaseToUse")]
2041 #[serde(default, skip_serializing_if = "Option::is_none")]
2042 pub phase_to_use: Option<i32>,
2043 #[serde(rename = "dischargeLimit")]
2046 #[serde(default, skip_serializing_if = "Option::is_none")]
2047 pub discharge_limit: Option<crate::types::Decimal>,
2048 #[serde(rename = "dischargeLimit_L2")]
2050 #[serde(default, skip_serializing_if = "Option::is_none")]
2051 pub discharge_limit_l2: Option<crate::types::Decimal>,
2052 #[serde(rename = "dischargeLimit_L3")]
2054 #[serde(default, skip_serializing_if = "Option::is_none")]
2055 pub discharge_limit_l3: Option<crate::types::Decimal>,
2056 #[serde(default, skip_serializing_if = "Option::is_none")]
2060 pub setpoint: Option<crate::types::Decimal>,
2061 #[serde(rename = "setpoint_L2")]
2063 #[serde(default, skip_serializing_if = "Option::is_none")]
2064 pub setpoint_l2: Option<crate::types::Decimal>,
2065 #[serde(rename = "setpoint_L3")]
2067 #[serde(default, skip_serializing_if = "Option::is_none")]
2068 pub setpoint_l3: Option<crate::types::Decimal>,
2069 #[serde(rename = "setpointReactive")]
2072 #[serde(default, skip_serializing_if = "Option::is_none")]
2073 pub setpoint_reactive: Option<crate::types::Decimal>,
2074 #[serde(rename = "setpointReactive_L2")]
2076 #[serde(default, skip_serializing_if = "Option::is_none")]
2077 pub setpoint_reactive_l2: Option<crate::types::Decimal>,
2078 #[serde(rename = "setpointReactive_L3")]
2080 #[serde(default, skip_serializing_if = "Option::is_none")]
2081 pub setpoint_reactive_l3: Option<crate::types::Decimal>,
2082 #[serde(rename = "preconditioningRequest")]
2084 #[serde(default, skip_serializing_if = "Option::is_none")]
2085 pub preconditioning_request: Option<bool>,
2086 #[serde(rename = "evseSleep")]
2088 #[serde(default, skip_serializing_if = "Option::is_none")]
2089 pub evse_sleep: Option<bool>,
2090 #[serde(rename = "v2xBaseline")]
2092 #[serde(default, skip_serializing_if = "Option::is_none")]
2093 pub v2x_baseline: Option<crate::types::Decimal>,
2094 #[serde(rename = "operationMode")]
2096 #[serde(default, skip_serializing_if = "Option::is_none")]
2097 pub operation_mode: Option<OperationMode>,
2098 #[serde(rename = "v2xFreqWattCurve")]
2100 #[serde(default, skip_serializing_if = "Option::is_none")]
2101 pub v2x_freq_watt_curve: Option<Vec<V2XFreqWattPoint>>,
2102 #[serde(rename = "v2xSignalWattCurve")]
2104 #[serde(default, skip_serializing_if = "Option::is_none")]
2105 pub v2x_signal_watt_curve: Option<Vec<V2XSignalWattPoint>>,
2106 #[serde(rename = "customData")]
2108 #[serde(default, skip_serializing_if = "Option::is_none")]
2109 pub custom_data: Option<crate::types::CustomData>,
2110}
2111
2112impl ChargingSchedulePeriod {
2113 #[must_use]
2115 pub fn new(start_period: i32) -> Self {
2116 Self {
2117 start_period,
2118 limit: None,
2119 limit_l2: None,
2120 limit_l3: None,
2121 number_phases: None,
2122 phase_to_use: None,
2123 discharge_limit: None,
2124 discharge_limit_l2: None,
2125 discharge_limit_l3: None,
2126 setpoint: None,
2127 setpoint_l2: None,
2128 setpoint_l3: None,
2129 setpoint_reactive: None,
2130 setpoint_reactive_l2: None,
2131 setpoint_reactive_l3: None,
2132 preconditioning_request: None,
2133 evse_sleep: None,
2134 v2x_baseline: None,
2135 operation_mode: None,
2136 v2x_freq_watt_curve: None,
2137 v2x_signal_watt_curve: None,
2138 custom_data: None,
2139 }
2140 }
2141
2142 #[must_use]
2144 pub fn with_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2145 self.limit = Some(value.into());
2146 self
2147 }
2148
2149 #[must_use]
2151 pub fn with_limit_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2152 self.limit_l2 = Some(value.into());
2153 self
2154 }
2155
2156 #[must_use]
2158 pub fn with_limit_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2159 self.limit_l3 = Some(value.into());
2160 self
2161 }
2162
2163 #[must_use]
2165 pub fn with_number_phases(mut self, value: i32) -> Self {
2166 self.number_phases = Some(value);
2167 self
2168 }
2169
2170 #[must_use]
2172 pub fn with_phase_to_use(mut self, value: i32) -> Self {
2173 self.phase_to_use = Some(value);
2174 self
2175 }
2176
2177 #[must_use]
2179 pub fn with_discharge_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2180 self.discharge_limit = Some(value.into());
2181 self
2182 }
2183
2184 #[must_use]
2186 pub fn with_discharge_limit_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2187 self.discharge_limit_l2 = Some(value.into());
2188 self
2189 }
2190
2191 #[must_use]
2193 pub fn with_discharge_limit_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2194 self.discharge_limit_l3 = Some(value.into());
2195 self
2196 }
2197
2198 #[must_use]
2200 pub fn with_setpoint(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2201 self.setpoint = Some(value.into());
2202 self
2203 }
2204
2205 #[must_use]
2207 pub fn with_setpoint_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2208 self.setpoint_l2 = Some(value.into());
2209 self
2210 }
2211
2212 #[must_use]
2214 pub fn with_setpoint_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2215 self.setpoint_l3 = Some(value.into());
2216 self
2217 }
2218
2219 #[must_use]
2221 pub fn with_setpoint_reactive(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2222 self.setpoint_reactive = Some(value.into());
2223 self
2224 }
2225
2226 #[must_use]
2228 pub fn with_setpoint_reactive_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2229 self.setpoint_reactive_l2 = Some(value.into());
2230 self
2231 }
2232
2233 #[must_use]
2235 pub fn with_setpoint_reactive_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2236 self.setpoint_reactive_l3 = Some(value.into());
2237 self
2238 }
2239
2240 #[must_use]
2242 pub fn with_preconditioning_request(mut self, value: bool) -> Self {
2243 self.preconditioning_request = Some(value);
2244 self
2245 }
2246
2247 #[must_use]
2249 pub fn with_evse_sleep(mut self, value: bool) -> Self {
2250 self.evse_sleep = Some(value);
2251 self
2252 }
2253
2254 #[must_use]
2256 pub fn with_v2x_baseline(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2257 self.v2x_baseline = Some(value.into());
2258 self
2259 }
2260
2261 #[must_use]
2263 pub fn with_operation_mode(mut self, value: OperationMode) -> Self {
2264 self.operation_mode = Some(value);
2265 self
2266 }
2267
2268 #[must_use]
2270 pub fn with_v2x_freq_watt_curve(mut self, value: Vec<V2XFreqWattPoint>) -> Self {
2271 self.v2x_freq_watt_curve = Some(value);
2272 self
2273 }
2274
2275 #[must_use]
2277 pub fn with_v2x_signal_watt_curve(mut self, value: Vec<V2XSignalWattPoint>) -> Self {
2278 self.v2x_signal_watt_curve = Some(value);
2279 self
2280 }
2281
2282 #[must_use]
2284 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2285 self.custom_data = Some(value);
2286 self
2287 }
2288}
2289
2290impl Validate for ChargingSchedulePeriod {
2291 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2292 path.push_key("numberPhases");
2293 if let Some(value) = &self.number_phases {
2294 validate::int_range(i64::from(*value), Some(0), Some(3), path, out);
2295 }
2296 path.pop();
2297 path.push_key("phaseToUse");
2298 if let Some(value) = &self.phase_to_use {
2299 validate::int_range(i64::from(*value), Some(0), Some(3), path, out);
2300 }
2301 path.pop();
2302 path.push_key("dischargeLimit");
2303 if let Some(value) = &self.discharge_limit {
2304 validate::range(
2305 *value,
2306 None,
2307 Some(crate::types::Decimal::new(0, 0)),
2308 path,
2309 out,
2310 );
2311 }
2312 path.pop();
2313 path.push_key("dischargeLimit_L2");
2314 if let Some(value) = &self.discharge_limit_l2 {
2315 validate::range(
2316 *value,
2317 None,
2318 Some(crate::types::Decimal::new(0, 0)),
2319 path,
2320 out,
2321 );
2322 }
2323 path.pop();
2324 path.push_key("dischargeLimit_L3");
2325 if let Some(value) = &self.discharge_limit_l3 {
2326 validate::range(
2327 *value,
2328 None,
2329 Some(crate::types::Decimal::new(0, 0)),
2330 path,
2331 out,
2332 );
2333 }
2334 path.pop();
2335 path.push_key("operationMode");
2336 if let Some(value) = &self.operation_mode {
2337 Validate::validate_at(value, path, out);
2338 }
2339 path.pop();
2340 path.push_key("v2xFreqWattCurve");
2341 if let Some(value) = &self.v2x_freq_watt_curve {
2342 validate::list_len(value.len(), Some(1), Some(20), path, out);
2343 for (index, item) in value.iter().enumerate() {
2344 path.push_index(index);
2345 Validate::validate_at(item, path, out);
2346 path.pop();
2347 }
2348 }
2349 path.pop();
2350 path.push_key("v2xSignalWattCurve");
2351 if let Some(value) = &self.v2x_signal_watt_curve {
2352 validate::list_len(value.len(), Some(1), Some(20), path, out);
2353 for (index, item) in value.iter().enumerate() {
2354 path.push_index(index);
2355 Validate::validate_at(item, path, out);
2356 path.pop();
2357 }
2358 }
2359 path.pop();
2360 path.push_key("customData");
2361 if let Some(value) = &self.custom_data {
2362 Validate::validate_at(value, path, out);
2363 }
2364 path.pop();
2365 }
2366}
2367
2368#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2372pub struct ChargingScheduleUpdate {
2373 #[serde(default, skip_serializing_if = "Option::is_none")]
2378 pub limit: Option<crate::types::Decimal>,
2379 #[serde(rename = "limit_L2")]
2381 #[serde(default, skip_serializing_if = "Option::is_none")]
2382 pub limit_l2: Option<crate::types::Decimal>,
2383 #[serde(rename = "limit_L3")]
2385 #[serde(default, skip_serializing_if = "Option::is_none")]
2386 pub limit_l3: Option<crate::types::Decimal>,
2387 #[serde(rename = "dischargeLimit")]
2390 #[serde(default, skip_serializing_if = "Option::is_none")]
2391 pub discharge_limit: Option<crate::types::Decimal>,
2392 #[serde(rename = "dischargeLimit_L2")]
2394 #[serde(default, skip_serializing_if = "Option::is_none")]
2395 pub discharge_limit_l2: Option<crate::types::Decimal>,
2396 #[serde(rename = "dischargeLimit_L3")]
2398 #[serde(default, skip_serializing_if = "Option::is_none")]
2399 pub discharge_limit_l3: Option<crate::types::Decimal>,
2400 #[serde(default, skip_serializing_if = "Option::is_none")]
2404 pub setpoint: Option<crate::types::Decimal>,
2405 #[serde(rename = "setpoint_L2")]
2407 #[serde(default, skip_serializing_if = "Option::is_none")]
2408 pub setpoint_l2: Option<crate::types::Decimal>,
2409 #[serde(rename = "setpoint_L3")]
2411 #[serde(default, skip_serializing_if = "Option::is_none")]
2412 pub setpoint_l3: Option<crate::types::Decimal>,
2413 #[serde(rename = "setpointReactive")]
2416 #[serde(default, skip_serializing_if = "Option::is_none")]
2417 pub setpoint_reactive: Option<crate::types::Decimal>,
2418 #[serde(rename = "setpointReactive_L2")]
2420 #[serde(default, skip_serializing_if = "Option::is_none")]
2421 pub setpoint_reactive_l2: Option<crate::types::Decimal>,
2422 #[serde(rename = "setpointReactive_L3")]
2424 #[serde(default, skip_serializing_if = "Option::is_none")]
2425 pub setpoint_reactive_l3: Option<crate::types::Decimal>,
2426 #[serde(rename = "customData")]
2428 #[serde(default, skip_serializing_if = "Option::is_none")]
2429 pub custom_data: Option<crate::types::CustomData>,
2430}
2431
2432impl ChargingScheduleUpdate {
2433 #[must_use]
2435 pub fn new() -> Self {
2436 Self::default()
2437 }
2438
2439 #[must_use]
2441 pub fn with_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2442 self.limit = Some(value.into());
2443 self
2444 }
2445
2446 #[must_use]
2448 pub fn with_limit_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2449 self.limit_l2 = Some(value.into());
2450 self
2451 }
2452
2453 #[must_use]
2455 pub fn with_limit_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2456 self.limit_l3 = Some(value.into());
2457 self
2458 }
2459
2460 #[must_use]
2462 pub fn with_discharge_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2463 self.discharge_limit = Some(value.into());
2464 self
2465 }
2466
2467 #[must_use]
2469 pub fn with_discharge_limit_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2470 self.discharge_limit_l2 = Some(value.into());
2471 self
2472 }
2473
2474 #[must_use]
2476 pub fn with_discharge_limit_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2477 self.discharge_limit_l3 = Some(value.into());
2478 self
2479 }
2480
2481 #[must_use]
2483 pub fn with_setpoint(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2484 self.setpoint = Some(value.into());
2485 self
2486 }
2487
2488 #[must_use]
2490 pub fn with_setpoint_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2491 self.setpoint_l2 = Some(value.into());
2492 self
2493 }
2494
2495 #[must_use]
2497 pub fn with_setpoint_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2498 self.setpoint_l3 = Some(value.into());
2499 self
2500 }
2501
2502 #[must_use]
2504 pub fn with_setpoint_reactive(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2505 self.setpoint_reactive = Some(value.into());
2506 self
2507 }
2508
2509 #[must_use]
2511 pub fn with_setpoint_reactive_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2512 self.setpoint_reactive_l2 = Some(value.into());
2513 self
2514 }
2515
2516 #[must_use]
2518 pub fn with_setpoint_reactive_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2519 self.setpoint_reactive_l3 = Some(value.into());
2520 self
2521 }
2522
2523 #[must_use]
2525 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2526 self.custom_data = Some(value);
2527 self
2528 }
2529}
2530
2531impl Validate for ChargingScheduleUpdate {
2532 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2533 path.push_key("dischargeLimit");
2534 if let Some(value) = &self.discharge_limit {
2535 validate::range(
2536 *value,
2537 None,
2538 Some(crate::types::Decimal::new(0, 0)),
2539 path,
2540 out,
2541 );
2542 }
2543 path.pop();
2544 path.push_key("dischargeLimit_L2");
2545 if let Some(value) = &self.discharge_limit_l2 {
2546 validate::range(
2547 *value,
2548 None,
2549 Some(crate::types::Decimal::new(0, 0)),
2550 path,
2551 out,
2552 );
2553 }
2554 path.pop();
2555 path.push_key("dischargeLimit_L3");
2556 if let Some(value) = &self.discharge_limit_l3 {
2557 validate::range(
2558 *value,
2559 None,
2560 Some(crate::types::Decimal::new(0, 0)),
2561 path,
2562 out,
2563 );
2564 }
2565 path.pop();
2566 path.push_key("customData");
2567 if let Some(value) = &self.custom_data {
2568 Validate::validate_at(value, path, out);
2569 }
2570 path.pop();
2571 }
2572}
2573
2574#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2578pub struct ChargingStation {
2579 pub model: String,
2581 #[serde(rename = "vendorName")]
2583 pub vendor_name: String,
2584 #[serde(rename = "serialNumber")]
2586 #[serde(default, skip_serializing_if = "Option::is_none")]
2587 pub serial_number: Option<String>,
2588 #[serde(default, skip_serializing_if = "Option::is_none")]
2590 pub modem: Option<Modem>,
2591 #[serde(rename = "firmwareVersion")]
2593 #[serde(default, skip_serializing_if = "Option::is_none")]
2594 pub firmware_version: Option<String>,
2595 #[serde(rename = "customData")]
2597 #[serde(default, skip_serializing_if = "Option::is_none")]
2598 pub custom_data: Option<crate::types::CustomData>,
2599}
2600
2601impl ChargingStation {
2602 #[must_use]
2604 pub fn new(model: impl Into<String>, vendor_name: impl Into<String>) -> Self {
2605 Self {
2606 model: model.into(),
2607 vendor_name: vendor_name.into(),
2608 serial_number: None,
2609 modem: None,
2610 firmware_version: None,
2611 custom_data: None,
2612 }
2613 }
2614
2615 #[must_use]
2617 pub fn with_serial_number(mut self, value: impl Into<String>) -> Self {
2618 self.serial_number = Some(value.into());
2619 self
2620 }
2621
2622 #[must_use]
2624 pub fn with_modem(mut self, value: Modem) -> Self {
2625 self.modem = Some(value);
2626 self
2627 }
2628
2629 #[must_use]
2631 pub fn with_firmware_version(mut self, value: impl Into<String>) -> Self {
2632 self.firmware_version = Some(value.into());
2633 self
2634 }
2635
2636 #[must_use]
2638 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2639 self.custom_data = Some(value);
2640 self
2641 }
2642}
2643
2644impl Validate for ChargingStation {
2645 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2646 path.push_key("model");
2647 validate::string(self.model.as_str(), None, Some(20), path, out);
2648 path.pop();
2649 path.push_key("vendorName");
2650 validate::string(self.vendor_name.as_str(), None, Some(50), path, out);
2651 path.pop();
2652 path.push_key("serialNumber");
2653 if let Some(value) = &self.serial_number {
2654 validate::string(value.as_str(), None, Some(25), path, out);
2655 }
2656 path.pop();
2657 path.push_key("modem");
2658 if let Some(value) = &self.modem {
2659 Validate::validate_at(value, path, out);
2660 }
2661 path.pop();
2662 path.push_key("firmwareVersion");
2663 if let Some(value) = &self.firmware_version {
2664 validate::string(value.as_str(), None, Some(50), path, out);
2665 }
2666 path.pop();
2667 path.push_key("customData");
2668 if let Some(value) = &self.custom_data {
2669 Validate::validate_at(value, path, out);
2670 }
2671 path.pop();
2672 }
2673}
2674
2675#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2679pub struct ClearChargingProfile {
2680 #[serde(rename = "evseId")]
2682 #[serde(default, skip_serializing_if = "Option::is_none")]
2683 pub evse_id: Option<i32>,
2684 #[serde(rename = "chargingProfilePurpose")]
2686 #[serde(default, skip_serializing_if = "Option::is_none")]
2687 pub charging_profile_purpose: Option<ChargingProfilePurpose>,
2688 #[serde(rename = "stackLevel")]
2690 #[serde(default, skip_serializing_if = "Option::is_none")]
2691 pub stack_level: Option<i32>,
2692 #[serde(rename = "customData")]
2694 #[serde(default, skip_serializing_if = "Option::is_none")]
2695 pub custom_data: Option<crate::types::CustomData>,
2696}
2697
2698impl ClearChargingProfile {
2699 #[must_use]
2701 pub fn new() -> Self {
2702 Self::default()
2703 }
2704
2705 #[must_use]
2707 pub fn with_evse_id(mut self, value: i32) -> Self {
2708 self.evse_id = Some(value);
2709 self
2710 }
2711
2712 #[must_use]
2714 pub fn with_charging_profile_purpose(mut self, value: ChargingProfilePurpose) -> Self {
2715 self.charging_profile_purpose = Some(value);
2716 self
2717 }
2718
2719 #[must_use]
2721 pub fn with_stack_level(mut self, value: i32) -> Self {
2722 self.stack_level = Some(value);
2723 self
2724 }
2725
2726 #[must_use]
2728 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2729 self.custom_data = Some(value);
2730 self
2731 }
2732}
2733
2734impl Validate for ClearChargingProfile {
2735 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2736 path.push_key("evseId");
2737 if let Some(value) = &self.evse_id {
2738 validate::int_range(i64::from(*value), Some(0), None, path, out);
2739 }
2740 path.pop();
2741 path.push_key("chargingProfilePurpose");
2742 if let Some(value) = &self.charging_profile_purpose {
2743 Validate::validate_at(value, path, out);
2744 }
2745 path.pop();
2746 path.push_key("stackLevel");
2747 if let Some(value) = &self.stack_level {
2748 validate::int_range(i64::from(*value), Some(0), None, path, out);
2749 }
2750 path.pop();
2751 path.push_key("customData");
2752 if let Some(value) = &self.custom_data {
2753 Validate::validate_at(value, path, out);
2754 }
2755 path.pop();
2756 }
2757}
2758
2759#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2761pub struct ClearMonitoringResult {
2762 pub status: ClearMonitoringStatus,
2764 pub id: i32,
2766 #[serde(rename = "statusInfo")]
2768 #[serde(default, skip_serializing_if = "Option::is_none")]
2769 pub status_info: Option<StatusInfo>,
2770 #[serde(rename = "customData")]
2772 #[serde(default, skip_serializing_if = "Option::is_none")]
2773 pub custom_data: Option<crate::types::CustomData>,
2774}
2775
2776impl ClearMonitoringResult {
2777 #[must_use]
2779 pub fn new(status: ClearMonitoringStatus, id: i32) -> Self {
2780 Self {
2781 status,
2782 id,
2783 status_info: None,
2784 custom_data: None,
2785 }
2786 }
2787
2788 #[must_use]
2790 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2791 self.status_info = Some(value);
2792 self
2793 }
2794
2795 #[must_use]
2797 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2798 self.custom_data = Some(value);
2799 self
2800 }
2801}
2802
2803impl Validate for ClearMonitoringResult {
2804 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2805 path.push_key("status");
2806 Validate::validate_at(&self.status, path, out);
2807 path.pop();
2808 path.push_key("id");
2809 validate::int_range(i64::from(self.id), Some(0), None, path, out);
2810 path.pop();
2811 path.push_key("statusInfo");
2812 if let Some(value) = &self.status_info {
2813 Validate::validate_at(value, path, out);
2814 }
2815 path.pop();
2816 path.push_key("customData");
2817 if let Some(value) = &self.custom_data {
2818 Validate::validate_at(value, path, out);
2819 }
2820 path.pop();
2821 }
2822}
2823
2824#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2826pub struct ClearTariffsResult {
2827 pub status: TariffClearStatus,
2829 #[serde(rename = "statusInfo")]
2831 #[serde(default, skip_serializing_if = "Option::is_none")]
2832 pub status_info: Option<StatusInfo>,
2833 #[serde(rename = "tariffId")]
2835 #[serde(default, skip_serializing_if = "Option::is_none")]
2836 pub tariff_id: Option<String>,
2837 #[serde(rename = "customData")]
2839 #[serde(default, skip_serializing_if = "Option::is_none")]
2840 pub custom_data: Option<crate::types::CustomData>,
2841}
2842
2843impl ClearTariffsResult {
2844 #[must_use]
2846 pub fn new(status: TariffClearStatus) -> Self {
2847 Self {
2848 status,
2849 status_info: None,
2850 tariff_id: None,
2851 custom_data: None,
2852 }
2853 }
2854
2855 #[must_use]
2857 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2858 self.status_info = Some(value);
2859 self
2860 }
2861
2862 #[must_use]
2864 pub fn with_tariff_id(mut self, value: impl Into<String>) -> Self {
2865 self.tariff_id = Some(value.into());
2866 self
2867 }
2868
2869 #[must_use]
2871 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2872 self.custom_data = Some(value);
2873 self
2874 }
2875}
2876
2877impl Validate for ClearTariffsResult {
2878 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2879 path.push_key("status");
2880 Validate::validate_at(&self.status, path, out);
2881 path.pop();
2882 path.push_key("statusInfo");
2883 if let Some(value) = &self.status_info {
2884 Validate::validate_at(value, path, out);
2885 }
2886 path.pop();
2887 path.push_key("tariffId");
2888 if let Some(value) = &self.tariff_id {
2889 validate::string(value.as_str(), None, Some(60), path, out);
2890 }
2891 path.pop();
2892 path.push_key("customData");
2893 if let Some(value) = &self.custom_data {
2894 Validate::validate_at(value, path, out);
2895 }
2896 path.pop();
2897 }
2898}
2899
2900#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2904pub struct Component {
2905 pub name: String,
2907 #[serde(default, skip_serializing_if = "Option::is_none")]
2909 pub evse: Option<EVSE>,
2910 #[serde(default, skip_serializing_if = "Option::is_none")]
2912 pub instance: Option<String>,
2913 #[serde(rename = "customData")]
2915 #[serde(default, skip_serializing_if = "Option::is_none")]
2916 pub custom_data: Option<crate::types::CustomData>,
2917}
2918
2919impl Component {
2920 #[must_use]
2922 pub fn new(name: impl Into<String>) -> Self {
2923 Self {
2924 name: name.into(),
2925 evse: None,
2926 instance: None,
2927 custom_data: None,
2928 }
2929 }
2930
2931 #[must_use]
2933 pub fn with_evse(mut self, value: EVSE) -> Self {
2934 self.evse = Some(value);
2935 self
2936 }
2937
2938 #[must_use]
2940 pub fn with_instance(mut self, value: impl Into<String>) -> Self {
2941 self.instance = Some(value.into());
2942 self
2943 }
2944
2945 #[must_use]
2947 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2948 self.custom_data = Some(value);
2949 self
2950 }
2951}
2952
2953impl Validate for Component {
2954 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2955 path.push_key("name");
2956 validate::string(self.name.as_str(), None, Some(50), path, out);
2957 path.pop();
2958 path.push_key("evse");
2959 if let Some(value) = &self.evse {
2960 Validate::validate_at(value, path, out);
2961 }
2962 path.pop();
2963 path.push_key("instance");
2964 if let Some(value) = &self.instance {
2965 validate::string(value.as_str(), None, Some(50), path, out);
2966 }
2967 path.pop();
2968 path.push_key("customData");
2969 if let Some(value) = &self.custom_data {
2970 Validate::validate_at(value, path, out);
2971 }
2972 path.pop();
2973 }
2974}
2975
2976#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2980pub struct ComponentVariable {
2981 pub component: Component,
2983 #[serde(default, skip_serializing_if = "Option::is_none")]
2985 pub variable: Option<Variable>,
2986 #[serde(rename = "customData")]
2988 #[serde(default, skip_serializing_if = "Option::is_none")]
2989 pub custom_data: Option<crate::types::CustomData>,
2990}
2991
2992impl ComponentVariable {
2993 #[must_use]
2995 pub fn new(component: Component) -> Self {
2996 Self {
2997 component,
2998 variable: None,
2999 custom_data: None,
3000 }
3001 }
3002
3003 #[must_use]
3005 pub fn with_variable(mut self, value: Variable) -> Self {
3006 self.variable = Some(value);
3007 self
3008 }
3009
3010 #[must_use]
3012 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3013 self.custom_data = Some(value);
3014 self
3015 }
3016}
3017
3018impl Validate for ComponentVariable {
3019 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3020 path.push_key("component");
3021 Validate::validate_at(&self.component, path, out);
3022 path.pop();
3023 path.push_key("variable");
3024 if let Some(value) = &self.variable {
3025 Validate::validate_at(value, path, out);
3026 }
3027 path.pop();
3028 path.push_key("customData");
3029 if let Some(value) = &self.custom_data {
3030 Validate::validate_at(value, path, out);
3031 }
3032 path.pop();
3033 }
3034}
3035
3036#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3038pub struct CompositeSchedule {
3039 #[serde(rename = "evseId")]
3041 pub evse_id: i32,
3042 pub duration: i32,
3044 #[serde(rename = "scheduleStart")]
3046 pub schedule_start: crate::types::DateTime,
3047 #[serde(rename = "chargingRateUnit")]
3049 pub charging_rate_unit: ChargingRateUnit,
3050 #[serde(rename = "chargingSchedulePeriod")]
3052 pub charging_schedule_period: Vec<ChargingSchedulePeriod>,
3053 #[serde(rename = "customData")]
3055 #[serde(default, skip_serializing_if = "Option::is_none")]
3056 pub custom_data: Option<crate::types::CustomData>,
3057}
3058
3059impl CompositeSchedule {
3060 #[must_use]
3062 pub fn new(
3063 evse_id: i32,
3064 duration: i32,
3065 schedule_start: impl Into<crate::types::DateTime>,
3066 charging_rate_unit: ChargingRateUnit,
3067 charging_schedule_period: Vec<ChargingSchedulePeriod>,
3068 ) -> Self {
3069 Self {
3070 evse_id,
3071 duration,
3072 schedule_start: schedule_start.into(),
3073 charging_rate_unit,
3074 charging_schedule_period,
3075 custom_data: None,
3076 }
3077 }
3078
3079 #[must_use]
3081 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3082 self.custom_data = Some(value);
3083 self
3084 }
3085}
3086
3087impl Validate for CompositeSchedule {
3088 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3089 path.push_key("evseId");
3090 validate::int_range(i64::from(self.evse_id), Some(0), None, path, out);
3091 path.pop();
3092 path.push_key("chargingRateUnit");
3093 Validate::validate_at(&self.charging_rate_unit, path, out);
3094 path.pop();
3095 path.push_key("chargingSchedulePeriod");
3096 validate::list_len(
3097 self.charging_schedule_period.len(),
3098 Some(1),
3099 None,
3100 path,
3101 out,
3102 );
3103 for (index, item) in self.charging_schedule_period.iter().enumerate() {
3104 path.push_index(index);
3105 Validate::validate_at(item, path, out);
3106 path.pop();
3107 }
3108 path.pop();
3109 path.push_key("customData");
3110 if let Some(value) = &self.custom_data {
3111 Validate::validate_at(value, path, out);
3112 }
3113 path.pop();
3114 }
3115}
3116
3117#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3119pub struct ConstantStreamData {
3120 pub id: i32,
3122 pub params: PeriodicEventStreamParams,
3124 #[serde(rename = "variableMonitoringId")]
3126 pub variable_monitoring_id: i32,
3127 #[serde(rename = "customData")]
3129 #[serde(default, skip_serializing_if = "Option::is_none")]
3130 pub custom_data: Option<crate::types::CustomData>,
3131}
3132
3133impl ConstantStreamData {
3134 #[must_use]
3136 pub fn new(id: i32, params: PeriodicEventStreamParams, variable_monitoring_id: i32) -> Self {
3137 Self {
3138 id,
3139 params,
3140 variable_monitoring_id,
3141 custom_data: None,
3142 }
3143 }
3144
3145 #[must_use]
3147 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3148 self.custom_data = Some(value);
3149 self
3150 }
3151}
3152
3153impl Validate for ConstantStreamData {
3154 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3155 path.push_key("id");
3156 validate::int_range(i64::from(self.id), Some(0), None, path, out);
3157 path.pop();
3158 path.push_key("params");
3159 Validate::validate_at(&self.params, path, out);
3160 path.pop();
3161 path.push_key("variableMonitoringId");
3162 validate::int_range(
3163 i64::from(self.variable_monitoring_id),
3164 Some(0),
3165 None,
3166 path,
3167 out,
3168 );
3169 path.pop();
3170 path.push_key("customData");
3171 if let Some(value) = &self.custom_data {
3172 Validate::validate_at(value, path, out);
3173 }
3174 path.pop();
3175 }
3176}
3177
3178#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3180pub struct ConsumptionCost {
3181 #[serde(rename = "startValue")]
3183 pub start_value: crate::types::Decimal,
3184 pub cost: Vec<Cost>,
3186 #[serde(rename = "customData")]
3188 #[serde(default, skip_serializing_if = "Option::is_none")]
3189 pub custom_data: Option<crate::types::CustomData>,
3190}
3191
3192impl ConsumptionCost {
3193 #[must_use]
3195 pub fn new(start_value: impl Into<crate::types::Decimal>, cost: Vec<Cost>) -> Self {
3196 Self {
3197 start_value: start_value.into(),
3198 cost,
3199 custom_data: None,
3200 }
3201 }
3202
3203 #[must_use]
3205 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3206 self.custom_data = Some(value);
3207 self
3208 }
3209}
3210
3211impl Validate for ConsumptionCost {
3212 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3213 path.push_key("cost");
3214 validate::list_len(self.cost.len(), Some(1), Some(3), path, out);
3215 for (index, item) in self.cost.iter().enumerate() {
3216 path.push_index(index);
3217 Validate::validate_at(item, path, out);
3218 path.pop();
3219 }
3220 path.pop();
3221 path.push_key("customData");
3222 if let Some(value) = &self.custom_data {
3223 Validate::validate_at(value, path, out);
3224 }
3225 path.pop();
3226 }
3227}
3228
3229#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3231pub struct Cost {
3232 #[serde(rename = "costKind")]
3234 pub cost_kind: CostKind,
3235 pub amount: i32,
3237 #[serde(rename = "amountMultiplier")]
3239 #[serde(default, skip_serializing_if = "Option::is_none")]
3240 pub amount_multiplier: Option<i32>,
3241 #[serde(rename = "customData")]
3243 #[serde(default, skip_serializing_if = "Option::is_none")]
3244 pub custom_data: Option<crate::types::CustomData>,
3245}
3246
3247impl Cost {
3248 #[must_use]
3250 pub fn new(cost_kind: CostKind, amount: i32) -> Self {
3251 Self {
3252 cost_kind,
3253 amount,
3254 amount_multiplier: None,
3255 custom_data: None,
3256 }
3257 }
3258
3259 #[must_use]
3261 pub fn with_amount_multiplier(mut self, value: i32) -> Self {
3262 self.amount_multiplier = Some(value);
3263 self
3264 }
3265
3266 #[must_use]
3268 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3269 self.custom_data = Some(value);
3270 self
3271 }
3272}
3273
3274impl Validate for Cost {
3275 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3276 path.push_key("costKind");
3277 Validate::validate_at(&self.cost_kind, path, out);
3278 path.pop();
3279 path.push_key("customData");
3280 if let Some(value) = &self.custom_data {
3281 Validate::validate_at(value, path, out);
3282 }
3283 path.pop();
3284 }
3285}
3286
3287#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3293pub struct CostDetails {
3294 #[serde(rename = "totalCost")]
3296 pub total_cost: TotalCost,
3297 #[serde(rename = "totalUsage")]
3299 pub total_usage: TotalUsage,
3300 #[serde(rename = "chargingPeriods")]
3302 #[serde(default, skip_serializing_if = "Option::is_none")]
3303 pub charging_periods: Option<Vec<ChargingPeriod>>,
3304 #[serde(rename = "failureToCalculate")]
3306 #[serde(default, skip_serializing_if = "Option::is_none")]
3307 pub failure_to_calculate: Option<bool>,
3308 #[serde(rename = "failureReason")]
3310 #[serde(default, skip_serializing_if = "Option::is_none")]
3311 pub failure_reason: Option<String>,
3312 #[serde(rename = "customData")]
3314 #[serde(default, skip_serializing_if = "Option::is_none")]
3315 pub custom_data: Option<crate::types::CustomData>,
3316}
3317
3318impl CostDetails {
3319 #[must_use]
3321 pub fn new(total_cost: TotalCost, total_usage: TotalUsage) -> Self {
3322 Self {
3323 total_cost,
3324 total_usage,
3325 charging_periods: None,
3326 failure_to_calculate: None,
3327 failure_reason: None,
3328 custom_data: None,
3329 }
3330 }
3331
3332 #[must_use]
3334 pub fn with_charging_periods(mut self, value: Vec<ChargingPeriod>) -> Self {
3335 self.charging_periods = Some(value);
3336 self
3337 }
3338
3339 #[must_use]
3341 pub fn with_failure_to_calculate(mut self, value: bool) -> Self {
3342 self.failure_to_calculate = Some(value);
3343 self
3344 }
3345
3346 #[must_use]
3348 pub fn with_failure_reason(mut self, value: impl Into<String>) -> Self {
3349 self.failure_reason = Some(value.into());
3350 self
3351 }
3352
3353 #[must_use]
3355 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3356 self.custom_data = Some(value);
3357 self
3358 }
3359}
3360
3361impl Validate for CostDetails {
3362 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3363 path.push_key("totalCost");
3364 Validate::validate_at(&self.total_cost, path, out);
3365 path.pop();
3366 path.push_key("totalUsage");
3367 Validate::validate_at(&self.total_usage, path, out);
3368 path.pop();
3369 path.push_key("chargingPeriods");
3370 if let Some(value) = &self.charging_periods {
3371 validate::list_len(value.len(), Some(1), None, path, out);
3372 for (index, item) in value.iter().enumerate() {
3373 path.push_index(index);
3374 Validate::validate_at(item, path, out);
3375 path.pop();
3376 }
3377 }
3378 path.pop();
3379 path.push_key("failureReason");
3380 if let Some(value) = &self.failure_reason {
3381 validate::string(value.as_str(), None, Some(500), path, out);
3382 }
3383 path.pop();
3384 path.push_key("customData");
3385 if let Some(value) = &self.custom_data {
3386 Validate::validate_at(value, path, out);
3387 }
3388 path.pop();
3389 }
3390}
3391
3392#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3396pub struct CostDimension {
3397 pub r#type: CostDimensionEnum,
3399 pub volume: crate::types::Decimal,
3401 #[serde(rename = "customData")]
3403 #[serde(default, skip_serializing_if = "Option::is_none")]
3404 pub custom_data: Option<crate::types::CustomData>,
3405}
3406
3407impl CostDimension {
3408 #[must_use]
3410 pub fn new(r#type: CostDimensionEnum, volume: impl Into<crate::types::Decimal>) -> Self {
3411 Self {
3412 r#type,
3413 volume: volume.into(),
3414 custom_data: None,
3415 }
3416 }
3417
3418 #[must_use]
3420 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3421 self.custom_data = Some(value);
3422 self
3423 }
3424}
3425
3426impl Validate for CostDimension {
3427 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3428 path.push_key("type");
3429 Validate::validate_at(&self.r#type, path, out);
3430 path.pop();
3431 path.push_key("customData");
3432 if let Some(value) = &self.custom_data {
3433 Validate::validate_at(value, path, out);
3434 }
3435 path.pop();
3436 }
3437}
3438
3439#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3443pub struct DCChargingParameters {
3444 #[serde(rename = "evMaxCurrent")]
3448 pub ev_max_current: crate::types::Decimal,
3449 #[serde(rename = "evMaxVoltage")]
3453 pub ev_max_voltage: crate::types::Decimal,
3454 #[serde(rename = "evMaxPower")]
3458 #[serde(default, skip_serializing_if = "Option::is_none")]
3459 pub ev_max_power: Option<crate::types::Decimal>,
3460 #[serde(rename = "evEnergyCapacity")]
3464 #[serde(default, skip_serializing_if = "Option::is_none")]
3465 pub ev_energy_capacity: Option<crate::types::Decimal>,
3466 #[serde(rename = "energyAmount")]
3470 #[serde(default, skip_serializing_if = "Option::is_none")]
3471 pub energy_amount: Option<crate::types::Decimal>,
3472 #[serde(rename = "stateOfCharge")]
3476 #[serde(default, skip_serializing_if = "Option::is_none")]
3477 pub state_of_charge: Option<i32>,
3478 #[serde(rename = "fullSoC")]
3482 #[serde(default, skip_serializing_if = "Option::is_none")]
3483 pub full_so_c: Option<i32>,
3484 #[serde(rename = "bulkSoC")]
3488 #[serde(default, skip_serializing_if = "Option::is_none")]
3489 pub bulk_so_c: Option<i32>,
3490 #[serde(rename = "customData")]
3492 #[serde(default, skip_serializing_if = "Option::is_none")]
3493 pub custom_data: Option<crate::types::CustomData>,
3494}
3495
3496impl DCChargingParameters {
3497 #[must_use]
3499 pub fn new(
3500 ev_max_current: impl Into<crate::types::Decimal>,
3501 ev_max_voltage: impl Into<crate::types::Decimal>,
3502 ) -> Self {
3503 Self {
3504 ev_max_current: ev_max_current.into(),
3505 ev_max_voltage: ev_max_voltage.into(),
3506 ev_max_power: None,
3507 ev_energy_capacity: None,
3508 energy_amount: None,
3509 state_of_charge: None,
3510 full_so_c: None,
3511 bulk_so_c: None,
3512 custom_data: None,
3513 }
3514 }
3515
3516 #[must_use]
3518 pub fn with_ev_max_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
3519 self.ev_max_power = Some(value.into());
3520 self
3521 }
3522
3523 #[must_use]
3525 pub fn with_ev_energy_capacity(mut self, value: impl Into<crate::types::Decimal>) -> Self {
3526 self.ev_energy_capacity = Some(value.into());
3527 self
3528 }
3529
3530 #[must_use]
3532 pub fn with_energy_amount(mut self, value: impl Into<crate::types::Decimal>) -> Self {
3533 self.energy_amount = Some(value.into());
3534 self
3535 }
3536
3537 #[must_use]
3539 pub fn with_state_of_charge(mut self, value: i32) -> Self {
3540 self.state_of_charge = Some(value);
3541 self
3542 }
3543
3544 #[must_use]
3546 pub fn with_full_so_c(mut self, value: i32) -> Self {
3547 self.full_so_c = Some(value);
3548 self
3549 }
3550
3551 #[must_use]
3553 pub fn with_bulk_so_c(mut self, value: i32) -> Self {
3554 self.bulk_so_c = Some(value);
3555 self
3556 }
3557
3558 #[must_use]
3560 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3561 self.custom_data = Some(value);
3562 self
3563 }
3564}
3565
3566impl Validate for DCChargingParameters {
3567 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3568 path.push_key("stateOfCharge");
3569 if let Some(value) = &self.state_of_charge {
3570 validate::int_range(i64::from(*value), Some(0), Some(100), path, out);
3571 }
3572 path.pop();
3573 path.push_key("fullSoC");
3574 if let Some(value) = &self.full_so_c {
3575 validate::int_range(i64::from(*value), Some(0), Some(100), path, out);
3576 }
3577 path.pop();
3578 path.push_key("bulkSoC");
3579 if let Some(value) = &self.bulk_so_c {
3580 validate::int_range(i64::from(*value), Some(0), Some(100), path, out);
3581 }
3582 path.pop();
3583 path.push_key("customData");
3584 if let Some(value) = &self.custom_data {
3585 Validate::validate_at(value, path, out);
3586 }
3587 path.pop();
3588 }
3589}
3590
3591#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
3602pub struct DERChargingParameters {
3603 #[serde(rename = "evSupportedDERControl")]
3606 #[serde(default, skip_serializing_if = "Option::is_none")]
3607 pub ev_supported_der_control: Option<Vec<DERControl>>,
3608 #[serde(rename = "evOverExcitedMaxDischargePower")]
3613 #[serde(default, skip_serializing_if = "Option::is_none")]
3614 pub ev_over_excited_max_discharge_power: Option<crate::types::Decimal>,
3615 #[serde(rename = "evOverExcitedPowerFactor")]
3619 #[serde(default, skip_serializing_if = "Option::is_none")]
3620 pub ev_over_excited_power_factor: Option<crate::types::Decimal>,
3621 #[serde(rename = "evUnderExcitedMaxDischargePower")]
3627 #[serde(default, skip_serializing_if = "Option::is_none")]
3628 pub ev_under_excited_max_discharge_power: Option<crate::types::Decimal>,
3629 #[serde(rename = "evUnderExcitedPowerFactor")]
3633 #[serde(default, skip_serializing_if = "Option::is_none")]
3634 pub ev_under_excited_power_factor: Option<crate::types::Decimal>,
3635 #[serde(rename = "maxApparentPower")]
3639 #[serde(default, skip_serializing_if = "Option::is_none")]
3640 pub max_apparent_power: Option<crate::types::Decimal>,
3641 #[serde(rename = "maxChargeApparentPower")]
3647 #[serde(default, skip_serializing_if = "Option::is_none")]
3648 pub max_charge_apparent_power: Option<crate::types::Decimal>,
3649 #[serde(rename = "maxChargeApparentPower_L2")]
3653 #[serde(default, skip_serializing_if = "Option::is_none")]
3654 pub max_charge_apparent_power_l2: Option<crate::types::Decimal>,
3655 #[serde(rename = "maxChargeApparentPower_L3")]
3659 #[serde(default, skip_serializing_if = "Option::is_none")]
3660 pub max_charge_apparent_power_l3: Option<crate::types::Decimal>,
3661 #[serde(rename = "maxDischargeApparentPower")]
3667 #[serde(default, skip_serializing_if = "Option::is_none")]
3668 pub max_discharge_apparent_power: Option<crate::types::Decimal>,
3669 #[serde(rename = "maxDischargeApparentPower_L2")]
3673 #[serde(default, skip_serializing_if = "Option::is_none")]
3674 pub max_discharge_apparent_power_l2: Option<crate::types::Decimal>,
3675 #[serde(rename = "maxDischargeApparentPower_L3")]
3679 #[serde(default, skip_serializing_if = "Option::is_none")]
3680 pub max_discharge_apparent_power_l3: Option<crate::types::Decimal>,
3681 #[serde(rename = "maxChargeReactivePower")]
3687 #[serde(default, skip_serializing_if = "Option::is_none")]
3688 pub max_charge_reactive_power: Option<crate::types::Decimal>,
3689 #[serde(rename = "maxChargeReactivePower_L2")]
3693 #[serde(default, skip_serializing_if = "Option::is_none")]
3694 pub max_charge_reactive_power_l2: Option<crate::types::Decimal>,
3695 #[serde(rename = "maxChargeReactivePower_L3")]
3699 #[serde(default, skip_serializing_if = "Option::is_none")]
3700 pub max_charge_reactive_power_l3: Option<crate::types::Decimal>,
3701 #[serde(rename = "minChargeReactivePower")]
3706 #[serde(default, skip_serializing_if = "Option::is_none")]
3707 pub min_charge_reactive_power: Option<crate::types::Decimal>,
3708 #[serde(rename = "minChargeReactivePower_L2")]
3711 #[serde(default, skip_serializing_if = "Option::is_none")]
3712 pub min_charge_reactive_power_l2: Option<crate::types::Decimal>,
3713 #[serde(rename = "minChargeReactivePower_L3")]
3716 #[serde(default, skip_serializing_if = "Option::is_none")]
3717 pub min_charge_reactive_power_l3: Option<crate::types::Decimal>,
3718 #[serde(rename = "maxDischargeReactivePower")]
3724 #[serde(default, skip_serializing_if = "Option::is_none")]
3725 pub max_discharge_reactive_power: Option<crate::types::Decimal>,
3726 #[serde(rename = "maxDischargeReactivePower_L2")]
3730 #[serde(default, skip_serializing_if = "Option::is_none")]
3731 pub max_discharge_reactive_power_l2: Option<crate::types::Decimal>,
3732 #[serde(rename = "maxDischargeReactivePower_L3")]
3736 #[serde(default, skip_serializing_if = "Option::is_none")]
3737 pub max_discharge_reactive_power_l3: Option<crate::types::Decimal>,
3738 #[serde(rename = "minDischargeReactivePower")]
3743 #[serde(default, skip_serializing_if = "Option::is_none")]
3744 pub min_discharge_reactive_power: Option<crate::types::Decimal>,
3745 #[serde(rename = "minDischargeReactivePower_L2")]
3748 #[serde(default, skip_serializing_if = "Option::is_none")]
3749 pub min_discharge_reactive_power_l2: Option<crate::types::Decimal>,
3750 #[serde(rename = "minDischargeReactivePower_L3")]
3753 #[serde(default, skip_serializing_if = "Option::is_none")]
3754 pub min_discharge_reactive_power_l3: Option<crate::types::Decimal>,
3755 #[serde(rename = "nominalVoltage")]
3758 #[serde(default, skip_serializing_if = "Option::is_none")]
3759 pub nominal_voltage: Option<crate::types::Decimal>,
3760 #[serde(rename = "nominalVoltageOffset")]
3763 #[serde(default, skip_serializing_if = "Option::is_none")]
3764 pub nominal_voltage_offset: Option<crate::types::Decimal>,
3765 #[serde(rename = "maxNominalVoltage")]
3768 #[serde(default, skip_serializing_if = "Option::is_none")]
3769 pub max_nominal_voltage: Option<crate::types::Decimal>,
3770 #[serde(rename = "minNominalVoltage")]
3773 #[serde(default, skip_serializing_if = "Option::is_none")]
3774 pub min_nominal_voltage: Option<crate::types::Decimal>,
3775 #[serde(rename = "evInverterManufacturer")]
3778 #[serde(default, skip_serializing_if = "Option::is_none")]
3779 pub ev_inverter_manufacturer: Option<String>,
3780 #[serde(rename = "evInverterModel")]
3783 #[serde(default, skip_serializing_if = "Option::is_none")]
3784 pub ev_inverter_model: Option<String>,
3785 #[serde(rename = "evInverterSerialNumber")]
3788 #[serde(default, skip_serializing_if = "Option::is_none")]
3789 pub ev_inverter_serial_number: Option<String>,
3790 #[serde(rename = "evInverterSwVersion")]
3793 #[serde(default, skip_serializing_if = "Option::is_none")]
3794 pub ev_inverter_sw_version: Option<String>,
3795 #[serde(rename = "evInverterHwVersion")]
3798 #[serde(default, skip_serializing_if = "Option::is_none")]
3799 pub ev_inverter_hw_version: Option<String>,
3800 #[serde(rename = "evIslandingDetectionMethod")]
3803 #[serde(default, skip_serializing_if = "Option::is_none")]
3804 pub ev_islanding_detection_method: Option<Vec<IslandingDetection>>,
3805 #[serde(rename = "evIslandingTripTime")]
3808 #[serde(default, skip_serializing_if = "Option::is_none")]
3809 pub ev_islanding_trip_time: Option<crate::types::Decimal>,
3810 #[serde(rename = "evMaximumLevel1DCInjection")]
3813 #[serde(default, skip_serializing_if = "Option::is_none")]
3814 pub ev_maximum_level1_dc_injection: Option<crate::types::Decimal>,
3815 #[serde(rename = "evDurationLevel1DCInjection")]
3818 #[serde(default, skip_serializing_if = "Option::is_none")]
3819 pub ev_duration_level1_dc_injection: Option<crate::types::Decimal>,
3820 #[serde(rename = "evMaximumLevel2DCInjection")]
3823 #[serde(default, skip_serializing_if = "Option::is_none")]
3824 pub ev_maximum_level2_dc_injection: Option<crate::types::Decimal>,
3825 #[serde(rename = "evDurationLevel2DCInjection")]
3828 #[serde(default, skip_serializing_if = "Option::is_none")]
3829 pub ev_duration_level2_dc_injection: Option<crate::types::Decimal>,
3830 #[serde(rename = "evReactiveSusceptance")]
3833 #[serde(default, skip_serializing_if = "Option::is_none")]
3834 pub ev_reactive_susceptance: Option<crate::types::Decimal>,
3835 #[serde(rename = "evSessionTotalDischargeEnergyAvailable")]
3838 #[serde(default, skip_serializing_if = "Option::is_none")]
3839 pub ev_session_total_discharge_energy_available: Option<crate::types::Decimal>,
3840 #[serde(rename = "customData")]
3842 #[serde(default, skip_serializing_if = "Option::is_none")]
3843 pub custom_data: Option<crate::types::CustomData>,
3844}
3845
3846impl DERChargingParameters {
3847 #[must_use]
3849 pub fn new() -> Self {
3850 Self::default()
3851 }
3852
3853 #[must_use]
3855 pub fn with_ev_supported_der_control(mut self, value: Vec<DERControl>) -> Self {
3856 self.ev_supported_der_control = Some(value);
3857 self
3858 }
3859
3860 #[must_use]
3862 pub fn with_ev_over_excited_max_discharge_power(
3863 mut self,
3864 value: impl Into<crate::types::Decimal>,
3865 ) -> Self {
3866 self.ev_over_excited_max_discharge_power = Some(value.into());
3867 self
3868 }
3869
3870 #[must_use]
3872 pub fn with_ev_over_excited_power_factor(
3873 mut self,
3874 value: impl Into<crate::types::Decimal>,
3875 ) -> Self {
3876 self.ev_over_excited_power_factor = Some(value.into());
3877 self
3878 }
3879
3880 #[must_use]
3882 pub fn with_ev_under_excited_max_discharge_power(
3883 mut self,
3884 value: impl Into<crate::types::Decimal>,
3885 ) -> Self {
3886 self.ev_under_excited_max_discharge_power = Some(value.into());
3887 self
3888 }
3889
3890 #[must_use]
3892 pub fn with_ev_under_excited_power_factor(
3893 mut self,
3894 value: impl Into<crate::types::Decimal>,
3895 ) -> Self {
3896 self.ev_under_excited_power_factor = Some(value.into());
3897 self
3898 }
3899
3900 #[must_use]
3902 pub fn with_max_apparent_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
3903 self.max_apparent_power = Some(value.into());
3904 self
3905 }
3906
3907 #[must_use]
3909 pub fn with_max_charge_apparent_power(
3910 mut self,
3911 value: impl Into<crate::types::Decimal>,
3912 ) -> Self {
3913 self.max_charge_apparent_power = Some(value.into());
3914 self
3915 }
3916
3917 #[must_use]
3919 pub fn with_max_charge_apparent_power_l2(
3920 mut self,
3921 value: impl Into<crate::types::Decimal>,
3922 ) -> Self {
3923 self.max_charge_apparent_power_l2 = Some(value.into());
3924 self
3925 }
3926
3927 #[must_use]
3929 pub fn with_max_charge_apparent_power_l3(
3930 mut self,
3931 value: impl Into<crate::types::Decimal>,
3932 ) -> Self {
3933 self.max_charge_apparent_power_l3 = Some(value.into());
3934 self
3935 }
3936
3937 #[must_use]
3939 pub fn with_max_discharge_apparent_power(
3940 mut self,
3941 value: impl Into<crate::types::Decimal>,
3942 ) -> Self {
3943 self.max_discharge_apparent_power = Some(value.into());
3944 self
3945 }
3946
3947 #[must_use]
3949 pub fn with_max_discharge_apparent_power_l2(
3950 mut self,
3951 value: impl Into<crate::types::Decimal>,
3952 ) -> Self {
3953 self.max_discharge_apparent_power_l2 = Some(value.into());
3954 self
3955 }
3956
3957 #[must_use]
3959 pub fn with_max_discharge_apparent_power_l3(
3960 mut self,
3961 value: impl Into<crate::types::Decimal>,
3962 ) -> Self {
3963 self.max_discharge_apparent_power_l3 = Some(value.into());
3964 self
3965 }
3966
3967 #[must_use]
3969 pub fn with_max_charge_reactive_power(
3970 mut self,
3971 value: impl Into<crate::types::Decimal>,
3972 ) -> Self {
3973 self.max_charge_reactive_power = Some(value.into());
3974 self
3975 }
3976
3977 #[must_use]
3979 pub fn with_max_charge_reactive_power_l2(
3980 mut self,
3981 value: impl Into<crate::types::Decimal>,
3982 ) -> Self {
3983 self.max_charge_reactive_power_l2 = Some(value.into());
3984 self
3985 }
3986
3987 #[must_use]
3989 pub fn with_max_charge_reactive_power_l3(
3990 mut self,
3991 value: impl Into<crate::types::Decimal>,
3992 ) -> Self {
3993 self.max_charge_reactive_power_l3 = Some(value.into());
3994 self
3995 }
3996
3997 #[must_use]
3999 pub fn with_min_charge_reactive_power(
4000 mut self,
4001 value: impl Into<crate::types::Decimal>,
4002 ) -> Self {
4003 self.min_charge_reactive_power = Some(value.into());
4004 self
4005 }
4006
4007 #[must_use]
4009 pub fn with_min_charge_reactive_power_l2(
4010 mut self,
4011 value: impl Into<crate::types::Decimal>,
4012 ) -> Self {
4013 self.min_charge_reactive_power_l2 = Some(value.into());
4014 self
4015 }
4016
4017 #[must_use]
4019 pub fn with_min_charge_reactive_power_l3(
4020 mut self,
4021 value: impl Into<crate::types::Decimal>,
4022 ) -> Self {
4023 self.min_charge_reactive_power_l3 = Some(value.into());
4024 self
4025 }
4026
4027 #[must_use]
4029 pub fn with_max_discharge_reactive_power(
4030 mut self,
4031 value: impl Into<crate::types::Decimal>,
4032 ) -> Self {
4033 self.max_discharge_reactive_power = Some(value.into());
4034 self
4035 }
4036
4037 #[must_use]
4039 pub fn with_max_discharge_reactive_power_l2(
4040 mut self,
4041 value: impl Into<crate::types::Decimal>,
4042 ) -> Self {
4043 self.max_discharge_reactive_power_l2 = Some(value.into());
4044 self
4045 }
4046
4047 #[must_use]
4049 pub fn with_max_discharge_reactive_power_l3(
4050 mut self,
4051 value: impl Into<crate::types::Decimal>,
4052 ) -> Self {
4053 self.max_discharge_reactive_power_l3 = Some(value.into());
4054 self
4055 }
4056
4057 #[must_use]
4059 pub fn with_min_discharge_reactive_power(
4060 mut self,
4061 value: impl Into<crate::types::Decimal>,
4062 ) -> Self {
4063 self.min_discharge_reactive_power = Some(value.into());
4064 self
4065 }
4066
4067 #[must_use]
4069 pub fn with_min_discharge_reactive_power_l2(
4070 mut self,
4071 value: impl Into<crate::types::Decimal>,
4072 ) -> Self {
4073 self.min_discharge_reactive_power_l2 = Some(value.into());
4074 self
4075 }
4076
4077 #[must_use]
4079 pub fn with_min_discharge_reactive_power_l3(
4080 mut self,
4081 value: impl Into<crate::types::Decimal>,
4082 ) -> Self {
4083 self.min_discharge_reactive_power_l3 = Some(value.into());
4084 self
4085 }
4086
4087 #[must_use]
4089 pub fn with_nominal_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4090 self.nominal_voltage = Some(value.into());
4091 self
4092 }
4093
4094 #[must_use]
4096 pub fn with_nominal_voltage_offset(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4097 self.nominal_voltage_offset = Some(value.into());
4098 self
4099 }
4100
4101 #[must_use]
4103 pub fn with_max_nominal_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4104 self.max_nominal_voltage = Some(value.into());
4105 self
4106 }
4107
4108 #[must_use]
4110 pub fn with_min_nominal_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4111 self.min_nominal_voltage = Some(value.into());
4112 self
4113 }
4114
4115 #[must_use]
4117 pub fn with_ev_inverter_manufacturer(mut self, value: impl Into<String>) -> Self {
4118 self.ev_inverter_manufacturer = Some(value.into());
4119 self
4120 }
4121
4122 #[must_use]
4124 pub fn with_ev_inverter_model(mut self, value: impl Into<String>) -> Self {
4125 self.ev_inverter_model = Some(value.into());
4126 self
4127 }
4128
4129 #[must_use]
4131 pub fn with_ev_inverter_serial_number(mut self, value: impl Into<String>) -> Self {
4132 self.ev_inverter_serial_number = Some(value.into());
4133 self
4134 }
4135
4136 #[must_use]
4138 pub fn with_ev_inverter_sw_version(mut self, value: impl Into<String>) -> Self {
4139 self.ev_inverter_sw_version = Some(value.into());
4140 self
4141 }
4142
4143 #[must_use]
4145 pub fn with_ev_inverter_hw_version(mut self, value: impl Into<String>) -> Self {
4146 self.ev_inverter_hw_version = Some(value.into());
4147 self
4148 }
4149
4150 #[must_use]
4152 pub fn with_ev_islanding_detection_method(mut self, value: Vec<IslandingDetection>) -> Self {
4153 self.ev_islanding_detection_method = Some(value);
4154 self
4155 }
4156
4157 #[must_use]
4159 pub fn with_ev_islanding_trip_time(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4160 self.ev_islanding_trip_time = Some(value.into());
4161 self
4162 }
4163
4164 #[must_use]
4166 pub fn with_ev_maximum_level1_dc_injection(
4167 mut self,
4168 value: impl Into<crate::types::Decimal>,
4169 ) -> Self {
4170 self.ev_maximum_level1_dc_injection = Some(value.into());
4171 self
4172 }
4173
4174 #[must_use]
4176 pub fn with_ev_duration_level1_dc_injection(
4177 mut self,
4178 value: impl Into<crate::types::Decimal>,
4179 ) -> Self {
4180 self.ev_duration_level1_dc_injection = Some(value.into());
4181 self
4182 }
4183
4184 #[must_use]
4186 pub fn with_ev_maximum_level2_dc_injection(
4187 mut self,
4188 value: impl Into<crate::types::Decimal>,
4189 ) -> Self {
4190 self.ev_maximum_level2_dc_injection = Some(value.into());
4191 self
4192 }
4193
4194 #[must_use]
4196 pub fn with_ev_duration_level2_dc_injection(
4197 mut self,
4198 value: impl Into<crate::types::Decimal>,
4199 ) -> Self {
4200 self.ev_duration_level2_dc_injection = Some(value.into());
4201 self
4202 }
4203
4204 #[must_use]
4206 pub fn with_ev_reactive_susceptance(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4207 self.ev_reactive_susceptance = Some(value.into());
4208 self
4209 }
4210
4211 #[must_use]
4213 pub fn with_ev_session_total_discharge_energy_available(
4214 mut self,
4215 value: impl Into<crate::types::Decimal>,
4216 ) -> Self {
4217 self.ev_session_total_discharge_energy_available = Some(value.into());
4218 self
4219 }
4220
4221 #[must_use]
4223 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4224 self.custom_data = Some(value);
4225 self
4226 }
4227}
4228
4229impl Validate for DERChargingParameters {
4230 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4231 path.push_key("evSupportedDERControl");
4232 if let Some(value) = &self.ev_supported_der_control {
4233 validate::list_len(value.len(), Some(1), None, path, out);
4234 for (index, item) in value.iter().enumerate() {
4235 path.push_index(index);
4236 Validate::validate_at(item, path, out);
4237 path.pop();
4238 }
4239 }
4240 path.pop();
4241 path.push_key("evInverterManufacturer");
4242 if let Some(value) = &self.ev_inverter_manufacturer {
4243 validate::string(value.as_str(), None, Some(50), path, out);
4244 }
4245 path.pop();
4246 path.push_key("evInverterModel");
4247 if let Some(value) = &self.ev_inverter_model {
4248 validate::string(value.as_str(), None, Some(50), path, out);
4249 }
4250 path.pop();
4251 path.push_key("evInverterSerialNumber");
4252 if let Some(value) = &self.ev_inverter_serial_number {
4253 validate::string(value.as_str(), None, Some(50), path, out);
4254 }
4255 path.pop();
4256 path.push_key("evInverterSwVersion");
4257 if let Some(value) = &self.ev_inverter_sw_version {
4258 validate::string(value.as_str(), None, Some(50), path, out);
4259 }
4260 path.pop();
4261 path.push_key("evInverterHwVersion");
4262 if let Some(value) = &self.ev_inverter_hw_version {
4263 validate::string(value.as_str(), None, Some(50), path, out);
4264 }
4265 path.pop();
4266 path.push_key("evIslandingDetectionMethod");
4267 if let Some(value) = &self.ev_islanding_detection_method {
4268 validate::list_len(value.len(), Some(1), None, path, out);
4269 for (index, item) in value.iter().enumerate() {
4270 path.push_index(index);
4271 Validate::validate_at(item, path, out);
4272 path.pop();
4273 }
4274 }
4275 path.pop();
4276 path.push_key("customData");
4277 if let Some(value) = &self.custom_data {
4278 Validate::validate_at(value, path, out);
4279 }
4280 path.pop();
4281 }
4282}
4283
4284#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4286pub struct DERCurve {
4287 #[serde(rename = "curveData")]
4289 pub curve_data: Vec<DERCurvePoints>,
4290 pub priority: i32,
4292 #[serde(rename = "yUnit")]
4294 pub y_unit: DERUnit,
4295 #[serde(default, skip_serializing_if = "Option::is_none")]
4297 pub hysteresis: Option<Hysteresis>,
4298 #[serde(rename = "reactivePowerParams")]
4300 #[serde(default, skip_serializing_if = "Option::is_none")]
4301 pub reactive_power_params: Option<ReactivePowerParams>,
4302 #[serde(rename = "voltageParams")]
4304 #[serde(default, skip_serializing_if = "Option::is_none")]
4305 pub voltage_params: Option<VoltageParams>,
4306 #[serde(rename = "responseTime")]
4308 #[serde(default, skip_serializing_if = "Option::is_none")]
4309 pub response_time: Option<crate::types::Decimal>,
4310 #[serde(rename = "startTime")]
4312 #[serde(default, skip_serializing_if = "Option::is_none")]
4313 pub start_time: Option<crate::types::DateTime>,
4314 #[serde(default, skip_serializing_if = "Option::is_none")]
4316 pub duration: Option<crate::types::Decimal>,
4317 #[serde(rename = "customData")]
4319 #[serde(default, skip_serializing_if = "Option::is_none")]
4320 pub custom_data: Option<crate::types::CustomData>,
4321}
4322
4323impl DERCurve {
4324 #[must_use]
4326 pub fn new(curve_data: Vec<DERCurvePoints>, priority: i32, y_unit: DERUnit) -> Self {
4327 Self {
4328 curve_data,
4329 priority,
4330 y_unit,
4331 hysteresis: None,
4332 reactive_power_params: None,
4333 voltage_params: None,
4334 response_time: None,
4335 start_time: None,
4336 duration: None,
4337 custom_data: None,
4338 }
4339 }
4340
4341 #[must_use]
4343 pub fn with_hysteresis(mut self, value: Hysteresis) -> Self {
4344 self.hysteresis = Some(value);
4345 self
4346 }
4347
4348 #[must_use]
4350 pub fn with_reactive_power_params(mut self, value: ReactivePowerParams) -> Self {
4351 self.reactive_power_params = Some(value);
4352 self
4353 }
4354
4355 #[must_use]
4357 pub fn with_voltage_params(mut self, value: VoltageParams) -> Self {
4358 self.voltage_params = Some(value);
4359 self
4360 }
4361
4362 #[must_use]
4364 pub fn with_response_time(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4365 self.response_time = Some(value.into());
4366 self
4367 }
4368
4369 #[must_use]
4371 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
4372 self.start_time = Some(value.into());
4373 self
4374 }
4375
4376 #[must_use]
4378 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4379 self.duration = Some(value.into());
4380 self
4381 }
4382
4383 #[must_use]
4385 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4386 self.custom_data = Some(value);
4387 self
4388 }
4389}
4390
4391impl Validate for DERCurve {
4392 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4393 path.push_key("curveData");
4394 validate::list_len(self.curve_data.len(), Some(1), Some(10), path, out);
4395 for (index, item) in self.curve_data.iter().enumerate() {
4396 path.push_index(index);
4397 Validate::validate_at(item, path, out);
4398 path.pop();
4399 }
4400 path.pop();
4401 path.push_key("priority");
4402 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
4403 path.pop();
4404 path.push_key("yUnit");
4405 Validate::validate_at(&self.y_unit, path, out);
4406 path.pop();
4407 path.push_key("hysteresis");
4408 if let Some(value) = &self.hysteresis {
4409 Validate::validate_at(value, path, out);
4410 }
4411 path.pop();
4412 path.push_key("reactivePowerParams");
4413 if let Some(value) = &self.reactive_power_params {
4414 Validate::validate_at(value, path, out);
4415 }
4416 path.pop();
4417 path.push_key("voltageParams");
4418 if let Some(value) = &self.voltage_params {
4419 Validate::validate_at(value, path, out);
4420 }
4421 path.pop();
4422 path.push_key("customData");
4423 if let Some(value) = &self.custom_data {
4424 Validate::validate_at(value, path, out);
4425 }
4426 path.pop();
4427 }
4428}
4429
4430#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4432pub struct DERCurveGet {
4433 pub curve: DERCurve,
4435 pub id: String,
4437 #[serde(rename = "curveType")]
4439 pub curve_type: DERControl,
4440 #[serde(rename = "isDefault")]
4442 pub is_default: bool,
4443 #[serde(rename = "isSuperseded")]
4445 pub is_superseded: bool,
4446 #[serde(rename = "customData")]
4448 #[serde(default, skip_serializing_if = "Option::is_none")]
4449 pub custom_data: Option<crate::types::CustomData>,
4450}
4451
4452impl DERCurveGet {
4453 #[must_use]
4455 pub fn new(
4456 curve: DERCurve,
4457 id: impl Into<String>,
4458 curve_type: DERControl,
4459 is_default: bool,
4460 is_superseded: bool,
4461 ) -> Self {
4462 Self {
4463 curve,
4464 id: id.into(),
4465 curve_type,
4466 is_default,
4467 is_superseded,
4468 custom_data: None,
4469 }
4470 }
4471
4472 #[must_use]
4474 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4475 self.custom_data = Some(value);
4476 self
4477 }
4478}
4479
4480impl Validate for DERCurveGet {
4481 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4482 path.push_key("curve");
4483 Validate::validate_at(&self.curve, path, out);
4484 path.pop();
4485 path.push_key("id");
4486 validate::string(self.id.as_str(), None, Some(36), path, out);
4487 path.pop();
4488 path.push_key("curveType");
4489 Validate::validate_at(&self.curve_type, path, out);
4490 path.pop();
4491 path.push_key("customData");
4492 if let Some(value) = &self.custom_data {
4493 Validate::validate_at(value, path, out);
4494 }
4495 path.pop();
4496 }
4497}
4498
4499#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4501pub struct DERCurvePoints {
4502 pub x: crate::types::Decimal,
4504 pub y: crate::types::Decimal,
4506 #[serde(rename = "customData")]
4508 #[serde(default, skip_serializing_if = "Option::is_none")]
4509 pub custom_data: Option<crate::types::CustomData>,
4510}
4511
4512impl DERCurvePoints {
4513 #[must_use]
4515 pub fn new(x: impl Into<crate::types::Decimal>, y: impl Into<crate::types::Decimal>) -> Self {
4516 Self {
4517 x: x.into(),
4518 y: y.into(),
4519 custom_data: None,
4520 }
4521 }
4522
4523 #[must_use]
4525 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4526 self.custom_data = Some(value);
4527 self
4528 }
4529}
4530
4531impl Validate for DERCurvePoints {
4532 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4533 path.push_key("customData");
4534 if let Some(value) = &self.custom_data {
4535 Validate::validate_at(value, path, out);
4536 }
4537 path.pop();
4538 }
4539}
4540
4541#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4545pub struct EVAbsolutePriceSchedule {
4546 #[serde(rename = "timeAnchor")]
4548 pub time_anchor: crate::types::DateTime,
4549 pub currency: String,
4551 #[serde(rename = "evAbsolutePriceScheduleEntries")]
4553 pub ev_absolute_price_schedule_entries: Vec<EVAbsolutePriceScheduleEntry>,
4554 #[serde(rename = "priceAlgorithm")]
4556 pub price_algorithm: String,
4557 #[serde(rename = "customData")]
4559 #[serde(default, skip_serializing_if = "Option::is_none")]
4560 pub custom_data: Option<crate::types::CustomData>,
4561}
4562
4563impl EVAbsolutePriceSchedule {
4564 #[must_use]
4566 pub fn new(
4567 time_anchor: impl Into<crate::types::DateTime>,
4568 currency: impl Into<String>,
4569 ev_absolute_price_schedule_entries: Vec<EVAbsolutePriceScheduleEntry>,
4570 price_algorithm: impl Into<String>,
4571 ) -> Self {
4572 Self {
4573 time_anchor: time_anchor.into(),
4574 currency: currency.into(),
4575 ev_absolute_price_schedule_entries,
4576 price_algorithm: price_algorithm.into(),
4577 custom_data: None,
4578 }
4579 }
4580
4581 #[must_use]
4583 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4584 self.custom_data = Some(value);
4585 self
4586 }
4587}
4588
4589impl Validate for EVAbsolutePriceSchedule {
4590 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4591 path.push_key("currency");
4592 validate::string(self.currency.as_str(), None, Some(3), path, out);
4593 path.pop();
4594 path.push_key("evAbsolutePriceScheduleEntries");
4595 validate::list_len(
4596 self.ev_absolute_price_schedule_entries.len(),
4597 Some(1),
4598 Some(1024),
4599 path,
4600 out,
4601 );
4602 for (index, item) in self.ev_absolute_price_schedule_entries.iter().enumerate() {
4603 path.push_index(index);
4604 Validate::validate_at(item, path, out);
4605 path.pop();
4606 }
4607 path.pop();
4608 path.push_key("priceAlgorithm");
4609 validate::string(self.price_algorithm.as_str(), None, Some(2000), path, out);
4610 path.pop();
4611 path.push_key("customData");
4612 if let Some(value) = &self.custom_data {
4613 Validate::validate_at(value, path, out);
4614 }
4615 path.pop();
4616 }
4617}
4618
4619#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4623pub struct EVAbsolutePriceScheduleEntry {
4624 pub duration: i32,
4626 #[serde(rename = "evPriceRule")]
4628 pub ev_price_rule: Vec<EVPriceRule>,
4629 #[serde(rename = "customData")]
4631 #[serde(default, skip_serializing_if = "Option::is_none")]
4632 pub custom_data: Option<crate::types::CustomData>,
4633}
4634
4635impl EVAbsolutePriceScheduleEntry {
4636 #[must_use]
4638 pub fn new(duration: i32, ev_price_rule: Vec<EVPriceRule>) -> Self {
4639 Self {
4640 duration,
4641 ev_price_rule,
4642 custom_data: None,
4643 }
4644 }
4645
4646 #[must_use]
4648 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4649 self.custom_data = Some(value);
4650 self
4651 }
4652}
4653
4654impl Validate for EVAbsolutePriceScheduleEntry {
4655 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4656 path.push_key("evPriceRule");
4657 validate::list_len(self.ev_price_rule.len(), Some(1), Some(8), path, out);
4658 for (index, item) in self.ev_price_rule.iter().enumerate() {
4659 path.push_index(index);
4660 Validate::validate_at(item, path, out);
4661 path.pop();
4662 }
4663 path.pop();
4664 path.push_key("customData");
4665 if let Some(value) = &self.custom_data {
4666 Validate::validate_at(value, path, out);
4667 }
4668 path.pop();
4669 }
4670}
4671
4672#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4676pub struct EVEnergyOffer {
4677 #[serde(rename = "evPowerSchedule")]
4679 pub ev_power_schedule: EVPowerSchedule,
4680 #[serde(rename = "evAbsolutePriceSchedule")]
4682 #[serde(default, skip_serializing_if = "Option::is_none")]
4683 pub ev_absolute_price_schedule: Option<EVAbsolutePriceSchedule>,
4684 #[serde(rename = "customData")]
4686 #[serde(default, skip_serializing_if = "Option::is_none")]
4687 pub custom_data: Option<crate::types::CustomData>,
4688}
4689
4690impl EVEnergyOffer {
4691 #[must_use]
4693 pub fn new(ev_power_schedule: EVPowerSchedule) -> Self {
4694 Self {
4695 ev_power_schedule,
4696 ev_absolute_price_schedule: None,
4697 custom_data: None,
4698 }
4699 }
4700
4701 #[must_use]
4703 pub fn with_ev_absolute_price_schedule(mut self, value: EVAbsolutePriceSchedule) -> Self {
4704 self.ev_absolute_price_schedule = Some(value);
4705 self
4706 }
4707
4708 #[must_use]
4710 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4711 self.custom_data = Some(value);
4712 self
4713 }
4714}
4715
4716impl Validate for EVEnergyOffer {
4717 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4718 path.push_key("evPowerSchedule");
4719 Validate::validate_at(&self.ev_power_schedule, path, out);
4720 path.pop();
4721 path.push_key("evAbsolutePriceSchedule");
4722 if let Some(value) = &self.ev_absolute_price_schedule {
4723 Validate::validate_at(value, path, out);
4724 }
4725 path.pop();
4726 path.push_key("customData");
4727 if let Some(value) = &self.custom_data {
4728 Validate::validate_at(value, path, out);
4729 }
4730 path.pop();
4731 }
4732}
4733
4734#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4738pub struct EVPowerSchedule {
4739 #[serde(rename = "evPowerScheduleEntries")]
4741 pub ev_power_schedule_entries: Vec<EVPowerScheduleEntry>,
4742 #[serde(rename = "timeAnchor")]
4744 pub time_anchor: crate::types::DateTime,
4745 #[serde(rename = "customData")]
4747 #[serde(default, skip_serializing_if = "Option::is_none")]
4748 pub custom_data: Option<crate::types::CustomData>,
4749}
4750
4751impl EVPowerSchedule {
4752 #[must_use]
4754 pub fn new(
4755 ev_power_schedule_entries: Vec<EVPowerScheduleEntry>,
4756 time_anchor: impl Into<crate::types::DateTime>,
4757 ) -> Self {
4758 Self {
4759 ev_power_schedule_entries,
4760 time_anchor: time_anchor.into(),
4761 custom_data: None,
4762 }
4763 }
4764
4765 #[must_use]
4767 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4768 self.custom_data = Some(value);
4769 self
4770 }
4771}
4772
4773impl Validate for EVPowerSchedule {
4774 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4775 path.push_key("evPowerScheduleEntries");
4776 validate::list_len(
4777 self.ev_power_schedule_entries.len(),
4778 Some(1),
4779 Some(1024),
4780 path,
4781 out,
4782 );
4783 for (index, item) in self.ev_power_schedule_entries.iter().enumerate() {
4784 path.push_index(index);
4785 Validate::validate_at(item, path, out);
4786 path.pop();
4787 }
4788 path.pop();
4789 path.push_key("customData");
4790 if let Some(value) = &self.custom_data {
4791 Validate::validate_at(value, path, out);
4792 }
4793 path.pop();
4794 }
4795}
4796
4797#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4801pub struct EVPowerScheduleEntry {
4802 pub duration: i32,
4804 pub power: crate::types::Decimal,
4806 #[serde(rename = "customData")]
4808 #[serde(default, skip_serializing_if = "Option::is_none")]
4809 pub custom_data: Option<crate::types::CustomData>,
4810}
4811
4812impl EVPowerScheduleEntry {
4813 #[must_use]
4815 pub fn new(duration: i32, power: impl Into<crate::types::Decimal>) -> Self {
4816 Self {
4817 duration,
4818 power: power.into(),
4819 custom_data: None,
4820 }
4821 }
4822
4823 #[must_use]
4825 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4826 self.custom_data = Some(value);
4827 self
4828 }
4829}
4830
4831impl Validate for EVPowerScheduleEntry {
4832 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4833 path.push_key("customData");
4834 if let Some(value) = &self.custom_data {
4835 Validate::validate_at(value, path, out);
4836 }
4837 path.pop();
4838 }
4839}
4840
4841#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4845pub struct EVPriceRule {
4846 #[serde(rename = "energyFee")]
4848 pub energy_fee: crate::types::Decimal,
4849 #[serde(rename = "powerRangeStart")]
4851 pub power_range_start: crate::types::Decimal,
4852 #[serde(rename = "customData")]
4854 #[serde(default, skip_serializing_if = "Option::is_none")]
4855 pub custom_data: Option<crate::types::CustomData>,
4856}
4857
4858impl EVPriceRule {
4859 #[must_use]
4861 pub fn new(
4862 energy_fee: impl Into<crate::types::Decimal>,
4863 power_range_start: impl Into<crate::types::Decimal>,
4864 ) -> Self {
4865 Self {
4866 energy_fee: energy_fee.into(),
4867 power_range_start: power_range_start.into(),
4868 custom_data: None,
4869 }
4870 }
4871
4872 #[must_use]
4874 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4875 self.custom_data = Some(value);
4876 self
4877 }
4878}
4879
4880impl Validate for EVPriceRule {
4881 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4882 path.push_key("customData");
4883 if let Some(value) = &self.custom_data {
4884 Validate::validate_at(value, path, out);
4885 }
4886 path.pop();
4887 }
4888}
4889
4890#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4894pub struct EVSE {
4895 pub id: i32,
4897 #[serde(rename = "connectorId")]
4899 #[serde(default, skip_serializing_if = "Option::is_none")]
4900 pub connector_id: Option<i32>,
4901 #[serde(rename = "customData")]
4903 #[serde(default, skip_serializing_if = "Option::is_none")]
4904 pub custom_data: Option<crate::types::CustomData>,
4905}
4906
4907impl EVSE {
4908 #[must_use]
4910 pub fn new(id: i32) -> Self {
4911 Self {
4912 id,
4913 connector_id: None,
4914 custom_data: None,
4915 }
4916 }
4917
4918 #[must_use]
4920 pub fn with_connector_id(mut self, value: i32) -> Self {
4921 self.connector_id = Some(value);
4922 self
4923 }
4924
4925 #[must_use]
4927 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4928 self.custom_data = Some(value);
4929 self
4930 }
4931}
4932
4933impl Validate for EVSE {
4934 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4935 path.push_key("id");
4936 validate::int_range(i64::from(self.id), Some(0), None, path, out);
4937 path.pop();
4938 path.push_key("connectorId");
4939 if let Some(value) = &self.connector_id {
4940 validate::int_range(i64::from(*value), Some(0), None, path, out);
4941 }
4942 path.pop();
4943 path.push_key("customData");
4944 if let Some(value) = &self.custom_data {
4945 Validate::validate_at(value, path, out);
4946 }
4947 path.pop();
4948 }
4949}
4950
4951#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4953pub struct EnterService {
4954 pub priority: i32,
4956 #[serde(rename = "highVoltage")]
4958 pub high_voltage: crate::types::Decimal,
4959 #[serde(rename = "lowVoltage")]
4961 pub low_voltage: crate::types::Decimal,
4962 #[serde(rename = "highFreq")]
4964 pub high_freq: crate::types::Decimal,
4965 #[serde(rename = "lowFreq")]
4967 pub low_freq: crate::types::Decimal,
4968 #[serde(default, skip_serializing_if = "Option::is_none")]
4970 pub delay: Option<crate::types::Decimal>,
4971 #[serde(rename = "randomDelay")]
4973 #[serde(default, skip_serializing_if = "Option::is_none")]
4974 pub random_delay: Option<crate::types::Decimal>,
4975 #[serde(rename = "rampRate")]
4977 #[serde(default, skip_serializing_if = "Option::is_none")]
4978 pub ramp_rate: Option<crate::types::Decimal>,
4979 #[serde(rename = "customData")]
4981 #[serde(default, skip_serializing_if = "Option::is_none")]
4982 pub custom_data: Option<crate::types::CustomData>,
4983}
4984
4985impl EnterService {
4986 #[must_use]
4988 pub fn new(
4989 priority: i32,
4990 high_voltage: impl Into<crate::types::Decimal>,
4991 low_voltage: impl Into<crate::types::Decimal>,
4992 high_freq: impl Into<crate::types::Decimal>,
4993 low_freq: impl Into<crate::types::Decimal>,
4994 ) -> Self {
4995 Self {
4996 priority,
4997 high_voltage: high_voltage.into(),
4998 low_voltage: low_voltage.into(),
4999 high_freq: high_freq.into(),
5000 low_freq: low_freq.into(),
5001 delay: None,
5002 random_delay: None,
5003 ramp_rate: None,
5004 custom_data: None,
5005 }
5006 }
5007
5008 #[must_use]
5010 pub fn with_delay(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5011 self.delay = Some(value.into());
5012 self
5013 }
5014
5015 #[must_use]
5017 pub fn with_random_delay(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5018 self.random_delay = Some(value.into());
5019 self
5020 }
5021
5022 #[must_use]
5024 pub fn with_ramp_rate(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5025 self.ramp_rate = Some(value.into());
5026 self
5027 }
5028
5029 #[must_use]
5031 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5032 self.custom_data = Some(value);
5033 self
5034 }
5035}
5036
5037impl Validate for EnterService {
5038 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5039 path.push_key("priority");
5040 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
5041 path.pop();
5042 path.push_key("customData");
5043 if let Some(value) = &self.custom_data {
5044 Validate::validate_at(value, path, out);
5045 }
5046 path.pop();
5047 }
5048}
5049
5050#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5052pub struct EnterServiceGet {
5053 #[serde(rename = "enterService")]
5055 pub enter_service: EnterService,
5056 pub id: String,
5058 #[serde(rename = "customData")]
5060 #[serde(default, skip_serializing_if = "Option::is_none")]
5061 pub custom_data: Option<crate::types::CustomData>,
5062}
5063
5064impl EnterServiceGet {
5065 #[must_use]
5067 pub fn new(enter_service: EnterService, id: impl Into<String>) -> Self {
5068 Self {
5069 enter_service,
5070 id: id.into(),
5071 custom_data: None,
5072 }
5073 }
5074
5075 #[must_use]
5077 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5078 self.custom_data = Some(value);
5079 self
5080 }
5081}
5082
5083impl Validate for EnterServiceGet {
5084 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5085 path.push_key("enterService");
5086 Validate::validate_at(&self.enter_service, path, out);
5087 path.pop();
5088 path.push_key("id");
5089 validate::string(self.id.as_str(), None, Some(36), path, out);
5090 path.pop();
5091 path.push_key("customData");
5092 if let Some(value) = &self.custom_data {
5093 Validate::validate_at(value, path, out);
5094 }
5095 path.pop();
5096 }
5097}
5098
5099#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5103pub struct EventData {
5104 #[serde(rename = "eventId")]
5106 pub event_id: i32,
5107 pub timestamp: crate::types::DateTime,
5109 pub trigger: EventTrigger,
5111 #[serde(rename = "actualValue")]
5115 pub actual_value: String,
5116 pub component: Component,
5118 #[serde(rename = "eventNotificationType")]
5120 pub event_notification_type: EventNotification,
5121 pub variable: Variable,
5123 #[serde(default, skip_serializing_if = "Option::is_none")]
5125 pub cause: Option<i32>,
5126 #[serde(rename = "techCode")]
5128 #[serde(default, skip_serializing_if = "Option::is_none")]
5129 pub tech_code: Option<String>,
5130 #[serde(rename = "techInfo")]
5132 #[serde(default, skip_serializing_if = "Option::is_none")]
5133 pub tech_info: Option<String>,
5134 #[serde(default, skip_serializing_if = "Option::is_none")]
5136 pub cleared: Option<bool>,
5137 #[serde(rename = "transactionId")]
5139 #[serde(default, skip_serializing_if = "Option::is_none")]
5140 pub transaction_id: Option<String>,
5141 #[serde(rename = "variableMonitoringId")]
5143 #[serde(default, skip_serializing_if = "Option::is_none")]
5144 pub variable_monitoring_id: Option<i32>,
5145 #[serde(default, skip_serializing_if = "Option::is_none")]
5147 pub severity: Option<i32>,
5148 #[serde(rename = "customData")]
5150 #[serde(default, skip_serializing_if = "Option::is_none")]
5151 pub custom_data: Option<crate::types::CustomData>,
5152}
5153
5154impl EventData {
5155 #[must_use]
5157 pub fn new(
5158 event_id: i32,
5159 timestamp: impl Into<crate::types::DateTime>,
5160 trigger: EventTrigger,
5161 actual_value: impl Into<String>,
5162 component: Component,
5163 event_notification_type: EventNotification,
5164 variable: Variable,
5165 ) -> Self {
5166 Self {
5167 event_id,
5168 timestamp: timestamp.into(),
5169 trigger,
5170 actual_value: actual_value.into(),
5171 component,
5172 event_notification_type,
5173 variable,
5174 cause: None,
5175 tech_code: None,
5176 tech_info: None,
5177 cleared: None,
5178 transaction_id: None,
5179 variable_monitoring_id: None,
5180 severity: None,
5181 custom_data: None,
5182 }
5183 }
5184
5185 #[must_use]
5187 pub fn with_cause(mut self, value: i32) -> Self {
5188 self.cause = Some(value);
5189 self
5190 }
5191
5192 #[must_use]
5194 pub fn with_tech_code(mut self, value: impl Into<String>) -> Self {
5195 self.tech_code = Some(value.into());
5196 self
5197 }
5198
5199 #[must_use]
5201 pub fn with_tech_info(mut self, value: impl Into<String>) -> Self {
5202 self.tech_info = Some(value.into());
5203 self
5204 }
5205
5206 #[must_use]
5208 pub fn with_cleared(mut self, value: bool) -> Self {
5209 self.cleared = Some(value);
5210 self
5211 }
5212
5213 #[must_use]
5215 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
5216 self.transaction_id = Some(value.into());
5217 self
5218 }
5219
5220 #[must_use]
5222 pub fn with_variable_monitoring_id(mut self, value: i32) -> Self {
5223 self.variable_monitoring_id = Some(value);
5224 self
5225 }
5226
5227 #[must_use]
5229 pub fn with_severity(mut self, value: i32) -> Self {
5230 self.severity = Some(value);
5231 self
5232 }
5233
5234 #[must_use]
5236 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5237 self.custom_data = Some(value);
5238 self
5239 }
5240}
5241
5242impl Validate for EventData {
5243 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5244 path.push_key("eventId");
5245 validate::int_range(i64::from(self.event_id), Some(0), None, path, out);
5246 path.pop();
5247 path.push_key("trigger");
5248 Validate::validate_at(&self.trigger, path, out);
5249 path.pop();
5250 path.push_key("actualValue");
5251 validate::string(self.actual_value.as_str(), None, Some(2500), path, out);
5252 path.pop();
5253 path.push_key("component");
5254 Validate::validate_at(&self.component, path, out);
5255 path.pop();
5256 path.push_key("eventNotificationType");
5257 Validate::validate_at(&self.event_notification_type, path, out);
5258 path.pop();
5259 path.push_key("variable");
5260 Validate::validate_at(&self.variable, path, out);
5261 path.pop();
5262 path.push_key("cause");
5263 if let Some(value) = &self.cause {
5264 validate::int_range(i64::from(*value), Some(0), None, path, out);
5265 }
5266 path.pop();
5267 path.push_key("techCode");
5268 if let Some(value) = &self.tech_code {
5269 validate::string(value.as_str(), None, Some(50), path, out);
5270 }
5271 path.pop();
5272 path.push_key("techInfo");
5273 if let Some(value) = &self.tech_info {
5274 validate::string(value.as_str(), None, Some(500), path, out);
5275 }
5276 path.pop();
5277 path.push_key("transactionId");
5278 if let Some(value) = &self.transaction_id {
5279 validate::string(value.as_str(), None, Some(36), path, out);
5280 }
5281 path.pop();
5282 path.push_key("variableMonitoringId");
5283 if let Some(value) = &self.variable_monitoring_id {
5284 validate::int_range(i64::from(*value), Some(0), None, path, out);
5285 }
5286 path.pop();
5287 path.push_key("severity");
5288 if let Some(value) = &self.severity {
5289 validate::int_range(i64::from(*value), Some(0), None, path, out);
5290 }
5291 path.pop();
5292 path.push_key("customData");
5293 if let Some(value) = &self.custom_data {
5294 Validate::validate_at(value, path, out);
5295 }
5296 path.pop();
5297 }
5298}
5299
5300#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5304pub struct Firmware {
5305 pub location: String,
5307 #[serde(rename = "retrieveDateTime")]
5309 pub retrieve_date_time: crate::types::DateTime,
5310 #[serde(rename = "installDateTime")]
5312 #[serde(default, skip_serializing_if = "Option::is_none")]
5313 pub install_date_time: Option<crate::types::DateTime>,
5314 #[serde(rename = "signingCertificate")]
5317 #[serde(default, skip_serializing_if = "Option::is_none")]
5318 pub signing_certificate: Option<String>,
5319 #[serde(default, skip_serializing_if = "Option::is_none")]
5321 pub signature: Option<String>,
5322 #[serde(rename = "customData")]
5324 #[serde(default, skip_serializing_if = "Option::is_none")]
5325 pub custom_data: Option<crate::types::CustomData>,
5326}
5327
5328impl Firmware {
5329 #[must_use]
5331 pub fn new(
5332 location: impl Into<String>,
5333 retrieve_date_time: impl Into<crate::types::DateTime>,
5334 ) -> Self {
5335 Self {
5336 location: location.into(),
5337 retrieve_date_time: retrieve_date_time.into(),
5338 install_date_time: None,
5339 signing_certificate: None,
5340 signature: None,
5341 custom_data: None,
5342 }
5343 }
5344
5345 #[must_use]
5347 pub fn with_install_date_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
5348 self.install_date_time = Some(value.into());
5349 self
5350 }
5351
5352 #[must_use]
5354 pub fn with_signing_certificate(mut self, value: impl Into<String>) -> Self {
5355 self.signing_certificate = Some(value.into());
5356 self
5357 }
5358
5359 #[must_use]
5361 pub fn with_signature(mut self, value: impl Into<String>) -> Self {
5362 self.signature = Some(value.into());
5363 self
5364 }
5365
5366 #[must_use]
5368 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5369 self.custom_data = Some(value);
5370 self
5371 }
5372}
5373
5374impl Validate for Firmware {
5375 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5376 path.push_key("location");
5377 validate::string(self.location.as_str(), None, Some(2000), path, out);
5378 path.pop();
5379 path.push_key("signingCertificate");
5380 if let Some(value) = &self.signing_certificate {
5381 validate::string(value.as_str(), None, Some(5500), path, out);
5382 }
5383 path.pop();
5384 path.push_key("signature");
5385 if let Some(value) = &self.signature {
5386 validate::string(value.as_str(), None, Some(800), path, out);
5387 }
5388 path.pop();
5389 path.push_key("customData");
5390 if let Some(value) = &self.custom_data {
5391 Validate::validate_at(value, path, out);
5392 }
5393 path.pop();
5394 }
5395}
5396
5397#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5399pub struct FixedPF {
5400 pub priority: i32,
5402 pub displacement: crate::types::Decimal,
5404 pub excitation: bool,
5406 #[serde(rename = "startTime")]
5408 #[serde(default, skip_serializing_if = "Option::is_none")]
5409 pub start_time: Option<crate::types::DateTime>,
5410 #[serde(default, skip_serializing_if = "Option::is_none")]
5412 pub duration: Option<crate::types::Decimal>,
5413 #[serde(rename = "customData")]
5415 #[serde(default, skip_serializing_if = "Option::is_none")]
5416 pub custom_data: Option<crate::types::CustomData>,
5417}
5418
5419impl FixedPF {
5420 #[must_use]
5422 pub fn new(
5423 priority: i32,
5424 displacement: impl Into<crate::types::Decimal>,
5425 excitation: bool,
5426 ) -> Self {
5427 Self {
5428 priority,
5429 displacement: displacement.into(),
5430 excitation,
5431 start_time: None,
5432 duration: None,
5433 custom_data: None,
5434 }
5435 }
5436
5437 #[must_use]
5439 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
5440 self.start_time = Some(value.into());
5441 self
5442 }
5443
5444 #[must_use]
5446 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5447 self.duration = Some(value.into());
5448 self
5449 }
5450
5451 #[must_use]
5453 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5454 self.custom_data = Some(value);
5455 self
5456 }
5457}
5458
5459impl Validate for FixedPF {
5460 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5461 path.push_key("priority");
5462 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
5463 path.pop();
5464 path.push_key("customData");
5465 if let Some(value) = &self.custom_data {
5466 Validate::validate_at(value, path, out);
5467 }
5468 path.pop();
5469 }
5470}
5471
5472#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5474pub struct FixedPFGet {
5475 #[serde(rename = "fixedPF")]
5477 pub fixed_pf: FixedPF,
5478 pub id: String,
5480 #[serde(rename = "isDefault")]
5482 pub is_default: bool,
5483 #[serde(rename = "isSuperseded")]
5485 pub is_superseded: bool,
5486 #[serde(rename = "customData")]
5488 #[serde(default, skip_serializing_if = "Option::is_none")]
5489 pub custom_data: Option<crate::types::CustomData>,
5490}
5491
5492impl FixedPFGet {
5493 #[must_use]
5495 pub fn new(
5496 fixed_pf: FixedPF,
5497 id: impl Into<String>,
5498 is_default: bool,
5499 is_superseded: bool,
5500 ) -> Self {
5501 Self {
5502 fixed_pf,
5503 id: id.into(),
5504 is_default,
5505 is_superseded,
5506 custom_data: None,
5507 }
5508 }
5509
5510 #[must_use]
5512 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5513 self.custom_data = Some(value);
5514 self
5515 }
5516}
5517
5518impl Validate for FixedPFGet {
5519 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5520 path.push_key("fixedPF");
5521 Validate::validate_at(&self.fixed_pf, path, out);
5522 path.pop();
5523 path.push_key("id");
5524 validate::string(self.id.as_str(), None, Some(36), path, out);
5525 path.pop();
5526 path.push_key("customData");
5527 if let Some(value) = &self.custom_data {
5528 Validate::validate_at(value, path, out);
5529 }
5530 path.pop();
5531 }
5532}
5533
5534#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5536pub struct FixedVar {
5537 pub priority: i32,
5539 pub setpoint: crate::types::Decimal,
5543 pub unit: DERUnit,
5545 #[serde(rename = "startTime")]
5547 #[serde(default, skip_serializing_if = "Option::is_none")]
5548 pub start_time: Option<crate::types::DateTime>,
5549 #[serde(default, skip_serializing_if = "Option::is_none")]
5551 pub duration: Option<crate::types::Decimal>,
5552 #[serde(rename = "customData")]
5554 #[serde(default, skip_serializing_if = "Option::is_none")]
5555 pub custom_data: Option<crate::types::CustomData>,
5556}
5557
5558impl FixedVar {
5559 #[must_use]
5561 pub fn new(priority: i32, setpoint: impl Into<crate::types::Decimal>, unit: DERUnit) -> Self {
5562 Self {
5563 priority,
5564 setpoint: setpoint.into(),
5565 unit,
5566 start_time: None,
5567 duration: None,
5568 custom_data: None,
5569 }
5570 }
5571
5572 #[must_use]
5574 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
5575 self.start_time = Some(value.into());
5576 self
5577 }
5578
5579 #[must_use]
5581 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5582 self.duration = Some(value.into());
5583 self
5584 }
5585
5586 #[must_use]
5588 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5589 self.custom_data = Some(value);
5590 self
5591 }
5592}
5593
5594impl Validate for FixedVar {
5595 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5596 path.push_key("priority");
5597 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
5598 path.pop();
5599 path.push_key("unit");
5600 Validate::validate_at(&self.unit, path, out);
5601 path.pop();
5602 path.push_key("customData");
5603 if let Some(value) = &self.custom_data {
5604 Validate::validate_at(value, path, out);
5605 }
5606 path.pop();
5607 }
5608}
5609
5610#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5612pub struct FixedVarGet {
5613 #[serde(rename = "fixedVar")]
5615 pub fixed_var: FixedVar,
5616 pub id: String,
5618 #[serde(rename = "isDefault")]
5620 pub is_default: bool,
5621 #[serde(rename = "isSuperseded")]
5623 pub is_superseded: bool,
5624 #[serde(rename = "customData")]
5626 #[serde(default, skip_serializing_if = "Option::is_none")]
5627 pub custom_data: Option<crate::types::CustomData>,
5628}
5629
5630impl FixedVarGet {
5631 #[must_use]
5633 pub fn new(
5634 fixed_var: FixedVar,
5635 id: impl Into<String>,
5636 is_default: bool,
5637 is_superseded: bool,
5638 ) -> Self {
5639 Self {
5640 fixed_var,
5641 id: id.into(),
5642 is_default,
5643 is_superseded,
5644 custom_data: None,
5645 }
5646 }
5647
5648 #[must_use]
5650 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5651 self.custom_data = Some(value);
5652 self
5653 }
5654}
5655
5656impl Validate for FixedVarGet {
5657 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5658 path.push_key("fixedVar");
5659 Validate::validate_at(&self.fixed_var, path, out);
5660 path.pop();
5661 path.push_key("id");
5662 validate::string(self.id.as_str(), None, Some(36), path, out);
5663 path.pop();
5664 path.push_key("customData");
5665 if let Some(value) = &self.custom_data {
5666 Validate::validate_at(value, path, out);
5667 }
5668 path.pop();
5669 }
5670}
5671
5672#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5674pub struct FreqDroop {
5675 pub priority: i32,
5677 #[serde(rename = "overFreq")]
5679 pub over_freq: crate::types::Decimal,
5680 #[serde(rename = "underFreq")]
5682 pub under_freq: crate::types::Decimal,
5683 #[serde(rename = "overDroop")]
5685 pub over_droop: crate::types::Decimal,
5686 #[serde(rename = "underDroop")]
5688 pub under_droop: crate::types::Decimal,
5689 #[serde(rename = "responseTime")]
5691 pub response_time: crate::types::Decimal,
5692 #[serde(rename = "startTime")]
5694 #[serde(default, skip_serializing_if = "Option::is_none")]
5695 pub start_time: Option<crate::types::DateTime>,
5696 #[serde(default, skip_serializing_if = "Option::is_none")]
5698 pub duration: Option<crate::types::Decimal>,
5699 #[serde(rename = "customData")]
5701 #[serde(default, skip_serializing_if = "Option::is_none")]
5702 pub custom_data: Option<crate::types::CustomData>,
5703}
5704
5705impl FreqDroop {
5706 #[must_use]
5708 pub fn new(
5709 priority: i32,
5710 over_freq: impl Into<crate::types::Decimal>,
5711 under_freq: impl Into<crate::types::Decimal>,
5712 over_droop: impl Into<crate::types::Decimal>,
5713 under_droop: impl Into<crate::types::Decimal>,
5714 response_time: impl Into<crate::types::Decimal>,
5715 ) -> Self {
5716 Self {
5717 priority,
5718 over_freq: over_freq.into(),
5719 under_freq: under_freq.into(),
5720 over_droop: over_droop.into(),
5721 under_droop: under_droop.into(),
5722 response_time: response_time.into(),
5723 start_time: None,
5724 duration: None,
5725 custom_data: None,
5726 }
5727 }
5728
5729 #[must_use]
5731 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
5732 self.start_time = Some(value.into());
5733 self
5734 }
5735
5736 #[must_use]
5738 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5739 self.duration = Some(value.into());
5740 self
5741 }
5742
5743 #[must_use]
5745 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5746 self.custom_data = Some(value);
5747 self
5748 }
5749}
5750
5751impl Validate for FreqDroop {
5752 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5753 path.push_key("priority");
5754 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
5755 path.pop();
5756 path.push_key("customData");
5757 if let Some(value) = &self.custom_data {
5758 Validate::validate_at(value, path, out);
5759 }
5760 path.pop();
5761 }
5762}
5763
5764#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5766pub struct FreqDroopGet {
5767 #[serde(rename = "freqDroop")]
5769 pub freq_droop: FreqDroop,
5770 pub id: String,
5772 #[serde(rename = "isDefault")]
5774 pub is_default: bool,
5775 #[serde(rename = "isSuperseded")]
5777 pub is_superseded: bool,
5778 #[serde(rename = "customData")]
5780 #[serde(default, skip_serializing_if = "Option::is_none")]
5781 pub custom_data: Option<crate::types::CustomData>,
5782}
5783
5784impl FreqDroopGet {
5785 #[must_use]
5787 pub fn new(
5788 freq_droop: FreqDroop,
5789 id: impl Into<String>,
5790 is_default: bool,
5791 is_superseded: bool,
5792 ) -> Self {
5793 Self {
5794 freq_droop,
5795 id: id.into(),
5796 is_default,
5797 is_superseded,
5798 custom_data: None,
5799 }
5800 }
5801
5802 #[must_use]
5804 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5805 self.custom_data = Some(value);
5806 self
5807 }
5808}
5809
5810impl Validate for FreqDroopGet {
5811 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5812 path.push_key("freqDroop");
5813 Validate::validate_at(&self.freq_droop, path, out);
5814 path.pop();
5815 path.push_key("id");
5816 validate::string(self.id.as_str(), None, Some(36), path, out);
5817 path.pop();
5818 path.push_key("customData");
5819 if let Some(value) = &self.custom_data {
5820 Validate::validate_at(value, path, out);
5821 }
5822 path.pop();
5823 }
5824}
5825
5826#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5830pub struct GetVariableData {
5831 pub component: Component,
5833 pub variable: Variable,
5835 #[serde(rename = "attributeType")]
5837 #[serde(default, skip_serializing_if = "Option::is_none")]
5838 pub attribute_type: Option<Attribute>,
5839 #[serde(rename = "customData")]
5841 #[serde(default, skip_serializing_if = "Option::is_none")]
5842 pub custom_data: Option<crate::types::CustomData>,
5843}
5844
5845impl GetVariableData {
5846 #[must_use]
5848 pub fn new(component: Component, variable: Variable) -> Self {
5849 Self {
5850 component,
5851 variable,
5852 attribute_type: None,
5853 custom_data: None,
5854 }
5855 }
5856
5857 #[must_use]
5859 pub fn with_attribute_type(mut self, value: Attribute) -> Self {
5860 self.attribute_type = Some(value);
5861 self
5862 }
5863
5864 #[must_use]
5866 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5867 self.custom_data = Some(value);
5868 self
5869 }
5870}
5871
5872impl Validate for GetVariableData {
5873 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5874 path.push_key("component");
5875 Validate::validate_at(&self.component, path, out);
5876 path.pop();
5877 path.push_key("variable");
5878 Validate::validate_at(&self.variable, path, out);
5879 path.pop();
5880 path.push_key("attributeType");
5881 if let Some(value) = &self.attribute_type {
5882 Validate::validate_at(value, path, out);
5883 }
5884 path.pop();
5885 path.push_key("customData");
5886 if let Some(value) = &self.custom_data {
5887 Validate::validate_at(value, path, out);
5888 }
5889 path.pop();
5890 }
5891}
5892
5893#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5897pub struct GetVariableResult {
5898 #[serde(rename = "attributeStatus")]
5900 pub attribute_status: GetVariableStatus,
5901 pub component: Component,
5903 pub variable: Variable,
5905 #[serde(rename = "attributeStatusInfo")]
5907 #[serde(default, skip_serializing_if = "Option::is_none")]
5908 pub attribute_status_info: Option<StatusInfo>,
5909 #[serde(rename = "attributeType")]
5911 #[serde(default, skip_serializing_if = "Option::is_none")]
5912 pub attribute_type: Option<Attribute>,
5913 #[serde(rename = "attributeValue")]
5917 #[serde(default, skip_serializing_if = "Option::is_none")]
5918 pub attribute_value: Option<String>,
5919 #[serde(rename = "customData")]
5921 #[serde(default, skip_serializing_if = "Option::is_none")]
5922 pub custom_data: Option<crate::types::CustomData>,
5923}
5924
5925impl GetVariableResult {
5926 #[must_use]
5928 pub fn new(
5929 attribute_status: GetVariableStatus,
5930 component: Component,
5931 variable: Variable,
5932 ) -> Self {
5933 Self {
5934 attribute_status,
5935 component,
5936 variable,
5937 attribute_status_info: None,
5938 attribute_type: None,
5939 attribute_value: None,
5940 custom_data: None,
5941 }
5942 }
5943
5944 #[must_use]
5946 pub fn with_attribute_status_info(mut self, value: StatusInfo) -> Self {
5947 self.attribute_status_info = Some(value);
5948 self
5949 }
5950
5951 #[must_use]
5953 pub fn with_attribute_type(mut self, value: Attribute) -> Self {
5954 self.attribute_type = Some(value);
5955 self
5956 }
5957
5958 #[must_use]
5960 pub fn with_attribute_value(mut self, value: impl Into<String>) -> Self {
5961 self.attribute_value = Some(value.into());
5962 self
5963 }
5964
5965 #[must_use]
5967 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5968 self.custom_data = Some(value);
5969 self
5970 }
5971}
5972
5973impl Validate for GetVariableResult {
5974 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5975 path.push_key("attributeStatus");
5976 Validate::validate_at(&self.attribute_status, path, out);
5977 path.pop();
5978 path.push_key("component");
5979 Validate::validate_at(&self.component, path, out);
5980 path.pop();
5981 path.push_key("variable");
5982 Validate::validate_at(&self.variable, path, out);
5983 path.pop();
5984 path.push_key("attributeStatusInfo");
5985 if let Some(value) = &self.attribute_status_info {
5986 Validate::validate_at(value, path, out);
5987 }
5988 path.pop();
5989 path.push_key("attributeType");
5990 if let Some(value) = &self.attribute_type {
5991 Validate::validate_at(value, path, out);
5992 }
5993 path.pop();
5994 path.push_key("attributeValue");
5995 if let Some(value) = &self.attribute_value {
5996 validate::string(value.as_str(), None, Some(2500), path, out);
5997 }
5998 path.pop();
5999 path.push_key("customData");
6000 if let Some(value) = &self.custom_data {
6001 Validate::validate_at(value, path, out);
6002 }
6003 path.pop();
6004 }
6005}
6006
6007#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6009pub struct Gradient {
6010 pub priority: i32,
6012 pub gradient: crate::types::Decimal,
6014 #[serde(rename = "softGradient")]
6016 pub soft_gradient: crate::types::Decimal,
6017 #[serde(rename = "customData")]
6019 #[serde(default, skip_serializing_if = "Option::is_none")]
6020 pub custom_data: Option<crate::types::CustomData>,
6021}
6022
6023impl Gradient {
6024 #[must_use]
6026 pub fn new(
6027 priority: i32,
6028 gradient: impl Into<crate::types::Decimal>,
6029 soft_gradient: impl Into<crate::types::Decimal>,
6030 ) -> Self {
6031 Self {
6032 priority,
6033 gradient: gradient.into(),
6034 soft_gradient: soft_gradient.into(),
6035 custom_data: None,
6036 }
6037 }
6038
6039 #[must_use]
6041 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6042 self.custom_data = Some(value);
6043 self
6044 }
6045}
6046
6047impl Validate for Gradient {
6048 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6049 path.push_key("priority");
6050 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
6051 path.pop();
6052 path.push_key("customData");
6053 if let Some(value) = &self.custom_data {
6054 Validate::validate_at(value, path, out);
6055 }
6056 path.pop();
6057 }
6058}
6059
6060#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6062pub struct GradientGet {
6063 pub gradient: Gradient,
6065 pub id: String,
6067 #[serde(rename = "customData")]
6069 #[serde(default, skip_serializing_if = "Option::is_none")]
6070 pub custom_data: Option<crate::types::CustomData>,
6071}
6072
6073impl GradientGet {
6074 #[must_use]
6076 pub fn new(gradient: Gradient, id: impl Into<String>) -> Self {
6077 Self {
6078 gradient,
6079 id: id.into(),
6080 custom_data: None,
6081 }
6082 }
6083
6084 #[must_use]
6086 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6087 self.custom_data = Some(value);
6088 self
6089 }
6090}
6091
6092impl Validate for GradientGet {
6093 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6094 path.push_key("gradient");
6095 Validate::validate_at(&self.gradient, path, out);
6096 path.pop();
6097 path.push_key("id");
6098 validate::string(self.id.as_str(), None, Some(36), path, out);
6099 path.pop();
6100 path.push_key("customData");
6101 if let Some(value) = &self.custom_data {
6102 Validate::validate_at(value, path, out);
6103 }
6104 path.pop();
6105 }
6106}
6107
6108#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
6110pub struct Hysteresis {
6111 #[serde(rename = "hysteresisHigh")]
6113 #[serde(default, skip_serializing_if = "Option::is_none")]
6114 pub hysteresis_high: Option<crate::types::Decimal>,
6115 #[serde(rename = "hysteresisLow")]
6117 #[serde(default, skip_serializing_if = "Option::is_none")]
6118 pub hysteresis_low: Option<crate::types::Decimal>,
6119 #[serde(rename = "hysteresisDelay")]
6121 #[serde(default, skip_serializing_if = "Option::is_none")]
6122 pub hysteresis_delay: Option<crate::types::Decimal>,
6123 #[serde(rename = "hysteresisGradient")]
6125 #[serde(default, skip_serializing_if = "Option::is_none")]
6126 pub hysteresis_gradient: Option<crate::types::Decimal>,
6127 #[serde(rename = "customData")]
6129 #[serde(default, skip_serializing_if = "Option::is_none")]
6130 pub custom_data: Option<crate::types::CustomData>,
6131}
6132
6133impl Hysteresis {
6134 #[must_use]
6136 pub fn new() -> Self {
6137 Self::default()
6138 }
6139
6140 #[must_use]
6142 pub fn with_hysteresis_high(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6143 self.hysteresis_high = Some(value.into());
6144 self
6145 }
6146
6147 #[must_use]
6149 pub fn with_hysteresis_low(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6150 self.hysteresis_low = Some(value.into());
6151 self
6152 }
6153
6154 #[must_use]
6156 pub fn with_hysteresis_delay(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6157 self.hysteresis_delay = Some(value.into());
6158 self
6159 }
6160
6161 #[must_use]
6163 pub fn with_hysteresis_gradient(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6164 self.hysteresis_gradient = Some(value.into());
6165 self
6166 }
6167
6168 #[must_use]
6170 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6171 self.custom_data = Some(value);
6172 self
6173 }
6174}
6175
6176impl Validate for Hysteresis {
6177 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6178 path.push_key("customData");
6179 if let Some(value) = &self.custom_data {
6180 Validate::validate_at(value, path, out);
6181 }
6182 path.pop();
6183 }
6184}
6185
6186#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6190pub struct IdToken {
6191 #[serde(rename = "idToken")]
6193 pub id_token: String,
6194 pub r#type: String,
6196 #[serde(rename = "additionalInfo")]
6198 #[serde(default, skip_serializing_if = "Option::is_none")]
6199 pub additional_info: Option<Vec<AdditionalInfo>>,
6200 #[serde(rename = "customData")]
6202 #[serde(default, skip_serializing_if = "Option::is_none")]
6203 pub custom_data: Option<crate::types::CustomData>,
6204}
6205
6206impl IdToken {
6207 #[must_use]
6209 pub fn new(id_token: impl Into<String>, r#type: impl Into<String>) -> Self {
6210 Self {
6211 id_token: id_token.into(),
6212 r#type: r#type.into(),
6213 additional_info: None,
6214 custom_data: None,
6215 }
6216 }
6217
6218 #[must_use]
6220 pub fn with_additional_info(mut self, value: Vec<AdditionalInfo>) -> Self {
6221 self.additional_info = Some(value);
6222 self
6223 }
6224
6225 #[must_use]
6227 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6228 self.custom_data = Some(value);
6229 self
6230 }
6231}
6232
6233impl Validate for IdToken {
6234 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6235 path.push_key("idToken");
6236 validate::string(self.id_token.as_str(), None, Some(255), path, out);
6237 path.pop();
6238 path.push_key("type");
6239 validate::string(self.r#type.as_str(), None, Some(20), path, out);
6240 path.pop();
6241 path.push_key("additionalInfo");
6242 if let Some(value) = &self.additional_info {
6243 validate::list_len(value.len(), Some(1), None, path, out);
6244 for (index, item) in value.iter().enumerate() {
6245 path.push_index(index);
6246 Validate::validate_at(item, path, out);
6247 path.pop();
6248 }
6249 }
6250 path.pop();
6251 path.push_key("customData");
6252 if let Some(value) = &self.custom_data {
6253 Validate::validate_at(value, path, out);
6254 }
6255 path.pop();
6256 }
6257}
6258
6259#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6264pub struct IdTokenInfo {
6265 pub status: AuthorizationStatus,
6267 #[serde(rename = "cacheExpiryDateTime")]
6269 #[serde(default, skip_serializing_if = "Option::is_none")]
6270 pub cache_expiry_date_time: Option<crate::types::DateTime>,
6271 #[serde(rename = "chargingPriority")]
6273 #[serde(default, skip_serializing_if = "Option::is_none")]
6274 pub charging_priority: Option<i32>,
6275 #[serde(rename = "groupIdToken")]
6277 #[serde(default, skip_serializing_if = "Option::is_none")]
6278 pub group_id_token: Option<IdToken>,
6279 #[serde(default, skip_serializing_if = "Option::is_none")]
6281 pub language1: Option<String>,
6282 #[serde(default, skip_serializing_if = "Option::is_none")]
6284 pub language2: Option<String>,
6285 #[serde(rename = "evseId")]
6287 #[serde(default, skip_serializing_if = "Option::is_none")]
6288 pub evse_id: Option<Vec<i32>>,
6289 #[serde(rename = "personalMessage")]
6291 #[serde(default, skip_serializing_if = "Option::is_none")]
6292 pub personal_message: Option<MessageContent>,
6293 #[serde(rename = "customData")]
6295 #[serde(default, skip_serializing_if = "Option::is_none")]
6296 pub custom_data: Option<crate::types::CustomData>,
6297}
6298
6299impl IdTokenInfo {
6300 #[must_use]
6302 pub fn new(status: AuthorizationStatus) -> Self {
6303 Self {
6304 status,
6305 cache_expiry_date_time: None,
6306 charging_priority: None,
6307 group_id_token: None,
6308 language1: None,
6309 language2: None,
6310 evse_id: None,
6311 personal_message: None,
6312 custom_data: None,
6313 }
6314 }
6315
6316 #[must_use]
6318 pub fn with_cache_expiry_date_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6319 self.cache_expiry_date_time = Some(value.into());
6320 self
6321 }
6322
6323 #[must_use]
6325 pub fn with_charging_priority(mut self, value: i32) -> Self {
6326 self.charging_priority = Some(value);
6327 self
6328 }
6329
6330 #[must_use]
6332 pub fn with_group_id_token(mut self, value: IdToken) -> Self {
6333 self.group_id_token = Some(value);
6334 self
6335 }
6336
6337 #[must_use]
6339 pub fn with_language1(mut self, value: impl Into<String>) -> Self {
6340 self.language1 = Some(value.into());
6341 self
6342 }
6343
6344 #[must_use]
6346 pub fn with_language2(mut self, value: impl Into<String>) -> Self {
6347 self.language2 = Some(value.into());
6348 self
6349 }
6350
6351 #[must_use]
6353 pub fn with_evse_id(mut self, value: Vec<i32>) -> Self {
6354 self.evse_id = Some(value);
6355 self
6356 }
6357
6358 #[must_use]
6360 pub fn with_personal_message(mut self, value: MessageContent) -> Self {
6361 self.personal_message = Some(value);
6362 self
6363 }
6364
6365 #[must_use]
6367 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6368 self.custom_data = Some(value);
6369 self
6370 }
6371}
6372
6373impl Validate for IdTokenInfo {
6374 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6375 path.push_key("status");
6376 Validate::validate_at(&self.status, path, out);
6377 path.pop();
6378 path.push_key("groupIdToken");
6379 if let Some(value) = &self.group_id_token {
6380 Validate::validate_at(value, path, out);
6381 }
6382 path.pop();
6383 path.push_key("language1");
6384 if let Some(value) = &self.language1 {
6385 validate::string(value.as_str(), None, Some(8), path, out);
6386 }
6387 path.pop();
6388 path.push_key("language2");
6389 if let Some(value) = &self.language2 {
6390 validate::string(value.as_str(), None, Some(8), path, out);
6391 }
6392 path.pop();
6393 path.push_key("evseId");
6394 if let Some(value) = &self.evse_id {
6395 validate::list_len(value.len(), Some(1), None, path, out);
6396 for (index, item) in value.iter().enumerate() {
6397 path.push_index(index);
6398 validate::int_range(i64::from(*item), Some(0), None, path, out);
6399 path.pop();
6400 }
6401 }
6402 path.pop();
6403 path.push_key("personalMessage");
6404 if let Some(value) = &self.personal_message {
6405 Validate::validate_at(value, path, out);
6406 }
6407 path.pop();
6408 path.push_key("customData");
6409 if let Some(value) = &self.custom_data {
6410 Validate::validate_at(value, path, out);
6411 }
6412 path.pop();
6413 }
6414}
6415
6416#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6418pub struct LimitAtSoC {
6419 pub soc: i32,
6421 pub limit: crate::types::Decimal,
6424 #[serde(rename = "customData")]
6426 #[serde(default, skip_serializing_if = "Option::is_none")]
6427 pub custom_data: Option<crate::types::CustomData>,
6428}
6429
6430impl LimitAtSoC {
6431 #[must_use]
6433 pub fn new(soc: i32, limit: impl Into<crate::types::Decimal>) -> Self {
6434 Self {
6435 soc,
6436 limit: limit.into(),
6437 custom_data: None,
6438 }
6439 }
6440
6441 #[must_use]
6443 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6444 self.custom_data = Some(value);
6445 self
6446 }
6447}
6448
6449impl Validate for LimitAtSoC {
6450 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6451 path.push_key("soc");
6452 validate::int_range(i64::from(self.soc), Some(0), Some(100), path, out);
6453 path.pop();
6454 path.push_key("customData");
6455 if let Some(value) = &self.custom_data {
6456 Validate::validate_at(value, path, out);
6457 }
6458 path.pop();
6459 }
6460}
6461
6462#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6464pub struct LimitMaxDischarge {
6465 pub priority: i32,
6467 #[serde(rename = "pctMaxDischargePower")]
6471 #[serde(default, skip_serializing_if = "Option::is_none")]
6472 pub pct_max_discharge_power: Option<crate::types::Decimal>,
6473 #[serde(rename = "powerMonitoringMustTrip")]
6475 #[serde(default, skip_serializing_if = "Option::is_none")]
6476 pub power_monitoring_must_trip: Option<DERCurve>,
6477 #[serde(rename = "startTime")]
6479 #[serde(default, skip_serializing_if = "Option::is_none")]
6480 pub start_time: Option<crate::types::DateTime>,
6481 #[serde(default, skip_serializing_if = "Option::is_none")]
6483 pub duration: Option<crate::types::Decimal>,
6484 #[serde(rename = "customData")]
6486 #[serde(default, skip_serializing_if = "Option::is_none")]
6487 pub custom_data: Option<crate::types::CustomData>,
6488}
6489
6490impl LimitMaxDischarge {
6491 #[must_use]
6493 pub fn new(priority: i32) -> Self {
6494 Self {
6495 priority,
6496 pct_max_discharge_power: None,
6497 power_monitoring_must_trip: None,
6498 start_time: None,
6499 duration: None,
6500 custom_data: None,
6501 }
6502 }
6503
6504 #[must_use]
6506 pub fn with_pct_max_discharge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6507 self.pct_max_discharge_power = Some(value.into());
6508 self
6509 }
6510
6511 #[must_use]
6513 pub fn with_power_monitoring_must_trip(mut self, value: DERCurve) -> Self {
6514 self.power_monitoring_must_trip = Some(value);
6515 self
6516 }
6517
6518 #[must_use]
6520 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6521 self.start_time = Some(value.into());
6522 self
6523 }
6524
6525 #[must_use]
6527 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6528 self.duration = Some(value.into());
6529 self
6530 }
6531
6532 #[must_use]
6534 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6535 self.custom_data = Some(value);
6536 self
6537 }
6538}
6539
6540impl Validate for LimitMaxDischarge {
6541 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6542 path.push_key("priority");
6543 validate::int_range(i64::from(self.priority), Some(0), None, path, out);
6544 path.pop();
6545 path.push_key("powerMonitoringMustTrip");
6546 if let Some(value) = &self.power_monitoring_must_trip {
6547 Validate::validate_at(value, path, out);
6548 }
6549 path.pop();
6550 path.push_key("customData");
6551 if let Some(value) = &self.custom_data {
6552 Validate::validate_at(value, path, out);
6553 }
6554 path.pop();
6555 }
6556}
6557
6558#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6560pub struct LimitMaxDischargeGet {
6561 pub id: String,
6563 #[serde(rename = "isDefault")]
6565 pub is_default: bool,
6566 #[serde(rename = "isSuperseded")]
6568 pub is_superseded: bool,
6569 #[serde(rename = "limitMaxDischarge")]
6571 pub limit_max_discharge: LimitMaxDischarge,
6572 #[serde(rename = "customData")]
6574 #[serde(default, skip_serializing_if = "Option::is_none")]
6575 pub custom_data: Option<crate::types::CustomData>,
6576}
6577
6578impl LimitMaxDischargeGet {
6579 #[must_use]
6581 pub fn new(
6582 id: impl Into<String>,
6583 is_default: bool,
6584 is_superseded: bool,
6585 limit_max_discharge: LimitMaxDischarge,
6586 ) -> Self {
6587 Self {
6588 id: id.into(),
6589 is_default,
6590 is_superseded,
6591 limit_max_discharge,
6592 custom_data: None,
6593 }
6594 }
6595
6596 #[must_use]
6598 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6599 self.custom_data = Some(value);
6600 self
6601 }
6602}
6603
6604impl Validate for LimitMaxDischargeGet {
6605 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6606 path.push_key("id");
6607 validate::string(self.id.as_str(), None, Some(36), path, out);
6608 path.pop();
6609 path.push_key("limitMaxDischarge");
6610 Validate::validate_at(&self.limit_max_discharge, path, out);
6611 path.pop();
6612 path.push_key("customData");
6613 if let Some(value) = &self.custom_data {
6614 Validate::validate_at(value, path, out);
6615 }
6616 path.pop();
6617 }
6618}
6619
6620#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6624pub struct LogParameters {
6625 #[serde(rename = "remoteLocation")]
6627 pub remote_location: String,
6628 #[serde(rename = "oldestTimestamp")]
6630 #[serde(default, skip_serializing_if = "Option::is_none")]
6631 pub oldest_timestamp: Option<crate::types::DateTime>,
6632 #[serde(rename = "latestTimestamp")]
6634 #[serde(default, skip_serializing_if = "Option::is_none")]
6635 pub latest_timestamp: Option<crate::types::DateTime>,
6636 #[serde(rename = "customData")]
6638 #[serde(default, skip_serializing_if = "Option::is_none")]
6639 pub custom_data: Option<crate::types::CustomData>,
6640}
6641
6642impl LogParameters {
6643 #[must_use]
6645 pub fn new(remote_location: impl Into<String>) -> Self {
6646 Self {
6647 remote_location: remote_location.into(),
6648 oldest_timestamp: None,
6649 latest_timestamp: None,
6650 custom_data: None,
6651 }
6652 }
6653
6654 #[must_use]
6656 pub fn with_oldest_timestamp(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6657 self.oldest_timestamp = Some(value.into());
6658 self
6659 }
6660
6661 #[must_use]
6663 pub fn with_latest_timestamp(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6664 self.latest_timestamp = Some(value.into());
6665 self
6666 }
6667
6668 #[must_use]
6670 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6671 self.custom_data = Some(value);
6672 self
6673 }
6674}
6675
6676impl Validate for LogParameters {
6677 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6678 path.push_key("remoteLocation");
6679 validate::string(self.remote_location.as_str(), None, Some(2000), path, out);
6680 path.pop();
6681 path.push_key("customData");
6682 if let Some(value) = &self.custom_data {
6683 Validate::validate_at(value, path, out);
6684 }
6685 path.pop();
6686 }
6687}
6688
6689#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6693pub struct MessageContent {
6694 pub format: MessageFormat,
6696 pub content: String,
6700 #[serde(default, skip_serializing_if = "Option::is_none")]
6702 pub language: Option<String>,
6703 #[serde(rename = "customData")]
6705 #[serde(default, skip_serializing_if = "Option::is_none")]
6706 pub custom_data: Option<crate::types::CustomData>,
6707}
6708
6709impl MessageContent {
6710 #[must_use]
6712 pub fn new(format: MessageFormat, content: impl Into<String>) -> Self {
6713 Self {
6714 format,
6715 content: content.into(),
6716 language: None,
6717 custom_data: None,
6718 }
6719 }
6720
6721 #[must_use]
6723 pub fn with_language(mut self, value: impl Into<String>) -> Self {
6724 self.language = Some(value.into());
6725 self
6726 }
6727
6728 #[must_use]
6730 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6731 self.custom_data = Some(value);
6732 self
6733 }
6734}
6735
6736impl Validate for MessageContent {
6737 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6738 path.push_key("format");
6739 Validate::validate_at(&self.format, path, out);
6740 path.pop();
6741 path.push_key("content");
6742 validate::string(self.content.as_str(), None, Some(1024), path, out);
6743 path.pop();
6744 path.push_key("language");
6745 if let Some(value) = &self.language {
6746 validate::string(value.as_str(), None, Some(8), path, out);
6747 }
6748 path.pop();
6749 path.push_key("customData");
6750 if let Some(value) = &self.custom_data {
6751 Validate::validate_at(value, path, out);
6752 }
6753 path.pop();
6754 }
6755}
6756
6757#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6761pub struct MessageInfo {
6762 pub id: i32,
6764 pub priority: MessagePriority,
6766 pub message: MessageContent,
6768 #[serde(default, skip_serializing_if = "Option::is_none")]
6770 pub display: Option<Component>,
6771 #[serde(default, skip_serializing_if = "Option::is_none")]
6773 pub state: Option<MessageState>,
6774 #[serde(rename = "startDateTime")]
6776 #[serde(default, skip_serializing_if = "Option::is_none")]
6777 pub start_date_time: Option<crate::types::DateTime>,
6778 #[serde(rename = "endDateTime")]
6780 #[serde(default, skip_serializing_if = "Option::is_none")]
6781 pub end_date_time: Option<crate::types::DateTime>,
6782 #[serde(rename = "transactionId")]
6786 #[serde(default, skip_serializing_if = "Option::is_none")]
6787 pub transaction_id: Option<String>,
6788 #[serde(rename = "messageExtra")]
6790 #[serde(default, skip_serializing_if = "Option::is_none")]
6791 pub message_extra: Option<Vec<MessageContent>>,
6792 #[serde(rename = "customData")]
6794 #[serde(default, skip_serializing_if = "Option::is_none")]
6795 pub custom_data: Option<crate::types::CustomData>,
6796}
6797
6798impl MessageInfo {
6799 #[must_use]
6801 pub fn new(id: i32, priority: MessagePriority, message: MessageContent) -> Self {
6802 Self {
6803 id,
6804 priority,
6805 message,
6806 display: None,
6807 state: None,
6808 start_date_time: None,
6809 end_date_time: None,
6810 transaction_id: None,
6811 message_extra: None,
6812 custom_data: None,
6813 }
6814 }
6815
6816 #[must_use]
6818 pub fn with_display(mut self, value: Component) -> Self {
6819 self.display = Some(value);
6820 self
6821 }
6822
6823 #[must_use]
6825 pub fn with_state(mut self, value: MessageState) -> Self {
6826 self.state = Some(value);
6827 self
6828 }
6829
6830 #[must_use]
6832 pub fn with_start_date_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6833 self.start_date_time = Some(value.into());
6834 self
6835 }
6836
6837 #[must_use]
6839 pub fn with_end_date_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6840 self.end_date_time = Some(value.into());
6841 self
6842 }
6843
6844 #[must_use]
6846 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
6847 self.transaction_id = Some(value.into());
6848 self
6849 }
6850
6851 #[must_use]
6853 pub fn with_message_extra(mut self, value: Vec<MessageContent>) -> Self {
6854 self.message_extra = Some(value);
6855 self
6856 }
6857
6858 #[must_use]
6860 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6861 self.custom_data = Some(value);
6862 self
6863 }
6864}
6865
6866impl Validate for MessageInfo {
6867 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6868 path.push_key("id");
6869 validate::int_range(i64::from(self.id), Some(0), None, path, out);
6870 path.pop();
6871 path.push_key("priority");
6872 Validate::validate_at(&self.priority, path, out);
6873 path.pop();
6874 path.push_key("message");
6875 Validate::validate_at(&self.message, path, out);
6876 path.pop();
6877 path.push_key("display");
6878 if let Some(value) = &self.display {
6879 Validate::validate_at(value, path, out);
6880 }
6881 path.pop();
6882 path.push_key("state");
6883 if let Some(value) = &self.state {
6884 Validate::validate_at(value, path, out);
6885 }
6886 path.pop();
6887 path.push_key("transactionId");
6888 if let Some(value) = &self.transaction_id {
6889 validate::string(value.as_str(), None, Some(36), path, out);
6890 }
6891 path.pop();
6892 path.push_key("messageExtra");
6893 if let Some(value) = &self.message_extra {
6894 validate::list_len(value.len(), Some(1), Some(4), path, out);
6895 for (index, item) in value.iter().enumerate() {
6896 path.push_index(index);
6897 Validate::validate_at(item, path, out);
6898 path.pop();
6899 }
6900 }
6901 path.pop();
6902 path.push_key("customData");
6903 if let Some(value) = &self.custom_data {
6904 Validate::validate_at(value, path, out);
6905 }
6906 path.pop();
6907 }
6908}
6909
6910#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6914pub struct MeterValue {
6915 #[serde(rename = "sampledValue")]
6917 pub sampled_value: Vec<SampledValue>,
6918 pub timestamp: crate::types::DateTime,
6920 #[serde(rename = "customData")]
6922 #[serde(default, skip_serializing_if = "Option::is_none")]
6923 pub custom_data: Option<crate::types::CustomData>,
6924}
6925
6926impl MeterValue {
6927 #[must_use]
6929 pub fn new(
6930 sampled_value: Vec<SampledValue>,
6931 timestamp: impl Into<crate::types::DateTime>,
6932 ) -> Self {
6933 Self {
6934 sampled_value,
6935 timestamp: timestamp.into(),
6936 custom_data: None,
6937 }
6938 }
6939
6940 #[must_use]
6942 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6943 self.custom_data = Some(value);
6944 self
6945 }
6946}
6947
6948impl Validate for MeterValue {
6949 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6950 path.push_key("sampledValue");
6951 validate::list_len(self.sampled_value.len(), Some(1), None, path, out);
6952 for (index, item) in self.sampled_value.iter().enumerate() {
6953 path.push_index(index);
6954 Validate::validate_at(item, path, out);
6955 path.pop();
6956 }
6957 path.pop();
6958 path.push_key("customData");
6959 if let Some(value) = &self.custom_data {
6960 Validate::validate_at(value, path, out);
6961 }
6962 path.pop();
6963 }
6964}
6965
6966#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
6970pub struct Modem {
6971 #[serde(default, skip_serializing_if = "Option::is_none")]
6973 pub iccid: Option<String>,
6974 #[serde(default, skip_serializing_if = "Option::is_none")]
6976 pub imsi: Option<String>,
6977 #[serde(rename = "customData")]
6979 #[serde(default, skip_serializing_if = "Option::is_none")]
6980 pub custom_data: Option<crate::types::CustomData>,
6981}
6982
6983impl Modem {
6984 #[must_use]
6986 pub fn new() -> Self {
6987 Self::default()
6988 }
6989
6990 #[must_use]
6992 pub fn with_iccid(mut self, value: impl Into<String>) -> Self {
6993 self.iccid = Some(value.into());
6994 self
6995 }
6996
6997 #[must_use]
6999 pub fn with_imsi(mut self, value: impl Into<String>) -> Self {
7000 self.imsi = Some(value.into());
7001 self
7002 }
7003
7004 #[must_use]
7006 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7007 self.custom_data = Some(value);
7008 self
7009 }
7010}
7011
7012impl Validate for Modem {
7013 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7014 path.push_key("iccid");
7015 if let Some(value) = &self.iccid {
7016 validate::string(value.as_str(), None, Some(20), path, out);
7017 }
7018 path.pop();
7019 path.push_key("imsi");
7020 if let Some(value) = &self.imsi {
7021 validate::string(value.as_str(), None, Some(20), path, out);
7022 }
7023 path.pop();
7024 path.push_key("customData");
7025 if let Some(value) = &self.custom_data {
7026 Validate::validate_at(value, path, out);
7027 }
7028 path.pop();
7029 }
7030}
7031
7032#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7036pub struct MonitoringData {
7037 pub component: Component,
7039 pub variable: Variable,
7041 #[serde(rename = "variableMonitoring")]
7043 pub variable_monitoring: Vec<VariableMonitoring>,
7044 #[serde(rename = "customData")]
7046 #[serde(default, skip_serializing_if = "Option::is_none")]
7047 pub custom_data: Option<crate::types::CustomData>,
7048}
7049
7050impl MonitoringData {
7051 #[must_use]
7053 pub fn new(
7054 component: Component,
7055 variable: Variable,
7056 variable_monitoring: Vec<VariableMonitoring>,
7057 ) -> Self {
7058 Self {
7059 component,
7060 variable,
7061 variable_monitoring,
7062 custom_data: None,
7063 }
7064 }
7065
7066 #[must_use]
7068 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7069 self.custom_data = Some(value);
7070 self
7071 }
7072}
7073
7074impl Validate for MonitoringData {
7075 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7076 path.push_key("component");
7077 Validate::validate_at(&self.component, path, out);
7078 path.pop();
7079 path.push_key("variable");
7080 Validate::validate_at(&self.variable, path, out);
7081 path.pop();
7082 path.push_key("variableMonitoring");
7083 validate::list_len(self.variable_monitoring.len(), Some(1), None, path, out);
7084 for (index, item) in self.variable_monitoring.iter().enumerate() {
7085 path.push_index(index);
7086 Validate::validate_at(item, path, out);
7087 path.pop();
7088 }
7089 path.pop();
7090 path.push_key("customData");
7091 if let Some(value) = &self.custom_data {
7092 Validate::validate_at(value, path, out);
7093 }
7094 path.pop();
7095 }
7096}
7097
7098#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7102pub struct NetworkConnectionProfile {
7103 #[serde(rename = "ocppInterface")]
7105 pub ocpp_interface: OCPPInterface,
7106 #[serde(rename = "ocppTransport")]
7108 pub ocpp_transport: OCPPTransport,
7109 #[serde(rename = "messageTimeout")]
7113 pub message_timeout: i32,
7114 #[serde(rename = "ocppCsmsUrl")]
7117 pub ocpp_csms_url: String,
7118 #[serde(rename = "securityProfile")]
7120 pub security_profile: i32,
7121 #[serde(default, skip_serializing_if = "Option::is_none")]
7123 pub apn: Option<APN>,
7124 #[serde(rename = "ocppVersion")]
7126 #[serde(default, skip_serializing_if = "Option::is_none")]
7127 pub ocpp_version: Option<OCPPVersion>,
7128 #[serde(default, skip_serializing_if = "Option::is_none")]
7130 pub identity: Option<String>,
7131 #[serde(rename = "basicAuthPassword")]
7133 #[serde(default, skip_serializing_if = "Option::is_none")]
7134 pub basic_auth_password: Option<String>,
7135 #[serde(default, skip_serializing_if = "Option::is_none")]
7137 pub vpn: Option<VPN>,
7138 #[serde(rename = "customData")]
7140 #[serde(default, skip_serializing_if = "Option::is_none")]
7141 pub custom_data: Option<crate::types::CustomData>,
7142}
7143
7144impl NetworkConnectionProfile {
7145 #[must_use]
7147 pub fn new(
7148 ocpp_interface: OCPPInterface,
7149 ocpp_transport: OCPPTransport,
7150 message_timeout: i32,
7151 ocpp_csms_url: impl Into<String>,
7152 security_profile: i32,
7153 ) -> Self {
7154 Self {
7155 ocpp_interface,
7156 ocpp_transport,
7157 message_timeout,
7158 ocpp_csms_url: ocpp_csms_url.into(),
7159 security_profile,
7160 apn: None,
7161 ocpp_version: None,
7162 identity: None,
7163 basic_auth_password: None,
7164 vpn: None,
7165 custom_data: None,
7166 }
7167 }
7168
7169 #[must_use]
7171 pub fn with_apn(mut self, value: APN) -> Self {
7172 self.apn = Some(value);
7173 self
7174 }
7175
7176 #[must_use]
7178 pub fn with_ocpp_version(mut self, value: OCPPVersion) -> Self {
7179 self.ocpp_version = Some(value);
7180 self
7181 }
7182
7183 #[must_use]
7185 pub fn with_identity(mut self, value: impl Into<String>) -> Self {
7186 self.identity = Some(value.into());
7187 self
7188 }
7189
7190 #[must_use]
7192 pub fn with_basic_auth_password(mut self, value: impl Into<String>) -> Self {
7193 self.basic_auth_password = Some(value.into());
7194 self
7195 }
7196
7197 #[must_use]
7199 pub fn with_vpn(mut self, value: VPN) -> Self {
7200 self.vpn = Some(value);
7201 self
7202 }
7203
7204 #[must_use]
7206 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7207 self.custom_data = Some(value);
7208 self
7209 }
7210}
7211
7212impl Validate for NetworkConnectionProfile {
7213 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7214 path.push_key("ocppInterface");
7215 Validate::validate_at(&self.ocpp_interface, path, out);
7216 path.pop();
7217 path.push_key("ocppTransport");
7218 Validate::validate_at(&self.ocpp_transport, path, out);
7219 path.pop();
7220 path.push_key("ocppCsmsUrl");
7221 validate::string(self.ocpp_csms_url.as_str(), None, Some(2000), path, out);
7222 path.pop();
7223 path.push_key("securityProfile");
7224 validate::int_range(i64::from(self.security_profile), Some(0), None, path, out);
7225 path.pop();
7226 path.push_key("apn");
7227 if let Some(value) = &self.apn {
7228 Validate::validate_at(value, path, out);
7229 }
7230 path.pop();
7231 path.push_key("ocppVersion");
7232 if let Some(value) = &self.ocpp_version {
7233 Validate::validate_at(value, path, out);
7234 }
7235 path.pop();
7236 path.push_key("identity");
7237 if let Some(value) = &self.identity {
7238 validate::string(value.as_str(), None, Some(48), path, out);
7239 }
7240 path.pop();
7241 path.push_key("basicAuthPassword");
7242 if let Some(value) = &self.basic_auth_password {
7243 validate::string(value.as_str(), None, Some(64), path, out);
7244 }
7245 path.pop();
7246 path.push_key("vpn");
7247 if let Some(value) = &self.vpn {
7248 Validate::validate_at(value, path, out);
7249 }
7250 path.pop();
7251 path.push_key("customData");
7252 if let Some(value) = &self.custom_data {
7253 Validate::validate_at(value, path, out);
7254 }
7255 path.pop();
7256 }
7257}
7258
7259#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7263pub struct OCSPRequestData {
7264 #[serde(rename = "hashAlgorithm")]
7266 pub hash_algorithm: HashAlgorithm,
7267 #[serde(rename = "issuerNameHash")]
7272 pub issuer_name_hash: String,
7273 #[serde(rename = "issuerKeyHash")]
7277 pub issuer_key_hash: String,
7278 #[serde(rename = "serialNumber")]
7282 pub serial_number: String,
7283 #[serde(rename = "responderURL")]
7285 pub responder_url: String,
7286 #[serde(rename = "customData")]
7288 #[serde(default, skip_serializing_if = "Option::is_none")]
7289 pub custom_data: Option<crate::types::CustomData>,
7290}
7291
7292impl OCSPRequestData {
7293 #[must_use]
7295 pub fn new(
7296 hash_algorithm: HashAlgorithm,
7297 issuer_name_hash: impl Into<String>,
7298 issuer_key_hash: impl Into<String>,
7299 serial_number: impl Into<String>,
7300 responder_url: impl Into<String>,
7301 ) -> Self {
7302 Self {
7303 hash_algorithm,
7304 issuer_name_hash: issuer_name_hash.into(),
7305 issuer_key_hash: issuer_key_hash.into(),
7306 serial_number: serial_number.into(),
7307 responder_url: responder_url.into(),
7308 custom_data: None,
7309 }
7310 }
7311
7312 #[must_use]
7314 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7315 self.custom_data = Some(value);
7316 self
7317 }
7318}
7319
7320impl Validate for OCSPRequestData {
7321 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7322 path.push_key("hashAlgorithm");
7323 Validate::validate_at(&self.hash_algorithm, path, out);
7324 path.pop();
7325 path.push_key("issuerNameHash");
7326 validate::string(self.issuer_name_hash.as_str(), None, Some(128), path, out);
7327 path.pop();
7328 path.push_key("issuerKeyHash");
7329 validate::string(self.issuer_key_hash.as_str(), None, Some(128), path, out);
7330 path.pop();
7331 path.push_key("serialNumber");
7332 validate::string(self.serial_number.as_str(), None, Some(40), path, out);
7333 path.pop();
7334 path.push_key("responderURL");
7335 validate::string(self.responder_url.as_str(), None, Some(2000), path, out);
7336 path.pop();
7337 path.push_key("customData");
7338 if let Some(value) = &self.custom_data {
7339 Validate::validate_at(value, path, out);
7340 }
7341 path.pop();
7342 }
7343}
7344
7345#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7349pub struct OverstayRule {
7350 #[serde(rename = "overstayFee")]
7352 pub overstay_fee: RationalNumber,
7353 #[serde(rename = "startTime")]
7355 pub start_time: i32,
7356 #[serde(rename = "overstayFeePeriod")]
7358 pub overstay_fee_period: i32,
7359 #[serde(rename = "overstayRuleDescription")]
7361 #[serde(default, skip_serializing_if = "Option::is_none")]
7362 pub overstay_rule_description: Option<String>,
7363 #[serde(rename = "customData")]
7365 #[serde(default, skip_serializing_if = "Option::is_none")]
7366 pub custom_data: Option<crate::types::CustomData>,
7367}
7368
7369impl OverstayRule {
7370 #[must_use]
7372 pub fn new(overstay_fee: RationalNumber, start_time: i32, overstay_fee_period: i32) -> Self {
7373 Self {
7374 overstay_fee,
7375 start_time,
7376 overstay_fee_period,
7377 overstay_rule_description: None,
7378 custom_data: None,
7379 }
7380 }
7381
7382 #[must_use]
7384 pub fn with_overstay_rule_description(mut self, value: impl Into<String>) -> Self {
7385 self.overstay_rule_description = Some(value.into());
7386 self
7387 }
7388
7389 #[must_use]
7391 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7392 self.custom_data = Some(value);
7393 self
7394 }
7395}
7396
7397impl Validate for OverstayRule {
7398 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7399 path.push_key("overstayFee");
7400 Validate::validate_at(&self.overstay_fee, path, out);
7401 path.pop();
7402 path.push_key("overstayRuleDescription");
7403 if let Some(value) = &self.overstay_rule_description {
7404 validate::string(value.as_str(), None, Some(32), path, out);
7405 }
7406 path.pop();
7407 path.push_key("customData");
7408 if let Some(value) = &self.custom_data {
7409 Validate::validate_at(value, path, out);
7410 }
7411 path.pop();
7412 }
7413}
7414
7415#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7419pub struct OverstayRuleList {
7420 #[serde(rename = "overstayRule")]
7422 pub overstay_rule: Vec<OverstayRule>,
7423 #[serde(rename = "overstayPowerThreshold")]
7425 #[serde(default, skip_serializing_if = "Option::is_none")]
7426 pub overstay_power_threshold: Option<RationalNumber>,
7427 #[serde(rename = "overstayTimeThreshold")]
7429 #[serde(default, skip_serializing_if = "Option::is_none")]
7430 pub overstay_time_threshold: Option<i32>,
7431 #[serde(rename = "customData")]
7433 #[serde(default, skip_serializing_if = "Option::is_none")]
7434 pub custom_data: Option<crate::types::CustomData>,
7435}
7436
7437impl OverstayRuleList {
7438 #[must_use]
7440 pub fn new(overstay_rule: Vec<OverstayRule>) -> Self {
7441 Self {
7442 overstay_rule,
7443 overstay_power_threshold: None,
7444 overstay_time_threshold: None,
7445 custom_data: None,
7446 }
7447 }
7448
7449 #[must_use]
7451 pub fn with_overstay_power_threshold(mut self, value: RationalNumber) -> Self {
7452 self.overstay_power_threshold = Some(value);
7453 self
7454 }
7455
7456 #[must_use]
7458 pub fn with_overstay_time_threshold(mut self, value: i32) -> Self {
7459 self.overstay_time_threshold = Some(value);
7460 self
7461 }
7462
7463 #[must_use]
7465 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7466 self.custom_data = Some(value);
7467 self
7468 }
7469}
7470
7471impl Validate for OverstayRuleList {
7472 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7473 path.push_key("overstayRule");
7474 validate::list_len(self.overstay_rule.len(), Some(1), Some(5), path, out);
7475 for (index, item) in self.overstay_rule.iter().enumerate() {
7476 path.push_index(index);
7477 Validate::validate_at(item, path, out);
7478 path.pop();
7479 }
7480 path.pop();
7481 path.push_key("overstayPowerThreshold");
7482 if let Some(value) = &self.overstay_power_threshold {
7483 Validate::validate_at(value, path, out);
7484 }
7485 path.pop();
7486 path.push_key("customData");
7487 if let Some(value) = &self.custom_data {
7488 Validate::validate_at(value, path, out);
7489 }
7490 path.pop();
7491 }
7492}
7493
7494#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7496pub struct PeriodicEventStreamParams {
7497 #[serde(default, skip_serializing_if = "Option::is_none")]
7499 pub interval: Option<i32>,
7500 #[serde(default, skip_serializing_if = "Option::is_none")]
7502 pub values: Option<i32>,
7503 #[serde(rename = "customData")]
7505 #[serde(default, skip_serializing_if = "Option::is_none")]
7506 pub custom_data: Option<crate::types::CustomData>,
7507}
7508
7509impl PeriodicEventStreamParams {
7510 #[must_use]
7512 pub fn new() -> Self {
7513 Self::default()
7514 }
7515
7516 #[must_use]
7518 pub fn with_interval(mut self, value: i32) -> Self {
7519 self.interval = Some(value);
7520 self
7521 }
7522
7523 #[must_use]
7525 pub fn with_values(mut self, value: i32) -> Self {
7526 self.values = Some(value);
7527 self
7528 }
7529
7530 #[must_use]
7532 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7533 self.custom_data = Some(value);
7534 self
7535 }
7536}
7537
7538impl Validate for PeriodicEventStreamParams {
7539 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7540 path.push_key("interval");
7541 if let Some(value) = &self.interval {
7542 validate::int_range(i64::from(*value), Some(0), None, path, out);
7543 }
7544 path.pop();
7545 path.push_key("values");
7546 if let Some(value) = &self.values {
7547 validate::int_range(i64::from(*value), Some(0), None, path, out);
7548 }
7549 path.pop();
7550 path.push_key("customData");
7551 if let Some(value) = &self.custom_data {
7552 Validate::validate_at(value, path, out);
7553 }
7554 path.pop();
7555 }
7556}
7557
7558#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7562pub struct Price {
7563 #[serde(rename = "exclTax")]
7565 #[serde(default, skip_serializing_if = "Option::is_none")]
7566 pub excl_tax: Option<crate::types::Decimal>,
7567 #[serde(rename = "inclTax")]
7569 #[serde(default, skip_serializing_if = "Option::is_none")]
7570 pub incl_tax: Option<crate::types::Decimal>,
7571 #[serde(rename = "taxRates")]
7573 #[serde(default, skip_serializing_if = "Option::is_none")]
7574 pub tax_rates: Option<Vec<TaxRate>>,
7575 #[serde(rename = "customData")]
7577 #[serde(default, skip_serializing_if = "Option::is_none")]
7578 pub custom_data: Option<crate::types::CustomData>,
7579}
7580
7581impl Price {
7582 #[must_use]
7584 pub fn new() -> Self {
7585 Self::default()
7586 }
7587
7588 #[must_use]
7590 pub fn with_excl_tax(mut self, value: impl Into<crate::types::Decimal>) -> Self {
7591 self.excl_tax = Some(value.into());
7592 self
7593 }
7594
7595 #[must_use]
7597 pub fn with_incl_tax(mut self, value: impl Into<crate::types::Decimal>) -> Self {
7598 self.incl_tax = Some(value.into());
7599 self
7600 }
7601
7602 #[must_use]
7604 pub fn with_tax_rates(mut self, value: Vec<TaxRate>) -> Self {
7605 self.tax_rates = Some(value);
7606 self
7607 }
7608
7609 #[must_use]
7611 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7612 self.custom_data = Some(value);
7613 self
7614 }
7615}
7616
7617impl Validate for Price {
7618 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7619 path.push_key("taxRates");
7620 if let Some(value) = &self.tax_rates {
7621 validate::list_len(value.len(), Some(1), Some(5), path, out);
7622 for (index, item) in value.iter().enumerate() {
7623 path.push_index(index);
7624 Validate::validate_at(item, path, out);
7625 path.pop();
7626 }
7627 }
7628 path.pop();
7629 path.push_key("customData");
7630 if let Some(value) = &self.custom_data {
7631 Validate::validate_at(value, path, out);
7632 }
7633 path.pop();
7634 }
7635}
7636
7637#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7641pub struct PriceLevelSchedule {
7642 #[serde(rename = "priceLevelScheduleEntries")]
7644 pub price_level_schedule_entries: Vec<PriceLevelScheduleEntry>,
7645 #[serde(rename = "timeAnchor")]
7647 pub time_anchor: crate::types::DateTime,
7648 #[serde(rename = "priceScheduleId")]
7650 pub price_schedule_id: i32,
7651 #[serde(rename = "numberOfPriceLevels")]
7653 pub number_of_price_levels: i32,
7654 #[serde(rename = "priceScheduleDescription")]
7656 #[serde(default, skip_serializing_if = "Option::is_none")]
7657 pub price_schedule_description: Option<String>,
7658 #[serde(rename = "customData")]
7660 #[serde(default, skip_serializing_if = "Option::is_none")]
7661 pub custom_data: Option<crate::types::CustomData>,
7662}
7663
7664impl PriceLevelSchedule {
7665 #[must_use]
7667 pub fn new(
7668 price_level_schedule_entries: Vec<PriceLevelScheduleEntry>,
7669 time_anchor: impl Into<crate::types::DateTime>,
7670 price_schedule_id: i32,
7671 number_of_price_levels: i32,
7672 ) -> Self {
7673 Self {
7674 price_level_schedule_entries,
7675 time_anchor: time_anchor.into(),
7676 price_schedule_id,
7677 number_of_price_levels,
7678 price_schedule_description: None,
7679 custom_data: None,
7680 }
7681 }
7682
7683 #[must_use]
7685 pub fn with_price_schedule_description(mut self, value: impl Into<String>) -> Self {
7686 self.price_schedule_description = Some(value.into());
7687 self
7688 }
7689
7690 #[must_use]
7692 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7693 self.custom_data = Some(value);
7694 self
7695 }
7696}
7697
7698impl Validate for PriceLevelSchedule {
7699 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7700 path.push_key("priceLevelScheduleEntries");
7701 validate::list_len(
7702 self.price_level_schedule_entries.len(),
7703 Some(1),
7704 Some(100),
7705 path,
7706 out,
7707 );
7708 for (index, item) in self.price_level_schedule_entries.iter().enumerate() {
7709 path.push_index(index);
7710 Validate::validate_at(item, path, out);
7711 path.pop();
7712 }
7713 path.pop();
7714 path.push_key("priceScheduleId");
7715 validate::int_range(i64::from(self.price_schedule_id), Some(0), None, path, out);
7716 path.pop();
7717 path.push_key("numberOfPriceLevels");
7718 validate::int_range(
7719 i64::from(self.number_of_price_levels),
7720 Some(0),
7721 None,
7722 path,
7723 out,
7724 );
7725 path.pop();
7726 path.push_key("priceScheduleDescription");
7727 if let Some(value) = &self.price_schedule_description {
7728 validate::string(value.as_str(), None, Some(32), path, out);
7729 }
7730 path.pop();
7731 path.push_key("customData");
7732 if let Some(value) = &self.custom_data {
7733 Validate::validate_at(value, path, out);
7734 }
7735 path.pop();
7736 }
7737}
7738
7739#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7743pub struct PriceLevelScheduleEntry {
7744 pub duration: i32,
7746 #[serde(rename = "priceLevel")]
7748 pub price_level: i32,
7749 #[serde(rename = "customData")]
7751 #[serde(default, skip_serializing_if = "Option::is_none")]
7752 pub custom_data: Option<crate::types::CustomData>,
7753}
7754
7755impl PriceLevelScheduleEntry {
7756 #[must_use]
7758 pub fn new(duration: i32, price_level: i32) -> Self {
7759 Self {
7760 duration,
7761 price_level,
7762 custom_data: None,
7763 }
7764 }
7765
7766 #[must_use]
7768 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7769 self.custom_data = Some(value);
7770 self
7771 }
7772}
7773
7774impl Validate for PriceLevelScheduleEntry {
7775 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7776 path.push_key("priceLevel");
7777 validate::int_range(i64::from(self.price_level), Some(0), None, path, out);
7778 path.pop();
7779 path.push_key("customData");
7780 if let Some(value) = &self.custom_data {
7781 Validate::validate_at(value, path, out);
7782 }
7783 path.pop();
7784 }
7785}
7786
7787#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7791pub struct PriceRule {
7792 #[serde(rename = "energyFee")]
7794 pub energy_fee: RationalNumber,
7795 #[serde(rename = "powerRangeStart")]
7797 pub power_range_start: RationalNumber,
7798 #[serde(rename = "parkingFeePeriod")]
7801 #[serde(default, skip_serializing_if = "Option::is_none")]
7802 pub parking_fee_period: Option<i32>,
7803 #[serde(rename = "carbonDioxideEmission")]
7805 #[serde(default, skip_serializing_if = "Option::is_none")]
7806 pub carbon_dioxide_emission: Option<i32>,
7807 #[serde(rename = "renewableGenerationPercentage")]
7809 #[serde(default, skip_serializing_if = "Option::is_none")]
7810 pub renewable_generation_percentage: Option<i32>,
7811 #[serde(rename = "parkingFee")]
7813 #[serde(default, skip_serializing_if = "Option::is_none")]
7814 pub parking_fee: Option<RationalNumber>,
7815 #[serde(rename = "customData")]
7817 #[serde(default, skip_serializing_if = "Option::is_none")]
7818 pub custom_data: Option<crate::types::CustomData>,
7819}
7820
7821impl PriceRule {
7822 #[must_use]
7824 pub fn new(energy_fee: RationalNumber, power_range_start: RationalNumber) -> Self {
7825 Self {
7826 energy_fee,
7827 power_range_start,
7828 parking_fee_period: None,
7829 carbon_dioxide_emission: None,
7830 renewable_generation_percentage: None,
7831 parking_fee: None,
7832 custom_data: None,
7833 }
7834 }
7835
7836 #[must_use]
7838 pub fn with_parking_fee_period(mut self, value: i32) -> Self {
7839 self.parking_fee_period = Some(value);
7840 self
7841 }
7842
7843 #[must_use]
7845 pub fn with_carbon_dioxide_emission(mut self, value: i32) -> Self {
7846 self.carbon_dioxide_emission = Some(value);
7847 self
7848 }
7849
7850 #[must_use]
7852 pub fn with_renewable_generation_percentage(mut self, value: i32) -> Self {
7853 self.renewable_generation_percentage = Some(value);
7854 self
7855 }
7856
7857 #[must_use]
7859 pub fn with_parking_fee(mut self, value: RationalNumber) -> Self {
7860 self.parking_fee = Some(value);
7861 self
7862 }
7863
7864 #[must_use]
7866 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7867 self.custom_data = Some(value);
7868 self
7869 }
7870}
7871
7872impl Validate for PriceRule {
7873 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7874 path.push_key("energyFee");
7875 Validate::validate_at(&self.energy_fee, path, out);
7876 path.pop();
7877 path.push_key("powerRangeStart");
7878 Validate::validate_at(&self.power_range_start, path, out);
7879 path.pop();
7880 path.push_key("carbonDioxideEmission");
7881 if let Some(value) = &self.carbon_dioxide_emission {
7882 validate::int_range(i64::from(*value), Some(0), None, path, out);
7883 }
7884 path.pop();
7885 path.push_key("renewableGenerationPercentage");
7886 if let Some(value) = &self.renewable_generation_percentage {
7887 validate::int_range(i64::from(*value), Some(0), Some(100), path, out);
7888 }
7889 path.pop();
7890 path.push_key("parkingFee");
7891 if let Some(value) = &self.parking_fee {
7892 Validate::validate_at(value, path, out);
7893 }
7894 path.pop();
7895 path.push_key("customData");
7896 if let Some(value) = &self.custom_data {
7897 Validate::validate_at(value, path, out);
7898 }
7899 path.pop();
7900 }
7901}
7902
7903#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7907pub struct PriceRuleStack {
7908 pub duration: i32,
7910 #[serde(rename = "priceRule")]
7912 pub price_rule: Vec<PriceRule>,
7913 #[serde(rename = "customData")]
7915 #[serde(default, skip_serializing_if = "Option::is_none")]
7916 pub custom_data: Option<crate::types::CustomData>,
7917}
7918
7919impl PriceRuleStack {
7920 #[must_use]
7922 pub fn new(duration: i32, price_rule: Vec<PriceRule>) -> Self {
7923 Self {
7924 duration,
7925 price_rule,
7926 custom_data: None,
7927 }
7928 }
7929
7930 #[must_use]
7932 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7933 self.custom_data = Some(value);
7934 self
7935 }
7936}
7937
7938impl Validate for PriceRuleStack {
7939 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7940 path.push_key("priceRule");
7941 validate::list_len(self.price_rule.len(), Some(1), Some(8), path, out);
7942 for (index, item) in self.price_rule.iter().enumerate() {
7943 path.push_index(index);
7944 Validate::validate_at(item, path, out);
7945 path.pop();
7946 }
7947 path.pop();
7948 path.push_key("customData");
7949 if let Some(value) = &self.custom_data {
7950 Validate::validate_at(value, path, out);
7951 }
7952 path.pop();
7953 }
7954}
7955
7956#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7960pub struct RationalNumber {
7961 pub exponent: i32,
7963 pub value: i32,
7965 #[serde(rename = "customData")]
7967 #[serde(default, skip_serializing_if = "Option::is_none")]
7968 pub custom_data: Option<crate::types::CustomData>,
7969}
7970
7971impl RationalNumber {
7972 #[must_use]
7974 pub fn new(exponent: i32, value: i32) -> Self {
7975 Self {
7976 exponent,
7977 value,
7978 custom_data: None,
7979 }
7980 }
7981
7982 #[must_use]
7984 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7985 self.custom_data = Some(value);
7986 self
7987 }
7988}
7989
7990impl Validate for RationalNumber {
7991 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7992 path.push_key("customData");
7993 if let Some(value) = &self.custom_data {
7994 Validate::validate_at(value, path, out);
7995 }
7996 path.pop();
7997 }
7998}
7999
8000#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
8002pub struct ReactivePowerParams {
8003 #[serde(rename = "vRef")]
8005 #[serde(default, skip_serializing_if = "Option::is_none")]
8006 pub v_ref: Option<crate::types::Decimal>,
8007 #[serde(rename = "autonomousVRefEnable")]
8009 #[serde(default, skip_serializing_if = "Option::is_none")]
8010 pub autonomous_v_ref_enable: Option<bool>,
8011 #[serde(rename = "autonomousVRefTimeConstant")]
8013 #[serde(default, skip_serializing_if = "Option::is_none")]
8014 pub autonomous_v_ref_time_constant: Option<crate::types::Decimal>,
8015 #[serde(rename = "customData")]
8017 #[serde(default, skip_serializing_if = "Option::is_none")]
8018 pub custom_data: Option<crate::types::CustomData>,
8019}
8020
8021impl ReactivePowerParams {
8022 #[must_use]
8024 pub fn new() -> Self {
8025 Self::default()
8026 }
8027
8028 #[must_use]
8030 pub fn with_v_ref(mut self, value: impl Into<crate::types::Decimal>) -> Self {
8031 self.v_ref = Some(value.into());
8032 self
8033 }
8034
8035 #[must_use]
8037 pub fn with_autonomous_v_ref_enable(mut self, value: bool) -> Self {
8038 self.autonomous_v_ref_enable = Some(value);
8039 self
8040 }
8041
8042 #[must_use]
8044 pub fn with_autonomous_v_ref_time_constant(
8045 mut self,
8046 value: impl Into<crate::types::Decimal>,
8047 ) -> Self {
8048 self.autonomous_v_ref_time_constant = Some(value.into());
8049 self
8050 }
8051
8052 #[must_use]
8054 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8055 self.custom_data = Some(value);
8056 self
8057 }
8058}
8059
8060impl Validate for ReactivePowerParams {
8061 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8062 path.push_key("customData");
8063 if let Some(value) = &self.custom_data {
8064 Validate::validate_at(value, path, out);
8065 }
8066 path.pop();
8067 }
8068}
8069
8070#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8072pub struct RelativeTimeInterval {
8073 pub start: i32,
8075 #[serde(default, skip_serializing_if = "Option::is_none")]
8077 pub duration: Option<i32>,
8078 #[serde(rename = "customData")]
8080 #[serde(default, skip_serializing_if = "Option::is_none")]
8081 pub custom_data: Option<crate::types::CustomData>,
8082}
8083
8084impl RelativeTimeInterval {
8085 #[must_use]
8087 pub fn new(start: i32) -> Self {
8088 Self {
8089 start,
8090 duration: None,
8091 custom_data: None,
8092 }
8093 }
8094
8095 #[must_use]
8097 pub fn with_duration(mut self, value: i32) -> Self {
8098 self.duration = Some(value);
8099 self
8100 }
8101
8102 #[must_use]
8104 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8105 self.custom_data = Some(value);
8106 self
8107 }
8108}
8109
8110impl Validate for RelativeTimeInterval {
8111 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8112 path.push_key("customData");
8113 if let Some(value) = &self.custom_data {
8114 Validate::validate_at(value, path, out);
8115 }
8116 path.pop();
8117 }
8118}
8119
8120#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8124pub struct ReportData {
8125 pub component: Component,
8127 pub variable: Variable,
8129 #[serde(rename = "variableAttribute")]
8131 pub variable_attribute: Vec<VariableAttribute>,
8132 #[serde(rename = "variableCharacteristics")]
8134 #[serde(default, skip_serializing_if = "Option::is_none")]
8135 pub variable_characteristics: Option<VariableCharacteristics>,
8136 #[serde(rename = "customData")]
8138 #[serde(default, skip_serializing_if = "Option::is_none")]
8139 pub custom_data: Option<crate::types::CustomData>,
8140}
8141
8142impl ReportData {
8143 #[must_use]
8145 pub fn new(
8146 component: Component,
8147 variable: Variable,
8148 variable_attribute: Vec<VariableAttribute>,
8149 ) -> Self {
8150 Self {
8151 component,
8152 variable,
8153 variable_attribute,
8154 variable_characteristics: None,
8155 custom_data: None,
8156 }
8157 }
8158
8159 #[must_use]
8161 pub fn with_variable_characteristics(mut self, value: VariableCharacteristics) -> Self {
8162 self.variable_characteristics = Some(value);
8163 self
8164 }
8165
8166 #[must_use]
8168 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8169 self.custom_data = Some(value);
8170 self
8171 }
8172}
8173
8174impl Validate for ReportData {
8175 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8176 path.push_key("component");
8177 Validate::validate_at(&self.component, path, out);
8178 path.pop();
8179 path.push_key("variable");
8180 Validate::validate_at(&self.variable, path, out);
8181 path.pop();
8182 path.push_key("variableAttribute");
8183 validate::list_len(self.variable_attribute.len(), Some(1), Some(4), path, out);
8184 for (index, item) in self.variable_attribute.iter().enumerate() {
8185 path.push_index(index);
8186 Validate::validate_at(item, path, out);
8187 path.pop();
8188 }
8189 path.pop();
8190 path.push_key("variableCharacteristics");
8191 if let Some(value) = &self.variable_characteristics {
8192 Validate::validate_at(value, path, out);
8193 }
8194 path.pop();
8195 path.push_key("customData");
8196 if let Some(value) = &self.custom_data {
8197 Validate::validate_at(value, path, out);
8198 }
8199 path.pop();
8200 }
8201}
8202
8203#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8208pub struct SalesTariff {
8209 pub id: i32,
8211 #[serde(rename = "salesTariffEntry")]
8213 pub sales_tariff_entry: Vec<SalesTariffEntry>,
8214 #[serde(rename = "salesTariffDescription")]
8216 #[serde(default, skip_serializing_if = "Option::is_none")]
8217 pub sales_tariff_description: Option<String>,
8218 #[serde(rename = "numEPriceLevels")]
8220 #[serde(default, skip_serializing_if = "Option::is_none")]
8221 pub num_e_price_levels: Option<i32>,
8222 #[serde(rename = "customData")]
8224 #[serde(default, skip_serializing_if = "Option::is_none")]
8225 pub custom_data: Option<crate::types::CustomData>,
8226}
8227
8228impl SalesTariff {
8229 #[must_use]
8231 pub fn new(id: i32, sales_tariff_entry: Vec<SalesTariffEntry>) -> Self {
8232 Self {
8233 id,
8234 sales_tariff_entry,
8235 sales_tariff_description: None,
8236 num_e_price_levels: None,
8237 custom_data: None,
8238 }
8239 }
8240
8241 #[must_use]
8243 pub fn with_sales_tariff_description(mut self, value: impl Into<String>) -> Self {
8244 self.sales_tariff_description = Some(value.into());
8245 self
8246 }
8247
8248 #[must_use]
8250 pub fn with_num_e_price_levels(mut self, value: i32) -> Self {
8251 self.num_e_price_levels = Some(value);
8252 self
8253 }
8254
8255 #[must_use]
8257 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8258 self.custom_data = Some(value);
8259 self
8260 }
8261}
8262
8263impl Validate for SalesTariff {
8264 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8265 path.push_key("id");
8266 validate::int_range(i64::from(self.id), Some(0), None, path, out);
8267 path.pop();
8268 path.push_key("salesTariffEntry");
8269 validate::list_len(
8270 self.sales_tariff_entry.len(),
8271 Some(1),
8272 Some(1024),
8273 path,
8274 out,
8275 );
8276 for (index, item) in self.sales_tariff_entry.iter().enumerate() {
8277 path.push_index(index);
8278 Validate::validate_at(item, path, out);
8279 path.pop();
8280 }
8281 path.pop();
8282 path.push_key("salesTariffDescription");
8283 if let Some(value) = &self.sales_tariff_description {
8284 validate::string(value.as_str(), None, Some(32), path, out);
8285 }
8286 path.pop();
8287 path.push_key("numEPriceLevels");
8288 if let Some(value) = &self.num_e_price_levels {
8289 validate::int_range(i64::from(*value), Some(0), None, path, out);
8290 }
8291 path.pop();
8292 path.push_key("customData");
8293 if let Some(value) = &self.custom_data {
8294 Validate::validate_at(value, path, out);
8295 }
8296 path.pop();
8297 }
8298}
8299
8300#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8302pub struct SalesTariffEntry {
8303 #[serde(rename = "relativeTimeInterval")]
8305 pub relative_time_interval: RelativeTimeInterval,
8306 #[serde(rename = "ePriceLevel")]
8308 #[serde(default, skip_serializing_if = "Option::is_none")]
8309 pub e_price_level: Option<i32>,
8310 #[serde(rename = "consumptionCost")]
8312 #[serde(default, skip_serializing_if = "Option::is_none")]
8313 pub consumption_cost: Option<Vec<ConsumptionCost>>,
8314 #[serde(rename = "customData")]
8316 #[serde(default, skip_serializing_if = "Option::is_none")]
8317 pub custom_data: Option<crate::types::CustomData>,
8318}
8319
8320impl SalesTariffEntry {
8321 #[must_use]
8323 pub fn new(relative_time_interval: RelativeTimeInterval) -> Self {
8324 Self {
8325 relative_time_interval,
8326 e_price_level: None,
8327 consumption_cost: None,
8328 custom_data: None,
8329 }
8330 }
8331
8332 #[must_use]
8334 pub fn with_e_price_level(mut self, value: i32) -> Self {
8335 self.e_price_level = Some(value);
8336 self
8337 }
8338
8339 #[must_use]
8341 pub fn with_consumption_cost(mut self, value: Vec<ConsumptionCost>) -> Self {
8342 self.consumption_cost = Some(value);
8343 self
8344 }
8345
8346 #[must_use]
8348 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8349 self.custom_data = Some(value);
8350 self
8351 }
8352}
8353
8354impl Validate for SalesTariffEntry {
8355 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8356 path.push_key("relativeTimeInterval");
8357 Validate::validate_at(&self.relative_time_interval, path, out);
8358 path.pop();
8359 path.push_key("ePriceLevel");
8360 if let Some(value) = &self.e_price_level {
8361 validate::int_range(i64::from(*value), Some(0), None, path, out);
8362 }
8363 path.pop();
8364 path.push_key("consumptionCost");
8365 if let Some(value) = &self.consumption_cost {
8366 validate::list_len(value.len(), Some(1), Some(3), path, out);
8367 for (index, item) in value.iter().enumerate() {
8368 path.push_index(index);
8369 Validate::validate_at(item, path, out);
8370 path.pop();
8371 }
8372 }
8373 path.pop();
8374 path.push_key("customData");
8375 if let Some(value) = &self.custom_data {
8376 Validate::validate_at(value, path, out);
8377 }
8378 path.pop();
8379 }
8380}
8381
8382#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8388pub struct SampledValue {
8389 pub value: crate::types::Decimal,
8391 #[serde(default, skip_serializing_if = "Option::is_none")]
8393 pub measurand: Option<Measurand>,
8394 #[serde(default, skip_serializing_if = "Option::is_none")]
8396 pub context: Option<ReadingContext>,
8397 #[serde(default, skip_serializing_if = "Option::is_none")]
8399 pub phase: Option<Phase>,
8400 #[serde(default, skip_serializing_if = "Option::is_none")]
8402 pub location: Option<Location>,
8403 #[serde(rename = "signedMeterValue")]
8405 #[serde(default, skip_serializing_if = "Option::is_none")]
8406 pub signed_meter_value: Option<SignedMeterValue>,
8407 #[serde(rename = "unitOfMeasure")]
8409 #[serde(default, skip_serializing_if = "Option::is_none")]
8410 pub unit_of_measure: Option<UnitOfMeasure>,
8411 #[serde(rename = "customData")]
8413 #[serde(default, skip_serializing_if = "Option::is_none")]
8414 pub custom_data: Option<crate::types::CustomData>,
8415}
8416
8417impl SampledValue {
8418 #[must_use]
8420 pub fn new(value: impl Into<crate::types::Decimal>) -> Self {
8421 Self {
8422 value: value.into(),
8423 measurand: None,
8424 context: None,
8425 phase: None,
8426 location: None,
8427 signed_meter_value: None,
8428 unit_of_measure: None,
8429 custom_data: None,
8430 }
8431 }
8432
8433 #[must_use]
8435 pub fn with_measurand(mut self, value: Measurand) -> Self {
8436 self.measurand = Some(value);
8437 self
8438 }
8439
8440 #[must_use]
8442 pub fn with_context(mut self, value: ReadingContext) -> Self {
8443 self.context = Some(value);
8444 self
8445 }
8446
8447 #[must_use]
8449 pub fn with_phase(mut self, value: Phase) -> Self {
8450 self.phase = Some(value);
8451 self
8452 }
8453
8454 #[must_use]
8456 pub fn with_location(mut self, value: Location) -> Self {
8457 self.location = Some(value);
8458 self
8459 }
8460
8461 #[must_use]
8463 pub fn with_signed_meter_value(mut self, value: SignedMeterValue) -> Self {
8464 self.signed_meter_value = Some(value);
8465 self
8466 }
8467
8468 #[must_use]
8470 pub fn with_unit_of_measure(mut self, value: UnitOfMeasure) -> Self {
8471 self.unit_of_measure = Some(value);
8472 self
8473 }
8474
8475 #[must_use]
8477 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8478 self.custom_data = Some(value);
8479 self
8480 }
8481}
8482
8483impl Validate for SampledValue {
8484 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8485 path.push_key("measurand");
8486 if let Some(value) = &self.measurand {
8487 Validate::validate_at(value, path, out);
8488 }
8489 path.pop();
8490 path.push_key("context");
8491 if let Some(value) = &self.context {
8492 Validate::validate_at(value, path, out);
8493 }
8494 path.pop();
8495 path.push_key("phase");
8496 if let Some(value) = &self.phase {
8497 Validate::validate_at(value, path, out);
8498 }
8499 path.pop();
8500 path.push_key("location");
8501 if let Some(value) = &self.location {
8502 Validate::validate_at(value, path, out);
8503 }
8504 path.pop();
8505 path.push_key("signedMeterValue");
8506 if let Some(value) = &self.signed_meter_value {
8507 Validate::validate_at(value, path, out);
8508 }
8509 path.pop();
8510 path.push_key("unitOfMeasure");
8511 if let Some(value) = &self.unit_of_measure {
8512 Validate::validate_at(value, path, out);
8513 }
8514 path.pop();
8515 path.push_key("customData");
8516 if let Some(value) = &self.custom_data {
8517 Validate::validate_at(value, path, out);
8518 }
8519 path.pop();
8520 }
8521}
8522
8523#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8527pub struct SetMonitoringData {
8528 pub value: crate::types::Decimal,
8531 pub r#type: Monitor,
8533 pub severity: i32,
8557 pub component: Component,
8559 pub variable: Variable,
8561 #[serde(default, skip_serializing_if = "Option::is_none")]
8563 pub id: Option<i32>,
8564 #[serde(rename = "periodicEventStream")]
8566 #[serde(default, skip_serializing_if = "Option::is_none")]
8567 pub periodic_event_stream: Option<PeriodicEventStreamParams>,
8568 #[serde(default, skip_serializing_if = "Option::is_none")]
8571 pub transaction: Option<bool>,
8572 #[serde(rename = "customData")]
8574 #[serde(default, skip_serializing_if = "Option::is_none")]
8575 pub custom_data: Option<crate::types::CustomData>,
8576}
8577
8578impl SetMonitoringData {
8579 #[must_use]
8581 pub fn new(
8582 value: impl Into<crate::types::Decimal>,
8583 r#type: Monitor,
8584 severity: i32,
8585 component: Component,
8586 variable: Variable,
8587 ) -> Self {
8588 Self {
8589 value: value.into(),
8590 r#type,
8591 severity,
8592 component,
8593 variable,
8594 id: None,
8595 periodic_event_stream: None,
8596 transaction: None,
8597 custom_data: None,
8598 }
8599 }
8600
8601 #[must_use]
8603 pub fn with_id(mut self, value: i32) -> Self {
8604 self.id = Some(value);
8605 self
8606 }
8607
8608 #[must_use]
8610 pub fn with_periodic_event_stream(mut self, value: PeriodicEventStreamParams) -> Self {
8611 self.periodic_event_stream = Some(value);
8612 self
8613 }
8614
8615 #[must_use]
8617 pub fn with_transaction(mut self, value: bool) -> Self {
8618 self.transaction = Some(value);
8619 self
8620 }
8621
8622 #[must_use]
8624 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8625 self.custom_data = Some(value);
8626 self
8627 }
8628}
8629
8630impl Validate for SetMonitoringData {
8631 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8632 path.push_key("type");
8633 Validate::validate_at(&self.r#type, path, out);
8634 path.pop();
8635 path.push_key("severity");
8636 validate::int_range(i64::from(self.severity), Some(0), None, path, out);
8637 path.pop();
8638 path.push_key("component");
8639 Validate::validate_at(&self.component, path, out);
8640 path.pop();
8641 path.push_key("variable");
8642 Validate::validate_at(&self.variable, path, out);
8643 path.pop();
8644 path.push_key("id");
8645 if let Some(value) = &self.id {
8646 validate::int_range(i64::from(*value), Some(0), None, path, out);
8647 }
8648 path.pop();
8649 path.push_key("periodicEventStream");
8650 if let Some(value) = &self.periodic_event_stream {
8651 Validate::validate_at(value, path, out);
8652 }
8653 path.pop();
8654 path.push_key("customData");
8655 if let Some(value) = &self.custom_data {
8656 Validate::validate_at(value, path, out);
8657 }
8658 path.pop();
8659 }
8660}
8661
8662#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8666pub struct SetMonitoringResult {
8667 pub status: SetMonitoringStatus,
8669 pub r#type: Monitor,
8671 pub component: Component,
8673 pub variable: Variable,
8675 pub severity: i32,
8699 #[serde(default, skip_serializing_if = "Option::is_none")]
8701 pub id: Option<i32>,
8702 #[serde(rename = "statusInfo")]
8704 #[serde(default, skip_serializing_if = "Option::is_none")]
8705 pub status_info: Option<StatusInfo>,
8706 #[serde(rename = "customData")]
8708 #[serde(default, skip_serializing_if = "Option::is_none")]
8709 pub custom_data: Option<crate::types::CustomData>,
8710}
8711
8712impl SetMonitoringResult {
8713 #[must_use]
8715 pub fn new(
8716 status: SetMonitoringStatus,
8717 r#type: Monitor,
8718 component: Component,
8719 variable: Variable,
8720 severity: i32,
8721 ) -> Self {
8722 Self {
8723 status,
8724 r#type,
8725 component,
8726 variable,
8727 severity,
8728 id: None,
8729 status_info: None,
8730 custom_data: None,
8731 }
8732 }
8733
8734 #[must_use]
8736 pub fn with_id(mut self, value: i32) -> Self {
8737 self.id = Some(value);
8738 self
8739 }
8740
8741 #[must_use]
8743 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
8744 self.status_info = Some(value);
8745 self
8746 }
8747
8748 #[must_use]
8750 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8751 self.custom_data = Some(value);
8752 self
8753 }
8754}
8755
8756impl Validate for SetMonitoringResult {
8757 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8758 path.push_key("status");
8759 Validate::validate_at(&self.status, path, out);
8760 path.pop();
8761 path.push_key("type");
8762 Validate::validate_at(&self.r#type, path, out);
8763 path.pop();
8764 path.push_key("component");
8765 Validate::validate_at(&self.component, path, out);
8766 path.pop();
8767 path.push_key("variable");
8768 Validate::validate_at(&self.variable, path, out);
8769 path.pop();
8770 path.push_key("severity");
8771 validate::int_range(i64::from(self.severity), Some(0), None, path, out);
8772 path.pop();
8773 path.push_key("id");
8774 if let Some(value) = &self.id {
8775 validate::int_range(i64::from(*value), Some(0), None, path, out);
8776 }
8777 path.pop();
8778 path.push_key("statusInfo");
8779 if let Some(value) = &self.status_info {
8780 Validate::validate_at(value, path, out);
8781 }
8782 path.pop();
8783 path.push_key("customData");
8784 if let Some(value) = &self.custom_data {
8785 Validate::validate_at(value, path, out);
8786 }
8787 path.pop();
8788 }
8789}
8790
8791#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8793pub struct SetVariableData {
8794 #[serde(rename = "attributeValue")]
8799 pub attribute_value: String,
8800 pub component: Component,
8802 pub variable: Variable,
8804 #[serde(rename = "attributeType")]
8806 #[serde(default, skip_serializing_if = "Option::is_none")]
8807 pub attribute_type: Option<Attribute>,
8808 #[serde(rename = "customData")]
8810 #[serde(default, skip_serializing_if = "Option::is_none")]
8811 pub custom_data: Option<crate::types::CustomData>,
8812}
8813
8814impl SetVariableData {
8815 #[must_use]
8817 pub fn new(
8818 attribute_value: impl Into<String>,
8819 component: Component,
8820 variable: Variable,
8821 ) -> Self {
8822 Self {
8823 attribute_value: attribute_value.into(),
8824 component,
8825 variable,
8826 attribute_type: None,
8827 custom_data: None,
8828 }
8829 }
8830
8831 #[must_use]
8833 pub fn with_attribute_type(mut self, value: Attribute) -> Self {
8834 self.attribute_type = Some(value);
8835 self
8836 }
8837
8838 #[must_use]
8840 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8841 self.custom_data = Some(value);
8842 self
8843 }
8844}
8845
8846impl Validate for SetVariableData {
8847 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8848 path.push_key("attributeValue");
8849 validate::string(self.attribute_value.as_str(), None, Some(2500), path, out);
8850 path.pop();
8851 path.push_key("component");
8852 Validate::validate_at(&self.component, path, out);
8853 path.pop();
8854 path.push_key("variable");
8855 Validate::validate_at(&self.variable, path, out);
8856 path.pop();
8857 path.push_key("attributeType");
8858 if let Some(value) = &self.attribute_type {
8859 Validate::validate_at(value, path, out);
8860 }
8861 path.pop();
8862 path.push_key("customData");
8863 if let Some(value) = &self.custom_data {
8864 Validate::validate_at(value, path, out);
8865 }
8866 path.pop();
8867 }
8868}
8869
8870#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8872pub struct SetVariableResult {
8873 #[serde(rename = "attributeStatus")]
8875 pub attribute_status: SetVariableStatus,
8876 pub component: Component,
8878 pub variable: Variable,
8880 #[serde(rename = "attributeType")]
8882 #[serde(default, skip_serializing_if = "Option::is_none")]
8883 pub attribute_type: Option<Attribute>,
8884 #[serde(rename = "attributeStatusInfo")]
8886 #[serde(default, skip_serializing_if = "Option::is_none")]
8887 pub attribute_status_info: Option<StatusInfo>,
8888 #[serde(rename = "customData")]
8890 #[serde(default, skip_serializing_if = "Option::is_none")]
8891 pub custom_data: Option<crate::types::CustomData>,
8892}
8893
8894impl SetVariableResult {
8895 #[must_use]
8897 pub fn new(
8898 attribute_status: SetVariableStatus,
8899 component: Component,
8900 variable: Variable,
8901 ) -> Self {
8902 Self {
8903 attribute_status,
8904 component,
8905 variable,
8906 attribute_type: None,
8907 attribute_status_info: None,
8908 custom_data: None,
8909 }
8910 }
8911
8912 #[must_use]
8914 pub fn with_attribute_type(mut self, value: Attribute) -> Self {
8915 self.attribute_type = Some(value);
8916 self
8917 }
8918
8919 #[must_use]
8921 pub fn with_attribute_status_info(mut self, value: StatusInfo) -> Self {
8922 self.attribute_status_info = Some(value);
8923 self
8924 }
8925
8926 #[must_use]
8928 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8929 self.custom_data = Some(value);
8930 self
8931 }
8932}
8933
8934impl Validate for SetVariableResult {
8935 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8936 path.push_key("attributeStatus");
8937 Validate::validate_at(&self.attribute_status, path, out);
8938 path.pop();
8939 path.push_key("component");
8940 Validate::validate_at(&self.component, path, out);
8941 path.pop();
8942 path.push_key("variable");
8943 Validate::validate_at(&self.variable, path, out);
8944 path.pop();
8945 path.push_key("attributeType");
8946 if let Some(value) = &self.attribute_type {
8947 Validate::validate_at(value, path, out);
8948 }
8949 path.pop();
8950 path.push_key("attributeStatusInfo");
8951 if let Some(value) = &self.attribute_status_info {
8952 Validate::validate_at(value, path, out);
8953 }
8954 path.pop();
8955 path.push_key("customData");
8956 if let Some(value) = &self.custom_data {
8957 Validate::validate_at(value, path, out);
8958 }
8959 path.pop();
8960 }
8961}
8962
8963#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8967pub struct SignedMeterValue {
8968 #[serde(rename = "signedMeterData")]
8970 pub signed_meter_data: String,
8971 #[serde(rename = "encodingMethod")]
8973 pub encoding_method: String,
8974 #[serde(rename = "signingMethod")]
8976 #[serde(default, skip_serializing_if = "Option::is_none")]
8977 pub signing_method: Option<String>,
8978 #[serde(rename = "publicKey")]
8980 #[serde(default, skip_serializing_if = "Option::is_none")]
8981 pub public_key: Option<String>,
8982 #[serde(rename = "customData")]
8984 #[serde(default, skip_serializing_if = "Option::is_none")]
8985 pub custom_data: Option<crate::types::CustomData>,
8986}
8987
8988impl SignedMeterValue {
8989 #[must_use]
8991 pub fn new(signed_meter_data: impl Into<String>, encoding_method: impl Into<String>) -> Self {
8992 Self {
8993 signed_meter_data: signed_meter_data.into(),
8994 encoding_method: encoding_method.into(),
8995 signing_method: None,
8996 public_key: None,
8997 custom_data: None,
8998 }
8999 }
9000
9001 #[must_use]
9003 pub fn with_signing_method(mut self, value: impl Into<String>) -> Self {
9004 self.signing_method = Some(value.into());
9005 self
9006 }
9007
9008 #[must_use]
9010 pub fn with_public_key(mut self, value: impl Into<String>) -> Self {
9011 self.public_key = Some(value.into());
9012 self
9013 }
9014
9015 #[must_use]
9017 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9018 self.custom_data = Some(value);
9019 self
9020 }
9021}
9022
9023impl Validate for SignedMeterValue {
9024 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9025 path.push_key("signedMeterData");
9026 validate::string(
9027 self.signed_meter_data.as_str(),
9028 None,
9029 Some(32768),
9030 path,
9031 out,
9032 );
9033 path.pop();
9034 path.push_key("encodingMethod");
9035 validate::string(self.encoding_method.as_str(), None, Some(50), path, out);
9036 path.pop();
9037 path.push_key("signingMethod");
9038 if let Some(value) = &self.signing_method {
9039 validate::string(value.as_str(), None, Some(50), path, out);
9040 }
9041 path.pop();
9042 path.push_key("publicKey");
9043 if let Some(value) = &self.public_key {
9044 validate::string(value.as_str(), None, Some(2500), path, out);
9045 }
9046 path.pop();
9047 path.push_key("customData");
9048 if let Some(value) = &self.custom_data {
9049 Validate::validate_at(value, path, out);
9050 }
9051 path.pop();
9052 }
9053}
9054
9055#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9059pub struct StatusInfo {
9060 #[serde(rename = "reasonCode")]
9062 pub reason_code: String,
9063 #[serde(rename = "additionalInfo")]
9065 #[serde(default, skip_serializing_if = "Option::is_none")]
9066 pub additional_info: Option<String>,
9067 #[serde(rename = "customData")]
9069 #[serde(default, skip_serializing_if = "Option::is_none")]
9070 pub custom_data: Option<crate::types::CustomData>,
9071}
9072
9073impl StatusInfo {
9074 #[must_use]
9076 pub fn new(reason_code: impl Into<String>) -> Self {
9077 Self {
9078 reason_code: reason_code.into(),
9079 additional_info: None,
9080 custom_data: None,
9081 }
9082 }
9083
9084 #[must_use]
9086 pub fn with_additional_info(mut self, value: impl Into<String>) -> Self {
9087 self.additional_info = Some(value.into());
9088 self
9089 }
9090
9091 #[must_use]
9093 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9094 self.custom_data = Some(value);
9095 self
9096 }
9097}
9098
9099impl Validate for StatusInfo {
9100 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9101 path.push_key("reasonCode");
9102 validate::string(self.reason_code.as_str(), None, Some(20), path, out);
9103 path.pop();
9104 path.push_key("additionalInfo");
9105 if let Some(value) = &self.additional_info {
9106 validate::string(value.as_str(), None, Some(1024), path, out);
9107 }
9108 path.pop();
9109 path.push_key("customData");
9110 if let Some(value) = &self.custom_data {
9111 Validate::validate_at(value, path, out);
9112 }
9113 path.pop();
9114 }
9115}
9116
9117#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9119pub struct StreamDataElement {
9120 pub t: crate::types::Decimal,
9122 pub v: String,
9124 #[serde(rename = "customData")]
9126 #[serde(default, skip_serializing_if = "Option::is_none")]
9127 pub custom_data: Option<crate::types::CustomData>,
9128}
9129
9130impl StreamDataElement {
9131 #[must_use]
9133 pub fn new(t: impl Into<crate::types::Decimal>, v: impl Into<String>) -> Self {
9134 Self {
9135 t: t.into(),
9136 v: v.into(),
9137 custom_data: None,
9138 }
9139 }
9140
9141 #[must_use]
9143 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9144 self.custom_data = Some(value);
9145 self
9146 }
9147}
9148
9149impl Validate for StreamDataElement {
9150 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9151 path.push_key("v");
9152 validate::string(self.v.as_str(), None, Some(2500), path, out);
9153 path.pop();
9154 path.push_key("customData");
9155 if let Some(value) = &self.custom_data {
9156 Validate::validate_at(value, path, out);
9157 }
9158 path.pop();
9159 }
9160}
9161
9162#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9175pub struct Tariff {
9176 #[serde(rename = "tariffId")]
9178 pub tariff_id: String,
9179 pub currency: String,
9181 #[serde(default, skip_serializing_if = "Option::is_none")]
9183 pub description: Option<Vec<MessageContent>>,
9184 #[serde(default, skip_serializing_if = "Option::is_none")]
9186 pub energy: Option<TariffEnergy>,
9187 #[serde(rename = "validFrom")]
9189 #[serde(default, skip_serializing_if = "Option::is_none")]
9190 pub valid_from: Option<crate::types::DateTime>,
9191 #[serde(rename = "chargingTime")]
9193 #[serde(default, skip_serializing_if = "Option::is_none")]
9194 pub charging_time: Option<TariffTime>,
9195 #[serde(rename = "idleTime")]
9197 #[serde(default, skip_serializing_if = "Option::is_none")]
9198 pub idle_time: Option<TariffTime>,
9199 #[serde(rename = "fixedFee")]
9201 #[serde(default, skip_serializing_if = "Option::is_none")]
9202 pub fixed_fee: Option<TariffFixed>,
9203 #[serde(rename = "reservationTime")]
9205 #[serde(default, skip_serializing_if = "Option::is_none")]
9206 pub reservation_time: Option<TariffTime>,
9207 #[serde(rename = "reservationFixed")]
9209 #[serde(default, skip_serializing_if = "Option::is_none")]
9210 pub reservation_fixed: Option<TariffFixed>,
9211 #[serde(rename = "minCost")]
9213 #[serde(default, skip_serializing_if = "Option::is_none")]
9214 pub min_cost: Option<Price>,
9215 #[serde(rename = "maxCost")]
9217 #[serde(default, skip_serializing_if = "Option::is_none")]
9218 pub max_cost: Option<Price>,
9219 #[serde(rename = "customData")]
9221 #[serde(default, skip_serializing_if = "Option::is_none")]
9222 pub custom_data: Option<crate::types::CustomData>,
9223}
9224
9225impl Tariff {
9226 #[must_use]
9228 pub fn new(tariff_id: impl Into<String>, currency: impl Into<String>) -> Self {
9229 Self {
9230 tariff_id: tariff_id.into(),
9231 currency: currency.into(),
9232 description: None,
9233 energy: None,
9234 valid_from: None,
9235 charging_time: None,
9236 idle_time: None,
9237 fixed_fee: None,
9238 reservation_time: None,
9239 reservation_fixed: None,
9240 min_cost: None,
9241 max_cost: None,
9242 custom_data: None,
9243 }
9244 }
9245
9246 #[must_use]
9248 pub fn with_description(mut self, value: Vec<MessageContent>) -> Self {
9249 self.description = Some(value);
9250 self
9251 }
9252
9253 #[must_use]
9255 pub fn with_energy(mut self, value: TariffEnergy) -> Self {
9256 self.energy = Some(value);
9257 self
9258 }
9259
9260 #[must_use]
9262 pub fn with_valid_from(mut self, value: impl Into<crate::types::DateTime>) -> Self {
9263 self.valid_from = Some(value.into());
9264 self
9265 }
9266
9267 #[must_use]
9269 pub fn with_charging_time(mut self, value: TariffTime) -> Self {
9270 self.charging_time = Some(value);
9271 self
9272 }
9273
9274 #[must_use]
9276 pub fn with_idle_time(mut self, value: TariffTime) -> Self {
9277 self.idle_time = Some(value);
9278 self
9279 }
9280
9281 #[must_use]
9283 pub fn with_fixed_fee(mut self, value: TariffFixed) -> Self {
9284 self.fixed_fee = Some(value);
9285 self
9286 }
9287
9288 #[must_use]
9290 pub fn with_reservation_time(mut self, value: TariffTime) -> Self {
9291 self.reservation_time = Some(value);
9292 self
9293 }
9294
9295 #[must_use]
9297 pub fn with_reservation_fixed(mut self, value: TariffFixed) -> Self {
9298 self.reservation_fixed = Some(value);
9299 self
9300 }
9301
9302 #[must_use]
9304 pub fn with_min_cost(mut self, value: Price) -> Self {
9305 self.min_cost = Some(value);
9306 self
9307 }
9308
9309 #[must_use]
9311 pub fn with_max_cost(mut self, value: Price) -> Self {
9312 self.max_cost = Some(value);
9313 self
9314 }
9315
9316 #[must_use]
9318 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9319 self.custom_data = Some(value);
9320 self
9321 }
9322}
9323
9324impl Validate for Tariff {
9325 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9326 path.push_key("tariffId");
9327 validate::string(self.tariff_id.as_str(), None, Some(60), path, out);
9328 path.pop();
9329 path.push_key("currency");
9330 validate::string(self.currency.as_str(), None, Some(3), path, out);
9331 path.pop();
9332 path.push_key("description");
9333 if let Some(value) = &self.description {
9334 validate::list_len(value.len(), Some(1), Some(10), path, out);
9335 for (index, item) in value.iter().enumerate() {
9336 path.push_index(index);
9337 Validate::validate_at(item, path, out);
9338 path.pop();
9339 }
9340 }
9341 path.pop();
9342 path.push_key("energy");
9343 if let Some(value) = &self.energy {
9344 Validate::validate_at(value, path, out);
9345 }
9346 path.pop();
9347 path.push_key("chargingTime");
9348 if let Some(value) = &self.charging_time {
9349 Validate::validate_at(value, path, out);
9350 }
9351 path.pop();
9352 path.push_key("idleTime");
9353 if let Some(value) = &self.idle_time {
9354 Validate::validate_at(value, path, out);
9355 }
9356 path.pop();
9357 path.push_key("fixedFee");
9358 if let Some(value) = &self.fixed_fee {
9359 Validate::validate_at(value, path, out);
9360 }
9361 path.pop();
9362 path.push_key("reservationTime");
9363 if let Some(value) = &self.reservation_time {
9364 Validate::validate_at(value, path, out);
9365 }
9366 path.pop();
9367 path.push_key("reservationFixed");
9368 if let Some(value) = &self.reservation_fixed {
9369 Validate::validate_at(value, path, out);
9370 }
9371 path.pop();
9372 path.push_key("minCost");
9373 if let Some(value) = &self.min_cost {
9374 Validate::validate_at(value, path, out);
9375 }
9376 path.pop();
9377 path.push_key("maxCost");
9378 if let Some(value) = &self.max_cost {
9379 Validate::validate_at(value, path, out);
9380 }
9381 path.pop();
9382 path.push_key("customData");
9383 if let Some(value) = &self.custom_data {
9384 Validate::validate_at(value, path, out);
9385 }
9386 path.pop();
9387 }
9388}
9389
9390#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9394pub struct TariffAssignment {
9395 #[serde(rename = "tariffId")]
9397 pub tariff_id: String,
9398 #[serde(rename = "tariffKind")]
9400 pub tariff_kind: TariffKind,
9401 #[serde(rename = "validFrom")]
9403 #[serde(default, skip_serializing_if = "Option::is_none")]
9404 pub valid_from: Option<crate::types::DateTime>,
9405 #[serde(rename = "evseIds")]
9407 #[serde(default, skip_serializing_if = "Option::is_none")]
9408 pub evse_ids: Option<Vec<i32>>,
9409 #[serde(rename = "idTokens")]
9411 #[serde(default, skip_serializing_if = "Option::is_none")]
9412 pub id_tokens: Option<Vec<String>>,
9413 #[serde(rename = "customData")]
9415 #[serde(default, skip_serializing_if = "Option::is_none")]
9416 pub custom_data: Option<crate::types::CustomData>,
9417}
9418
9419impl TariffAssignment {
9420 #[must_use]
9422 pub fn new(tariff_id: impl Into<String>, tariff_kind: TariffKind) -> Self {
9423 Self {
9424 tariff_id: tariff_id.into(),
9425 tariff_kind,
9426 valid_from: None,
9427 evse_ids: None,
9428 id_tokens: None,
9429 custom_data: None,
9430 }
9431 }
9432
9433 #[must_use]
9435 pub fn with_valid_from(mut self, value: impl Into<crate::types::DateTime>) -> Self {
9436 self.valid_from = Some(value.into());
9437 self
9438 }
9439
9440 #[must_use]
9442 pub fn with_evse_ids(mut self, value: Vec<i32>) -> Self {
9443 self.evse_ids = Some(value);
9444 self
9445 }
9446
9447 #[must_use]
9449 pub fn with_id_tokens(mut self, value: impl IntoIterator<Item = impl Into<String>>) -> Self {
9450 self.id_tokens = Some(value.into_iter().map(Into::into).collect());
9451 self
9452 }
9453
9454 #[must_use]
9456 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9457 self.custom_data = Some(value);
9458 self
9459 }
9460}
9461
9462impl Validate for TariffAssignment {
9463 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9464 path.push_key("tariffId");
9465 validate::string(self.tariff_id.as_str(), None, Some(60), path, out);
9466 path.pop();
9467 path.push_key("tariffKind");
9468 Validate::validate_at(&self.tariff_kind, path, out);
9469 path.pop();
9470 path.push_key("evseIds");
9471 if let Some(value) = &self.evse_ids {
9472 validate::list_len(value.len(), Some(1), None, path, out);
9473 for (index, item) in value.iter().enumerate() {
9474 path.push_index(index);
9475 validate::int_range(i64::from(*item), Some(0), None, path, out);
9476 path.pop();
9477 }
9478 }
9479 path.pop();
9480 path.push_key("idTokens");
9481 if let Some(value) = &self.id_tokens {
9482 validate::list_len(value.len(), Some(1), None, path, out);
9483 for (index, item) in value.iter().enumerate() {
9484 path.push_index(index);
9485 validate::string(item.as_str(), None, Some(255), path, out);
9486 path.pop();
9487 }
9488 }
9489 path.pop();
9490 path.push_key("customData");
9491 if let Some(value) = &self.custom_data {
9492 Validate::validate_at(value, path, out);
9493 }
9494 path.pop();
9495 }
9496}
9497
9498#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
9511pub struct TariffConditions {
9512 #[serde(rename = "startTimeOfDay")]
9517 #[serde(default, skip_serializing_if = "Option::is_none")]
9518 pub start_time_of_day: Option<String>,
9519 #[serde(rename = "endTimeOfDay")]
9523 #[serde(default, skip_serializing_if = "Option::is_none")]
9524 pub end_time_of_day: Option<String>,
9525 #[serde(rename = "dayOfWeek")]
9527 #[serde(default, skip_serializing_if = "Option::is_none")]
9528 pub day_of_week: Option<Vec<DayOfWeek>>,
9529 #[serde(rename = "validFromDate")]
9535 #[serde(default, skip_serializing_if = "Option::is_none")]
9536 pub valid_from_date: Option<String>,
9537 #[serde(rename = "validToDate")]
9540 #[serde(default, skip_serializing_if = "Option::is_none")]
9541 pub valid_to_date: Option<String>,
9542 #[serde(rename = "evseKind")]
9544 #[serde(default, skip_serializing_if = "Option::is_none")]
9545 pub evse_kind: Option<EvseKind>,
9546 #[serde(rename = "minEnergy")]
9549 #[serde(default, skip_serializing_if = "Option::is_none")]
9550 pub min_energy: Option<crate::types::Decimal>,
9551 #[serde(rename = "maxEnergy")]
9554 #[serde(default, skip_serializing_if = "Option::is_none")]
9555 pub max_energy: Option<crate::types::Decimal>,
9556 #[serde(rename = "minCurrent")]
9560 #[serde(default, skip_serializing_if = "Option::is_none")]
9561 pub min_current: Option<crate::types::Decimal>,
9562 #[serde(rename = "maxCurrent")]
9566 #[serde(default, skip_serializing_if = "Option::is_none")]
9567 pub max_current: Option<crate::types::Decimal>,
9568 #[serde(rename = "minPower")]
9573 #[serde(default, skip_serializing_if = "Option::is_none")]
9574 pub min_power: Option<crate::types::Decimal>,
9575 #[serde(rename = "maxPower")]
9580 #[serde(default, skip_serializing_if = "Option::is_none")]
9581 pub max_power: Option<crate::types::Decimal>,
9582 #[serde(rename = "minTime")]
9586 #[serde(default, skip_serializing_if = "Option::is_none")]
9587 pub min_time: Option<i32>,
9588 #[serde(rename = "maxTime")]
9592 #[serde(default, skip_serializing_if = "Option::is_none")]
9593 pub max_time: Option<i32>,
9594 #[serde(rename = "minChargingTime")]
9598 #[serde(default, skip_serializing_if = "Option::is_none")]
9599 pub min_charging_time: Option<i32>,
9600 #[serde(rename = "maxChargingTime")]
9604 #[serde(default, skip_serializing_if = "Option::is_none")]
9605 pub max_charging_time: Option<i32>,
9606 #[serde(rename = "minIdleTime")]
9610 #[serde(default, skip_serializing_if = "Option::is_none")]
9611 pub min_idle_time: Option<i32>,
9612 #[serde(rename = "maxIdleTime")]
9616 #[serde(default, skip_serializing_if = "Option::is_none")]
9617 pub max_idle_time: Option<i32>,
9618 #[serde(rename = "customData")]
9620 #[serde(default, skip_serializing_if = "Option::is_none")]
9621 pub custom_data: Option<crate::types::CustomData>,
9622}
9623
9624impl TariffConditions {
9625 #[must_use]
9627 pub fn new() -> Self {
9628 Self::default()
9629 }
9630
9631 #[must_use]
9633 pub fn with_start_time_of_day(mut self, value: impl Into<String>) -> Self {
9634 self.start_time_of_day = Some(value.into());
9635 self
9636 }
9637
9638 #[must_use]
9640 pub fn with_end_time_of_day(mut self, value: impl Into<String>) -> Self {
9641 self.end_time_of_day = Some(value.into());
9642 self
9643 }
9644
9645 #[must_use]
9647 pub fn with_day_of_week(mut self, value: Vec<DayOfWeek>) -> Self {
9648 self.day_of_week = Some(value);
9649 self
9650 }
9651
9652 #[must_use]
9654 pub fn with_valid_from_date(mut self, value: impl Into<String>) -> Self {
9655 self.valid_from_date = Some(value.into());
9656 self
9657 }
9658
9659 #[must_use]
9661 pub fn with_valid_to_date(mut self, value: impl Into<String>) -> Self {
9662 self.valid_to_date = Some(value.into());
9663 self
9664 }
9665
9666 #[must_use]
9668 pub fn with_evse_kind(mut self, value: EvseKind) -> Self {
9669 self.evse_kind = Some(value);
9670 self
9671 }
9672
9673 #[must_use]
9675 pub fn with_min_energy(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9676 self.min_energy = Some(value.into());
9677 self
9678 }
9679
9680 #[must_use]
9682 pub fn with_max_energy(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9683 self.max_energy = Some(value.into());
9684 self
9685 }
9686
9687 #[must_use]
9689 pub fn with_min_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9690 self.min_current = Some(value.into());
9691 self
9692 }
9693
9694 #[must_use]
9696 pub fn with_max_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9697 self.max_current = Some(value.into());
9698 self
9699 }
9700
9701 #[must_use]
9703 pub fn with_min_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9704 self.min_power = Some(value.into());
9705 self
9706 }
9707
9708 #[must_use]
9710 pub fn with_max_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9711 self.max_power = Some(value.into());
9712 self
9713 }
9714
9715 #[must_use]
9717 pub fn with_min_time(mut self, value: i32) -> Self {
9718 self.min_time = Some(value);
9719 self
9720 }
9721
9722 #[must_use]
9724 pub fn with_max_time(mut self, value: i32) -> Self {
9725 self.max_time = Some(value);
9726 self
9727 }
9728
9729 #[must_use]
9731 pub fn with_min_charging_time(mut self, value: i32) -> Self {
9732 self.min_charging_time = Some(value);
9733 self
9734 }
9735
9736 #[must_use]
9738 pub fn with_max_charging_time(mut self, value: i32) -> Self {
9739 self.max_charging_time = Some(value);
9740 self
9741 }
9742
9743 #[must_use]
9745 pub fn with_min_idle_time(mut self, value: i32) -> Self {
9746 self.min_idle_time = Some(value);
9747 self
9748 }
9749
9750 #[must_use]
9752 pub fn with_max_idle_time(mut self, value: i32) -> Self {
9753 self.max_idle_time = Some(value);
9754 self
9755 }
9756
9757 #[must_use]
9759 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9760 self.custom_data = Some(value);
9761 self
9762 }
9763}
9764
9765impl Validate for TariffConditions {
9766 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9767 path.push_key("dayOfWeek");
9768 if let Some(value) = &self.day_of_week {
9769 validate::list_len(value.len(), Some(1), Some(7), path, out);
9770 for (index, item) in value.iter().enumerate() {
9771 path.push_index(index);
9772 Validate::validate_at(item, path, out);
9773 path.pop();
9774 }
9775 }
9776 path.pop();
9777 path.push_key("evseKind");
9778 if let Some(value) = &self.evse_kind {
9779 Validate::validate_at(value, path, out);
9780 }
9781 path.pop();
9782 path.push_key("customData");
9783 if let Some(value) = &self.custom_data {
9784 Validate::validate_at(value, path, out);
9785 }
9786 path.pop();
9787 }
9788}
9789
9790#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
9799pub struct TariffConditionsFixed {
9800 #[serde(rename = "startTimeOfDay")]
9805 #[serde(default, skip_serializing_if = "Option::is_none")]
9806 pub start_time_of_day: Option<String>,
9807 #[serde(rename = "endTimeOfDay")]
9811 #[serde(default, skip_serializing_if = "Option::is_none")]
9812 pub end_time_of_day: Option<String>,
9813 #[serde(rename = "dayOfWeek")]
9815 #[serde(default, skip_serializing_if = "Option::is_none")]
9816 pub day_of_week: Option<Vec<DayOfWeek>>,
9817 #[serde(rename = "validFromDate")]
9823 #[serde(default, skip_serializing_if = "Option::is_none")]
9824 pub valid_from_date: Option<String>,
9825 #[serde(rename = "validToDate")]
9828 #[serde(default, skip_serializing_if = "Option::is_none")]
9829 pub valid_to_date: Option<String>,
9830 #[serde(rename = "evseKind")]
9832 #[serde(default, skip_serializing_if = "Option::is_none")]
9833 pub evse_kind: Option<EvseKind>,
9834 #[serde(rename = "paymentBrand")]
9837 #[serde(default, skip_serializing_if = "Option::is_none")]
9838 pub payment_brand: Option<String>,
9839 #[serde(rename = "paymentRecognition")]
9842 #[serde(default, skip_serializing_if = "Option::is_none")]
9843 pub payment_recognition: Option<String>,
9844 #[serde(rename = "customData")]
9846 #[serde(default, skip_serializing_if = "Option::is_none")]
9847 pub custom_data: Option<crate::types::CustomData>,
9848}
9849
9850impl TariffConditionsFixed {
9851 #[must_use]
9853 pub fn new() -> Self {
9854 Self::default()
9855 }
9856
9857 #[must_use]
9859 pub fn with_start_time_of_day(mut self, value: impl Into<String>) -> Self {
9860 self.start_time_of_day = Some(value.into());
9861 self
9862 }
9863
9864 #[must_use]
9866 pub fn with_end_time_of_day(mut self, value: impl Into<String>) -> Self {
9867 self.end_time_of_day = Some(value.into());
9868 self
9869 }
9870
9871 #[must_use]
9873 pub fn with_day_of_week(mut self, value: Vec<DayOfWeek>) -> Self {
9874 self.day_of_week = Some(value);
9875 self
9876 }
9877
9878 #[must_use]
9880 pub fn with_valid_from_date(mut self, value: impl Into<String>) -> Self {
9881 self.valid_from_date = Some(value.into());
9882 self
9883 }
9884
9885 #[must_use]
9887 pub fn with_valid_to_date(mut self, value: impl Into<String>) -> Self {
9888 self.valid_to_date = Some(value.into());
9889 self
9890 }
9891
9892 #[must_use]
9894 pub fn with_evse_kind(mut self, value: EvseKind) -> Self {
9895 self.evse_kind = Some(value);
9896 self
9897 }
9898
9899 #[must_use]
9901 pub fn with_payment_brand(mut self, value: impl Into<String>) -> Self {
9902 self.payment_brand = Some(value.into());
9903 self
9904 }
9905
9906 #[must_use]
9908 pub fn with_payment_recognition(mut self, value: impl Into<String>) -> Self {
9909 self.payment_recognition = Some(value.into());
9910 self
9911 }
9912
9913 #[must_use]
9915 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9916 self.custom_data = Some(value);
9917 self
9918 }
9919}
9920
9921impl Validate for TariffConditionsFixed {
9922 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9923 path.push_key("dayOfWeek");
9924 if let Some(value) = &self.day_of_week {
9925 validate::list_len(value.len(), Some(1), Some(7), path, out);
9926 for (index, item) in value.iter().enumerate() {
9927 path.push_index(index);
9928 Validate::validate_at(item, path, out);
9929 path.pop();
9930 }
9931 }
9932 path.pop();
9933 path.push_key("evseKind");
9934 if let Some(value) = &self.evse_kind {
9935 Validate::validate_at(value, path, out);
9936 }
9937 path.pop();
9938 path.push_key("paymentBrand");
9939 if let Some(value) = &self.payment_brand {
9940 validate::string(value.as_str(), None, Some(20), path, out);
9941 }
9942 path.pop();
9943 path.push_key("paymentRecognition");
9944 if let Some(value) = &self.payment_recognition {
9945 validate::string(value.as_str(), None, Some(20), path, out);
9946 }
9947 path.pop();
9948 path.push_key("customData");
9949 if let Some(value) = &self.custom_data {
9950 Validate::validate_at(value, path, out);
9951 }
9952 path.pop();
9953 }
9954}
9955
9956#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9960pub struct TariffEnergy {
9961 pub prices: Vec<TariffEnergyPrice>,
9963 #[serde(rename = "taxRates")]
9965 #[serde(default, skip_serializing_if = "Option::is_none")]
9966 pub tax_rates: Option<Vec<TaxRate>>,
9967 #[serde(rename = "customData")]
9969 #[serde(default, skip_serializing_if = "Option::is_none")]
9970 pub custom_data: Option<crate::types::CustomData>,
9971}
9972
9973impl TariffEnergy {
9974 #[must_use]
9976 pub fn new(prices: Vec<TariffEnergyPrice>) -> Self {
9977 Self {
9978 prices,
9979 tax_rates: None,
9980 custom_data: None,
9981 }
9982 }
9983
9984 #[must_use]
9986 pub fn with_tax_rates(mut self, value: Vec<TaxRate>) -> Self {
9987 self.tax_rates = Some(value);
9988 self
9989 }
9990
9991 #[must_use]
9993 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9994 self.custom_data = Some(value);
9995 self
9996 }
9997}
9998
9999impl Validate for TariffEnergy {
10000 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10001 path.push_key("prices");
10002 validate::list_len(self.prices.len(), Some(1), None, path, out);
10003 for (index, item) in self.prices.iter().enumerate() {
10004 path.push_index(index);
10005 Validate::validate_at(item, path, out);
10006 path.pop();
10007 }
10008 path.pop();
10009 path.push_key("taxRates");
10010 if let Some(value) = &self.tax_rates {
10011 validate::list_len(value.len(), Some(1), Some(5), path, out);
10012 for (index, item) in value.iter().enumerate() {
10013 path.push_index(index);
10014 Validate::validate_at(item, path, out);
10015 path.pop();
10016 }
10017 }
10018 path.pop();
10019 path.push_key("customData");
10020 if let Some(value) = &self.custom_data {
10021 Validate::validate_at(value, path, out);
10022 }
10023 path.pop();
10024 }
10025}
10026
10027#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10031pub struct TariffEnergyPrice {
10032 #[serde(rename = "priceKwh")]
10034 pub price_kwh: crate::types::Decimal,
10035 #[serde(default, skip_serializing_if = "Option::is_none")]
10037 pub conditions: Option<TariffConditions>,
10038 #[serde(rename = "customData")]
10040 #[serde(default, skip_serializing_if = "Option::is_none")]
10041 pub custom_data: Option<crate::types::CustomData>,
10042}
10043
10044impl TariffEnergyPrice {
10045 #[must_use]
10047 pub fn new(price_kwh: impl Into<crate::types::Decimal>) -> Self {
10048 Self {
10049 price_kwh: price_kwh.into(),
10050 conditions: None,
10051 custom_data: None,
10052 }
10053 }
10054
10055 #[must_use]
10057 pub fn with_conditions(mut self, value: TariffConditions) -> Self {
10058 self.conditions = Some(value);
10059 self
10060 }
10061
10062 #[must_use]
10064 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10065 self.custom_data = Some(value);
10066 self
10067 }
10068}
10069
10070impl Validate for TariffEnergyPrice {
10071 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10072 path.push_key("conditions");
10073 if let Some(value) = &self.conditions {
10074 Validate::validate_at(value, path, out);
10075 }
10076 path.pop();
10077 path.push_key("customData");
10078 if let Some(value) = &self.custom_data {
10079 Validate::validate_at(value, path, out);
10080 }
10081 path.pop();
10082 }
10083}
10084
10085#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10087pub struct TariffFixed {
10088 pub prices: Vec<TariffFixedPrice>,
10090 #[serde(rename = "taxRates")]
10092 #[serde(default, skip_serializing_if = "Option::is_none")]
10093 pub tax_rates: Option<Vec<TaxRate>>,
10094 #[serde(rename = "customData")]
10096 #[serde(default, skip_serializing_if = "Option::is_none")]
10097 pub custom_data: Option<crate::types::CustomData>,
10098}
10099
10100impl TariffFixed {
10101 #[must_use]
10103 pub fn new(prices: Vec<TariffFixedPrice>) -> Self {
10104 Self {
10105 prices,
10106 tax_rates: None,
10107 custom_data: None,
10108 }
10109 }
10110
10111 #[must_use]
10113 pub fn with_tax_rates(mut self, value: Vec<TaxRate>) -> Self {
10114 self.tax_rates = Some(value);
10115 self
10116 }
10117
10118 #[must_use]
10120 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10121 self.custom_data = Some(value);
10122 self
10123 }
10124}
10125
10126impl Validate for TariffFixed {
10127 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10128 path.push_key("prices");
10129 validate::list_len(self.prices.len(), Some(1), None, path, out);
10130 for (index, item) in self.prices.iter().enumerate() {
10131 path.push_index(index);
10132 Validate::validate_at(item, path, out);
10133 path.pop();
10134 }
10135 path.pop();
10136 path.push_key("taxRates");
10137 if let Some(value) = &self.tax_rates {
10138 validate::list_len(value.len(), Some(1), Some(5), path, out);
10139 for (index, item) in value.iter().enumerate() {
10140 path.push_index(index);
10141 Validate::validate_at(item, path, out);
10142 path.pop();
10143 }
10144 }
10145 path.pop();
10146 path.push_key("customData");
10147 if let Some(value) = &self.custom_data {
10148 Validate::validate_at(value, path, out);
10149 }
10150 path.pop();
10151 }
10152}
10153
10154#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10158pub struct TariffFixedPrice {
10159 #[serde(rename = "priceFixed")]
10161 pub price_fixed: crate::types::Decimal,
10162 #[serde(default, skip_serializing_if = "Option::is_none")]
10164 pub conditions: Option<TariffConditionsFixed>,
10165 #[serde(rename = "customData")]
10167 #[serde(default, skip_serializing_if = "Option::is_none")]
10168 pub custom_data: Option<crate::types::CustomData>,
10169}
10170
10171impl TariffFixedPrice {
10172 #[must_use]
10174 pub fn new(price_fixed: impl Into<crate::types::Decimal>) -> Self {
10175 Self {
10176 price_fixed: price_fixed.into(),
10177 conditions: None,
10178 custom_data: None,
10179 }
10180 }
10181
10182 #[must_use]
10184 pub fn with_conditions(mut self, value: TariffConditionsFixed) -> Self {
10185 self.conditions = Some(value);
10186 self
10187 }
10188
10189 #[must_use]
10191 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10192 self.custom_data = Some(value);
10193 self
10194 }
10195}
10196
10197impl Validate for TariffFixedPrice {
10198 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10199 path.push_key("conditions");
10200 if let Some(value) = &self.conditions {
10201 Validate::validate_at(value, path, out);
10202 }
10203 path.pop();
10204 path.push_key("customData");
10205 if let Some(value) = &self.custom_data {
10206 Validate::validate_at(value, path, out);
10207 }
10208 path.pop();
10209 }
10210}
10211
10212#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10216pub struct TariffTime {
10217 pub prices: Vec<TariffTimePrice>,
10219 #[serde(rename = "taxRates")]
10221 #[serde(default, skip_serializing_if = "Option::is_none")]
10222 pub tax_rates: Option<Vec<TaxRate>>,
10223 #[serde(rename = "customData")]
10225 #[serde(default, skip_serializing_if = "Option::is_none")]
10226 pub custom_data: Option<crate::types::CustomData>,
10227}
10228
10229impl TariffTime {
10230 #[must_use]
10232 pub fn new(prices: Vec<TariffTimePrice>) -> Self {
10233 Self {
10234 prices,
10235 tax_rates: None,
10236 custom_data: None,
10237 }
10238 }
10239
10240 #[must_use]
10242 pub fn with_tax_rates(mut self, value: Vec<TaxRate>) -> Self {
10243 self.tax_rates = Some(value);
10244 self
10245 }
10246
10247 #[must_use]
10249 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10250 self.custom_data = Some(value);
10251 self
10252 }
10253}
10254
10255impl Validate for TariffTime {
10256 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10257 path.push_key("prices");
10258 validate::list_len(self.prices.len(), Some(1), None, path, out);
10259 for (index, item) in self.prices.iter().enumerate() {
10260 path.push_index(index);
10261 Validate::validate_at(item, path, out);
10262 path.pop();
10263 }
10264 path.pop();
10265 path.push_key("taxRates");
10266 if let Some(value) = &self.tax_rates {
10267 validate::list_len(value.len(), Some(1), Some(5), path, out);
10268 for (index, item) in value.iter().enumerate() {
10269 path.push_index(index);
10270 Validate::validate_at(item, path, out);
10271 path.pop();
10272 }
10273 }
10274 path.pop();
10275 path.push_key("customData");
10276 if let Some(value) = &self.custom_data {
10277 Validate::validate_at(value, path, out);
10278 }
10279 path.pop();
10280 }
10281}
10282
10283#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10287pub struct TariffTimePrice {
10288 #[serde(rename = "priceMinute")]
10290 pub price_minute: crate::types::Decimal,
10291 #[serde(default, skip_serializing_if = "Option::is_none")]
10293 pub conditions: Option<TariffConditions>,
10294 #[serde(rename = "customData")]
10296 #[serde(default, skip_serializing_if = "Option::is_none")]
10297 pub custom_data: Option<crate::types::CustomData>,
10298}
10299
10300impl TariffTimePrice {
10301 #[must_use]
10303 pub fn new(price_minute: impl Into<crate::types::Decimal>) -> Self {
10304 Self {
10305 price_minute: price_minute.into(),
10306 conditions: None,
10307 custom_data: None,
10308 }
10309 }
10310
10311 #[must_use]
10313 pub fn with_conditions(mut self, value: TariffConditions) -> Self {
10314 self.conditions = Some(value);
10315 self
10316 }
10317
10318 #[must_use]
10320 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10321 self.custom_data = Some(value);
10322 self
10323 }
10324}
10325
10326impl Validate for TariffTimePrice {
10327 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10328 path.push_key("conditions");
10329 if let Some(value) = &self.conditions {
10330 Validate::validate_at(value, path, out);
10331 }
10332 path.pop();
10333 path.push_key("customData");
10334 if let Some(value) = &self.custom_data {
10335 Validate::validate_at(value, path, out);
10336 }
10337 path.pop();
10338 }
10339}
10340
10341#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10345pub struct TaxRate {
10346 pub r#type: String,
10348 pub tax: crate::types::Decimal,
10350 #[serde(default, skip_serializing_if = "Option::is_none")]
10355 pub stack: Option<i32>,
10356 #[serde(rename = "customData")]
10358 #[serde(default, skip_serializing_if = "Option::is_none")]
10359 pub custom_data: Option<crate::types::CustomData>,
10360}
10361
10362impl TaxRate {
10363 #[must_use]
10365 pub fn new(r#type: impl Into<String>, tax: impl Into<crate::types::Decimal>) -> Self {
10366 Self {
10367 r#type: r#type.into(),
10368 tax: tax.into(),
10369 stack: None,
10370 custom_data: None,
10371 }
10372 }
10373
10374 #[must_use]
10376 pub fn with_stack(mut self, value: i32) -> Self {
10377 self.stack = Some(value);
10378 self
10379 }
10380
10381 #[must_use]
10383 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10384 self.custom_data = Some(value);
10385 self
10386 }
10387}
10388
10389impl Validate for TaxRate {
10390 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10391 path.push_key("type");
10392 validate::string(self.r#type.as_str(), None, Some(20), path, out);
10393 path.pop();
10394 path.push_key("stack");
10395 if let Some(value) = &self.stack {
10396 validate::int_range(i64::from(*value), Some(0), None, path, out);
10397 }
10398 path.pop();
10399 path.push_key("customData");
10400 if let Some(value) = &self.custom_data {
10401 Validate::validate_at(value, path, out);
10402 }
10403 path.pop();
10404 }
10405}
10406
10407#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10411pub struct TaxRule {
10412 #[serde(rename = "taxRuleID")]
10414 pub tax_rule_id: i32,
10415 #[serde(rename = "appliesToEnergyFee")]
10417 pub applies_to_energy_fee: bool,
10418 #[serde(rename = "appliesToParkingFee")]
10420 pub applies_to_parking_fee: bool,
10421 #[serde(rename = "appliesToOverstayFee")]
10423 pub applies_to_overstay_fee: bool,
10424 #[serde(rename = "appliesToMinimumMaximumCost")]
10426 pub applies_to_minimum_maximum_cost: bool,
10427 #[serde(rename = "taxRate")]
10429 pub tax_rate: RationalNumber,
10430 #[serde(rename = "taxRuleName")]
10432 #[serde(default, skip_serializing_if = "Option::is_none")]
10433 pub tax_rule_name: Option<String>,
10434 #[serde(rename = "taxIncludedInPrice")]
10436 #[serde(default, skip_serializing_if = "Option::is_none")]
10437 pub tax_included_in_price: Option<bool>,
10438 #[serde(rename = "customData")]
10440 #[serde(default, skip_serializing_if = "Option::is_none")]
10441 pub custom_data: Option<crate::types::CustomData>,
10442}
10443
10444impl TaxRule {
10445 #[must_use]
10447 pub fn new(
10448 tax_rule_id: i32,
10449 applies_to_energy_fee: bool,
10450 applies_to_parking_fee: bool,
10451 applies_to_overstay_fee: bool,
10452 applies_to_minimum_maximum_cost: bool,
10453 tax_rate: RationalNumber,
10454 ) -> Self {
10455 Self {
10456 tax_rule_id,
10457 applies_to_energy_fee,
10458 applies_to_parking_fee,
10459 applies_to_overstay_fee,
10460 applies_to_minimum_maximum_cost,
10461 tax_rate,
10462 tax_rule_name: None,
10463 tax_included_in_price: None,
10464 custom_data: None,
10465 }
10466 }
10467
10468 #[must_use]
10470 pub fn with_tax_rule_name(mut self, value: impl Into<String>) -> Self {
10471 self.tax_rule_name = Some(value.into());
10472 self
10473 }
10474
10475 #[must_use]
10477 pub fn with_tax_included_in_price(mut self, value: bool) -> Self {
10478 self.tax_included_in_price = Some(value);
10479 self
10480 }
10481
10482 #[must_use]
10484 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10485 self.custom_data = Some(value);
10486 self
10487 }
10488}
10489
10490impl Validate for TaxRule {
10491 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10492 path.push_key("taxRuleID");
10493 validate::int_range(i64::from(self.tax_rule_id), Some(0), None, path, out);
10494 path.pop();
10495 path.push_key("taxRate");
10496 Validate::validate_at(&self.tax_rate, path, out);
10497 path.pop();
10498 path.push_key("taxRuleName");
10499 if let Some(value) = &self.tax_rule_name {
10500 validate::string(value.as_str(), None, Some(100), path, out);
10501 }
10502 path.pop();
10503 path.push_key("customData");
10504 if let Some(value) = &self.custom_data {
10505 Validate::validate_at(value, path, out);
10506 }
10507 path.pop();
10508 }
10509}
10510
10511#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10515pub struct TotalCost {
10516 pub currency: String,
10518 #[serde(rename = "typeOfCost")]
10520 pub type_of_cost: TariffCost,
10521 pub total: TotalPrice,
10523 #[serde(default, skip_serializing_if = "Option::is_none")]
10525 pub fixed: Option<Price>,
10526 #[serde(default, skip_serializing_if = "Option::is_none")]
10528 pub energy: Option<Price>,
10529 #[serde(rename = "chargingTime")]
10531 #[serde(default, skip_serializing_if = "Option::is_none")]
10532 pub charging_time: Option<Price>,
10533 #[serde(rename = "idleTime")]
10535 #[serde(default, skip_serializing_if = "Option::is_none")]
10536 pub idle_time: Option<Price>,
10537 #[serde(rename = "reservationTime")]
10539 #[serde(default, skip_serializing_if = "Option::is_none")]
10540 pub reservation_time: Option<Price>,
10541 #[serde(rename = "reservationFixed")]
10543 #[serde(default, skip_serializing_if = "Option::is_none")]
10544 pub reservation_fixed: Option<Price>,
10545 #[serde(rename = "customData")]
10547 #[serde(default, skip_serializing_if = "Option::is_none")]
10548 pub custom_data: Option<crate::types::CustomData>,
10549}
10550
10551impl TotalCost {
10552 #[must_use]
10554 pub fn new(currency: impl Into<String>, type_of_cost: TariffCost, total: TotalPrice) -> Self {
10555 Self {
10556 currency: currency.into(),
10557 type_of_cost,
10558 total,
10559 fixed: None,
10560 energy: None,
10561 charging_time: None,
10562 idle_time: None,
10563 reservation_time: None,
10564 reservation_fixed: None,
10565 custom_data: None,
10566 }
10567 }
10568
10569 #[must_use]
10571 pub fn with_fixed(mut self, value: Price) -> Self {
10572 self.fixed = Some(value);
10573 self
10574 }
10575
10576 #[must_use]
10578 pub fn with_energy(mut self, value: Price) -> Self {
10579 self.energy = Some(value);
10580 self
10581 }
10582
10583 #[must_use]
10585 pub fn with_charging_time(mut self, value: Price) -> Self {
10586 self.charging_time = Some(value);
10587 self
10588 }
10589
10590 #[must_use]
10592 pub fn with_idle_time(mut self, value: Price) -> Self {
10593 self.idle_time = Some(value);
10594 self
10595 }
10596
10597 #[must_use]
10599 pub fn with_reservation_time(mut self, value: Price) -> Self {
10600 self.reservation_time = Some(value);
10601 self
10602 }
10603
10604 #[must_use]
10606 pub fn with_reservation_fixed(mut self, value: Price) -> Self {
10607 self.reservation_fixed = Some(value);
10608 self
10609 }
10610
10611 #[must_use]
10613 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10614 self.custom_data = Some(value);
10615 self
10616 }
10617}
10618
10619impl Validate for TotalCost {
10620 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10621 path.push_key("currency");
10622 validate::string(self.currency.as_str(), None, Some(3), path, out);
10623 path.pop();
10624 path.push_key("typeOfCost");
10625 Validate::validate_at(&self.type_of_cost, path, out);
10626 path.pop();
10627 path.push_key("total");
10628 Validate::validate_at(&self.total, path, out);
10629 path.pop();
10630 path.push_key("fixed");
10631 if let Some(value) = &self.fixed {
10632 Validate::validate_at(value, path, out);
10633 }
10634 path.pop();
10635 path.push_key("energy");
10636 if let Some(value) = &self.energy {
10637 Validate::validate_at(value, path, out);
10638 }
10639 path.pop();
10640 path.push_key("chargingTime");
10641 if let Some(value) = &self.charging_time {
10642 Validate::validate_at(value, path, out);
10643 }
10644 path.pop();
10645 path.push_key("idleTime");
10646 if let Some(value) = &self.idle_time {
10647 Validate::validate_at(value, path, out);
10648 }
10649 path.pop();
10650 path.push_key("reservationTime");
10651 if let Some(value) = &self.reservation_time {
10652 Validate::validate_at(value, path, out);
10653 }
10654 path.pop();
10655 path.push_key("reservationFixed");
10656 if let Some(value) = &self.reservation_fixed {
10657 Validate::validate_at(value, path, out);
10658 }
10659 path.pop();
10660 path.push_key("customData");
10661 if let Some(value) = &self.custom_data {
10662 Validate::validate_at(value, path, out);
10663 }
10664 path.pop();
10665 }
10666}
10667
10668#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
10672pub struct TotalPrice {
10673 #[serde(rename = "exclTax")]
10675 #[serde(default, skip_serializing_if = "Option::is_none")]
10676 pub excl_tax: Option<crate::types::Decimal>,
10677 #[serde(rename = "inclTax")]
10679 #[serde(default, skip_serializing_if = "Option::is_none")]
10680 pub incl_tax: Option<crate::types::Decimal>,
10681 #[serde(rename = "customData")]
10683 #[serde(default, skip_serializing_if = "Option::is_none")]
10684 pub custom_data: Option<crate::types::CustomData>,
10685}
10686
10687impl TotalPrice {
10688 #[must_use]
10690 pub fn new() -> Self {
10691 Self::default()
10692 }
10693
10694 #[must_use]
10696 pub fn with_excl_tax(mut self, value: impl Into<crate::types::Decimal>) -> Self {
10697 self.excl_tax = Some(value.into());
10698 self
10699 }
10700
10701 #[must_use]
10703 pub fn with_incl_tax(mut self, value: impl Into<crate::types::Decimal>) -> Self {
10704 self.incl_tax = Some(value.into());
10705 self
10706 }
10707
10708 #[must_use]
10710 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10711 self.custom_data = Some(value);
10712 self
10713 }
10714}
10715
10716impl Validate for TotalPrice {
10717 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10718 path.push_key("customData");
10719 if let Some(value) = &self.custom_data {
10720 Validate::validate_at(value, path, out);
10721 }
10722 path.pop();
10723 }
10724}
10725
10726#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10730pub struct TotalUsage {
10731 pub energy: crate::types::Decimal,
10733 #[serde(rename = "chargingTime")]
10735 pub charging_time: i32,
10736 #[serde(rename = "idleTime")]
10738 pub idle_time: i32,
10739 #[serde(rename = "reservationTime")]
10741 #[serde(default, skip_serializing_if = "Option::is_none")]
10742 pub reservation_time: Option<i32>,
10743 #[serde(rename = "customData")]
10745 #[serde(default, skip_serializing_if = "Option::is_none")]
10746 pub custom_data: Option<crate::types::CustomData>,
10747}
10748
10749impl TotalUsage {
10750 #[must_use]
10752 pub fn new(
10753 energy: impl Into<crate::types::Decimal>,
10754 charging_time: i32,
10755 idle_time: i32,
10756 ) -> Self {
10757 Self {
10758 energy: energy.into(),
10759 charging_time,
10760 idle_time,
10761 reservation_time: None,
10762 custom_data: None,
10763 }
10764 }
10765
10766 #[must_use]
10768 pub fn with_reservation_time(mut self, value: i32) -> Self {
10769 self.reservation_time = Some(value);
10770 self
10771 }
10772
10773 #[must_use]
10775 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10776 self.custom_data = Some(value);
10777 self
10778 }
10779}
10780
10781impl Validate for TotalUsage {
10782 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10783 path.push_key("customData");
10784 if let Some(value) = &self.custom_data {
10785 Validate::validate_at(value, path, out);
10786 }
10787 path.pop();
10788 }
10789}
10790
10791#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10793pub struct Transaction {
10794 #[serde(rename = "transactionId")]
10796 pub transaction_id: String,
10797 #[serde(rename = "chargingState")]
10799 #[serde(default, skip_serializing_if = "Option::is_none")]
10800 pub charging_state: Option<ChargingState>,
10801 #[serde(rename = "timeSpentCharging")]
10803 #[serde(default, skip_serializing_if = "Option::is_none")]
10804 pub time_spent_charging: Option<i32>,
10805 #[serde(rename = "stoppedReason")]
10807 #[serde(default, skip_serializing_if = "Option::is_none")]
10808 pub stopped_reason: Option<Reason>,
10809 #[serde(rename = "remoteStartId")]
10811 #[serde(default, skip_serializing_if = "Option::is_none")]
10812 pub remote_start_id: Option<i32>,
10813 #[serde(rename = "operationMode")]
10815 #[serde(default, skip_serializing_if = "Option::is_none")]
10816 pub operation_mode: Option<OperationMode>,
10817 #[serde(rename = "tariffId")]
10819 #[serde(default, skip_serializing_if = "Option::is_none")]
10820 pub tariff_id: Option<String>,
10821 #[serde(rename = "transactionLimit")]
10823 #[serde(default, skip_serializing_if = "Option::is_none")]
10824 pub transaction_limit: Option<TransactionLimit>,
10825 #[serde(rename = "customData")]
10827 #[serde(default, skip_serializing_if = "Option::is_none")]
10828 pub custom_data: Option<crate::types::CustomData>,
10829}
10830
10831impl Transaction {
10832 #[must_use]
10834 pub fn new(transaction_id: impl Into<String>) -> Self {
10835 Self {
10836 transaction_id: transaction_id.into(),
10837 charging_state: None,
10838 time_spent_charging: None,
10839 stopped_reason: None,
10840 remote_start_id: None,
10841 operation_mode: None,
10842 tariff_id: None,
10843 transaction_limit: None,
10844 custom_data: None,
10845 }
10846 }
10847
10848 #[must_use]
10850 pub fn with_charging_state(mut self, value: ChargingState) -> Self {
10851 self.charging_state = Some(value);
10852 self
10853 }
10854
10855 #[must_use]
10857 pub fn with_time_spent_charging(mut self, value: i32) -> Self {
10858 self.time_spent_charging = Some(value);
10859 self
10860 }
10861
10862 #[must_use]
10864 pub fn with_stopped_reason(mut self, value: Reason) -> Self {
10865 self.stopped_reason = Some(value);
10866 self
10867 }
10868
10869 #[must_use]
10871 pub fn with_remote_start_id(mut self, value: i32) -> Self {
10872 self.remote_start_id = Some(value);
10873 self
10874 }
10875
10876 #[must_use]
10878 pub fn with_operation_mode(mut self, value: OperationMode) -> Self {
10879 self.operation_mode = Some(value);
10880 self
10881 }
10882
10883 #[must_use]
10885 pub fn with_tariff_id(mut self, value: impl Into<String>) -> Self {
10886 self.tariff_id = Some(value.into());
10887 self
10888 }
10889
10890 #[must_use]
10892 pub fn with_transaction_limit(mut self, value: TransactionLimit) -> Self {
10893 self.transaction_limit = Some(value);
10894 self
10895 }
10896
10897 #[must_use]
10899 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10900 self.custom_data = Some(value);
10901 self
10902 }
10903}
10904
10905impl Validate for Transaction {
10906 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10907 path.push_key("transactionId");
10908 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
10909 path.pop();
10910 path.push_key("chargingState");
10911 if let Some(value) = &self.charging_state {
10912 Validate::validate_at(value, path, out);
10913 }
10914 path.pop();
10915 path.push_key("stoppedReason");
10916 if let Some(value) = &self.stopped_reason {
10917 Validate::validate_at(value, path, out);
10918 }
10919 path.pop();
10920 path.push_key("operationMode");
10921 if let Some(value) = &self.operation_mode {
10922 Validate::validate_at(value, path, out);
10923 }
10924 path.pop();
10925 path.push_key("tariffId");
10926 if let Some(value) = &self.tariff_id {
10927 validate::string(value.as_str(), None, Some(60), path, out);
10928 }
10929 path.pop();
10930 path.push_key("transactionLimit");
10931 if let Some(value) = &self.transaction_limit {
10932 Validate::validate_at(value, path, out);
10933 }
10934 path.pop();
10935 path.push_key("customData");
10936 if let Some(value) = &self.custom_data {
10937 Validate::validate_at(value, path, out);
10938 }
10939 path.pop();
10940 }
10941}
10942
10943#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
10947pub struct TransactionLimit {
10948 #[serde(rename = "maxCost")]
10950 #[serde(default, skip_serializing_if = "Option::is_none")]
10951 pub max_cost: Option<crate::types::Decimal>,
10952 #[serde(rename = "maxEnergy")]
10954 #[serde(default, skip_serializing_if = "Option::is_none")]
10955 pub max_energy: Option<crate::types::Decimal>,
10956 #[serde(rename = "maxTime")]
10958 #[serde(default, skip_serializing_if = "Option::is_none")]
10959 pub max_time: Option<i32>,
10960 #[serde(rename = "maxSoC")]
10962 #[serde(default, skip_serializing_if = "Option::is_none")]
10963 pub max_so_c: Option<i32>,
10964 #[serde(rename = "customData")]
10966 #[serde(default, skip_serializing_if = "Option::is_none")]
10967 pub custom_data: Option<crate::types::CustomData>,
10968}
10969
10970impl TransactionLimit {
10971 #[must_use]
10973 pub fn new() -> Self {
10974 Self::default()
10975 }
10976
10977 #[must_use]
10979 pub fn with_max_cost(mut self, value: impl Into<crate::types::Decimal>) -> Self {
10980 self.max_cost = Some(value.into());
10981 self
10982 }
10983
10984 #[must_use]
10986 pub fn with_max_energy(mut self, value: impl Into<crate::types::Decimal>) -> Self {
10987 self.max_energy = Some(value.into());
10988 self
10989 }
10990
10991 #[must_use]
10993 pub fn with_max_time(mut self, value: i32) -> Self {
10994 self.max_time = Some(value);
10995 self
10996 }
10997
10998 #[must_use]
11000 pub fn with_max_so_c(mut self, value: i32) -> Self {
11001 self.max_so_c = Some(value);
11002 self
11003 }
11004
11005 #[must_use]
11007 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11008 self.custom_data = Some(value);
11009 self
11010 }
11011}
11012
11013impl Validate for TransactionLimit {
11014 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11015 path.push_key("maxSoC");
11016 if let Some(value) = &self.max_so_c {
11017 validate::int_range(i64::from(*value), Some(0), Some(100), path, out);
11018 }
11019 path.pop();
11020 path.push_key("customData");
11021 if let Some(value) = &self.custom_data {
11022 Validate::validate_at(value, path, out);
11023 }
11024 path.pop();
11025 }
11026}
11027
11028#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
11032pub struct UnitOfMeasure {
11033 #[serde(default, skip_serializing_if = "Option::is_none")]
11038 pub unit: Option<String>,
11039 #[serde(default, skip_serializing_if = "Option::is_none")]
11043 pub multiplier: Option<i32>,
11044 #[serde(rename = "customData")]
11046 #[serde(default, skip_serializing_if = "Option::is_none")]
11047 pub custom_data: Option<crate::types::CustomData>,
11048}
11049
11050impl UnitOfMeasure {
11051 #[must_use]
11053 pub fn new() -> Self {
11054 Self::default()
11055 }
11056
11057 #[must_use]
11059 pub fn with_unit(mut self, value: impl Into<String>) -> Self {
11060 self.unit = Some(value.into());
11061 self
11062 }
11063
11064 #[must_use]
11066 pub fn with_multiplier(mut self, value: i32) -> Self {
11067 self.multiplier = Some(value);
11068 self
11069 }
11070
11071 #[must_use]
11073 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11074 self.custom_data = Some(value);
11075 self
11076 }
11077}
11078
11079impl Validate for UnitOfMeasure {
11080 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11081 path.push_key("unit");
11082 if let Some(value) = &self.unit {
11083 validate::string(value.as_str(), None, Some(20), path, out);
11084 }
11085 path.pop();
11086 path.push_key("customData");
11087 if let Some(value) = &self.custom_data {
11088 Validate::validate_at(value, path, out);
11089 }
11090 path.pop();
11091 }
11092}
11093
11094#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
11099pub struct V2XChargingParameters {
11100 #[serde(rename = "minChargePower")]
11105 #[serde(default, skip_serializing_if = "Option::is_none")]
11106 pub min_charge_power: Option<crate::types::Decimal>,
11107 #[serde(rename = "minChargePower_L2")]
11111 #[serde(default, skip_serializing_if = "Option::is_none")]
11112 pub min_charge_power_l2: Option<crate::types::Decimal>,
11113 #[serde(rename = "minChargePower_L3")]
11117 #[serde(default, skip_serializing_if = "Option::is_none")]
11118 pub min_charge_power_l3: Option<crate::types::Decimal>,
11119 #[serde(rename = "maxChargePower")]
11127 #[serde(default, skip_serializing_if = "Option::is_none")]
11128 pub max_charge_power: Option<crate::types::Decimal>,
11129 #[serde(rename = "maxChargePower_L2")]
11133 #[serde(default, skip_serializing_if = "Option::is_none")]
11134 pub max_charge_power_l2: Option<crate::types::Decimal>,
11135 #[serde(rename = "maxChargePower_L3")]
11139 #[serde(default, skip_serializing_if = "Option::is_none")]
11140 pub max_charge_power_l3: Option<crate::types::Decimal>,
11141 #[serde(rename = "minDischargePower")]
11149 #[serde(default, skip_serializing_if = "Option::is_none")]
11150 pub min_discharge_power: Option<crate::types::Decimal>,
11151 #[serde(rename = "minDischargePower_L2")]
11155 #[serde(default, skip_serializing_if = "Option::is_none")]
11156 pub min_discharge_power_l2: Option<crate::types::Decimal>,
11157 #[serde(rename = "minDischargePower_L3")]
11161 #[serde(default, skip_serializing_if = "Option::is_none")]
11162 pub min_discharge_power_l3: Option<crate::types::Decimal>,
11163 #[serde(rename = "maxDischargePower")]
11168 #[serde(default, skip_serializing_if = "Option::is_none")]
11169 pub max_discharge_power: Option<crate::types::Decimal>,
11170 #[serde(rename = "maxDischargePower_L2")]
11174 #[serde(default, skip_serializing_if = "Option::is_none")]
11175 pub max_discharge_power_l2: Option<crate::types::Decimal>,
11176 #[serde(rename = "maxDischargePower_L3")]
11180 #[serde(default, skip_serializing_if = "Option::is_none")]
11181 pub max_discharge_power_l3: Option<crate::types::Decimal>,
11182 #[serde(rename = "minChargeCurrent")]
11186 #[serde(default, skip_serializing_if = "Option::is_none")]
11187 pub min_charge_current: Option<crate::types::Decimal>,
11188 #[serde(rename = "maxChargeCurrent")]
11192 #[serde(default, skip_serializing_if = "Option::is_none")]
11193 pub max_charge_current: Option<crate::types::Decimal>,
11194 #[serde(rename = "minDischargeCurrent")]
11198 #[serde(default, skip_serializing_if = "Option::is_none")]
11199 pub min_discharge_current: Option<crate::types::Decimal>,
11200 #[serde(rename = "maxDischargeCurrent")]
11204 #[serde(default, skip_serializing_if = "Option::is_none")]
11205 pub max_discharge_current: Option<crate::types::Decimal>,
11206 #[serde(rename = "minVoltage")]
11210 #[serde(default, skip_serializing_if = "Option::is_none")]
11211 pub min_voltage: Option<crate::types::Decimal>,
11212 #[serde(rename = "maxVoltage")]
11216 #[serde(default, skip_serializing_if = "Option::is_none")]
11217 pub max_voltage: Option<crate::types::Decimal>,
11218 #[serde(rename = "evTargetEnergyRequest")]
11222 #[serde(default, skip_serializing_if = "Option::is_none")]
11223 pub ev_target_energy_request: Option<crate::types::Decimal>,
11224 #[serde(rename = "evMinEnergyRequest")]
11228 #[serde(default, skip_serializing_if = "Option::is_none")]
11229 pub ev_min_energy_request: Option<crate::types::Decimal>,
11230 #[serde(rename = "evMaxEnergyRequest")]
11234 #[serde(default, skip_serializing_if = "Option::is_none")]
11235 pub ev_max_energy_request: Option<crate::types::Decimal>,
11236 #[serde(rename = "evMinV2XEnergyRequest")]
11241 #[serde(default, skip_serializing_if = "Option::is_none")]
11242 pub ev_min_v2_x_energy_request: Option<crate::types::Decimal>,
11243 #[serde(rename = "evMaxV2XEnergyRequest")]
11248 #[serde(default, skip_serializing_if = "Option::is_none")]
11249 pub ev_max_v2_x_energy_request: Option<crate::types::Decimal>,
11250 #[serde(rename = "targetSoC")]
11254 #[serde(default, skip_serializing_if = "Option::is_none")]
11255 pub target_so_c: Option<i32>,
11256 #[serde(rename = "customData")]
11258 #[serde(default, skip_serializing_if = "Option::is_none")]
11259 pub custom_data: Option<crate::types::CustomData>,
11260}
11261
11262impl V2XChargingParameters {
11263 #[must_use]
11265 pub fn new() -> Self {
11266 Self::default()
11267 }
11268
11269 #[must_use]
11271 pub fn with_min_charge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11272 self.min_charge_power = Some(value.into());
11273 self
11274 }
11275
11276 #[must_use]
11278 pub fn with_min_charge_power_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11279 self.min_charge_power_l2 = Some(value.into());
11280 self
11281 }
11282
11283 #[must_use]
11285 pub fn with_min_charge_power_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11286 self.min_charge_power_l3 = Some(value.into());
11287 self
11288 }
11289
11290 #[must_use]
11292 pub fn with_max_charge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11293 self.max_charge_power = Some(value.into());
11294 self
11295 }
11296
11297 #[must_use]
11299 pub fn with_max_charge_power_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11300 self.max_charge_power_l2 = Some(value.into());
11301 self
11302 }
11303
11304 #[must_use]
11306 pub fn with_max_charge_power_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11307 self.max_charge_power_l3 = Some(value.into());
11308 self
11309 }
11310
11311 #[must_use]
11313 pub fn with_min_discharge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11314 self.min_discharge_power = Some(value.into());
11315 self
11316 }
11317
11318 #[must_use]
11320 pub fn with_min_discharge_power_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11321 self.min_discharge_power_l2 = Some(value.into());
11322 self
11323 }
11324
11325 #[must_use]
11327 pub fn with_min_discharge_power_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11328 self.min_discharge_power_l3 = Some(value.into());
11329 self
11330 }
11331
11332 #[must_use]
11334 pub fn with_max_discharge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11335 self.max_discharge_power = Some(value.into());
11336 self
11337 }
11338
11339 #[must_use]
11341 pub fn with_max_discharge_power_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11342 self.max_discharge_power_l2 = Some(value.into());
11343 self
11344 }
11345
11346 #[must_use]
11348 pub fn with_max_discharge_power_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11349 self.max_discharge_power_l3 = Some(value.into());
11350 self
11351 }
11352
11353 #[must_use]
11355 pub fn with_min_charge_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11356 self.min_charge_current = Some(value.into());
11357 self
11358 }
11359
11360 #[must_use]
11362 pub fn with_max_charge_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11363 self.max_charge_current = Some(value.into());
11364 self
11365 }
11366
11367 #[must_use]
11369 pub fn with_min_discharge_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11370 self.min_discharge_current = Some(value.into());
11371 self
11372 }
11373
11374 #[must_use]
11376 pub fn with_max_discharge_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11377 self.max_discharge_current = Some(value.into());
11378 self
11379 }
11380
11381 #[must_use]
11383 pub fn with_min_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11384 self.min_voltage = Some(value.into());
11385 self
11386 }
11387
11388 #[must_use]
11390 pub fn with_max_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11391 self.max_voltage = Some(value.into());
11392 self
11393 }
11394
11395 #[must_use]
11397 pub fn with_ev_target_energy_request(
11398 mut self,
11399 value: impl Into<crate::types::Decimal>,
11400 ) -> Self {
11401 self.ev_target_energy_request = Some(value.into());
11402 self
11403 }
11404
11405 #[must_use]
11407 pub fn with_ev_min_energy_request(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11408 self.ev_min_energy_request = Some(value.into());
11409 self
11410 }
11411
11412 #[must_use]
11414 pub fn with_ev_max_energy_request(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11415 self.ev_max_energy_request = Some(value.into());
11416 self
11417 }
11418
11419 #[must_use]
11421 pub fn with_ev_min_v2_x_energy_request(
11422 mut self,
11423 value: impl Into<crate::types::Decimal>,
11424 ) -> Self {
11425 self.ev_min_v2_x_energy_request = Some(value.into());
11426 self
11427 }
11428
11429 #[must_use]
11431 pub fn with_ev_max_v2_x_energy_request(
11432 mut self,
11433 value: impl Into<crate::types::Decimal>,
11434 ) -> Self {
11435 self.ev_max_v2_x_energy_request = Some(value.into());
11436 self
11437 }
11438
11439 #[must_use]
11441 pub fn with_target_so_c(mut self, value: i32) -> Self {
11442 self.target_so_c = Some(value);
11443 self
11444 }
11445
11446 #[must_use]
11448 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11449 self.custom_data = Some(value);
11450 self
11451 }
11452}
11453
11454impl Validate for V2XChargingParameters {
11455 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11456 path.push_key("targetSoC");
11457 if let Some(value) = &self.target_so_c {
11458 validate::int_range(i64::from(*value), Some(0), Some(100), path, out);
11459 }
11460 path.pop();
11461 path.push_key("customData");
11462 if let Some(value) = &self.custom_data {
11463 Validate::validate_at(value, path, out);
11464 }
11465 path.pop();
11466 }
11467}
11468
11469#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11473pub struct V2XFreqWattPoint {
11474 pub frequency: crate::types::Decimal,
11476 pub power: crate::types::Decimal,
11478 #[serde(rename = "customData")]
11480 #[serde(default, skip_serializing_if = "Option::is_none")]
11481 pub custom_data: Option<crate::types::CustomData>,
11482}
11483
11484impl V2XFreqWattPoint {
11485 #[must_use]
11487 pub fn new(
11488 frequency: impl Into<crate::types::Decimal>,
11489 power: impl Into<crate::types::Decimal>,
11490 ) -> Self {
11491 Self {
11492 frequency: frequency.into(),
11493 power: power.into(),
11494 custom_data: None,
11495 }
11496 }
11497
11498 #[must_use]
11500 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11501 self.custom_data = Some(value);
11502 self
11503 }
11504}
11505
11506impl Validate for V2XFreqWattPoint {
11507 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11508 path.push_key("customData");
11509 if let Some(value) = &self.custom_data {
11510 Validate::validate_at(value, path, out);
11511 }
11512 path.pop();
11513 }
11514}
11515
11516#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11520pub struct V2XSignalWattPoint {
11521 pub signal: i32,
11523 pub power: crate::types::Decimal,
11525 #[serde(rename = "customData")]
11527 #[serde(default, skip_serializing_if = "Option::is_none")]
11528 pub custom_data: Option<crate::types::CustomData>,
11529}
11530
11531impl V2XSignalWattPoint {
11532 #[must_use]
11534 pub fn new(signal: i32, power: impl Into<crate::types::Decimal>) -> Self {
11535 Self {
11536 signal,
11537 power: power.into(),
11538 custom_data: None,
11539 }
11540 }
11541
11542 #[must_use]
11544 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11545 self.custom_data = Some(value);
11546 self
11547 }
11548}
11549
11550impl Validate for V2XSignalWattPoint {
11551 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
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 VPN {
11565 pub server: String,
11567 pub user: String,
11569 pub password: String,
11571 pub key: String,
11573 pub r#type: VPNEnum,
11575 #[serde(default, skip_serializing_if = "Option::is_none")]
11577 pub group: Option<String>,
11578 #[serde(rename = "customData")]
11580 #[serde(default, skip_serializing_if = "Option::is_none")]
11581 pub custom_data: Option<crate::types::CustomData>,
11582}
11583
11584impl VPN {
11585 #[must_use]
11587 pub fn new(
11588 server: impl Into<String>,
11589 user: impl Into<String>,
11590 password: impl Into<String>,
11591 key: impl Into<String>,
11592 r#type: VPNEnum,
11593 ) -> Self {
11594 Self {
11595 server: server.into(),
11596 user: user.into(),
11597 password: password.into(),
11598 key: key.into(),
11599 r#type,
11600 group: None,
11601 custom_data: None,
11602 }
11603 }
11604
11605 #[must_use]
11607 pub fn with_group(mut self, value: impl Into<String>) -> Self {
11608 self.group = Some(value.into());
11609 self
11610 }
11611
11612 #[must_use]
11614 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11615 self.custom_data = Some(value);
11616 self
11617 }
11618}
11619
11620impl Validate for VPN {
11621 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11622 path.push_key("server");
11623 validate::string(self.server.as_str(), None, Some(2000), path, out);
11624 path.pop();
11625 path.push_key("user");
11626 validate::string(self.user.as_str(), None, Some(50), path, out);
11627 path.pop();
11628 path.push_key("password");
11629 validate::string(self.password.as_str(), None, Some(64), path, out);
11630 path.pop();
11631 path.push_key("key");
11632 validate::string(self.key.as_str(), None, Some(255), path, out);
11633 path.pop();
11634 path.push_key("type");
11635 Validate::validate_at(&self.r#type, path, out);
11636 path.pop();
11637 path.push_key("group");
11638 if let Some(value) = &self.group {
11639 validate::string(value.as_str(), None, Some(50), path, out);
11640 }
11641 path.pop();
11642 path.push_key("customData");
11643 if let Some(value) = &self.custom_data {
11644 Validate::validate_at(value, path, out);
11645 }
11646 path.pop();
11647 }
11648}
11649
11650#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11654pub struct Variable {
11655 pub name: String,
11657 #[serde(default, skip_serializing_if = "Option::is_none")]
11659 pub instance: Option<String>,
11660 #[serde(rename = "customData")]
11662 #[serde(default, skip_serializing_if = "Option::is_none")]
11663 pub custom_data: Option<crate::types::CustomData>,
11664}
11665
11666impl Variable {
11667 #[must_use]
11669 pub fn new(name: impl Into<String>) -> Self {
11670 Self {
11671 name: name.into(),
11672 instance: None,
11673 custom_data: None,
11674 }
11675 }
11676
11677 #[must_use]
11679 pub fn with_instance(mut self, value: impl Into<String>) -> Self {
11680 self.instance = Some(value.into());
11681 self
11682 }
11683
11684 #[must_use]
11686 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11687 self.custom_data = Some(value);
11688 self
11689 }
11690}
11691
11692impl Validate for Variable {
11693 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11694 path.push_key("name");
11695 validate::string(self.name.as_str(), None, Some(50), path, out);
11696 path.pop();
11697 path.push_key("instance");
11698 if let Some(value) = &self.instance {
11699 validate::string(value.as_str(), None, Some(50), path, out);
11700 }
11701 path.pop();
11702 path.push_key("customData");
11703 if let Some(value) = &self.custom_data {
11704 Validate::validate_at(value, path, out);
11705 }
11706 path.pop();
11707 }
11708}
11709
11710#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
11714pub struct VariableAttribute {
11715 #[serde(default, skip_serializing_if = "Option::is_none")]
11717 pub r#type: Option<Attribute>,
11718 #[serde(default, skip_serializing_if = "Option::is_none")]
11722 pub value: Option<String>,
11723 #[serde(default, skip_serializing_if = "Option::is_none")]
11725 pub mutability: Option<Mutability>,
11726 #[serde(default, skip_serializing_if = "Option::is_none")]
11729 pub persistent: Option<bool>,
11730 #[serde(default, skip_serializing_if = "Option::is_none")]
11733 pub constant: Option<bool>,
11734 #[serde(rename = "customData")]
11736 #[serde(default, skip_serializing_if = "Option::is_none")]
11737 pub custom_data: Option<crate::types::CustomData>,
11738}
11739
11740impl VariableAttribute {
11741 #[must_use]
11743 pub fn new() -> Self {
11744 Self::default()
11745 }
11746
11747 #[must_use]
11749 pub fn with_type(mut self, value: Attribute) -> Self {
11750 self.r#type = Some(value);
11751 self
11752 }
11753
11754 #[must_use]
11756 pub fn with_value(mut self, value: impl Into<String>) -> Self {
11757 self.value = Some(value.into());
11758 self
11759 }
11760
11761 #[must_use]
11763 pub fn with_mutability(mut self, value: Mutability) -> Self {
11764 self.mutability = Some(value);
11765 self
11766 }
11767
11768 #[must_use]
11770 pub fn with_persistent(mut self, value: bool) -> Self {
11771 self.persistent = Some(value);
11772 self
11773 }
11774
11775 #[must_use]
11777 pub fn with_constant(mut self, value: bool) -> Self {
11778 self.constant = Some(value);
11779 self
11780 }
11781
11782 #[must_use]
11784 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11785 self.custom_data = Some(value);
11786 self
11787 }
11788}
11789
11790impl Validate for VariableAttribute {
11791 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11792 path.push_key("type");
11793 if let Some(value) = &self.r#type {
11794 Validate::validate_at(value, path, out);
11795 }
11796 path.pop();
11797 path.push_key("value");
11798 if let Some(value) = &self.value {
11799 validate::string(value.as_str(), None, Some(2500), path, out);
11800 }
11801 path.pop();
11802 path.push_key("mutability");
11803 if let Some(value) = &self.mutability {
11804 Validate::validate_at(value, path, out);
11805 }
11806 path.pop();
11807 path.push_key("customData");
11808 if let Some(value) = &self.custom_data {
11809 Validate::validate_at(value, path, out);
11810 }
11811 path.pop();
11812 }
11813}
11814
11815#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11819pub struct VariableCharacteristics {
11820 #[serde(rename = "dataType")]
11822 pub data_type: Data,
11823 #[serde(rename = "supportsMonitoring")]
11825 pub supports_monitoring: bool,
11826 #[serde(default, skip_serializing_if = "Option::is_none")]
11828 pub unit: Option<String>,
11829 #[serde(rename = "minLimit")]
11831 #[serde(default, skip_serializing_if = "Option::is_none")]
11832 pub min_limit: Option<crate::types::Decimal>,
11833 #[serde(rename = "maxLimit")]
11835 #[serde(default, skip_serializing_if = "Option::is_none")]
11836 pub max_limit: Option<crate::types::Decimal>,
11837 #[serde(rename = "maxElements")]
11839 #[serde(default, skip_serializing_if = "Option::is_none")]
11840 pub max_elements: Option<i32>,
11841 #[serde(rename = "valuesList")]
11855 #[serde(default, skip_serializing_if = "Option::is_none")]
11856 pub values_list: Option<String>,
11857 #[serde(rename = "customData")]
11859 #[serde(default, skip_serializing_if = "Option::is_none")]
11860 pub custom_data: Option<crate::types::CustomData>,
11861}
11862
11863impl VariableCharacteristics {
11864 #[must_use]
11866 pub fn new(data_type: Data, supports_monitoring: bool) -> Self {
11867 Self {
11868 data_type,
11869 supports_monitoring,
11870 unit: None,
11871 min_limit: None,
11872 max_limit: None,
11873 max_elements: None,
11874 values_list: None,
11875 custom_data: None,
11876 }
11877 }
11878
11879 #[must_use]
11881 pub fn with_unit(mut self, value: impl Into<String>) -> Self {
11882 self.unit = Some(value.into());
11883 self
11884 }
11885
11886 #[must_use]
11888 pub fn with_min_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11889 self.min_limit = Some(value.into());
11890 self
11891 }
11892
11893 #[must_use]
11895 pub fn with_max_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11896 self.max_limit = Some(value.into());
11897 self
11898 }
11899
11900 #[must_use]
11902 pub fn with_max_elements(mut self, value: i32) -> Self {
11903 self.max_elements = Some(value);
11904 self
11905 }
11906
11907 #[must_use]
11909 pub fn with_values_list(mut self, value: impl Into<String>) -> Self {
11910 self.values_list = Some(value.into());
11911 self
11912 }
11913
11914 #[must_use]
11916 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11917 self.custom_data = Some(value);
11918 self
11919 }
11920}
11921
11922impl Validate for VariableCharacteristics {
11923 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11924 path.push_key("dataType");
11925 Validate::validate_at(&self.data_type, path, out);
11926 path.pop();
11927 path.push_key("unit");
11928 if let Some(value) = &self.unit {
11929 validate::string(value.as_str(), None, Some(16), path, out);
11930 }
11931 path.pop();
11932 path.push_key("maxElements");
11933 if let Some(value) = &self.max_elements {
11934 validate::int_range(i64::from(*value), Some(1), None, path, out);
11935 }
11936 path.pop();
11937 path.push_key("valuesList");
11938 if let Some(value) = &self.values_list {
11939 validate::string(value.as_str(), None, Some(1000), path, out);
11940 }
11941 path.pop();
11942 path.push_key("customData");
11943 if let Some(value) = &self.custom_data {
11944 Validate::validate_at(value, path, out);
11945 }
11946 path.pop();
11947 }
11948}
11949
11950#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11954pub struct VariableMonitoring {
11955 pub id: i32,
11957 pub transaction: bool,
11959 pub value: crate::types::Decimal,
11962 pub r#type: Monitor,
11964 pub severity: i32,
11988 #[serde(rename = "eventNotificationType")]
11990 pub event_notification_type: EventNotification,
11991 #[serde(rename = "customData")]
11993 #[serde(default, skip_serializing_if = "Option::is_none")]
11994 pub custom_data: Option<crate::types::CustomData>,
11995}
11996
11997impl VariableMonitoring {
11998 #[must_use]
12000 pub fn new(
12001 id: i32,
12002 transaction: bool,
12003 value: impl Into<crate::types::Decimal>,
12004 r#type: Monitor,
12005 severity: i32,
12006 event_notification_type: EventNotification,
12007 ) -> Self {
12008 Self {
12009 id,
12010 transaction,
12011 value: value.into(),
12012 r#type,
12013 severity,
12014 event_notification_type,
12015 custom_data: None,
12016 }
12017 }
12018
12019 #[must_use]
12021 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12022 self.custom_data = Some(value);
12023 self
12024 }
12025}
12026
12027impl Validate for VariableMonitoring {
12028 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12029 path.push_key("id");
12030 validate::int_range(i64::from(self.id), Some(0), None, path, out);
12031 path.pop();
12032 path.push_key("type");
12033 Validate::validate_at(&self.r#type, path, out);
12034 path.pop();
12035 path.push_key("severity");
12036 validate::int_range(i64::from(self.severity), Some(0), None, path, out);
12037 path.pop();
12038 path.push_key("eventNotificationType");
12039 Validate::validate_at(&self.event_notification_type, path, out);
12040 path.pop();
12041 path.push_key("customData");
12042 if let Some(value) = &self.custom_data {
12043 Validate::validate_at(value, path, out);
12044 }
12045 path.pop();
12046 }
12047}
12048
12049#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
12051pub struct VoltageParams {
12052 #[serde(rename = "hv10MinMeanValue")]
12058 #[serde(default, skip_serializing_if = "Option::is_none")]
12059 pub hv10_min_mean_value: Option<crate::types::Decimal>,
12060 #[serde(rename = "hv10MinMeanTripDelay")]
12064 #[serde(default, skip_serializing_if = "Option::is_none")]
12065 pub hv10_min_mean_trip_delay: Option<crate::types::Decimal>,
12066 #[serde(rename = "powerDuringCessation")]
12068 #[serde(default, skip_serializing_if = "Option::is_none")]
12069 pub power_during_cessation: Option<PowerDuringCessation>,
12070 #[serde(rename = "customData")]
12072 #[serde(default, skip_serializing_if = "Option::is_none")]
12073 pub custom_data: Option<crate::types::CustomData>,
12074}
12075
12076impl VoltageParams {
12077 #[must_use]
12079 pub fn new() -> Self {
12080 Self::default()
12081 }
12082
12083 #[must_use]
12085 pub fn with_hv10_min_mean_value(mut self, value: impl Into<crate::types::Decimal>) -> Self {
12086 self.hv10_min_mean_value = Some(value.into());
12087 self
12088 }
12089
12090 #[must_use]
12092 pub fn with_hv10_min_mean_trip_delay(
12093 mut self,
12094 value: impl Into<crate::types::Decimal>,
12095 ) -> Self {
12096 self.hv10_min_mean_trip_delay = Some(value.into());
12097 self
12098 }
12099
12100 #[must_use]
12102 pub fn with_power_during_cessation(mut self, value: PowerDuringCessation) -> Self {
12103 self.power_during_cessation = Some(value);
12104 self
12105 }
12106
12107 #[must_use]
12109 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12110 self.custom_data = Some(value);
12111 self
12112 }
12113}
12114
12115impl Validate for VoltageParams {
12116 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12117 path.push_key("powerDuringCessation");
12118 if let Some(value) = &self.power_during_cessation {
12119 Validate::validate_at(value, path, out);
12120 }
12121 path.pop();
12122 path.push_key("customData");
12123 if let Some(value) = &self.custom_data {
12124 Validate::validate_at(value, path, out);
12125 }
12126 path.pop();
12127 }
12128}