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(
358 i64::from(self.price_schedule_id),
359 Some(0.0),
360 None,
361 path,
362 out,
363 );
364 path.pop();
365 path.push_key("currency");
366 validate::string(self.currency.as_str(), None, Some(3), path, out);
367 path.pop();
368 path.push_key("language");
369 validate::string(self.language.as_str(), None, Some(8), path, out);
370 path.pop();
371 path.push_key("priceAlgorithm");
372 validate::string(self.price_algorithm.as_str(), None, Some(2000), path, out);
373 path.pop();
374 path.push_key("priceRuleStacks");
375 validate::list_len(self.price_rule_stacks.len(), Some(1), Some(1024), path, out);
376 for (index, item) in self.price_rule_stacks.iter().enumerate() {
377 path.push_index(index);
378 Validate::validate_at(item, path, out);
379 path.pop();
380 }
381 path.pop();
382 path.push_key("priceScheduleDescription");
383 if let Some(value) = &self.price_schedule_description {
384 validate::string(value.as_str(), None, Some(160), path, out);
385 }
386 path.pop();
387 path.push_key("minimumCost");
388 if let Some(value) = &self.minimum_cost {
389 Validate::validate_at(value, path, out);
390 }
391 path.pop();
392 path.push_key("maximumCost");
393 if let Some(value) = &self.maximum_cost {
394 Validate::validate_at(value, path, out);
395 }
396 path.pop();
397 path.push_key("taxRules");
398 if let Some(value) = &self.tax_rules {
399 validate::list_len(value.len(), Some(1), Some(10), path, out);
400 for (index, item) in value.iter().enumerate() {
401 path.push_index(index);
402 Validate::validate_at(item, path, out);
403 path.pop();
404 }
405 }
406 path.pop();
407 path.push_key("overstayRuleList");
408 if let Some(value) = &self.overstay_rule_list {
409 Validate::validate_at(value, path, out);
410 }
411 path.pop();
412 path.push_key("additionalSelectedServices");
413 if let Some(value) = &self.additional_selected_services {
414 validate::list_len(value.len(), Some(1), Some(5), path, out);
415 for (index, item) in value.iter().enumerate() {
416 path.push_index(index);
417 Validate::validate_at(item, path, out);
418 path.pop();
419 }
420 }
421 path.pop();
422 path.push_key("customData");
423 if let Some(value) = &self.custom_data {
424 Validate::validate_at(value, path, out);
425 }
426 path.pop();
427 }
428}
429
430#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
434pub struct AdditionalInfo {
435 #[serde(rename = "additionalIdToken")]
437 pub additional_id_token: String,
438 pub r#type: String,
440 #[serde(rename = "customData")]
442 #[serde(default, skip_serializing_if = "Option::is_none")]
443 pub custom_data: Option<crate::types::CustomData>,
444}
445
446impl AdditionalInfo {
447 #[must_use]
449 pub fn new(additional_id_token: impl Into<String>, r#type: impl Into<String>) -> Self {
450 Self {
451 additional_id_token: additional_id_token.into(),
452 r#type: r#type.into(),
453 custom_data: None,
454 }
455 }
456
457 #[must_use]
459 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
460 self.custom_data = Some(value);
461 self
462 }
463}
464
465impl Validate for AdditionalInfo {
466 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
467 path.push_key("additionalIdToken");
468 validate::string(
469 self.additional_id_token.as_str(),
470 None,
471 Some(255),
472 path,
473 out,
474 );
475 path.pop();
476 path.push_key("type");
477 validate::string(self.r#type.as_str(), None, Some(50), path, out);
478 path.pop();
479 path.push_key("customData");
480 if let Some(value) = &self.custom_data {
481 Validate::validate_at(value, path, out);
482 }
483 path.pop();
484 }
485}
486
487#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
491pub struct AdditionalSelectedServices {
492 #[serde(rename = "serviceFee")]
494 pub service_fee: RationalNumber,
495 #[serde(rename = "serviceName")]
497 pub service_name: String,
498 #[serde(rename = "customData")]
500 #[serde(default, skip_serializing_if = "Option::is_none")]
501 pub custom_data: Option<crate::types::CustomData>,
502}
503
504impl AdditionalSelectedServices {
505 #[must_use]
507 pub fn new(service_fee: RationalNumber, service_name: impl Into<String>) -> Self {
508 Self {
509 service_fee,
510 service_name: service_name.into(),
511 custom_data: None,
512 }
513 }
514
515 #[must_use]
517 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
518 self.custom_data = Some(value);
519 self
520 }
521}
522
523impl Validate for AdditionalSelectedServices {
524 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
525 path.push_key("serviceFee");
526 Validate::validate_at(&self.service_fee, path, out);
527 path.pop();
528 path.push_key("serviceName");
529 validate::string(self.service_name.as_str(), None, Some(80), path, out);
530 path.pop();
531 path.push_key("customData");
532 if let Some(value) = &self.custom_data {
533 Validate::validate_at(value, path, out);
534 }
535 path.pop();
536 }
537}
538
539#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
543pub struct Address {
544 pub name: String,
546 pub address1: String,
548 pub city: String,
550 pub country: String,
552 #[serde(default, skip_serializing_if = "Option::is_none")]
554 pub address2: Option<String>,
555 #[serde(rename = "postalCode")]
557 #[serde(default, skip_serializing_if = "Option::is_none")]
558 pub postal_code: Option<String>,
559 #[serde(rename = "customData")]
561 #[serde(default, skip_serializing_if = "Option::is_none")]
562 pub custom_data: Option<crate::types::CustomData>,
563}
564
565impl Address {
566 #[must_use]
568 pub fn new(
569 name: impl Into<String>,
570 address1: impl Into<String>,
571 city: impl Into<String>,
572 country: impl Into<String>,
573 ) -> Self {
574 Self {
575 name: name.into(),
576 address1: address1.into(),
577 city: city.into(),
578 country: country.into(),
579 address2: None,
580 postal_code: None,
581 custom_data: None,
582 }
583 }
584
585 #[must_use]
587 pub fn with_address2(mut self, value: impl Into<String>) -> Self {
588 self.address2 = Some(value.into());
589 self
590 }
591
592 #[must_use]
594 pub fn with_postal_code(mut self, value: impl Into<String>) -> Self {
595 self.postal_code = Some(value.into());
596 self
597 }
598
599 #[must_use]
601 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
602 self.custom_data = Some(value);
603 self
604 }
605}
606
607impl Validate for Address {
608 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
609 path.push_key("name");
610 validate::string(self.name.as_str(), None, Some(50), path, out);
611 path.pop();
612 path.push_key("address1");
613 validate::string(self.address1.as_str(), None, Some(100), path, out);
614 path.pop();
615 path.push_key("city");
616 validate::string(self.city.as_str(), None, Some(100), path, out);
617 path.pop();
618 path.push_key("country");
619 validate::string(self.country.as_str(), None, Some(50), path, out);
620 path.pop();
621 path.push_key("address2");
622 if let Some(value) = &self.address2 {
623 validate::string(value.as_str(), None, Some(100), path, out);
624 }
625 path.pop();
626 path.push_key("postalCode");
627 if let Some(value) = &self.postal_code {
628 validate::string(value.as_str(), None, Some(20), path, out);
629 }
630 path.pop();
631 path.push_key("customData");
632 if let Some(value) = &self.custom_data {
633 Validate::validate_at(value, path, out);
634 }
635 path.pop();
636 }
637}
638
639#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
643pub struct AuthorizationData {
644 #[serde(rename = "idToken")]
646 pub id_token: IdToken,
647 #[serde(rename = "idTokenInfo")]
649 #[serde(default, skip_serializing_if = "Option::is_none")]
650 pub id_token_info: Option<IdTokenInfo>,
651 #[serde(rename = "customData")]
653 #[serde(default, skip_serializing_if = "Option::is_none")]
654 pub custom_data: Option<crate::types::CustomData>,
655}
656
657impl AuthorizationData {
658 #[must_use]
660 pub fn new(id_token: IdToken) -> Self {
661 Self {
662 id_token,
663 id_token_info: None,
664 custom_data: None,
665 }
666 }
667
668 #[must_use]
670 pub fn with_id_token_info(mut self, value: IdTokenInfo) -> Self {
671 self.id_token_info = Some(value);
672 self
673 }
674
675 #[must_use]
677 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
678 self.custom_data = Some(value);
679 self
680 }
681}
682
683impl Validate for AuthorizationData {
684 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
685 path.push_key("idToken");
686 Validate::validate_at(&self.id_token, path, out);
687 path.pop();
688 path.push_key("idTokenInfo");
689 if let Some(value) = &self.id_token_info {
690 Validate::validate_at(value, path, out);
691 }
692 path.pop();
693 path.push_key("customData");
694 if let Some(value) = &self.custom_data {
695 Validate::validate_at(value, path, out);
696 }
697 path.pop();
698 }
699}
700
701#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
703pub struct BatteryData {
704 #[serde(rename = "evseId")]
706 pub evse_id: i32,
707 #[serde(rename = "serialNumber")]
709 pub serial_number: String,
710 #[serde(rename = "soC")]
712 pub so_c: crate::types::Decimal,
713 #[serde(rename = "soH")]
715 pub so_h: crate::types::Decimal,
716 #[serde(rename = "productionDate")]
718 #[serde(default, skip_serializing_if = "Option::is_none")]
719 pub production_date: Option<crate::types::DateTime>,
720 #[serde(rename = "vendorInfo")]
722 #[serde(default, skip_serializing_if = "Option::is_none")]
723 pub vendor_info: Option<String>,
724 #[serde(rename = "customData")]
726 #[serde(default, skip_serializing_if = "Option::is_none")]
727 pub custom_data: Option<crate::types::CustomData>,
728}
729
730impl BatteryData {
731 #[must_use]
733 pub fn new(
734 evse_id: i32,
735 serial_number: impl Into<String>,
736 so_c: impl Into<crate::types::Decimal>,
737 so_h: impl Into<crate::types::Decimal>,
738 ) -> Self {
739 Self {
740 evse_id,
741 serial_number: serial_number.into(),
742 so_c: so_c.into(),
743 so_h: so_h.into(),
744 production_date: None,
745 vendor_info: None,
746 custom_data: None,
747 }
748 }
749
750 #[must_use]
752 pub fn with_production_date(mut self, value: impl Into<crate::types::DateTime>) -> Self {
753 self.production_date = Some(value.into());
754 self
755 }
756
757 #[must_use]
759 pub fn with_vendor_info(mut self, value: impl Into<String>) -> Self {
760 self.vendor_info = Some(value.into());
761 self
762 }
763
764 #[must_use]
766 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
767 self.custom_data = Some(value);
768 self
769 }
770}
771
772impl Validate for BatteryData {
773 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
774 path.push_key("evseId");
775 validate::int_range(i64::from(self.evse_id), Some(0.0), None, path, out);
776 path.pop();
777 path.push_key("serialNumber");
778 validate::string(self.serial_number.as_str(), None, Some(50), path, out);
779 path.pop();
780 path.push_key("soC");
781 validate::range(self.so_c.get(), Some(0.0), Some(100.0), path, out);
782 path.pop();
783 path.push_key("soH");
784 validate::range(self.so_h.get(), Some(0.0), Some(100.0), path, out);
785 path.pop();
786 path.push_key("vendorInfo");
787 if let Some(value) = &self.vendor_info {
788 validate::string(value.as_str(), None, Some(500), path, out);
789 }
790 path.pop();
791 path.push_key("customData");
792 if let Some(value) = &self.custom_data {
793 Validate::validate_at(value, path, out);
794 }
795 path.pop();
796 }
797}
798
799#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
801pub struct CertificateHashData {
802 #[serde(rename = "hashAlgorithm")]
804 pub hash_algorithm: HashAlgorithm,
805 #[serde(rename = "issuerNameHash")]
810 pub issuer_name_hash: String,
811 #[serde(rename = "issuerKeyHash")]
815 pub issuer_key_hash: String,
816 #[serde(rename = "serialNumber")]
820 pub serial_number: String,
821 #[serde(rename = "customData")]
823 #[serde(default, skip_serializing_if = "Option::is_none")]
824 pub custom_data: Option<crate::types::CustomData>,
825}
826
827impl CertificateHashData {
828 #[must_use]
830 pub fn new(
831 hash_algorithm: HashAlgorithm,
832 issuer_name_hash: impl Into<String>,
833 issuer_key_hash: impl Into<String>,
834 serial_number: impl Into<String>,
835 ) -> Self {
836 Self {
837 hash_algorithm,
838 issuer_name_hash: issuer_name_hash.into(),
839 issuer_key_hash: issuer_key_hash.into(),
840 serial_number: serial_number.into(),
841 custom_data: None,
842 }
843 }
844
845 #[must_use]
847 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
848 self.custom_data = Some(value);
849 self
850 }
851}
852
853impl Validate for CertificateHashData {
854 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
855 path.push_key("hashAlgorithm");
856 Validate::validate_at(&self.hash_algorithm, path, out);
857 path.pop();
858 path.push_key("issuerNameHash");
859 validate::string(self.issuer_name_hash.as_str(), None, Some(128), path, out);
860 path.pop();
861 path.push_key("issuerKeyHash");
862 validate::string(self.issuer_key_hash.as_str(), None, Some(128), path, out);
863 path.pop();
864 path.push_key("serialNumber");
865 validate::string(self.serial_number.as_str(), None, Some(40), path, out);
866 path.pop();
867 path.push_key("customData");
868 if let Some(value) = &self.custom_data {
869 Validate::validate_at(value, path, out);
870 }
871 path.pop();
872 }
873}
874
875#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
877pub struct CertificateHashDataChain {
878 #[serde(rename = "certificateHashData")]
880 pub certificate_hash_data: CertificateHashData,
881 #[serde(rename = "certificateType")]
883 pub certificate_type: GetCertificateIdUse,
884 #[serde(rename = "childCertificateHashData")]
886 #[serde(default, skip_serializing_if = "Option::is_none")]
887 pub child_certificate_hash_data: Option<Vec<CertificateHashData>>,
888 #[serde(rename = "customData")]
890 #[serde(default, skip_serializing_if = "Option::is_none")]
891 pub custom_data: Option<crate::types::CustomData>,
892}
893
894impl CertificateHashDataChain {
895 #[must_use]
897 pub fn new(
898 certificate_hash_data: CertificateHashData,
899 certificate_type: GetCertificateIdUse,
900 ) -> Self {
901 Self {
902 certificate_hash_data,
903 certificate_type,
904 child_certificate_hash_data: None,
905 custom_data: None,
906 }
907 }
908
909 #[must_use]
911 pub fn with_child_certificate_hash_data(mut self, value: Vec<CertificateHashData>) -> Self {
912 self.child_certificate_hash_data = Some(value);
913 self
914 }
915
916 #[must_use]
918 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
919 self.custom_data = Some(value);
920 self
921 }
922}
923
924impl Validate for CertificateHashDataChain {
925 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
926 path.push_key("certificateHashData");
927 Validate::validate_at(&self.certificate_hash_data, path, out);
928 path.pop();
929 path.push_key("certificateType");
930 Validate::validate_at(&self.certificate_type, path, out);
931 path.pop();
932 path.push_key("childCertificateHashData");
933 if let Some(value) = &self.child_certificate_hash_data {
934 validate::list_len(value.len(), Some(1), Some(4), path, out);
935 for (index, item) in value.iter().enumerate() {
936 path.push_index(index);
937 Validate::validate_at(item, path, out);
938 path.pop();
939 }
940 }
941 path.pop();
942 path.push_key("customData");
943 if let Some(value) = &self.custom_data {
944 Validate::validate_at(value, path, out);
945 }
946 path.pop();
947 }
948}
949
950#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
954pub struct CertificateStatus {
955 #[serde(rename = "certificateHashData")]
957 pub certificate_hash_data: CertificateHashData,
958 pub source: CertificateStatusSource,
960 pub status: CertificateStatusEnum,
962 #[serde(rename = "nextUpdate")]
964 pub next_update: crate::types::DateTime,
965 #[serde(rename = "customData")]
967 #[serde(default, skip_serializing_if = "Option::is_none")]
968 pub custom_data: Option<crate::types::CustomData>,
969}
970
971impl CertificateStatus {
972 #[must_use]
974 pub fn new(
975 certificate_hash_data: CertificateHashData,
976 source: CertificateStatusSource,
977 status: CertificateStatusEnum,
978 next_update: impl Into<crate::types::DateTime>,
979 ) -> Self {
980 Self {
981 certificate_hash_data,
982 source,
983 status,
984 next_update: next_update.into(),
985 custom_data: None,
986 }
987 }
988
989 #[must_use]
991 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
992 self.custom_data = Some(value);
993 self
994 }
995}
996
997impl Validate for CertificateStatus {
998 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
999 path.push_key("certificateHashData");
1000 Validate::validate_at(&self.certificate_hash_data, path, out);
1001 path.pop();
1002 path.push_key("source");
1003 Validate::validate_at(&self.source, path, out);
1004 path.pop();
1005 path.push_key("status");
1006 Validate::validate_at(&self.status, path, out);
1007 path.pop();
1008 path.push_key("customData");
1009 if let Some(value) = &self.custom_data {
1010 Validate::validate_at(value, path, out);
1011 }
1012 path.pop();
1013 }
1014}
1015
1016#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1020pub struct CertificateStatusRequestInfo {
1021 #[serde(rename = "certificateHashData")]
1023 pub certificate_hash_data: CertificateHashData,
1024 pub source: CertificateStatusSource,
1026 pub urls: Vec<String>,
1028 #[serde(rename = "customData")]
1030 #[serde(default, skip_serializing_if = "Option::is_none")]
1031 pub custom_data: Option<crate::types::CustomData>,
1032}
1033
1034impl CertificateStatusRequestInfo {
1035 #[must_use]
1037 pub fn new(
1038 certificate_hash_data: CertificateHashData,
1039 source: CertificateStatusSource,
1040 urls: impl IntoIterator<Item = impl Into<String>>,
1041 ) -> Self {
1042 Self {
1043 certificate_hash_data,
1044 source,
1045 urls: urls.into_iter().map(Into::into).collect(),
1046 custom_data: None,
1047 }
1048 }
1049
1050 #[must_use]
1052 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1053 self.custom_data = Some(value);
1054 self
1055 }
1056}
1057
1058impl Validate for CertificateStatusRequestInfo {
1059 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1060 path.push_key("certificateHashData");
1061 Validate::validate_at(&self.certificate_hash_data, path, out);
1062 path.pop();
1063 path.push_key("source");
1064 Validate::validate_at(&self.source, path, out);
1065 path.pop();
1066 path.push_key("urls");
1067 validate::list_len(self.urls.len(), Some(1), Some(5), path, out);
1068 for (index, item) in self.urls.iter().enumerate() {
1069 path.push_index(index);
1070 validate::string(item.as_str(), None, Some(2000), path, out);
1071 path.pop();
1072 }
1073 path.pop();
1074 path.push_key("customData");
1075 if let Some(value) = &self.custom_data {
1076 Validate::validate_at(value, path, out);
1077 }
1078 path.pop();
1079 }
1080}
1081
1082#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1084pub struct ChargingLimit {
1085 #[serde(rename = "chargingLimitSource")]
1087 pub charging_limit_source: String,
1088 #[serde(rename = "isLocalGeneration")]
1090 #[serde(default, skip_serializing_if = "Option::is_none")]
1091 pub is_local_generation: Option<bool>,
1092 #[serde(rename = "isGridCritical")]
1094 #[serde(default, skip_serializing_if = "Option::is_none")]
1095 pub is_grid_critical: Option<bool>,
1096 #[serde(rename = "customData")]
1098 #[serde(default, skip_serializing_if = "Option::is_none")]
1099 pub custom_data: Option<crate::types::CustomData>,
1100}
1101
1102impl ChargingLimit {
1103 #[must_use]
1105 pub fn new(charging_limit_source: impl Into<String>) -> Self {
1106 Self {
1107 charging_limit_source: charging_limit_source.into(),
1108 is_local_generation: None,
1109 is_grid_critical: None,
1110 custom_data: None,
1111 }
1112 }
1113
1114 #[must_use]
1116 pub fn with_is_local_generation(mut self, value: bool) -> Self {
1117 self.is_local_generation = Some(value);
1118 self
1119 }
1120
1121 #[must_use]
1123 pub fn with_is_grid_critical(mut self, value: bool) -> Self {
1124 self.is_grid_critical = Some(value);
1125 self
1126 }
1127
1128 #[must_use]
1130 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1131 self.custom_data = Some(value);
1132 self
1133 }
1134}
1135
1136impl Validate for ChargingLimit {
1137 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1138 path.push_key("chargingLimitSource");
1139 validate::string(
1140 self.charging_limit_source.as_str(),
1141 None,
1142 Some(20),
1143 path,
1144 out,
1145 );
1146 path.pop();
1147 path.push_key("customData");
1148 if let Some(value) = &self.custom_data {
1149 Validate::validate_at(value, path, out);
1150 }
1151 path.pop();
1152 }
1153}
1154
1155#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1157pub struct ChargingNeeds {
1158 #[serde(rename = "requestedEnergyTransfer")]
1160 pub requested_energy_transfer: EnergyTransferMode,
1161 #[serde(rename = "acChargingParameters")]
1163 #[serde(default, skip_serializing_if = "Option::is_none")]
1164 pub ac_charging_parameters: Option<ACChargingParameters>,
1165 #[serde(rename = "derChargingParameters")]
1167 #[serde(default, skip_serializing_if = "Option::is_none")]
1168 pub der_charging_parameters: Option<DERChargingParameters>,
1169 #[serde(rename = "evEnergyOffer")]
1171 #[serde(default, skip_serializing_if = "Option::is_none")]
1172 pub ev_energy_offer: Option<EVEnergyOffer>,
1173 #[serde(rename = "dcChargingParameters")]
1175 #[serde(default, skip_serializing_if = "Option::is_none")]
1176 pub dc_charging_parameters: Option<DCChargingParameters>,
1177 #[serde(rename = "v2xChargingParameters")]
1179 #[serde(default, skip_serializing_if = "Option::is_none")]
1180 pub v2x_charging_parameters: Option<V2XChargingParameters>,
1181 #[serde(rename = "availableEnergyTransfer")]
1183 #[serde(default, skip_serializing_if = "Option::is_none")]
1184 pub available_energy_transfer: Option<Vec<EnergyTransferMode>>,
1185 #[serde(rename = "controlMode")]
1187 #[serde(default, skip_serializing_if = "Option::is_none")]
1188 pub control_mode: Option<ControlMode>,
1189 #[serde(rename = "mobilityNeedsMode")]
1191 #[serde(default, skip_serializing_if = "Option::is_none")]
1192 pub mobility_needs_mode: Option<MobilityNeedsMode>,
1193 #[serde(rename = "departureTime")]
1197 #[serde(default, skip_serializing_if = "Option::is_none")]
1198 pub departure_time: Option<crate::types::DateTime>,
1199 #[serde(rename = "customData")]
1201 #[serde(default, skip_serializing_if = "Option::is_none")]
1202 pub custom_data: Option<crate::types::CustomData>,
1203}
1204
1205impl ChargingNeeds {
1206 #[must_use]
1208 pub fn new(requested_energy_transfer: EnergyTransferMode) -> Self {
1209 Self {
1210 requested_energy_transfer,
1211 ac_charging_parameters: None,
1212 der_charging_parameters: None,
1213 ev_energy_offer: None,
1214 dc_charging_parameters: None,
1215 v2x_charging_parameters: None,
1216 available_energy_transfer: None,
1217 control_mode: None,
1218 mobility_needs_mode: None,
1219 departure_time: None,
1220 custom_data: None,
1221 }
1222 }
1223
1224 #[must_use]
1226 pub fn with_ac_charging_parameters(mut self, value: ACChargingParameters) -> Self {
1227 self.ac_charging_parameters = Some(value);
1228 self
1229 }
1230
1231 #[must_use]
1233 pub fn with_der_charging_parameters(mut self, value: DERChargingParameters) -> Self {
1234 self.der_charging_parameters = Some(value);
1235 self
1236 }
1237
1238 #[must_use]
1240 pub fn with_ev_energy_offer(mut self, value: EVEnergyOffer) -> Self {
1241 self.ev_energy_offer = Some(value);
1242 self
1243 }
1244
1245 #[must_use]
1247 pub fn with_dc_charging_parameters(mut self, value: DCChargingParameters) -> Self {
1248 self.dc_charging_parameters = Some(value);
1249 self
1250 }
1251
1252 #[must_use]
1254 pub fn with_v2x_charging_parameters(mut self, value: V2XChargingParameters) -> Self {
1255 self.v2x_charging_parameters = Some(value);
1256 self
1257 }
1258
1259 #[must_use]
1261 pub fn with_available_energy_transfer(mut self, value: Vec<EnergyTransferMode>) -> Self {
1262 self.available_energy_transfer = Some(value);
1263 self
1264 }
1265
1266 #[must_use]
1268 pub fn with_control_mode(mut self, value: ControlMode) -> Self {
1269 self.control_mode = Some(value);
1270 self
1271 }
1272
1273 #[must_use]
1275 pub fn with_mobility_needs_mode(mut self, value: MobilityNeedsMode) -> Self {
1276 self.mobility_needs_mode = Some(value);
1277 self
1278 }
1279
1280 #[must_use]
1282 pub fn with_departure_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1283 self.departure_time = Some(value.into());
1284 self
1285 }
1286
1287 #[must_use]
1289 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1290 self.custom_data = Some(value);
1291 self
1292 }
1293}
1294
1295impl Validate for ChargingNeeds {
1296 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1297 path.push_key("requestedEnergyTransfer");
1298 Validate::validate_at(&self.requested_energy_transfer, path, out);
1299 path.pop();
1300 path.push_key("acChargingParameters");
1301 if let Some(value) = &self.ac_charging_parameters {
1302 Validate::validate_at(value, path, out);
1303 }
1304 path.pop();
1305 path.push_key("derChargingParameters");
1306 if let Some(value) = &self.der_charging_parameters {
1307 Validate::validate_at(value, path, out);
1308 }
1309 path.pop();
1310 path.push_key("evEnergyOffer");
1311 if let Some(value) = &self.ev_energy_offer {
1312 Validate::validate_at(value, path, out);
1313 }
1314 path.pop();
1315 path.push_key("dcChargingParameters");
1316 if let Some(value) = &self.dc_charging_parameters {
1317 Validate::validate_at(value, path, out);
1318 }
1319 path.pop();
1320 path.push_key("v2xChargingParameters");
1321 if let Some(value) = &self.v2x_charging_parameters {
1322 Validate::validate_at(value, path, out);
1323 }
1324 path.pop();
1325 path.push_key("availableEnergyTransfer");
1326 if let Some(value) = &self.available_energy_transfer {
1327 validate::list_len(value.len(), Some(1), None, path, out);
1328 for (index, item) in value.iter().enumerate() {
1329 path.push_index(index);
1330 Validate::validate_at(item, path, out);
1331 path.pop();
1332 }
1333 }
1334 path.pop();
1335 path.push_key("controlMode");
1336 if let Some(value) = &self.control_mode {
1337 Validate::validate_at(value, path, out);
1338 }
1339 path.pop();
1340 path.push_key("mobilityNeedsMode");
1341 if let Some(value) = &self.mobility_needs_mode {
1342 Validate::validate_at(value, path, out);
1343 }
1344 path.pop();
1345 path.push_key("customData");
1346 if let Some(value) = &self.custom_data {
1347 Validate::validate_at(value, path, out);
1348 }
1349 path.pop();
1350 }
1351}
1352
1353#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1357pub struct ChargingPeriod {
1358 #[serde(rename = "startPeriod")]
1360 pub start_period: crate::types::DateTime,
1361 #[serde(default, skip_serializing_if = "Option::is_none")]
1363 pub dimensions: Option<Vec<CostDimension>>,
1364 #[serde(rename = "tariffId")]
1366 #[serde(default, skip_serializing_if = "Option::is_none")]
1367 pub tariff_id: Option<String>,
1368 #[serde(rename = "customData")]
1370 #[serde(default, skip_serializing_if = "Option::is_none")]
1371 pub custom_data: Option<crate::types::CustomData>,
1372}
1373
1374impl ChargingPeriod {
1375 #[must_use]
1377 pub fn new(start_period: impl Into<crate::types::DateTime>) -> Self {
1378 Self {
1379 start_period: start_period.into(),
1380 dimensions: None,
1381 tariff_id: None,
1382 custom_data: None,
1383 }
1384 }
1385
1386 #[must_use]
1388 pub fn with_dimensions(mut self, value: Vec<CostDimension>) -> Self {
1389 self.dimensions = Some(value);
1390 self
1391 }
1392
1393 #[must_use]
1395 pub fn with_tariff_id(mut self, value: impl Into<String>) -> Self {
1396 self.tariff_id = Some(value.into());
1397 self
1398 }
1399
1400 #[must_use]
1402 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1403 self.custom_data = Some(value);
1404 self
1405 }
1406}
1407
1408impl Validate for ChargingPeriod {
1409 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1410 path.push_key("dimensions");
1411 if let Some(value) = &self.dimensions {
1412 validate::list_len(value.len(), Some(1), None, path, out);
1413 for (index, item) in value.iter().enumerate() {
1414 path.push_index(index);
1415 Validate::validate_at(item, path, out);
1416 path.pop();
1417 }
1418 }
1419 path.pop();
1420 path.push_key("tariffId");
1421 if let Some(value) = &self.tariff_id {
1422 validate::string(value.as_str(), None, Some(60), path, out);
1423 }
1424 path.pop();
1425 path.push_key("customData");
1426 if let Some(value) = &self.custom_data {
1427 Validate::validate_at(value, path, out);
1428 }
1429 path.pop();
1430 }
1431}
1432
1433#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1439pub struct ChargingProfile {
1440 pub id: i32,
1442 #[serde(rename = "stackLevel")]
1444 pub stack_level: i32,
1445 #[serde(rename = "chargingProfilePurpose")]
1447 pub charging_profile_purpose: ChargingProfilePurpose,
1448 #[serde(rename = "chargingProfileKind")]
1450 pub charging_profile_kind: ChargingProfileKind,
1451 #[serde(rename = "chargingSchedule")]
1453 pub charging_schedule: Vec<ChargingSchedule>,
1454 #[serde(rename = "recurrencyKind")]
1456 #[serde(default, skip_serializing_if = "Option::is_none")]
1457 pub recurrency_kind: Option<RecurrencyKind>,
1458 #[serde(rename = "validFrom")]
1460 #[serde(default, skip_serializing_if = "Option::is_none")]
1461 pub valid_from: Option<crate::types::DateTime>,
1462 #[serde(rename = "validTo")]
1464 #[serde(default, skip_serializing_if = "Option::is_none")]
1465 pub valid_to: Option<crate::types::DateTime>,
1466 #[serde(rename = "transactionId")]
1468 #[serde(default, skip_serializing_if = "Option::is_none")]
1469 pub transaction_id: Option<String>,
1470 #[serde(rename = "maxOfflineDuration")]
1474 #[serde(default, skip_serializing_if = "Option::is_none")]
1475 pub max_offline_duration: Option<i32>,
1476 #[serde(rename = "invalidAfterOfflineDuration")]
1479 #[serde(default, skip_serializing_if = "Option::is_none")]
1480 pub invalid_after_offline_duration: Option<bool>,
1481 #[serde(rename = "dynUpdateInterval")]
1485 #[serde(default, skip_serializing_if = "Option::is_none")]
1486 pub dyn_update_interval: Option<i32>,
1487 #[serde(rename = "dynUpdateTime")]
1490 #[serde(default, skip_serializing_if = "Option::is_none")]
1491 pub dyn_update_time: Option<crate::types::DateTime>,
1492 #[serde(rename = "priceScheduleSignature")]
1495 #[serde(default, skip_serializing_if = "Option::is_none")]
1496 pub price_schedule_signature: Option<String>,
1497 #[serde(rename = "customData")]
1499 #[serde(default, skip_serializing_if = "Option::is_none")]
1500 pub custom_data: Option<crate::types::CustomData>,
1501}
1502
1503impl ChargingProfile {
1504 #[must_use]
1506 pub fn new(
1507 id: i32,
1508 stack_level: i32,
1509 charging_profile_purpose: ChargingProfilePurpose,
1510 charging_profile_kind: ChargingProfileKind,
1511 charging_schedule: Vec<ChargingSchedule>,
1512 ) -> Self {
1513 Self {
1514 id,
1515 stack_level,
1516 charging_profile_purpose,
1517 charging_profile_kind,
1518 charging_schedule,
1519 recurrency_kind: None,
1520 valid_from: None,
1521 valid_to: None,
1522 transaction_id: None,
1523 max_offline_duration: None,
1524 invalid_after_offline_duration: None,
1525 dyn_update_interval: None,
1526 dyn_update_time: None,
1527 price_schedule_signature: None,
1528 custom_data: None,
1529 }
1530 }
1531
1532 #[must_use]
1534 pub fn with_recurrency_kind(mut self, value: RecurrencyKind) -> Self {
1535 self.recurrency_kind = Some(value);
1536 self
1537 }
1538
1539 #[must_use]
1541 pub fn with_valid_from(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1542 self.valid_from = Some(value.into());
1543 self
1544 }
1545
1546 #[must_use]
1548 pub fn with_valid_to(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1549 self.valid_to = Some(value.into());
1550 self
1551 }
1552
1553 #[must_use]
1555 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
1556 self.transaction_id = Some(value.into());
1557 self
1558 }
1559
1560 #[must_use]
1562 pub fn with_max_offline_duration(mut self, value: i32) -> Self {
1563 self.max_offline_duration = Some(value);
1564 self
1565 }
1566
1567 #[must_use]
1569 pub fn with_invalid_after_offline_duration(mut self, value: bool) -> Self {
1570 self.invalid_after_offline_duration = Some(value);
1571 self
1572 }
1573
1574 #[must_use]
1576 pub fn with_dyn_update_interval(mut self, value: i32) -> Self {
1577 self.dyn_update_interval = Some(value);
1578 self
1579 }
1580
1581 #[must_use]
1583 pub fn with_dyn_update_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1584 self.dyn_update_time = Some(value.into());
1585 self
1586 }
1587
1588 #[must_use]
1590 pub fn with_price_schedule_signature(mut self, value: impl Into<String>) -> Self {
1591 self.price_schedule_signature = Some(value.into());
1592 self
1593 }
1594
1595 #[must_use]
1597 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1598 self.custom_data = Some(value);
1599 self
1600 }
1601}
1602
1603impl Validate for ChargingProfile {
1604 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1605 path.push_key("stackLevel");
1606 validate::int_range(i64::from(self.stack_level), Some(0.0), None, path, out);
1607 path.pop();
1608 path.push_key("chargingProfilePurpose");
1609 Validate::validate_at(&self.charging_profile_purpose, path, out);
1610 path.pop();
1611 path.push_key("chargingProfileKind");
1612 Validate::validate_at(&self.charging_profile_kind, path, out);
1613 path.pop();
1614 path.push_key("chargingSchedule");
1615 validate::list_len(self.charging_schedule.len(), Some(1), Some(3), path, out);
1616 for (index, item) in self.charging_schedule.iter().enumerate() {
1617 path.push_index(index);
1618 Validate::validate_at(item, path, out);
1619 path.pop();
1620 }
1621 path.pop();
1622 path.push_key("recurrencyKind");
1623 if let Some(value) = &self.recurrency_kind {
1624 Validate::validate_at(value, path, out);
1625 }
1626 path.pop();
1627 path.push_key("transactionId");
1628 if let Some(value) = &self.transaction_id {
1629 validate::string(value.as_str(), None, Some(36), path, out);
1630 }
1631 path.pop();
1632 path.push_key("priceScheduleSignature");
1633 if let Some(value) = &self.price_schedule_signature {
1634 validate::string(value.as_str(), None, Some(256), path, out);
1635 }
1636 path.pop();
1637 path.push_key("customData");
1638 if let Some(value) = &self.custom_data {
1639 Validate::validate_at(value, path, out);
1640 }
1641 path.pop();
1642 }
1643}
1644
1645#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1649pub struct ChargingProfileCriterion {
1650 #[serde(rename = "chargingProfilePurpose")]
1652 #[serde(default, skip_serializing_if = "Option::is_none")]
1653 pub charging_profile_purpose: Option<ChargingProfilePurpose>,
1654 #[serde(rename = "stackLevel")]
1656 #[serde(default, skip_serializing_if = "Option::is_none")]
1657 pub stack_level: Option<i32>,
1658 #[serde(rename = "chargingProfileId")]
1660 #[serde(default, skip_serializing_if = "Option::is_none")]
1661 pub charging_profile_id: Option<Vec<i32>>,
1662 #[serde(rename = "chargingLimitSource")]
1664 #[serde(default, skip_serializing_if = "Option::is_none")]
1665 pub charging_limit_source: Option<Vec<String>>,
1666 #[serde(rename = "customData")]
1668 #[serde(default, skip_serializing_if = "Option::is_none")]
1669 pub custom_data: Option<crate::types::CustomData>,
1670}
1671
1672impl ChargingProfileCriterion {
1673 #[must_use]
1675 pub fn new() -> Self {
1676 Self::default()
1677 }
1678
1679 #[must_use]
1681 pub fn with_charging_profile_purpose(mut self, value: ChargingProfilePurpose) -> Self {
1682 self.charging_profile_purpose = Some(value);
1683 self
1684 }
1685
1686 #[must_use]
1688 pub fn with_stack_level(mut self, value: i32) -> Self {
1689 self.stack_level = Some(value);
1690 self
1691 }
1692
1693 #[must_use]
1695 pub fn with_charging_profile_id(mut self, value: Vec<i32>) -> Self {
1696 self.charging_profile_id = Some(value);
1697 self
1698 }
1699
1700 #[must_use]
1702 pub fn with_charging_limit_source(
1703 mut self,
1704 value: impl IntoIterator<Item = impl Into<String>>,
1705 ) -> Self {
1706 self.charging_limit_source = Some(value.into_iter().map(Into::into).collect());
1707 self
1708 }
1709
1710 #[must_use]
1712 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1713 self.custom_data = Some(value);
1714 self
1715 }
1716}
1717
1718impl Validate for ChargingProfileCriterion {
1719 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1720 path.push_key("chargingProfilePurpose");
1721 if let Some(value) = &self.charging_profile_purpose {
1722 Validate::validate_at(value, path, out);
1723 }
1724 path.pop();
1725 path.push_key("stackLevel");
1726 if let Some(value) = &self.stack_level {
1727 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
1728 }
1729 path.pop();
1730 path.push_key("chargingProfileId");
1731 if let Some(value) = &self.charging_profile_id {
1732 validate::list_len(value.len(), Some(1), None, path, out);
1733 }
1734 path.pop();
1735 path.push_key("chargingLimitSource");
1736 if let Some(value) = &self.charging_limit_source {
1737 validate::list_len(value.len(), Some(1), Some(4), path, out);
1738 for (index, item) in value.iter().enumerate() {
1739 path.push_index(index);
1740 validate::string(item.as_str(), None, Some(20), path, out);
1741 path.pop();
1742 }
1743 }
1744 path.pop();
1745 path.push_key("customData");
1746 if let Some(value) = &self.custom_data {
1747 Validate::validate_at(value, path, out);
1748 }
1749 path.pop();
1750 }
1751}
1752
1753#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1760pub struct ChargingSchedule {
1761 pub id: i32,
1763 #[serde(rename = "chargingRateUnit")]
1765 pub charging_rate_unit: ChargingRateUnit,
1766 #[serde(rename = "chargingSchedulePeriod")]
1768 pub charging_schedule_period: Vec<ChargingSchedulePeriod>,
1769 #[serde(rename = "limitAtSoC")]
1771 #[serde(default, skip_serializing_if = "Option::is_none")]
1772 pub limit_at_so_c: Option<LimitAtSoC>,
1773 #[serde(rename = "startSchedule")]
1775 #[serde(default, skip_serializing_if = "Option::is_none")]
1776 pub start_schedule: Option<crate::types::DateTime>,
1777 #[serde(default, skip_serializing_if = "Option::is_none")]
1779 pub duration: Option<i32>,
1780 #[serde(rename = "minChargingRate")]
1782 #[serde(default, skip_serializing_if = "Option::is_none")]
1783 pub min_charging_rate: Option<crate::types::Decimal>,
1784 #[serde(rename = "powerTolerance")]
1786 #[serde(default, skip_serializing_if = "Option::is_none")]
1787 pub power_tolerance: Option<crate::types::Decimal>,
1788 #[serde(rename = "signatureId")]
1790 #[serde(default, skip_serializing_if = "Option::is_none")]
1791 pub signature_id: Option<i32>,
1792 #[serde(rename = "digestValue")]
1794 #[serde(default, skip_serializing_if = "Option::is_none")]
1795 pub digest_value: Option<String>,
1796 #[serde(rename = "useLocalTime")]
1799 #[serde(default, skip_serializing_if = "Option::is_none")]
1800 pub use_local_time: Option<bool>,
1801 #[serde(rename = "randomizedDelay")]
1803 #[serde(default, skip_serializing_if = "Option::is_none")]
1804 pub randomized_delay: Option<i32>,
1805 #[serde(rename = "salesTariff")]
1807 #[serde(default, skip_serializing_if = "Option::is_none")]
1808 pub sales_tariff: Option<SalesTariff>,
1809 #[serde(rename = "absolutePriceSchedule")]
1811 #[serde(default, skip_serializing_if = "Option::is_none")]
1812 pub absolute_price_schedule: Option<AbsolutePriceSchedule>,
1813 #[serde(rename = "priceLevelSchedule")]
1815 #[serde(default, skip_serializing_if = "Option::is_none")]
1816 pub price_level_schedule: Option<PriceLevelSchedule>,
1817 #[serde(rename = "customData")]
1819 #[serde(default, skip_serializing_if = "Option::is_none")]
1820 pub custom_data: Option<crate::types::CustomData>,
1821}
1822
1823impl ChargingSchedule {
1824 #[must_use]
1826 pub fn new(
1827 id: i32,
1828 charging_rate_unit: ChargingRateUnit,
1829 charging_schedule_period: Vec<ChargingSchedulePeriod>,
1830 ) -> Self {
1831 Self {
1832 id,
1833 charging_rate_unit,
1834 charging_schedule_period,
1835 limit_at_so_c: None,
1836 start_schedule: None,
1837 duration: None,
1838 min_charging_rate: None,
1839 power_tolerance: None,
1840 signature_id: None,
1841 digest_value: None,
1842 use_local_time: None,
1843 randomized_delay: None,
1844 sales_tariff: None,
1845 absolute_price_schedule: None,
1846 price_level_schedule: None,
1847 custom_data: None,
1848 }
1849 }
1850
1851 #[must_use]
1853 pub fn with_limit_at_so_c(mut self, value: LimitAtSoC) -> Self {
1854 self.limit_at_so_c = Some(value);
1855 self
1856 }
1857
1858 #[must_use]
1860 pub fn with_start_schedule(mut self, value: impl Into<crate::types::DateTime>) -> Self {
1861 self.start_schedule = Some(value.into());
1862 self
1863 }
1864
1865 #[must_use]
1867 pub fn with_duration(mut self, value: i32) -> Self {
1868 self.duration = Some(value);
1869 self
1870 }
1871
1872 #[must_use]
1874 pub fn with_min_charging_rate(mut self, value: impl Into<crate::types::Decimal>) -> Self {
1875 self.min_charging_rate = Some(value.into());
1876 self
1877 }
1878
1879 #[must_use]
1881 pub fn with_power_tolerance(mut self, value: impl Into<crate::types::Decimal>) -> Self {
1882 self.power_tolerance = Some(value.into());
1883 self
1884 }
1885
1886 #[must_use]
1888 pub fn with_signature_id(mut self, value: i32) -> Self {
1889 self.signature_id = Some(value);
1890 self
1891 }
1892
1893 #[must_use]
1895 pub fn with_digest_value(mut self, value: impl Into<String>) -> Self {
1896 self.digest_value = Some(value.into());
1897 self
1898 }
1899
1900 #[must_use]
1902 pub fn with_use_local_time(mut self, value: bool) -> Self {
1903 self.use_local_time = Some(value);
1904 self
1905 }
1906
1907 #[must_use]
1909 pub fn with_randomized_delay(mut self, value: i32) -> Self {
1910 self.randomized_delay = Some(value);
1911 self
1912 }
1913
1914 #[must_use]
1916 pub fn with_sales_tariff(mut self, value: SalesTariff) -> Self {
1917 self.sales_tariff = Some(value);
1918 self
1919 }
1920
1921 #[must_use]
1923 pub fn with_absolute_price_schedule(mut self, value: AbsolutePriceSchedule) -> Self {
1924 self.absolute_price_schedule = Some(value);
1925 self
1926 }
1927
1928 #[must_use]
1930 pub fn with_price_level_schedule(mut self, value: PriceLevelSchedule) -> Self {
1931 self.price_level_schedule = Some(value);
1932 self
1933 }
1934
1935 #[must_use]
1937 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
1938 self.custom_data = Some(value);
1939 self
1940 }
1941}
1942
1943impl Validate for ChargingSchedule {
1944 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
1945 path.push_key("chargingRateUnit");
1946 Validate::validate_at(&self.charging_rate_unit, path, out);
1947 path.pop();
1948 path.push_key("chargingSchedulePeriod");
1949 validate::list_len(
1950 self.charging_schedule_period.len(),
1951 Some(1),
1952 Some(1024),
1953 path,
1954 out,
1955 );
1956 for (index, item) in self.charging_schedule_period.iter().enumerate() {
1957 path.push_index(index);
1958 Validate::validate_at(item, path, out);
1959 path.pop();
1960 }
1961 path.pop();
1962 path.push_key("limitAtSoC");
1963 if let Some(value) = &self.limit_at_so_c {
1964 Validate::validate_at(value, path, out);
1965 }
1966 path.pop();
1967 path.push_key("signatureId");
1968 if let Some(value) = &self.signature_id {
1969 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
1970 }
1971 path.pop();
1972 path.push_key("digestValue");
1973 if let Some(value) = &self.digest_value {
1974 validate::string(value.as_str(), None, Some(88), path, out);
1975 }
1976 path.pop();
1977 path.push_key("randomizedDelay");
1978 if let Some(value) = &self.randomized_delay {
1979 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
1980 }
1981 path.pop();
1982 path.push_key("salesTariff");
1983 if let Some(value) = &self.sales_tariff {
1984 Validate::validate_at(value, path, out);
1985 }
1986 path.pop();
1987 path.push_key("absolutePriceSchedule");
1988 if let Some(value) = &self.absolute_price_schedule {
1989 Validate::validate_at(value, path, out);
1990 }
1991 path.pop();
1992 path.push_key("priceLevelSchedule");
1993 if let Some(value) = &self.price_level_schedule {
1994 Validate::validate_at(value, path, out);
1995 }
1996 path.pop();
1997 path.push_key("customData");
1998 if let Some(value) = &self.custom_data {
1999 Validate::validate_at(value, path, out);
2000 }
2001 path.pop();
2002 }
2003}
2004
2005#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2009pub struct ChargingSchedulePeriod {
2010 #[serde(rename = "startPeriod")]
2012 pub start_period: i32,
2013 #[serde(default, skip_serializing_if = "Option::is_none")]
2018 pub limit: Option<crate::types::Decimal>,
2019 #[serde(rename = "limit_L2")]
2021 #[serde(default, skip_serializing_if = "Option::is_none")]
2022 pub limit_l2: Option<crate::types::Decimal>,
2023 #[serde(rename = "limit_L3")]
2025 #[serde(default, skip_serializing_if = "Option::is_none")]
2026 pub limit_l3: Option<crate::types::Decimal>,
2027 #[serde(rename = "numberPhases")]
2031 #[serde(default, skip_serializing_if = "Option::is_none")]
2032 pub number_phases: Option<i32>,
2033 #[serde(rename = "phaseToUse")]
2035 #[serde(default, skip_serializing_if = "Option::is_none")]
2036 pub phase_to_use: Option<i32>,
2037 #[serde(rename = "dischargeLimit")]
2040 #[serde(default, skip_serializing_if = "Option::is_none")]
2041 pub discharge_limit: Option<crate::types::Decimal>,
2042 #[serde(rename = "dischargeLimit_L2")]
2044 #[serde(default, skip_serializing_if = "Option::is_none")]
2045 pub discharge_limit_l2: Option<crate::types::Decimal>,
2046 #[serde(rename = "dischargeLimit_L3")]
2048 #[serde(default, skip_serializing_if = "Option::is_none")]
2049 pub discharge_limit_l3: Option<crate::types::Decimal>,
2050 #[serde(default, skip_serializing_if = "Option::is_none")]
2054 pub setpoint: Option<crate::types::Decimal>,
2055 #[serde(rename = "setpoint_L2")]
2057 #[serde(default, skip_serializing_if = "Option::is_none")]
2058 pub setpoint_l2: Option<crate::types::Decimal>,
2059 #[serde(rename = "setpoint_L3")]
2061 #[serde(default, skip_serializing_if = "Option::is_none")]
2062 pub setpoint_l3: Option<crate::types::Decimal>,
2063 #[serde(rename = "setpointReactive")]
2066 #[serde(default, skip_serializing_if = "Option::is_none")]
2067 pub setpoint_reactive: Option<crate::types::Decimal>,
2068 #[serde(rename = "setpointReactive_L2")]
2070 #[serde(default, skip_serializing_if = "Option::is_none")]
2071 pub setpoint_reactive_l2: Option<crate::types::Decimal>,
2072 #[serde(rename = "setpointReactive_L3")]
2074 #[serde(default, skip_serializing_if = "Option::is_none")]
2075 pub setpoint_reactive_l3: Option<crate::types::Decimal>,
2076 #[serde(rename = "preconditioningRequest")]
2078 #[serde(default, skip_serializing_if = "Option::is_none")]
2079 pub preconditioning_request: Option<bool>,
2080 #[serde(rename = "evseSleep")]
2082 #[serde(default, skip_serializing_if = "Option::is_none")]
2083 pub evse_sleep: Option<bool>,
2084 #[serde(rename = "v2xBaseline")]
2086 #[serde(default, skip_serializing_if = "Option::is_none")]
2087 pub v2x_baseline: Option<crate::types::Decimal>,
2088 #[serde(rename = "operationMode")]
2090 #[serde(default, skip_serializing_if = "Option::is_none")]
2091 pub operation_mode: Option<OperationMode>,
2092 #[serde(rename = "v2xFreqWattCurve")]
2094 #[serde(default, skip_serializing_if = "Option::is_none")]
2095 pub v2x_freq_watt_curve: Option<Vec<V2XFreqWattPoint>>,
2096 #[serde(rename = "v2xSignalWattCurve")]
2098 #[serde(default, skip_serializing_if = "Option::is_none")]
2099 pub v2x_signal_watt_curve: Option<Vec<V2XSignalWattPoint>>,
2100 #[serde(rename = "customData")]
2102 #[serde(default, skip_serializing_if = "Option::is_none")]
2103 pub custom_data: Option<crate::types::CustomData>,
2104}
2105
2106impl ChargingSchedulePeriod {
2107 #[must_use]
2109 pub fn new(start_period: i32) -> Self {
2110 Self {
2111 start_period,
2112 limit: None,
2113 limit_l2: None,
2114 limit_l3: None,
2115 number_phases: None,
2116 phase_to_use: None,
2117 discharge_limit: None,
2118 discharge_limit_l2: None,
2119 discharge_limit_l3: None,
2120 setpoint: None,
2121 setpoint_l2: None,
2122 setpoint_l3: None,
2123 setpoint_reactive: None,
2124 setpoint_reactive_l2: None,
2125 setpoint_reactive_l3: None,
2126 preconditioning_request: None,
2127 evse_sleep: None,
2128 v2x_baseline: None,
2129 operation_mode: None,
2130 v2x_freq_watt_curve: None,
2131 v2x_signal_watt_curve: None,
2132 custom_data: None,
2133 }
2134 }
2135
2136 #[must_use]
2138 pub fn with_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2139 self.limit = Some(value.into());
2140 self
2141 }
2142
2143 #[must_use]
2145 pub fn with_limit_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2146 self.limit_l2 = Some(value.into());
2147 self
2148 }
2149
2150 #[must_use]
2152 pub fn with_limit_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2153 self.limit_l3 = Some(value.into());
2154 self
2155 }
2156
2157 #[must_use]
2159 pub fn with_number_phases(mut self, value: i32) -> Self {
2160 self.number_phases = Some(value);
2161 self
2162 }
2163
2164 #[must_use]
2166 pub fn with_phase_to_use(mut self, value: i32) -> Self {
2167 self.phase_to_use = Some(value);
2168 self
2169 }
2170
2171 #[must_use]
2173 pub fn with_discharge_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2174 self.discharge_limit = Some(value.into());
2175 self
2176 }
2177
2178 #[must_use]
2180 pub fn with_discharge_limit_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2181 self.discharge_limit_l2 = Some(value.into());
2182 self
2183 }
2184
2185 #[must_use]
2187 pub fn with_discharge_limit_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2188 self.discharge_limit_l3 = Some(value.into());
2189 self
2190 }
2191
2192 #[must_use]
2194 pub fn with_setpoint(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2195 self.setpoint = Some(value.into());
2196 self
2197 }
2198
2199 #[must_use]
2201 pub fn with_setpoint_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2202 self.setpoint_l2 = Some(value.into());
2203 self
2204 }
2205
2206 #[must_use]
2208 pub fn with_setpoint_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2209 self.setpoint_l3 = Some(value.into());
2210 self
2211 }
2212
2213 #[must_use]
2215 pub fn with_setpoint_reactive(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2216 self.setpoint_reactive = Some(value.into());
2217 self
2218 }
2219
2220 #[must_use]
2222 pub fn with_setpoint_reactive_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2223 self.setpoint_reactive_l2 = Some(value.into());
2224 self
2225 }
2226
2227 #[must_use]
2229 pub fn with_setpoint_reactive_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2230 self.setpoint_reactive_l3 = Some(value.into());
2231 self
2232 }
2233
2234 #[must_use]
2236 pub fn with_preconditioning_request(mut self, value: bool) -> Self {
2237 self.preconditioning_request = Some(value);
2238 self
2239 }
2240
2241 #[must_use]
2243 pub fn with_evse_sleep(mut self, value: bool) -> Self {
2244 self.evse_sleep = Some(value);
2245 self
2246 }
2247
2248 #[must_use]
2250 pub fn with_v2x_baseline(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2251 self.v2x_baseline = Some(value.into());
2252 self
2253 }
2254
2255 #[must_use]
2257 pub fn with_operation_mode(mut self, value: OperationMode) -> Self {
2258 self.operation_mode = Some(value);
2259 self
2260 }
2261
2262 #[must_use]
2264 pub fn with_v2x_freq_watt_curve(mut self, value: Vec<V2XFreqWattPoint>) -> Self {
2265 self.v2x_freq_watt_curve = Some(value);
2266 self
2267 }
2268
2269 #[must_use]
2271 pub fn with_v2x_signal_watt_curve(mut self, value: Vec<V2XSignalWattPoint>) -> Self {
2272 self.v2x_signal_watt_curve = Some(value);
2273 self
2274 }
2275
2276 #[must_use]
2278 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2279 self.custom_data = Some(value);
2280 self
2281 }
2282}
2283
2284impl Validate for ChargingSchedulePeriod {
2285 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2286 path.push_key("numberPhases");
2287 if let Some(value) = &self.number_phases {
2288 validate::int_range(i64::from(*value), Some(0.0), Some(3.0), path, out);
2289 }
2290 path.pop();
2291 path.push_key("phaseToUse");
2292 if let Some(value) = &self.phase_to_use {
2293 validate::int_range(i64::from(*value), Some(0.0), Some(3.0), path, out);
2294 }
2295 path.pop();
2296 path.push_key("dischargeLimit");
2297 if let Some(value) = &self.discharge_limit {
2298 validate::range(value.get(), None, Some(0.0), path, out);
2299 }
2300 path.pop();
2301 path.push_key("dischargeLimit_L2");
2302 if let Some(value) = &self.discharge_limit_l2 {
2303 validate::range(value.get(), None, Some(0.0), path, out);
2304 }
2305 path.pop();
2306 path.push_key("dischargeLimit_L3");
2307 if let Some(value) = &self.discharge_limit_l3 {
2308 validate::range(value.get(), None, Some(0.0), path, out);
2309 }
2310 path.pop();
2311 path.push_key("operationMode");
2312 if let Some(value) = &self.operation_mode {
2313 Validate::validate_at(value, path, out);
2314 }
2315 path.pop();
2316 path.push_key("v2xFreqWattCurve");
2317 if let Some(value) = &self.v2x_freq_watt_curve {
2318 validate::list_len(value.len(), Some(1), Some(20), path, out);
2319 for (index, item) in value.iter().enumerate() {
2320 path.push_index(index);
2321 Validate::validate_at(item, path, out);
2322 path.pop();
2323 }
2324 }
2325 path.pop();
2326 path.push_key("v2xSignalWattCurve");
2327 if let Some(value) = &self.v2x_signal_watt_curve {
2328 validate::list_len(value.len(), Some(1), Some(20), path, out);
2329 for (index, item) in value.iter().enumerate() {
2330 path.push_index(index);
2331 Validate::validate_at(item, path, out);
2332 path.pop();
2333 }
2334 }
2335 path.pop();
2336 path.push_key("customData");
2337 if let Some(value) = &self.custom_data {
2338 Validate::validate_at(value, path, out);
2339 }
2340 path.pop();
2341 }
2342}
2343
2344#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2348pub struct ChargingScheduleUpdate {
2349 #[serde(default, skip_serializing_if = "Option::is_none")]
2354 pub limit: Option<crate::types::Decimal>,
2355 #[serde(rename = "limit_L2")]
2357 #[serde(default, skip_serializing_if = "Option::is_none")]
2358 pub limit_l2: Option<crate::types::Decimal>,
2359 #[serde(rename = "limit_L3")]
2361 #[serde(default, skip_serializing_if = "Option::is_none")]
2362 pub limit_l3: Option<crate::types::Decimal>,
2363 #[serde(rename = "dischargeLimit")]
2366 #[serde(default, skip_serializing_if = "Option::is_none")]
2367 pub discharge_limit: Option<crate::types::Decimal>,
2368 #[serde(rename = "dischargeLimit_L2")]
2370 #[serde(default, skip_serializing_if = "Option::is_none")]
2371 pub discharge_limit_l2: Option<crate::types::Decimal>,
2372 #[serde(rename = "dischargeLimit_L3")]
2374 #[serde(default, skip_serializing_if = "Option::is_none")]
2375 pub discharge_limit_l3: Option<crate::types::Decimal>,
2376 #[serde(default, skip_serializing_if = "Option::is_none")]
2380 pub setpoint: Option<crate::types::Decimal>,
2381 #[serde(rename = "setpoint_L2")]
2383 #[serde(default, skip_serializing_if = "Option::is_none")]
2384 pub setpoint_l2: Option<crate::types::Decimal>,
2385 #[serde(rename = "setpoint_L3")]
2387 #[serde(default, skip_serializing_if = "Option::is_none")]
2388 pub setpoint_l3: Option<crate::types::Decimal>,
2389 #[serde(rename = "setpointReactive")]
2392 #[serde(default, skip_serializing_if = "Option::is_none")]
2393 pub setpoint_reactive: Option<crate::types::Decimal>,
2394 #[serde(rename = "setpointReactive_L2")]
2396 #[serde(default, skip_serializing_if = "Option::is_none")]
2397 pub setpoint_reactive_l2: Option<crate::types::Decimal>,
2398 #[serde(rename = "setpointReactive_L3")]
2400 #[serde(default, skip_serializing_if = "Option::is_none")]
2401 pub setpoint_reactive_l3: Option<crate::types::Decimal>,
2402 #[serde(rename = "customData")]
2404 #[serde(default, skip_serializing_if = "Option::is_none")]
2405 pub custom_data: Option<crate::types::CustomData>,
2406}
2407
2408impl ChargingScheduleUpdate {
2409 #[must_use]
2411 pub fn new() -> Self {
2412 Self::default()
2413 }
2414
2415 #[must_use]
2417 pub fn with_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2418 self.limit = Some(value.into());
2419 self
2420 }
2421
2422 #[must_use]
2424 pub fn with_limit_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2425 self.limit_l2 = Some(value.into());
2426 self
2427 }
2428
2429 #[must_use]
2431 pub fn with_limit_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2432 self.limit_l3 = Some(value.into());
2433 self
2434 }
2435
2436 #[must_use]
2438 pub fn with_discharge_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2439 self.discharge_limit = Some(value.into());
2440 self
2441 }
2442
2443 #[must_use]
2445 pub fn with_discharge_limit_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2446 self.discharge_limit_l2 = Some(value.into());
2447 self
2448 }
2449
2450 #[must_use]
2452 pub fn with_discharge_limit_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2453 self.discharge_limit_l3 = Some(value.into());
2454 self
2455 }
2456
2457 #[must_use]
2459 pub fn with_setpoint(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2460 self.setpoint = Some(value.into());
2461 self
2462 }
2463
2464 #[must_use]
2466 pub fn with_setpoint_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2467 self.setpoint_l2 = Some(value.into());
2468 self
2469 }
2470
2471 #[must_use]
2473 pub fn with_setpoint_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2474 self.setpoint_l3 = Some(value.into());
2475 self
2476 }
2477
2478 #[must_use]
2480 pub fn with_setpoint_reactive(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2481 self.setpoint_reactive = Some(value.into());
2482 self
2483 }
2484
2485 #[must_use]
2487 pub fn with_setpoint_reactive_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2488 self.setpoint_reactive_l2 = Some(value.into());
2489 self
2490 }
2491
2492 #[must_use]
2494 pub fn with_setpoint_reactive_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
2495 self.setpoint_reactive_l3 = Some(value.into());
2496 self
2497 }
2498
2499 #[must_use]
2501 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2502 self.custom_data = Some(value);
2503 self
2504 }
2505}
2506
2507impl Validate for ChargingScheduleUpdate {
2508 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2509 path.push_key("dischargeLimit");
2510 if let Some(value) = &self.discharge_limit {
2511 validate::range(value.get(), None, Some(0.0), path, out);
2512 }
2513 path.pop();
2514 path.push_key("dischargeLimit_L2");
2515 if let Some(value) = &self.discharge_limit_l2 {
2516 validate::range(value.get(), None, Some(0.0), path, out);
2517 }
2518 path.pop();
2519 path.push_key("dischargeLimit_L3");
2520 if let Some(value) = &self.discharge_limit_l3 {
2521 validate::range(value.get(), None, Some(0.0), path, out);
2522 }
2523 path.pop();
2524 path.push_key("customData");
2525 if let Some(value) = &self.custom_data {
2526 Validate::validate_at(value, path, out);
2527 }
2528 path.pop();
2529 }
2530}
2531
2532#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2536pub struct ChargingStation {
2537 pub model: String,
2539 #[serde(rename = "vendorName")]
2541 pub vendor_name: String,
2542 #[serde(rename = "serialNumber")]
2544 #[serde(default, skip_serializing_if = "Option::is_none")]
2545 pub serial_number: Option<String>,
2546 #[serde(default, skip_serializing_if = "Option::is_none")]
2548 pub modem: Option<Modem>,
2549 #[serde(rename = "firmwareVersion")]
2551 #[serde(default, skip_serializing_if = "Option::is_none")]
2552 pub firmware_version: Option<String>,
2553 #[serde(rename = "customData")]
2555 #[serde(default, skip_serializing_if = "Option::is_none")]
2556 pub custom_data: Option<crate::types::CustomData>,
2557}
2558
2559impl ChargingStation {
2560 #[must_use]
2562 pub fn new(model: impl Into<String>, vendor_name: impl Into<String>) -> Self {
2563 Self {
2564 model: model.into(),
2565 vendor_name: vendor_name.into(),
2566 serial_number: None,
2567 modem: None,
2568 firmware_version: None,
2569 custom_data: None,
2570 }
2571 }
2572
2573 #[must_use]
2575 pub fn with_serial_number(mut self, value: impl Into<String>) -> Self {
2576 self.serial_number = Some(value.into());
2577 self
2578 }
2579
2580 #[must_use]
2582 pub fn with_modem(mut self, value: Modem) -> Self {
2583 self.modem = Some(value);
2584 self
2585 }
2586
2587 #[must_use]
2589 pub fn with_firmware_version(mut self, value: impl Into<String>) -> Self {
2590 self.firmware_version = Some(value.into());
2591 self
2592 }
2593
2594 #[must_use]
2596 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2597 self.custom_data = Some(value);
2598 self
2599 }
2600}
2601
2602impl Validate for ChargingStation {
2603 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2604 path.push_key("model");
2605 validate::string(self.model.as_str(), None, Some(20), path, out);
2606 path.pop();
2607 path.push_key("vendorName");
2608 validate::string(self.vendor_name.as_str(), None, Some(50), path, out);
2609 path.pop();
2610 path.push_key("serialNumber");
2611 if let Some(value) = &self.serial_number {
2612 validate::string(value.as_str(), None, Some(25), path, out);
2613 }
2614 path.pop();
2615 path.push_key("modem");
2616 if let Some(value) = &self.modem {
2617 Validate::validate_at(value, path, out);
2618 }
2619 path.pop();
2620 path.push_key("firmwareVersion");
2621 if let Some(value) = &self.firmware_version {
2622 validate::string(value.as_str(), None, Some(50), path, out);
2623 }
2624 path.pop();
2625 path.push_key("customData");
2626 if let Some(value) = &self.custom_data {
2627 Validate::validate_at(value, path, out);
2628 }
2629 path.pop();
2630 }
2631}
2632
2633#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
2637pub struct ClearChargingProfile {
2638 #[serde(rename = "evseId")]
2640 #[serde(default, skip_serializing_if = "Option::is_none")]
2641 pub evse_id: Option<i32>,
2642 #[serde(rename = "chargingProfilePurpose")]
2644 #[serde(default, skip_serializing_if = "Option::is_none")]
2645 pub charging_profile_purpose: Option<ChargingProfilePurpose>,
2646 #[serde(rename = "stackLevel")]
2648 #[serde(default, skip_serializing_if = "Option::is_none")]
2649 pub stack_level: Option<i32>,
2650 #[serde(rename = "customData")]
2652 #[serde(default, skip_serializing_if = "Option::is_none")]
2653 pub custom_data: Option<crate::types::CustomData>,
2654}
2655
2656impl ClearChargingProfile {
2657 #[must_use]
2659 pub fn new() -> Self {
2660 Self::default()
2661 }
2662
2663 #[must_use]
2665 pub fn with_evse_id(mut self, value: i32) -> Self {
2666 self.evse_id = Some(value);
2667 self
2668 }
2669
2670 #[must_use]
2672 pub fn with_charging_profile_purpose(mut self, value: ChargingProfilePurpose) -> Self {
2673 self.charging_profile_purpose = Some(value);
2674 self
2675 }
2676
2677 #[must_use]
2679 pub fn with_stack_level(mut self, value: i32) -> Self {
2680 self.stack_level = Some(value);
2681 self
2682 }
2683
2684 #[must_use]
2686 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2687 self.custom_data = Some(value);
2688 self
2689 }
2690}
2691
2692impl Validate for ClearChargingProfile {
2693 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2694 path.push_key("evseId");
2695 if let Some(value) = &self.evse_id {
2696 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
2697 }
2698 path.pop();
2699 path.push_key("chargingProfilePurpose");
2700 if let Some(value) = &self.charging_profile_purpose {
2701 Validate::validate_at(value, path, out);
2702 }
2703 path.pop();
2704 path.push_key("stackLevel");
2705 if let Some(value) = &self.stack_level {
2706 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
2707 }
2708 path.pop();
2709 path.push_key("customData");
2710 if let Some(value) = &self.custom_data {
2711 Validate::validate_at(value, path, out);
2712 }
2713 path.pop();
2714 }
2715}
2716
2717#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2719pub struct ClearMonitoringResult {
2720 pub status: ClearMonitoringStatus,
2722 pub id: i32,
2724 #[serde(rename = "statusInfo")]
2726 #[serde(default, skip_serializing_if = "Option::is_none")]
2727 pub status_info: Option<StatusInfo>,
2728 #[serde(rename = "customData")]
2730 #[serde(default, skip_serializing_if = "Option::is_none")]
2731 pub custom_data: Option<crate::types::CustomData>,
2732}
2733
2734impl ClearMonitoringResult {
2735 #[must_use]
2737 pub fn new(status: ClearMonitoringStatus, id: i32) -> Self {
2738 Self {
2739 status,
2740 id,
2741 status_info: None,
2742 custom_data: None,
2743 }
2744 }
2745
2746 #[must_use]
2748 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2749 self.status_info = Some(value);
2750 self
2751 }
2752
2753 #[must_use]
2755 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2756 self.custom_data = Some(value);
2757 self
2758 }
2759}
2760
2761impl Validate for ClearMonitoringResult {
2762 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2763 path.push_key("status");
2764 Validate::validate_at(&self.status, path, out);
2765 path.pop();
2766 path.push_key("id");
2767 validate::int_range(i64::from(self.id), Some(0.0), None, path, out);
2768 path.pop();
2769 path.push_key("statusInfo");
2770 if let Some(value) = &self.status_info {
2771 Validate::validate_at(value, path, out);
2772 }
2773 path.pop();
2774 path.push_key("customData");
2775 if let Some(value) = &self.custom_data {
2776 Validate::validate_at(value, path, out);
2777 }
2778 path.pop();
2779 }
2780}
2781
2782#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2784pub struct ClearTariffsResult {
2785 pub status: TariffClearStatus,
2787 #[serde(rename = "statusInfo")]
2789 #[serde(default, skip_serializing_if = "Option::is_none")]
2790 pub status_info: Option<StatusInfo>,
2791 #[serde(rename = "tariffId")]
2793 #[serde(default, skip_serializing_if = "Option::is_none")]
2794 pub tariff_id: Option<String>,
2795 #[serde(rename = "customData")]
2797 #[serde(default, skip_serializing_if = "Option::is_none")]
2798 pub custom_data: Option<crate::types::CustomData>,
2799}
2800
2801impl ClearTariffsResult {
2802 #[must_use]
2804 pub fn new(status: TariffClearStatus) -> Self {
2805 Self {
2806 status,
2807 status_info: None,
2808 tariff_id: None,
2809 custom_data: None,
2810 }
2811 }
2812
2813 #[must_use]
2815 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
2816 self.status_info = Some(value);
2817 self
2818 }
2819
2820 #[must_use]
2822 pub fn with_tariff_id(mut self, value: impl Into<String>) -> Self {
2823 self.tariff_id = Some(value.into());
2824 self
2825 }
2826
2827 #[must_use]
2829 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2830 self.custom_data = Some(value);
2831 self
2832 }
2833}
2834
2835impl Validate for ClearTariffsResult {
2836 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2837 path.push_key("status");
2838 Validate::validate_at(&self.status, path, out);
2839 path.pop();
2840 path.push_key("statusInfo");
2841 if let Some(value) = &self.status_info {
2842 Validate::validate_at(value, path, out);
2843 }
2844 path.pop();
2845 path.push_key("tariffId");
2846 if let Some(value) = &self.tariff_id {
2847 validate::string(value.as_str(), None, Some(60), path, out);
2848 }
2849 path.pop();
2850 path.push_key("customData");
2851 if let Some(value) = &self.custom_data {
2852 Validate::validate_at(value, path, out);
2853 }
2854 path.pop();
2855 }
2856}
2857
2858#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2862pub struct Component {
2863 pub name: String,
2865 #[serde(default, skip_serializing_if = "Option::is_none")]
2867 pub evse: Option<EVSE>,
2868 #[serde(default, skip_serializing_if = "Option::is_none")]
2870 pub instance: Option<String>,
2871 #[serde(rename = "customData")]
2873 #[serde(default, skip_serializing_if = "Option::is_none")]
2874 pub custom_data: Option<crate::types::CustomData>,
2875}
2876
2877impl Component {
2878 #[must_use]
2880 pub fn new(name: impl Into<String>) -> Self {
2881 Self {
2882 name: name.into(),
2883 evse: None,
2884 instance: None,
2885 custom_data: None,
2886 }
2887 }
2888
2889 #[must_use]
2891 pub fn with_evse(mut self, value: EVSE) -> Self {
2892 self.evse = Some(value);
2893 self
2894 }
2895
2896 #[must_use]
2898 pub fn with_instance(mut self, value: impl Into<String>) -> Self {
2899 self.instance = Some(value.into());
2900 self
2901 }
2902
2903 #[must_use]
2905 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2906 self.custom_data = Some(value);
2907 self
2908 }
2909}
2910
2911impl Validate for Component {
2912 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2913 path.push_key("name");
2914 validate::string(self.name.as_str(), None, Some(50), path, out);
2915 path.pop();
2916 path.push_key("evse");
2917 if let Some(value) = &self.evse {
2918 Validate::validate_at(value, path, out);
2919 }
2920 path.pop();
2921 path.push_key("instance");
2922 if let Some(value) = &self.instance {
2923 validate::string(value.as_str(), None, Some(50), path, out);
2924 }
2925 path.pop();
2926 path.push_key("customData");
2927 if let Some(value) = &self.custom_data {
2928 Validate::validate_at(value, path, out);
2929 }
2930 path.pop();
2931 }
2932}
2933
2934#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2938pub struct ComponentVariable {
2939 pub component: Component,
2941 #[serde(default, skip_serializing_if = "Option::is_none")]
2943 pub variable: Option<Variable>,
2944 #[serde(rename = "customData")]
2946 #[serde(default, skip_serializing_if = "Option::is_none")]
2947 pub custom_data: Option<crate::types::CustomData>,
2948}
2949
2950impl ComponentVariable {
2951 #[must_use]
2953 pub fn new(component: Component) -> Self {
2954 Self {
2955 component,
2956 variable: None,
2957 custom_data: None,
2958 }
2959 }
2960
2961 #[must_use]
2963 pub fn with_variable(mut self, value: Variable) -> Self {
2964 self.variable = Some(value);
2965 self
2966 }
2967
2968 #[must_use]
2970 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
2971 self.custom_data = Some(value);
2972 self
2973 }
2974}
2975
2976impl Validate for ComponentVariable {
2977 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
2978 path.push_key("component");
2979 Validate::validate_at(&self.component, path, out);
2980 path.pop();
2981 path.push_key("variable");
2982 if let Some(value) = &self.variable {
2983 Validate::validate_at(value, path, out);
2984 }
2985 path.pop();
2986 path.push_key("customData");
2987 if let Some(value) = &self.custom_data {
2988 Validate::validate_at(value, path, out);
2989 }
2990 path.pop();
2991 }
2992}
2993
2994#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2996pub struct CompositeSchedule {
2997 #[serde(rename = "evseId")]
2999 pub evse_id: i32,
3000 pub duration: i32,
3002 #[serde(rename = "scheduleStart")]
3004 pub schedule_start: crate::types::DateTime,
3005 #[serde(rename = "chargingRateUnit")]
3007 pub charging_rate_unit: ChargingRateUnit,
3008 #[serde(rename = "chargingSchedulePeriod")]
3010 pub charging_schedule_period: Vec<ChargingSchedulePeriod>,
3011 #[serde(rename = "customData")]
3013 #[serde(default, skip_serializing_if = "Option::is_none")]
3014 pub custom_data: Option<crate::types::CustomData>,
3015}
3016
3017impl CompositeSchedule {
3018 #[must_use]
3020 pub fn new(
3021 evse_id: i32,
3022 duration: i32,
3023 schedule_start: impl Into<crate::types::DateTime>,
3024 charging_rate_unit: ChargingRateUnit,
3025 charging_schedule_period: Vec<ChargingSchedulePeriod>,
3026 ) -> Self {
3027 Self {
3028 evse_id,
3029 duration,
3030 schedule_start: schedule_start.into(),
3031 charging_rate_unit,
3032 charging_schedule_period,
3033 custom_data: None,
3034 }
3035 }
3036
3037 #[must_use]
3039 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3040 self.custom_data = Some(value);
3041 self
3042 }
3043}
3044
3045impl Validate for CompositeSchedule {
3046 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3047 path.push_key("evseId");
3048 validate::int_range(i64::from(self.evse_id), Some(0.0), None, path, out);
3049 path.pop();
3050 path.push_key("chargingRateUnit");
3051 Validate::validate_at(&self.charging_rate_unit, path, out);
3052 path.pop();
3053 path.push_key("chargingSchedulePeriod");
3054 validate::list_len(
3055 self.charging_schedule_period.len(),
3056 Some(1),
3057 None,
3058 path,
3059 out,
3060 );
3061 for (index, item) in self.charging_schedule_period.iter().enumerate() {
3062 path.push_index(index);
3063 Validate::validate_at(item, path, out);
3064 path.pop();
3065 }
3066 path.pop();
3067 path.push_key("customData");
3068 if let Some(value) = &self.custom_data {
3069 Validate::validate_at(value, path, out);
3070 }
3071 path.pop();
3072 }
3073}
3074
3075#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3077pub struct ConstantStreamData {
3078 pub id: i32,
3080 pub params: PeriodicEventStreamParams,
3082 #[serde(rename = "variableMonitoringId")]
3084 pub variable_monitoring_id: i32,
3085 #[serde(rename = "customData")]
3087 #[serde(default, skip_serializing_if = "Option::is_none")]
3088 pub custom_data: Option<crate::types::CustomData>,
3089}
3090
3091impl ConstantStreamData {
3092 #[must_use]
3094 pub fn new(id: i32, params: PeriodicEventStreamParams, variable_monitoring_id: i32) -> Self {
3095 Self {
3096 id,
3097 params,
3098 variable_monitoring_id,
3099 custom_data: None,
3100 }
3101 }
3102
3103 #[must_use]
3105 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3106 self.custom_data = Some(value);
3107 self
3108 }
3109}
3110
3111impl Validate for ConstantStreamData {
3112 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3113 path.push_key("id");
3114 validate::int_range(i64::from(self.id), Some(0.0), None, path, out);
3115 path.pop();
3116 path.push_key("params");
3117 Validate::validate_at(&self.params, path, out);
3118 path.pop();
3119 path.push_key("variableMonitoringId");
3120 validate::int_range(
3121 i64::from(self.variable_monitoring_id),
3122 Some(0.0),
3123 None,
3124 path,
3125 out,
3126 );
3127 path.pop();
3128 path.push_key("customData");
3129 if let Some(value) = &self.custom_data {
3130 Validate::validate_at(value, path, out);
3131 }
3132 path.pop();
3133 }
3134}
3135
3136#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3138pub struct ConsumptionCost {
3139 #[serde(rename = "startValue")]
3141 pub start_value: crate::types::Decimal,
3142 pub cost: Vec<Cost>,
3144 #[serde(rename = "customData")]
3146 #[serde(default, skip_serializing_if = "Option::is_none")]
3147 pub custom_data: Option<crate::types::CustomData>,
3148}
3149
3150impl ConsumptionCost {
3151 #[must_use]
3153 pub fn new(start_value: impl Into<crate::types::Decimal>, cost: Vec<Cost>) -> Self {
3154 Self {
3155 start_value: start_value.into(),
3156 cost,
3157 custom_data: None,
3158 }
3159 }
3160
3161 #[must_use]
3163 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3164 self.custom_data = Some(value);
3165 self
3166 }
3167}
3168
3169impl Validate for ConsumptionCost {
3170 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3171 path.push_key("cost");
3172 validate::list_len(self.cost.len(), Some(1), Some(3), path, out);
3173 for (index, item) in self.cost.iter().enumerate() {
3174 path.push_index(index);
3175 Validate::validate_at(item, path, out);
3176 path.pop();
3177 }
3178 path.pop();
3179 path.push_key("customData");
3180 if let Some(value) = &self.custom_data {
3181 Validate::validate_at(value, path, out);
3182 }
3183 path.pop();
3184 }
3185}
3186
3187#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3189pub struct Cost {
3190 #[serde(rename = "costKind")]
3192 pub cost_kind: CostKind,
3193 pub amount: i32,
3195 #[serde(rename = "amountMultiplier")]
3197 #[serde(default, skip_serializing_if = "Option::is_none")]
3198 pub amount_multiplier: Option<i32>,
3199 #[serde(rename = "customData")]
3201 #[serde(default, skip_serializing_if = "Option::is_none")]
3202 pub custom_data: Option<crate::types::CustomData>,
3203}
3204
3205impl Cost {
3206 #[must_use]
3208 pub fn new(cost_kind: CostKind, amount: i32) -> Self {
3209 Self {
3210 cost_kind,
3211 amount,
3212 amount_multiplier: None,
3213 custom_data: None,
3214 }
3215 }
3216
3217 #[must_use]
3219 pub fn with_amount_multiplier(mut self, value: i32) -> Self {
3220 self.amount_multiplier = Some(value);
3221 self
3222 }
3223
3224 #[must_use]
3226 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3227 self.custom_data = Some(value);
3228 self
3229 }
3230}
3231
3232impl Validate for Cost {
3233 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3234 path.push_key("costKind");
3235 Validate::validate_at(&self.cost_kind, path, out);
3236 path.pop();
3237 path.push_key("customData");
3238 if let Some(value) = &self.custom_data {
3239 Validate::validate_at(value, path, out);
3240 }
3241 path.pop();
3242 }
3243}
3244
3245#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3251pub struct CostDetails {
3252 #[serde(rename = "totalCost")]
3254 pub total_cost: TotalCost,
3255 #[serde(rename = "totalUsage")]
3257 pub total_usage: TotalUsage,
3258 #[serde(rename = "chargingPeriods")]
3260 #[serde(default, skip_serializing_if = "Option::is_none")]
3261 pub charging_periods: Option<Vec<ChargingPeriod>>,
3262 #[serde(rename = "failureToCalculate")]
3264 #[serde(default, skip_serializing_if = "Option::is_none")]
3265 pub failure_to_calculate: Option<bool>,
3266 #[serde(rename = "failureReason")]
3268 #[serde(default, skip_serializing_if = "Option::is_none")]
3269 pub failure_reason: Option<String>,
3270 #[serde(rename = "customData")]
3272 #[serde(default, skip_serializing_if = "Option::is_none")]
3273 pub custom_data: Option<crate::types::CustomData>,
3274}
3275
3276impl CostDetails {
3277 #[must_use]
3279 pub fn new(total_cost: TotalCost, total_usage: TotalUsage) -> Self {
3280 Self {
3281 total_cost,
3282 total_usage,
3283 charging_periods: None,
3284 failure_to_calculate: None,
3285 failure_reason: None,
3286 custom_data: None,
3287 }
3288 }
3289
3290 #[must_use]
3292 pub fn with_charging_periods(mut self, value: Vec<ChargingPeriod>) -> Self {
3293 self.charging_periods = Some(value);
3294 self
3295 }
3296
3297 #[must_use]
3299 pub fn with_failure_to_calculate(mut self, value: bool) -> Self {
3300 self.failure_to_calculate = Some(value);
3301 self
3302 }
3303
3304 #[must_use]
3306 pub fn with_failure_reason(mut self, value: impl Into<String>) -> Self {
3307 self.failure_reason = Some(value.into());
3308 self
3309 }
3310
3311 #[must_use]
3313 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3314 self.custom_data = Some(value);
3315 self
3316 }
3317}
3318
3319impl Validate for CostDetails {
3320 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3321 path.push_key("totalCost");
3322 Validate::validate_at(&self.total_cost, path, out);
3323 path.pop();
3324 path.push_key("totalUsage");
3325 Validate::validate_at(&self.total_usage, path, out);
3326 path.pop();
3327 path.push_key("chargingPeriods");
3328 if let Some(value) = &self.charging_periods {
3329 validate::list_len(value.len(), Some(1), None, path, out);
3330 for (index, item) in value.iter().enumerate() {
3331 path.push_index(index);
3332 Validate::validate_at(item, path, out);
3333 path.pop();
3334 }
3335 }
3336 path.pop();
3337 path.push_key("failureReason");
3338 if let Some(value) = &self.failure_reason {
3339 validate::string(value.as_str(), None, Some(500), path, out);
3340 }
3341 path.pop();
3342 path.push_key("customData");
3343 if let Some(value) = &self.custom_data {
3344 Validate::validate_at(value, path, out);
3345 }
3346 path.pop();
3347 }
3348}
3349
3350#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3354pub struct CostDimension {
3355 pub r#type: CostDimensionEnum,
3357 pub volume: crate::types::Decimal,
3359 #[serde(rename = "customData")]
3361 #[serde(default, skip_serializing_if = "Option::is_none")]
3362 pub custom_data: Option<crate::types::CustomData>,
3363}
3364
3365impl CostDimension {
3366 #[must_use]
3368 pub fn new(r#type: CostDimensionEnum, volume: impl Into<crate::types::Decimal>) -> Self {
3369 Self {
3370 r#type,
3371 volume: volume.into(),
3372 custom_data: None,
3373 }
3374 }
3375
3376 #[must_use]
3378 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3379 self.custom_data = Some(value);
3380 self
3381 }
3382}
3383
3384impl Validate for CostDimension {
3385 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3386 path.push_key("type");
3387 Validate::validate_at(&self.r#type, path, out);
3388 path.pop();
3389 path.push_key("customData");
3390 if let Some(value) = &self.custom_data {
3391 Validate::validate_at(value, path, out);
3392 }
3393 path.pop();
3394 }
3395}
3396
3397#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3401pub struct DCChargingParameters {
3402 #[serde(rename = "evMaxCurrent")]
3406 pub ev_max_current: crate::types::Decimal,
3407 #[serde(rename = "evMaxVoltage")]
3411 pub ev_max_voltage: crate::types::Decimal,
3412 #[serde(rename = "evMaxPower")]
3416 #[serde(default, skip_serializing_if = "Option::is_none")]
3417 pub ev_max_power: Option<crate::types::Decimal>,
3418 #[serde(rename = "evEnergyCapacity")]
3422 #[serde(default, skip_serializing_if = "Option::is_none")]
3423 pub ev_energy_capacity: Option<crate::types::Decimal>,
3424 #[serde(rename = "energyAmount")]
3428 #[serde(default, skip_serializing_if = "Option::is_none")]
3429 pub energy_amount: Option<crate::types::Decimal>,
3430 #[serde(rename = "stateOfCharge")]
3434 #[serde(default, skip_serializing_if = "Option::is_none")]
3435 pub state_of_charge: Option<i32>,
3436 #[serde(rename = "fullSoC")]
3440 #[serde(default, skip_serializing_if = "Option::is_none")]
3441 pub full_so_c: Option<i32>,
3442 #[serde(rename = "bulkSoC")]
3446 #[serde(default, skip_serializing_if = "Option::is_none")]
3447 pub bulk_so_c: Option<i32>,
3448 #[serde(rename = "customData")]
3450 #[serde(default, skip_serializing_if = "Option::is_none")]
3451 pub custom_data: Option<crate::types::CustomData>,
3452}
3453
3454impl DCChargingParameters {
3455 #[must_use]
3457 pub fn new(
3458 ev_max_current: impl Into<crate::types::Decimal>,
3459 ev_max_voltage: impl Into<crate::types::Decimal>,
3460 ) -> Self {
3461 Self {
3462 ev_max_current: ev_max_current.into(),
3463 ev_max_voltage: ev_max_voltage.into(),
3464 ev_max_power: None,
3465 ev_energy_capacity: None,
3466 energy_amount: None,
3467 state_of_charge: None,
3468 full_so_c: None,
3469 bulk_so_c: None,
3470 custom_data: None,
3471 }
3472 }
3473
3474 #[must_use]
3476 pub fn with_ev_max_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
3477 self.ev_max_power = Some(value.into());
3478 self
3479 }
3480
3481 #[must_use]
3483 pub fn with_ev_energy_capacity(mut self, value: impl Into<crate::types::Decimal>) -> Self {
3484 self.ev_energy_capacity = Some(value.into());
3485 self
3486 }
3487
3488 #[must_use]
3490 pub fn with_energy_amount(mut self, value: impl Into<crate::types::Decimal>) -> Self {
3491 self.energy_amount = Some(value.into());
3492 self
3493 }
3494
3495 #[must_use]
3497 pub fn with_state_of_charge(mut self, value: i32) -> Self {
3498 self.state_of_charge = Some(value);
3499 self
3500 }
3501
3502 #[must_use]
3504 pub fn with_full_so_c(mut self, value: i32) -> Self {
3505 self.full_so_c = Some(value);
3506 self
3507 }
3508
3509 #[must_use]
3511 pub fn with_bulk_so_c(mut self, value: i32) -> Self {
3512 self.bulk_so_c = Some(value);
3513 self
3514 }
3515
3516 #[must_use]
3518 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
3519 self.custom_data = Some(value);
3520 self
3521 }
3522}
3523
3524impl Validate for DCChargingParameters {
3525 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
3526 path.push_key("stateOfCharge");
3527 if let Some(value) = &self.state_of_charge {
3528 validate::int_range(i64::from(*value), Some(0.0), Some(100.0), path, out);
3529 }
3530 path.pop();
3531 path.push_key("fullSoC");
3532 if let Some(value) = &self.full_so_c {
3533 validate::int_range(i64::from(*value), Some(0.0), Some(100.0), path, out);
3534 }
3535 path.pop();
3536 path.push_key("bulkSoC");
3537 if let Some(value) = &self.bulk_so_c {
3538 validate::int_range(i64::from(*value), Some(0.0), Some(100.0), path, out);
3539 }
3540 path.pop();
3541 path.push_key("customData");
3542 if let Some(value) = &self.custom_data {
3543 Validate::validate_at(value, path, out);
3544 }
3545 path.pop();
3546 }
3547}
3548
3549#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
3560pub struct DERChargingParameters {
3561 #[serde(rename = "evSupportedDERControl")]
3564 #[serde(default, skip_serializing_if = "Option::is_none")]
3565 pub ev_supported_der_control: Option<Vec<DERControl>>,
3566 #[serde(rename = "evOverExcitedMaxDischargePower")]
3571 #[serde(default, skip_serializing_if = "Option::is_none")]
3572 pub ev_over_excited_max_discharge_power: Option<crate::types::Decimal>,
3573 #[serde(rename = "evOverExcitedPowerFactor")]
3577 #[serde(default, skip_serializing_if = "Option::is_none")]
3578 pub ev_over_excited_power_factor: Option<crate::types::Decimal>,
3579 #[serde(rename = "evUnderExcitedMaxDischargePower")]
3585 #[serde(default, skip_serializing_if = "Option::is_none")]
3586 pub ev_under_excited_max_discharge_power: Option<crate::types::Decimal>,
3587 #[serde(rename = "evUnderExcitedPowerFactor")]
3591 #[serde(default, skip_serializing_if = "Option::is_none")]
3592 pub ev_under_excited_power_factor: Option<crate::types::Decimal>,
3593 #[serde(rename = "maxApparentPower")]
3597 #[serde(default, skip_serializing_if = "Option::is_none")]
3598 pub max_apparent_power: Option<crate::types::Decimal>,
3599 #[serde(rename = "maxChargeApparentPower")]
3605 #[serde(default, skip_serializing_if = "Option::is_none")]
3606 pub max_charge_apparent_power: Option<crate::types::Decimal>,
3607 #[serde(rename = "maxChargeApparentPower_L2")]
3611 #[serde(default, skip_serializing_if = "Option::is_none")]
3612 pub max_charge_apparent_power_l2: Option<crate::types::Decimal>,
3613 #[serde(rename = "maxChargeApparentPower_L3")]
3617 #[serde(default, skip_serializing_if = "Option::is_none")]
3618 pub max_charge_apparent_power_l3: Option<crate::types::Decimal>,
3619 #[serde(rename = "maxDischargeApparentPower")]
3625 #[serde(default, skip_serializing_if = "Option::is_none")]
3626 pub max_discharge_apparent_power: Option<crate::types::Decimal>,
3627 #[serde(rename = "maxDischargeApparentPower_L2")]
3631 #[serde(default, skip_serializing_if = "Option::is_none")]
3632 pub max_discharge_apparent_power_l2: Option<crate::types::Decimal>,
3633 #[serde(rename = "maxDischargeApparentPower_L3")]
3637 #[serde(default, skip_serializing_if = "Option::is_none")]
3638 pub max_discharge_apparent_power_l3: Option<crate::types::Decimal>,
3639 #[serde(rename = "maxChargeReactivePower")]
3645 #[serde(default, skip_serializing_if = "Option::is_none")]
3646 pub max_charge_reactive_power: Option<crate::types::Decimal>,
3647 #[serde(rename = "maxChargeReactivePower_L2")]
3651 #[serde(default, skip_serializing_if = "Option::is_none")]
3652 pub max_charge_reactive_power_l2: Option<crate::types::Decimal>,
3653 #[serde(rename = "maxChargeReactivePower_L3")]
3657 #[serde(default, skip_serializing_if = "Option::is_none")]
3658 pub max_charge_reactive_power_l3: Option<crate::types::Decimal>,
3659 #[serde(rename = "minChargeReactivePower")]
3664 #[serde(default, skip_serializing_if = "Option::is_none")]
3665 pub min_charge_reactive_power: Option<crate::types::Decimal>,
3666 #[serde(rename = "minChargeReactivePower_L2")]
3669 #[serde(default, skip_serializing_if = "Option::is_none")]
3670 pub min_charge_reactive_power_l2: Option<crate::types::Decimal>,
3671 #[serde(rename = "minChargeReactivePower_L3")]
3674 #[serde(default, skip_serializing_if = "Option::is_none")]
3675 pub min_charge_reactive_power_l3: Option<crate::types::Decimal>,
3676 #[serde(rename = "maxDischargeReactivePower")]
3682 #[serde(default, skip_serializing_if = "Option::is_none")]
3683 pub max_discharge_reactive_power: Option<crate::types::Decimal>,
3684 #[serde(rename = "maxDischargeReactivePower_L2")]
3688 #[serde(default, skip_serializing_if = "Option::is_none")]
3689 pub max_discharge_reactive_power_l2: Option<crate::types::Decimal>,
3690 #[serde(rename = "maxDischargeReactivePower_L3")]
3694 #[serde(default, skip_serializing_if = "Option::is_none")]
3695 pub max_discharge_reactive_power_l3: Option<crate::types::Decimal>,
3696 #[serde(rename = "minDischargeReactivePower")]
3701 #[serde(default, skip_serializing_if = "Option::is_none")]
3702 pub min_discharge_reactive_power: Option<crate::types::Decimal>,
3703 #[serde(rename = "minDischargeReactivePower_L2")]
3706 #[serde(default, skip_serializing_if = "Option::is_none")]
3707 pub min_discharge_reactive_power_l2: Option<crate::types::Decimal>,
3708 #[serde(rename = "minDischargeReactivePower_L3")]
3711 #[serde(default, skip_serializing_if = "Option::is_none")]
3712 pub min_discharge_reactive_power_l3: Option<crate::types::Decimal>,
3713 #[serde(rename = "nominalVoltage")]
3716 #[serde(default, skip_serializing_if = "Option::is_none")]
3717 pub nominal_voltage: Option<crate::types::Decimal>,
3718 #[serde(rename = "nominalVoltageOffset")]
3721 #[serde(default, skip_serializing_if = "Option::is_none")]
3722 pub nominal_voltage_offset: Option<crate::types::Decimal>,
3723 #[serde(rename = "maxNominalVoltage")]
3726 #[serde(default, skip_serializing_if = "Option::is_none")]
3727 pub max_nominal_voltage: Option<crate::types::Decimal>,
3728 #[serde(rename = "minNominalVoltage")]
3731 #[serde(default, skip_serializing_if = "Option::is_none")]
3732 pub min_nominal_voltage: Option<crate::types::Decimal>,
3733 #[serde(rename = "evInverterManufacturer")]
3736 #[serde(default, skip_serializing_if = "Option::is_none")]
3737 pub ev_inverter_manufacturer: Option<String>,
3738 #[serde(rename = "evInverterModel")]
3741 #[serde(default, skip_serializing_if = "Option::is_none")]
3742 pub ev_inverter_model: Option<String>,
3743 #[serde(rename = "evInverterSerialNumber")]
3746 #[serde(default, skip_serializing_if = "Option::is_none")]
3747 pub ev_inverter_serial_number: Option<String>,
3748 #[serde(rename = "evInverterSwVersion")]
3751 #[serde(default, skip_serializing_if = "Option::is_none")]
3752 pub ev_inverter_sw_version: Option<String>,
3753 #[serde(rename = "evInverterHwVersion")]
3756 #[serde(default, skip_serializing_if = "Option::is_none")]
3757 pub ev_inverter_hw_version: Option<String>,
3758 #[serde(rename = "evIslandingDetectionMethod")]
3761 #[serde(default, skip_serializing_if = "Option::is_none")]
3762 pub ev_islanding_detection_method: Option<Vec<IslandingDetection>>,
3763 #[serde(rename = "evIslandingTripTime")]
3766 #[serde(default, skip_serializing_if = "Option::is_none")]
3767 pub ev_islanding_trip_time: Option<crate::types::Decimal>,
3768 #[serde(rename = "evMaximumLevel1DCInjection")]
3771 #[serde(default, skip_serializing_if = "Option::is_none")]
3772 pub ev_maximum_level1_dc_injection: Option<crate::types::Decimal>,
3773 #[serde(rename = "evDurationLevel1DCInjection")]
3776 #[serde(default, skip_serializing_if = "Option::is_none")]
3777 pub ev_duration_level1_dc_injection: Option<crate::types::Decimal>,
3778 #[serde(rename = "evMaximumLevel2DCInjection")]
3781 #[serde(default, skip_serializing_if = "Option::is_none")]
3782 pub ev_maximum_level2_dc_injection: Option<crate::types::Decimal>,
3783 #[serde(rename = "evDurationLevel2DCInjection")]
3786 #[serde(default, skip_serializing_if = "Option::is_none")]
3787 pub ev_duration_level2_dc_injection: Option<crate::types::Decimal>,
3788 #[serde(rename = "evReactiveSusceptance")]
3791 #[serde(default, skip_serializing_if = "Option::is_none")]
3792 pub ev_reactive_susceptance: Option<crate::types::Decimal>,
3793 #[serde(rename = "evSessionTotalDischargeEnergyAvailable")]
3796 #[serde(default, skip_serializing_if = "Option::is_none")]
3797 pub ev_session_total_discharge_energy_available: Option<crate::types::Decimal>,
3798 #[serde(rename = "customData")]
3800 #[serde(default, skip_serializing_if = "Option::is_none")]
3801 pub custom_data: Option<crate::types::CustomData>,
3802}
3803
3804impl DERChargingParameters {
3805 #[must_use]
3807 pub fn new() -> Self {
3808 Self::default()
3809 }
3810
3811 #[must_use]
3813 pub fn with_ev_supported_der_control(mut self, value: Vec<DERControl>) -> Self {
3814 self.ev_supported_der_control = Some(value);
3815 self
3816 }
3817
3818 #[must_use]
3820 pub fn with_ev_over_excited_max_discharge_power(
3821 mut self,
3822 value: impl Into<crate::types::Decimal>,
3823 ) -> Self {
3824 self.ev_over_excited_max_discharge_power = Some(value.into());
3825 self
3826 }
3827
3828 #[must_use]
3830 pub fn with_ev_over_excited_power_factor(
3831 mut self,
3832 value: impl Into<crate::types::Decimal>,
3833 ) -> Self {
3834 self.ev_over_excited_power_factor = Some(value.into());
3835 self
3836 }
3837
3838 #[must_use]
3840 pub fn with_ev_under_excited_max_discharge_power(
3841 mut self,
3842 value: impl Into<crate::types::Decimal>,
3843 ) -> Self {
3844 self.ev_under_excited_max_discharge_power = Some(value.into());
3845 self
3846 }
3847
3848 #[must_use]
3850 pub fn with_ev_under_excited_power_factor(
3851 mut self,
3852 value: impl Into<crate::types::Decimal>,
3853 ) -> Self {
3854 self.ev_under_excited_power_factor = Some(value.into());
3855 self
3856 }
3857
3858 #[must_use]
3860 pub fn with_max_apparent_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
3861 self.max_apparent_power = Some(value.into());
3862 self
3863 }
3864
3865 #[must_use]
3867 pub fn with_max_charge_apparent_power(
3868 mut self,
3869 value: impl Into<crate::types::Decimal>,
3870 ) -> Self {
3871 self.max_charge_apparent_power = Some(value.into());
3872 self
3873 }
3874
3875 #[must_use]
3877 pub fn with_max_charge_apparent_power_l2(
3878 mut self,
3879 value: impl Into<crate::types::Decimal>,
3880 ) -> Self {
3881 self.max_charge_apparent_power_l2 = Some(value.into());
3882 self
3883 }
3884
3885 #[must_use]
3887 pub fn with_max_charge_apparent_power_l3(
3888 mut self,
3889 value: impl Into<crate::types::Decimal>,
3890 ) -> Self {
3891 self.max_charge_apparent_power_l3 = Some(value.into());
3892 self
3893 }
3894
3895 #[must_use]
3897 pub fn with_max_discharge_apparent_power(
3898 mut self,
3899 value: impl Into<crate::types::Decimal>,
3900 ) -> Self {
3901 self.max_discharge_apparent_power = Some(value.into());
3902 self
3903 }
3904
3905 #[must_use]
3907 pub fn with_max_discharge_apparent_power_l2(
3908 mut self,
3909 value: impl Into<crate::types::Decimal>,
3910 ) -> Self {
3911 self.max_discharge_apparent_power_l2 = Some(value.into());
3912 self
3913 }
3914
3915 #[must_use]
3917 pub fn with_max_discharge_apparent_power_l3(
3918 mut self,
3919 value: impl Into<crate::types::Decimal>,
3920 ) -> Self {
3921 self.max_discharge_apparent_power_l3 = Some(value.into());
3922 self
3923 }
3924
3925 #[must_use]
3927 pub fn with_max_charge_reactive_power(
3928 mut self,
3929 value: impl Into<crate::types::Decimal>,
3930 ) -> Self {
3931 self.max_charge_reactive_power = Some(value.into());
3932 self
3933 }
3934
3935 #[must_use]
3937 pub fn with_max_charge_reactive_power_l2(
3938 mut self,
3939 value: impl Into<crate::types::Decimal>,
3940 ) -> Self {
3941 self.max_charge_reactive_power_l2 = Some(value.into());
3942 self
3943 }
3944
3945 #[must_use]
3947 pub fn with_max_charge_reactive_power_l3(
3948 mut self,
3949 value: impl Into<crate::types::Decimal>,
3950 ) -> Self {
3951 self.max_charge_reactive_power_l3 = Some(value.into());
3952 self
3953 }
3954
3955 #[must_use]
3957 pub fn with_min_charge_reactive_power(
3958 mut self,
3959 value: impl Into<crate::types::Decimal>,
3960 ) -> Self {
3961 self.min_charge_reactive_power = Some(value.into());
3962 self
3963 }
3964
3965 #[must_use]
3967 pub fn with_min_charge_reactive_power_l2(
3968 mut self,
3969 value: impl Into<crate::types::Decimal>,
3970 ) -> Self {
3971 self.min_charge_reactive_power_l2 = Some(value.into());
3972 self
3973 }
3974
3975 #[must_use]
3977 pub fn with_min_charge_reactive_power_l3(
3978 mut self,
3979 value: impl Into<crate::types::Decimal>,
3980 ) -> Self {
3981 self.min_charge_reactive_power_l3 = Some(value.into());
3982 self
3983 }
3984
3985 #[must_use]
3987 pub fn with_max_discharge_reactive_power(
3988 mut self,
3989 value: impl Into<crate::types::Decimal>,
3990 ) -> Self {
3991 self.max_discharge_reactive_power = Some(value.into());
3992 self
3993 }
3994
3995 #[must_use]
3997 pub fn with_max_discharge_reactive_power_l2(
3998 mut self,
3999 value: impl Into<crate::types::Decimal>,
4000 ) -> Self {
4001 self.max_discharge_reactive_power_l2 = Some(value.into());
4002 self
4003 }
4004
4005 #[must_use]
4007 pub fn with_max_discharge_reactive_power_l3(
4008 mut self,
4009 value: impl Into<crate::types::Decimal>,
4010 ) -> Self {
4011 self.max_discharge_reactive_power_l3 = Some(value.into());
4012 self
4013 }
4014
4015 #[must_use]
4017 pub fn with_min_discharge_reactive_power(
4018 mut self,
4019 value: impl Into<crate::types::Decimal>,
4020 ) -> Self {
4021 self.min_discharge_reactive_power = Some(value.into());
4022 self
4023 }
4024
4025 #[must_use]
4027 pub fn with_min_discharge_reactive_power_l2(
4028 mut self,
4029 value: impl Into<crate::types::Decimal>,
4030 ) -> Self {
4031 self.min_discharge_reactive_power_l2 = Some(value.into());
4032 self
4033 }
4034
4035 #[must_use]
4037 pub fn with_min_discharge_reactive_power_l3(
4038 mut self,
4039 value: impl Into<crate::types::Decimal>,
4040 ) -> Self {
4041 self.min_discharge_reactive_power_l3 = Some(value.into());
4042 self
4043 }
4044
4045 #[must_use]
4047 pub fn with_nominal_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4048 self.nominal_voltage = Some(value.into());
4049 self
4050 }
4051
4052 #[must_use]
4054 pub fn with_nominal_voltage_offset(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4055 self.nominal_voltage_offset = Some(value.into());
4056 self
4057 }
4058
4059 #[must_use]
4061 pub fn with_max_nominal_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4062 self.max_nominal_voltage = Some(value.into());
4063 self
4064 }
4065
4066 #[must_use]
4068 pub fn with_min_nominal_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4069 self.min_nominal_voltage = Some(value.into());
4070 self
4071 }
4072
4073 #[must_use]
4075 pub fn with_ev_inverter_manufacturer(mut self, value: impl Into<String>) -> Self {
4076 self.ev_inverter_manufacturer = Some(value.into());
4077 self
4078 }
4079
4080 #[must_use]
4082 pub fn with_ev_inverter_model(mut self, value: impl Into<String>) -> Self {
4083 self.ev_inverter_model = Some(value.into());
4084 self
4085 }
4086
4087 #[must_use]
4089 pub fn with_ev_inverter_serial_number(mut self, value: impl Into<String>) -> Self {
4090 self.ev_inverter_serial_number = Some(value.into());
4091 self
4092 }
4093
4094 #[must_use]
4096 pub fn with_ev_inverter_sw_version(mut self, value: impl Into<String>) -> Self {
4097 self.ev_inverter_sw_version = Some(value.into());
4098 self
4099 }
4100
4101 #[must_use]
4103 pub fn with_ev_inverter_hw_version(mut self, value: impl Into<String>) -> Self {
4104 self.ev_inverter_hw_version = Some(value.into());
4105 self
4106 }
4107
4108 #[must_use]
4110 pub fn with_ev_islanding_detection_method(mut self, value: Vec<IslandingDetection>) -> Self {
4111 self.ev_islanding_detection_method = Some(value);
4112 self
4113 }
4114
4115 #[must_use]
4117 pub fn with_ev_islanding_trip_time(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4118 self.ev_islanding_trip_time = Some(value.into());
4119 self
4120 }
4121
4122 #[must_use]
4124 pub fn with_ev_maximum_level1_dc_injection(
4125 mut self,
4126 value: impl Into<crate::types::Decimal>,
4127 ) -> Self {
4128 self.ev_maximum_level1_dc_injection = Some(value.into());
4129 self
4130 }
4131
4132 #[must_use]
4134 pub fn with_ev_duration_level1_dc_injection(
4135 mut self,
4136 value: impl Into<crate::types::Decimal>,
4137 ) -> Self {
4138 self.ev_duration_level1_dc_injection = Some(value.into());
4139 self
4140 }
4141
4142 #[must_use]
4144 pub fn with_ev_maximum_level2_dc_injection(
4145 mut self,
4146 value: impl Into<crate::types::Decimal>,
4147 ) -> Self {
4148 self.ev_maximum_level2_dc_injection = Some(value.into());
4149 self
4150 }
4151
4152 #[must_use]
4154 pub fn with_ev_duration_level2_dc_injection(
4155 mut self,
4156 value: impl Into<crate::types::Decimal>,
4157 ) -> Self {
4158 self.ev_duration_level2_dc_injection = Some(value.into());
4159 self
4160 }
4161
4162 #[must_use]
4164 pub fn with_ev_reactive_susceptance(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4165 self.ev_reactive_susceptance = Some(value.into());
4166 self
4167 }
4168
4169 #[must_use]
4171 pub fn with_ev_session_total_discharge_energy_available(
4172 mut self,
4173 value: impl Into<crate::types::Decimal>,
4174 ) -> Self {
4175 self.ev_session_total_discharge_energy_available = Some(value.into());
4176 self
4177 }
4178
4179 #[must_use]
4181 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4182 self.custom_data = Some(value);
4183 self
4184 }
4185}
4186
4187impl Validate for DERChargingParameters {
4188 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4189 path.push_key("evSupportedDERControl");
4190 if let Some(value) = &self.ev_supported_der_control {
4191 validate::list_len(value.len(), Some(1), None, path, out);
4192 for (index, item) in value.iter().enumerate() {
4193 path.push_index(index);
4194 Validate::validate_at(item, path, out);
4195 path.pop();
4196 }
4197 }
4198 path.pop();
4199 path.push_key("evInverterManufacturer");
4200 if let Some(value) = &self.ev_inverter_manufacturer {
4201 validate::string(value.as_str(), None, Some(50), path, out);
4202 }
4203 path.pop();
4204 path.push_key("evInverterModel");
4205 if let Some(value) = &self.ev_inverter_model {
4206 validate::string(value.as_str(), None, Some(50), path, out);
4207 }
4208 path.pop();
4209 path.push_key("evInverterSerialNumber");
4210 if let Some(value) = &self.ev_inverter_serial_number {
4211 validate::string(value.as_str(), None, Some(50), path, out);
4212 }
4213 path.pop();
4214 path.push_key("evInverterSwVersion");
4215 if let Some(value) = &self.ev_inverter_sw_version {
4216 validate::string(value.as_str(), None, Some(50), path, out);
4217 }
4218 path.pop();
4219 path.push_key("evInverterHwVersion");
4220 if let Some(value) = &self.ev_inverter_hw_version {
4221 validate::string(value.as_str(), None, Some(50), path, out);
4222 }
4223 path.pop();
4224 path.push_key("evIslandingDetectionMethod");
4225 if let Some(value) = &self.ev_islanding_detection_method {
4226 validate::list_len(value.len(), Some(1), None, path, out);
4227 for (index, item) in value.iter().enumerate() {
4228 path.push_index(index);
4229 Validate::validate_at(item, path, out);
4230 path.pop();
4231 }
4232 }
4233 path.pop();
4234 path.push_key("customData");
4235 if let Some(value) = &self.custom_data {
4236 Validate::validate_at(value, path, out);
4237 }
4238 path.pop();
4239 }
4240}
4241
4242#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4244pub struct DERCurve {
4245 #[serde(rename = "curveData")]
4247 pub curve_data: Vec<DERCurvePoints>,
4248 pub priority: i32,
4250 #[serde(rename = "yUnit")]
4252 pub y_unit: DERUnit,
4253 #[serde(default, skip_serializing_if = "Option::is_none")]
4255 pub hysteresis: Option<Hysteresis>,
4256 #[serde(rename = "reactivePowerParams")]
4258 #[serde(default, skip_serializing_if = "Option::is_none")]
4259 pub reactive_power_params: Option<ReactivePowerParams>,
4260 #[serde(rename = "voltageParams")]
4262 #[serde(default, skip_serializing_if = "Option::is_none")]
4263 pub voltage_params: Option<VoltageParams>,
4264 #[serde(rename = "responseTime")]
4266 #[serde(default, skip_serializing_if = "Option::is_none")]
4267 pub response_time: Option<crate::types::Decimal>,
4268 #[serde(rename = "startTime")]
4270 #[serde(default, skip_serializing_if = "Option::is_none")]
4271 pub start_time: Option<crate::types::DateTime>,
4272 #[serde(default, skip_serializing_if = "Option::is_none")]
4274 pub duration: Option<crate::types::Decimal>,
4275 #[serde(rename = "customData")]
4277 #[serde(default, skip_serializing_if = "Option::is_none")]
4278 pub custom_data: Option<crate::types::CustomData>,
4279}
4280
4281impl DERCurve {
4282 #[must_use]
4284 pub fn new(curve_data: Vec<DERCurvePoints>, priority: i32, y_unit: DERUnit) -> Self {
4285 Self {
4286 curve_data,
4287 priority,
4288 y_unit,
4289 hysteresis: None,
4290 reactive_power_params: None,
4291 voltage_params: None,
4292 response_time: None,
4293 start_time: None,
4294 duration: None,
4295 custom_data: None,
4296 }
4297 }
4298
4299 #[must_use]
4301 pub fn with_hysteresis(mut self, value: Hysteresis) -> Self {
4302 self.hysteresis = Some(value);
4303 self
4304 }
4305
4306 #[must_use]
4308 pub fn with_reactive_power_params(mut self, value: ReactivePowerParams) -> Self {
4309 self.reactive_power_params = Some(value);
4310 self
4311 }
4312
4313 #[must_use]
4315 pub fn with_voltage_params(mut self, value: VoltageParams) -> Self {
4316 self.voltage_params = Some(value);
4317 self
4318 }
4319
4320 #[must_use]
4322 pub fn with_response_time(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4323 self.response_time = Some(value.into());
4324 self
4325 }
4326
4327 #[must_use]
4329 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
4330 self.start_time = Some(value.into());
4331 self
4332 }
4333
4334 #[must_use]
4336 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4337 self.duration = Some(value.into());
4338 self
4339 }
4340
4341 #[must_use]
4343 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4344 self.custom_data = Some(value);
4345 self
4346 }
4347}
4348
4349impl Validate for DERCurve {
4350 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4351 path.push_key("curveData");
4352 validate::list_len(self.curve_data.len(), Some(1), Some(10), path, out);
4353 for (index, item) in self.curve_data.iter().enumerate() {
4354 path.push_index(index);
4355 Validate::validate_at(item, path, out);
4356 path.pop();
4357 }
4358 path.pop();
4359 path.push_key("priority");
4360 validate::int_range(i64::from(self.priority), Some(0.0), None, path, out);
4361 path.pop();
4362 path.push_key("yUnit");
4363 Validate::validate_at(&self.y_unit, path, out);
4364 path.pop();
4365 path.push_key("hysteresis");
4366 if let Some(value) = &self.hysteresis {
4367 Validate::validate_at(value, path, out);
4368 }
4369 path.pop();
4370 path.push_key("reactivePowerParams");
4371 if let Some(value) = &self.reactive_power_params {
4372 Validate::validate_at(value, path, out);
4373 }
4374 path.pop();
4375 path.push_key("voltageParams");
4376 if let Some(value) = &self.voltage_params {
4377 Validate::validate_at(value, path, out);
4378 }
4379 path.pop();
4380 path.push_key("customData");
4381 if let Some(value) = &self.custom_data {
4382 Validate::validate_at(value, path, out);
4383 }
4384 path.pop();
4385 }
4386}
4387
4388#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4390pub struct DERCurveGet {
4391 pub curve: DERCurve,
4393 pub id: String,
4395 #[serde(rename = "curveType")]
4397 pub curve_type: DERControl,
4398 #[serde(rename = "isDefault")]
4400 pub is_default: bool,
4401 #[serde(rename = "isSuperseded")]
4403 pub is_superseded: bool,
4404 #[serde(rename = "customData")]
4406 #[serde(default, skip_serializing_if = "Option::is_none")]
4407 pub custom_data: Option<crate::types::CustomData>,
4408}
4409
4410impl DERCurveGet {
4411 #[must_use]
4413 pub fn new(
4414 curve: DERCurve,
4415 id: impl Into<String>,
4416 curve_type: DERControl,
4417 is_default: bool,
4418 is_superseded: bool,
4419 ) -> Self {
4420 Self {
4421 curve,
4422 id: id.into(),
4423 curve_type,
4424 is_default,
4425 is_superseded,
4426 custom_data: None,
4427 }
4428 }
4429
4430 #[must_use]
4432 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4433 self.custom_data = Some(value);
4434 self
4435 }
4436}
4437
4438impl Validate for DERCurveGet {
4439 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4440 path.push_key("curve");
4441 Validate::validate_at(&self.curve, path, out);
4442 path.pop();
4443 path.push_key("id");
4444 validate::string(self.id.as_str(), None, Some(36), path, out);
4445 path.pop();
4446 path.push_key("curveType");
4447 Validate::validate_at(&self.curve_type, path, out);
4448 path.pop();
4449 path.push_key("customData");
4450 if let Some(value) = &self.custom_data {
4451 Validate::validate_at(value, path, out);
4452 }
4453 path.pop();
4454 }
4455}
4456
4457#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4459pub struct DERCurvePoints {
4460 pub x: crate::types::Decimal,
4462 pub y: crate::types::Decimal,
4464 #[serde(rename = "customData")]
4466 #[serde(default, skip_serializing_if = "Option::is_none")]
4467 pub custom_data: Option<crate::types::CustomData>,
4468}
4469
4470impl DERCurvePoints {
4471 #[must_use]
4473 pub fn new(x: impl Into<crate::types::Decimal>, y: impl Into<crate::types::Decimal>) -> Self {
4474 Self {
4475 x: x.into(),
4476 y: y.into(),
4477 custom_data: None,
4478 }
4479 }
4480
4481 #[must_use]
4483 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4484 self.custom_data = Some(value);
4485 self
4486 }
4487}
4488
4489impl Validate for DERCurvePoints {
4490 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
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)]
4503pub struct EVAbsolutePriceSchedule {
4504 #[serde(rename = "timeAnchor")]
4506 pub time_anchor: crate::types::DateTime,
4507 pub currency: String,
4509 #[serde(rename = "evAbsolutePriceScheduleEntries")]
4511 pub ev_absolute_price_schedule_entries: Vec<EVAbsolutePriceScheduleEntry>,
4512 #[serde(rename = "priceAlgorithm")]
4514 pub price_algorithm: String,
4515 #[serde(rename = "customData")]
4517 #[serde(default, skip_serializing_if = "Option::is_none")]
4518 pub custom_data: Option<crate::types::CustomData>,
4519}
4520
4521impl EVAbsolutePriceSchedule {
4522 #[must_use]
4524 pub fn new(
4525 time_anchor: impl Into<crate::types::DateTime>,
4526 currency: impl Into<String>,
4527 ev_absolute_price_schedule_entries: Vec<EVAbsolutePriceScheduleEntry>,
4528 price_algorithm: impl Into<String>,
4529 ) -> Self {
4530 Self {
4531 time_anchor: time_anchor.into(),
4532 currency: currency.into(),
4533 ev_absolute_price_schedule_entries,
4534 price_algorithm: price_algorithm.into(),
4535 custom_data: None,
4536 }
4537 }
4538
4539 #[must_use]
4541 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4542 self.custom_data = Some(value);
4543 self
4544 }
4545}
4546
4547impl Validate for EVAbsolutePriceSchedule {
4548 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4549 path.push_key("currency");
4550 validate::string(self.currency.as_str(), None, Some(3), path, out);
4551 path.pop();
4552 path.push_key("evAbsolutePriceScheduleEntries");
4553 validate::list_len(
4554 self.ev_absolute_price_schedule_entries.len(),
4555 Some(1),
4556 Some(1024),
4557 path,
4558 out,
4559 );
4560 for (index, item) in self.ev_absolute_price_schedule_entries.iter().enumerate() {
4561 path.push_index(index);
4562 Validate::validate_at(item, path, out);
4563 path.pop();
4564 }
4565 path.pop();
4566 path.push_key("priceAlgorithm");
4567 validate::string(self.price_algorithm.as_str(), None, Some(2000), path, out);
4568 path.pop();
4569 path.push_key("customData");
4570 if let Some(value) = &self.custom_data {
4571 Validate::validate_at(value, path, out);
4572 }
4573 path.pop();
4574 }
4575}
4576
4577#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4581pub struct EVAbsolutePriceScheduleEntry {
4582 pub duration: i32,
4584 #[serde(rename = "evPriceRule")]
4586 pub ev_price_rule: Vec<EVPriceRule>,
4587 #[serde(rename = "customData")]
4589 #[serde(default, skip_serializing_if = "Option::is_none")]
4590 pub custom_data: Option<crate::types::CustomData>,
4591}
4592
4593impl EVAbsolutePriceScheduleEntry {
4594 #[must_use]
4596 pub fn new(duration: i32, ev_price_rule: Vec<EVPriceRule>) -> Self {
4597 Self {
4598 duration,
4599 ev_price_rule,
4600 custom_data: None,
4601 }
4602 }
4603
4604 #[must_use]
4606 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4607 self.custom_data = Some(value);
4608 self
4609 }
4610}
4611
4612impl Validate for EVAbsolutePriceScheduleEntry {
4613 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4614 path.push_key("evPriceRule");
4615 validate::list_len(self.ev_price_rule.len(), Some(1), Some(8), path, out);
4616 for (index, item) in self.ev_price_rule.iter().enumerate() {
4617 path.push_index(index);
4618 Validate::validate_at(item, path, out);
4619 path.pop();
4620 }
4621 path.pop();
4622 path.push_key("customData");
4623 if let Some(value) = &self.custom_data {
4624 Validate::validate_at(value, path, out);
4625 }
4626 path.pop();
4627 }
4628}
4629
4630#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4634pub struct EVEnergyOffer {
4635 #[serde(rename = "evPowerSchedule")]
4637 pub ev_power_schedule: EVPowerSchedule,
4638 #[serde(rename = "evAbsolutePriceSchedule")]
4640 #[serde(default, skip_serializing_if = "Option::is_none")]
4641 pub ev_absolute_price_schedule: Option<EVAbsolutePriceSchedule>,
4642 #[serde(rename = "customData")]
4644 #[serde(default, skip_serializing_if = "Option::is_none")]
4645 pub custom_data: Option<crate::types::CustomData>,
4646}
4647
4648impl EVEnergyOffer {
4649 #[must_use]
4651 pub fn new(ev_power_schedule: EVPowerSchedule) -> Self {
4652 Self {
4653 ev_power_schedule,
4654 ev_absolute_price_schedule: None,
4655 custom_data: None,
4656 }
4657 }
4658
4659 #[must_use]
4661 pub fn with_ev_absolute_price_schedule(mut self, value: EVAbsolutePriceSchedule) -> Self {
4662 self.ev_absolute_price_schedule = Some(value);
4663 self
4664 }
4665
4666 #[must_use]
4668 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4669 self.custom_data = Some(value);
4670 self
4671 }
4672}
4673
4674impl Validate for EVEnergyOffer {
4675 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4676 path.push_key("evPowerSchedule");
4677 Validate::validate_at(&self.ev_power_schedule, path, out);
4678 path.pop();
4679 path.push_key("evAbsolutePriceSchedule");
4680 if let Some(value) = &self.ev_absolute_price_schedule {
4681 Validate::validate_at(value, path, out);
4682 }
4683 path.pop();
4684 path.push_key("customData");
4685 if let Some(value) = &self.custom_data {
4686 Validate::validate_at(value, path, out);
4687 }
4688 path.pop();
4689 }
4690}
4691
4692#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4696pub struct EVPowerSchedule {
4697 #[serde(rename = "evPowerScheduleEntries")]
4699 pub ev_power_schedule_entries: Vec<EVPowerScheduleEntry>,
4700 #[serde(rename = "timeAnchor")]
4702 pub time_anchor: crate::types::DateTime,
4703 #[serde(rename = "customData")]
4705 #[serde(default, skip_serializing_if = "Option::is_none")]
4706 pub custom_data: Option<crate::types::CustomData>,
4707}
4708
4709impl EVPowerSchedule {
4710 #[must_use]
4712 pub fn new(
4713 ev_power_schedule_entries: Vec<EVPowerScheduleEntry>,
4714 time_anchor: impl Into<crate::types::DateTime>,
4715 ) -> Self {
4716 Self {
4717 ev_power_schedule_entries,
4718 time_anchor: time_anchor.into(),
4719 custom_data: None,
4720 }
4721 }
4722
4723 #[must_use]
4725 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4726 self.custom_data = Some(value);
4727 self
4728 }
4729}
4730
4731impl Validate for EVPowerSchedule {
4732 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4733 path.push_key("evPowerScheduleEntries");
4734 validate::list_len(
4735 self.ev_power_schedule_entries.len(),
4736 Some(1),
4737 Some(1024),
4738 path,
4739 out,
4740 );
4741 for (index, item) in self.ev_power_schedule_entries.iter().enumerate() {
4742 path.push_index(index);
4743 Validate::validate_at(item, path, out);
4744 path.pop();
4745 }
4746 path.pop();
4747 path.push_key("customData");
4748 if let Some(value) = &self.custom_data {
4749 Validate::validate_at(value, path, out);
4750 }
4751 path.pop();
4752 }
4753}
4754
4755#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4759pub struct EVPowerScheduleEntry {
4760 pub duration: i32,
4762 pub power: crate::types::Decimal,
4764 #[serde(rename = "customData")]
4766 #[serde(default, skip_serializing_if = "Option::is_none")]
4767 pub custom_data: Option<crate::types::CustomData>,
4768}
4769
4770impl EVPowerScheduleEntry {
4771 #[must_use]
4773 pub fn new(duration: i32, power: impl Into<crate::types::Decimal>) -> Self {
4774 Self {
4775 duration,
4776 power: power.into(),
4777 custom_data: None,
4778 }
4779 }
4780
4781 #[must_use]
4783 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4784 self.custom_data = Some(value);
4785 self
4786 }
4787}
4788
4789impl Validate for EVPowerScheduleEntry {
4790 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4791 path.push_key("customData");
4792 if let Some(value) = &self.custom_data {
4793 Validate::validate_at(value, path, out);
4794 }
4795 path.pop();
4796 }
4797}
4798
4799#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4803pub struct EVPriceRule {
4804 #[serde(rename = "energyFee")]
4806 pub energy_fee: crate::types::Decimal,
4807 #[serde(rename = "powerRangeStart")]
4809 pub power_range_start: crate::types::Decimal,
4810 #[serde(rename = "customData")]
4812 #[serde(default, skip_serializing_if = "Option::is_none")]
4813 pub custom_data: Option<crate::types::CustomData>,
4814}
4815
4816impl EVPriceRule {
4817 #[must_use]
4819 pub fn new(
4820 energy_fee: impl Into<crate::types::Decimal>,
4821 power_range_start: impl Into<crate::types::Decimal>,
4822 ) -> Self {
4823 Self {
4824 energy_fee: energy_fee.into(),
4825 power_range_start: power_range_start.into(),
4826 custom_data: None,
4827 }
4828 }
4829
4830 #[must_use]
4832 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4833 self.custom_data = Some(value);
4834 self
4835 }
4836}
4837
4838impl Validate for EVPriceRule {
4839 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4840 path.push_key("customData");
4841 if let Some(value) = &self.custom_data {
4842 Validate::validate_at(value, path, out);
4843 }
4844 path.pop();
4845 }
4846}
4847
4848#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4852pub struct EVSE {
4853 pub id: i32,
4855 #[serde(rename = "connectorId")]
4857 #[serde(default, skip_serializing_if = "Option::is_none")]
4858 pub connector_id: Option<i32>,
4859 #[serde(rename = "customData")]
4861 #[serde(default, skip_serializing_if = "Option::is_none")]
4862 pub custom_data: Option<crate::types::CustomData>,
4863}
4864
4865impl EVSE {
4866 #[must_use]
4868 pub fn new(id: i32) -> Self {
4869 Self {
4870 id,
4871 connector_id: None,
4872 custom_data: None,
4873 }
4874 }
4875
4876 #[must_use]
4878 pub fn with_connector_id(mut self, value: i32) -> Self {
4879 self.connector_id = Some(value);
4880 self
4881 }
4882
4883 #[must_use]
4885 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4886 self.custom_data = Some(value);
4887 self
4888 }
4889}
4890
4891impl Validate for EVSE {
4892 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4893 path.push_key("id");
4894 validate::int_range(i64::from(self.id), Some(0.0), None, path, out);
4895 path.pop();
4896 path.push_key("connectorId");
4897 if let Some(value) = &self.connector_id {
4898 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
4899 }
4900 path.pop();
4901 path.push_key("customData");
4902 if let Some(value) = &self.custom_data {
4903 Validate::validate_at(value, path, out);
4904 }
4905 path.pop();
4906 }
4907}
4908
4909#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4911pub struct EnterService {
4912 pub priority: i32,
4914 #[serde(rename = "highVoltage")]
4916 pub high_voltage: crate::types::Decimal,
4917 #[serde(rename = "lowVoltage")]
4919 pub low_voltage: crate::types::Decimal,
4920 #[serde(rename = "highFreq")]
4922 pub high_freq: crate::types::Decimal,
4923 #[serde(rename = "lowFreq")]
4925 pub low_freq: crate::types::Decimal,
4926 #[serde(default, skip_serializing_if = "Option::is_none")]
4928 pub delay: Option<crate::types::Decimal>,
4929 #[serde(rename = "randomDelay")]
4931 #[serde(default, skip_serializing_if = "Option::is_none")]
4932 pub random_delay: Option<crate::types::Decimal>,
4933 #[serde(rename = "rampRate")]
4935 #[serde(default, skip_serializing_if = "Option::is_none")]
4936 pub ramp_rate: Option<crate::types::Decimal>,
4937 #[serde(rename = "customData")]
4939 #[serde(default, skip_serializing_if = "Option::is_none")]
4940 pub custom_data: Option<crate::types::CustomData>,
4941}
4942
4943impl EnterService {
4944 #[must_use]
4946 pub fn new(
4947 priority: i32,
4948 high_voltage: impl Into<crate::types::Decimal>,
4949 low_voltage: impl Into<crate::types::Decimal>,
4950 high_freq: impl Into<crate::types::Decimal>,
4951 low_freq: impl Into<crate::types::Decimal>,
4952 ) -> Self {
4953 Self {
4954 priority,
4955 high_voltage: high_voltage.into(),
4956 low_voltage: low_voltage.into(),
4957 high_freq: high_freq.into(),
4958 low_freq: low_freq.into(),
4959 delay: None,
4960 random_delay: None,
4961 ramp_rate: None,
4962 custom_data: None,
4963 }
4964 }
4965
4966 #[must_use]
4968 pub fn with_delay(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4969 self.delay = Some(value.into());
4970 self
4971 }
4972
4973 #[must_use]
4975 pub fn with_random_delay(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4976 self.random_delay = Some(value.into());
4977 self
4978 }
4979
4980 #[must_use]
4982 pub fn with_ramp_rate(mut self, value: impl Into<crate::types::Decimal>) -> Self {
4983 self.ramp_rate = Some(value.into());
4984 self
4985 }
4986
4987 #[must_use]
4989 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
4990 self.custom_data = Some(value);
4991 self
4992 }
4993}
4994
4995impl Validate for EnterService {
4996 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
4997 path.push_key("priority");
4998 validate::int_range(i64::from(self.priority), Some(0.0), None, path, out);
4999 path.pop();
5000 path.push_key("customData");
5001 if let Some(value) = &self.custom_data {
5002 Validate::validate_at(value, path, out);
5003 }
5004 path.pop();
5005 }
5006}
5007
5008#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5010pub struct EnterServiceGet {
5011 #[serde(rename = "enterService")]
5013 pub enter_service: EnterService,
5014 pub id: String,
5016 #[serde(rename = "customData")]
5018 #[serde(default, skip_serializing_if = "Option::is_none")]
5019 pub custom_data: Option<crate::types::CustomData>,
5020}
5021
5022impl EnterServiceGet {
5023 #[must_use]
5025 pub fn new(enter_service: EnterService, id: impl Into<String>) -> Self {
5026 Self {
5027 enter_service,
5028 id: id.into(),
5029 custom_data: None,
5030 }
5031 }
5032
5033 #[must_use]
5035 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5036 self.custom_data = Some(value);
5037 self
5038 }
5039}
5040
5041impl Validate for EnterServiceGet {
5042 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5043 path.push_key("enterService");
5044 Validate::validate_at(&self.enter_service, path, out);
5045 path.pop();
5046 path.push_key("id");
5047 validate::string(self.id.as_str(), None, Some(36), path, out);
5048 path.pop();
5049 path.push_key("customData");
5050 if let Some(value) = &self.custom_data {
5051 Validate::validate_at(value, path, out);
5052 }
5053 path.pop();
5054 }
5055}
5056
5057#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5061pub struct EventData {
5062 #[serde(rename = "eventId")]
5064 pub event_id: i32,
5065 pub timestamp: crate::types::DateTime,
5067 pub trigger: EventTrigger,
5069 #[serde(rename = "actualValue")]
5073 pub actual_value: String,
5074 pub component: Component,
5076 #[serde(rename = "eventNotificationType")]
5078 pub event_notification_type: EventNotification,
5079 pub variable: Variable,
5081 #[serde(default, skip_serializing_if = "Option::is_none")]
5083 pub cause: Option<i32>,
5084 #[serde(rename = "techCode")]
5086 #[serde(default, skip_serializing_if = "Option::is_none")]
5087 pub tech_code: Option<String>,
5088 #[serde(rename = "techInfo")]
5090 #[serde(default, skip_serializing_if = "Option::is_none")]
5091 pub tech_info: Option<String>,
5092 #[serde(default, skip_serializing_if = "Option::is_none")]
5094 pub cleared: Option<bool>,
5095 #[serde(rename = "transactionId")]
5097 #[serde(default, skip_serializing_if = "Option::is_none")]
5098 pub transaction_id: Option<String>,
5099 #[serde(rename = "variableMonitoringId")]
5101 #[serde(default, skip_serializing_if = "Option::is_none")]
5102 pub variable_monitoring_id: Option<i32>,
5103 #[serde(default, skip_serializing_if = "Option::is_none")]
5105 pub severity: Option<i32>,
5106 #[serde(rename = "customData")]
5108 #[serde(default, skip_serializing_if = "Option::is_none")]
5109 pub custom_data: Option<crate::types::CustomData>,
5110}
5111
5112impl EventData {
5113 #[must_use]
5115 pub fn new(
5116 event_id: i32,
5117 timestamp: impl Into<crate::types::DateTime>,
5118 trigger: EventTrigger,
5119 actual_value: impl Into<String>,
5120 component: Component,
5121 event_notification_type: EventNotification,
5122 variable: Variable,
5123 ) -> Self {
5124 Self {
5125 event_id,
5126 timestamp: timestamp.into(),
5127 trigger,
5128 actual_value: actual_value.into(),
5129 component,
5130 event_notification_type,
5131 variable,
5132 cause: None,
5133 tech_code: None,
5134 tech_info: None,
5135 cleared: None,
5136 transaction_id: None,
5137 variable_monitoring_id: None,
5138 severity: None,
5139 custom_data: None,
5140 }
5141 }
5142
5143 #[must_use]
5145 pub fn with_cause(mut self, value: i32) -> Self {
5146 self.cause = Some(value);
5147 self
5148 }
5149
5150 #[must_use]
5152 pub fn with_tech_code(mut self, value: impl Into<String>) -> Self {
5153 self.tech_code = Some(value.into());
5154 self
5155 }
5156
5157 #[must_use]
5159 pub fn with_tech_info(mut self, value: impl Into<String>) -> Self {
5160 self.tech_info = Some(value.into());
5161 self
5162 }
5163
5164 #[must_use]
5166 pub fn with_cleared(mut self, value: bool) -> Self {
5167 self.cleared = Some(value);
5168 self
5169 }
5170
5171 #[must_use]
5173 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
5174 self.transaction_id = Some(value.into());
5175 self
5176 }
5177
5178 #[must_use]
5180 pub fn with_variable_monitoring_id(mut self, value: i32) -> Self {
5181 self.variable_monitoring_id = Some(value);
5182 self
5183 }
5184
5185 #[must_use]
5187 pub fn with_severity(mut self, value: i32) -> Self {
5188 self.severity = Some(value);
5189 self
5190 }
5191
5192 #[must_use]
5194 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5195 self.custom_data = Some(value);
5196 self
5197 }
5198}
5199
5200impl Validate for EventData {
5201 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5202 path.push_key("eventId");
5203 validate::int_range(i64::from(self.event_id), Some(0.0), None, path, out);
5204 path.pop();
5205 path.push_key("trigger");
5206 Validate::validate_at(&self.trigger, path, out);
5207 path.pop();
5208 path.push_key("actualValue");
5209 validate::string(self.actual_value.as_str(), None, Some(2500), path, out);
5210 path.pop();
5211 path.push_key("component");
5212 Validate::validate_at(&self.component, path, out);
5213 path.pop();
5214 path.push_key("eventNotificationType");
5215 Validate::validate_at(&self.event_notification_type, path, out);
5216 path.pop();
5217 path.push_key("variable");
5218 Validate::validate_at(&self.variable, path, out);
5219 path.pop();
5220 path.push_key("cause");
5221 if let Some(value) = &self.cause {
5222 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
5223 }
5224 path.pop();
5225 path.push_key("techCode");
5226 if let Some(value) = &self.tech_code {
5227 validate::string(value.as_str(), None, Some(50), path, out);
5228 }
5229 path.pop();
5230 path.push_key("techInfo");
5231 if let Some(value) = &self.tech_info {
5232 validate::string(value.as_str(), None, Some(500), path, out);
5233 }
5234 path.pop();
5235 path.push_key("transactionId");
5236 if let Some(value) = &self.transaction_id {
5237 validate::string(value.as_str(), None, Some(36), path, out);
5238 }
5239 path.pop();
5240 path.push_key("variableMonitoringId");
5241 if let Some(value) = &self.variable_monitoring_id {
5242 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
5243 }
5244 path.pop();
5245 path.push_key("severity");
5246 if let Some(value) = &self.severity {
5247 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
5248 }
5249 path.pop();
5250 path.push_key("customData");
5251 if let Some(value) = &self.custom_data {
5252 Validate::validate_at(value, path, out);
5253 }
5254 path.pop();
5255 }
5256}
5257
5258#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5262pub struct Firmware {
5263 pub location: String,
5265 #[serde(rename = "retrieveDateTime")]
5267 pub retrieve_date_time: crate::types::DateTime,
5268 #[serde(rename = "installDateTime")]
5270 #[serde(default, skip_serializing_if = "Option::is_none")]
5271 pub install_date_time: Option<crate::types::DateTime>,
5272 #[serde(rename = "signingCertificate")]
5275 #[serde(default, skip_serializing_if = "Option::is_none")]
5276 pub signing_certificate: Option<String>,
5277 #[serde(default, skip_serializing_if = "Option::is_none")]
5279 pub signature: Option<String>,
5280 #[serde(rename = "customData")]
5282 #[serde(default, skip_serializing_if = "Option::is_none")]
5283 pub custom_data: Option<crate::types::CustomData>,
5284}
5285
5286impl Firmware {
5287 #[must_use]
5289 pub fn new(
5290 location: impl Into<String>,
5291 retrieve_date_time: impl Into<crate::types::DateTime>,
5292 ) -> Self {
5293 Self {
5294 location: location.into(),
5295 retrieve_date_time: retrieve_date_time.into(),
5296 install_date_time: None,
5297 signing_certificate: None,
5298 signature: None,
5299 custom_data: None,
5300 }
5301 }
5302
5303 #[must_use]
5305 pub fn with_install_date_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
5306 self.install_date_time = Some(value.into());
5307 self
5308 }
5309
5310 #[must_use]
5312 pub fn with_signing_certificate(mut self, value: impl Into<String>) -> Self {
5313 self.signing_certificate = Some(value.into());
5314 self
5315 }
5316
5317 #[must_use]
5319 pub fn with_signature(mut self, value: impl Into<String>) -> Self {
5320 self.signature = Some(value.into());
5321 self
5322 }
5323
5324 #[must_use]
5326 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5327 self.custom_data = Some(value);
5328 self
5329 }
5330}
5331
5332impl Validate for Firmware {
5333 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5334 path.push_key("location");
5335 validate::string(self.location.as_str(), None, Some(2000), path, out);
5336 path.pop();
5337 path.push_key("signingCertificate");
5338 if let Some(value) = &self.signing_certificate {
5339 validate::string(value.as_str(), None, Some(5500), path, out);
5340 }
5341 path.pop();
5342 path.push_key("signature");
5343 if let Some(value) = &self.signature {
5344 validate::string(value.as_str(), None, Some(800), path, out);
5345 }
5346 path.pop();
5347 path.push_key("customData");
5348 if let Some(value) = &self.custom_data {
5349 Validate::validate_at(value, path, out);
5350 }
5351 path.pop();
5352 }
5353}
5354
5355#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5357pub struct FixedPF {
5358 pub priority: i32,
5360 pub displacement: crate::types::Decimal,
5362 pub excitation: bool,
5364 #[serde(rename = "startTime")]
5366 #[serde(default, skip_serializing_if = "Option::is_none")]
5367 pub start_time: Option<crate::types::DateTime>,
5368 #[serde(default, skip_serializing_if = "Option::is_none")]
5370 pub duration: Option<crate::types::Decimal>,
5371 #[serde(rename = "customData")]
5373 #[serde(default, skip_serializing_if = "Option::is_none")]
5374 pub custom_data: Option<crate::types::CustomData>,
5375}
5376
5377impl FixedPF {
5378 #[must_use]
5380 pub fn new(
5381 priority: i32,
5382 displacement: impl Into<crate::types::Decimal>,
5383 excitation: bool,
5384 ) -> Self {
5385 Self {
5386 priority,
5387 displacement: displacement.into(),
5388 excitation,
5389 start_time: None,
5390 duration: None,
5391 custom_data: None,
5392 }
5393 }
5394
5395 #[must_use]
5397 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
5398 self.start_time = Some(value.into());
5399 self
5400 }
5401
5402 #[must_use]
5404 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5405 self.duration = Some(value.into());
5406 self
5407 }
5408
5409 #[must_use]
5411 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5412 self.custom_data = Some(value);
5413 self
5414 }
5415}
5416
5417impl Validate for FixedPF {
5418 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5419 path.push_key("priority");
5420 validate::int_range(i64::from(self.priority), Some(0.0), None, path, out);
5421 path.pop();
5422 path.push_key("customData");
5423 if let Some(value) = &self.custom_data {
5424 Validate::validate_at(value, path, out);
5425 }
5426 path.pop();
5427 }
5428}
5429
5430#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5432pub struct FixedPFGet {
5433 #[serde(rename = "fixedPF")]
5435 pub fixed_pf: FixedPF,
5436 pub id: String,
5438 #[serde(rename = "isDefault")]
5440 pub is_default: bool,
5441 #[serde(rename = "isSuperseded")]
5443 pub is_superseded: bool,
5444 #[serde(rename = "customData")]
5446 #[serde(default, skip_serializing_if = "Option::is_none")]
5447 pub custom_data: Option<crate::types::CustomData>,
5448}
5449
5450impl FixedPFGet {
5451 #[must_use]
5453 pub fn new(
5454 fixed_pf: FixedPF,
5455 id: impl Into<String>,
5456 is_default: bool,
5457 is_superseded: bool,
5458 ) -> Self {
5459 Self {
5460 fixed_pf,
5461 id: id.into(),
5462 is_default,
5463 is_superseded,
5464 custom_data: None,
5465 }
5466 }
5467
5468 #[must_use]
5470 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5471 self.custom_data = Some(value);
5472 self
5473 }
5474}
5475
5476impl Validate for FixedPFGet {
5477 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5478 path.push_key("fixedPF");
5479 Validate::validate_at(&self.fixed_pf, path, out);
5480 path.pop();
5481 path.push_key("id");
5482 validate::string(self.id.as_str(), None, Some(36), path, out);
5483 path.pop();
5484 path.push_key("customData");
5485 if let Some(value) = &self.custom_data {
5486 Validate::validate_at(value, path, out);
5487 }
5488 path.pop();
5489 }
5490}
5491
5492#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5494pub struct FixedVar {
5495 pub priority: i32,
5497 pub setpoint: crate::types::Decimal,
5501 pub unit: DERUnit,
5503 #[serde(rename = "startTime")]
5505 #[serde(default, skip_serializing_if = "Option::is_none")]
5506 pub start_time: Option<crate::types::DateTime>,
5507 #[serde(default, skip_serializing_if = "Option::is_none")]
5509 pub duration: Option<crate::types::Decimal>,
5510 #[serde(rename = "customData")]
5512 #[serde(default, skip_serializing_if = "Option::is_none")]
5513 pub custom_data: Option<crate::types::CustomData>,
5514}
5515
5516impl FixedVar {
5517 #[must_use]
5519 pub fn new(priority: i32, setpoint: impl Into<crate::types::Decimal>, unit: DERUnit) -> Self {
5520 Self {
5521 priority,
5522 setpoint: setpoint.into(),
5523 unit,
5524 start_time: None,
5525 duration: None,
5526 custom_data: None,
5527 }
5528 }
5529
5530 #[must_use]
5532 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
5533 self.start_time = Some(value.into());
5534 self
5535 }
5536
5537 #[must_use]
5539 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5540 self.duration = Some(value.into());
5541 self
5542 }
5543
5544 #[must_use]
5546 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5547 self.custom_data = Some(value);
5548 self
5549 }
5550}
5551
5552impl Validate for FixedVar {
5553 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5554 path.push_key("priority");
5555 validate::int_range(i64::from(self.priority), Some(0.0), None, path, out);
5556 path.pop();
5557 path.push_key("unit");
5558 Validate::validate_at(&self.unit, path, out);
5559 path.pop();
5560 path.push_key("customData");
5561 if let Some(value) = &self.custom_data {
5562 Validate::validate_at(value, path, out);
5563 }
5564 path.pop();
5565 }
5566}
5567
5568#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5570pub struct FixedVarGet {
5571 #[serde(rename = "fixedVar")]
5573 pub fixed_var: FixedVar,
5574 pub id: String,
5576 #[serde(rename = "isDefault")]
5578 pub is_default: bool,
5579 #[serde(rename = "isSuperseded")]
5581 pub is_superseded: bool,
5582 #[serde(rename = "customData")]
5584 #[serde(default, skip_serializing_if = "Option::is_none")]
5585 pub custom_data: Option<crate::types::CustomData>,
5586}
5587
5588impl FixedVarGet {
5589 #[must_use]
5591 pub fn new(
5592 fixed_var: FixedVar,
5593 id: impl Into<String>,
5594 is_default: bool,
5595 is_superseded: bool,
5596 ) -> Self {
5597 Self {
5598 fixed_var,
5599 id: id.into(),
5600 is_default,
5601 is_superseded,
5602 custom_data: None,
5603 }
5604 }
5605
5606 #[must_use]
5608 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5609 self.custom_data = Some(value);
5610 self
5611 }
5612}
5613
5614impl Validate for FixedVarGet {
5615 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5616 path.push_key("fixedVar");
5617 Validate::validate_at(&self.fixed_var, path, out);
5618 path.pop();
5619 path.push_key("id");
5620 validate::string(self.id.as_str(), None, Some(36), path, out);
5621 path.pop();
5622 path.push_key("customData");
5623 if let Some(value) = &self.custom_data {
5624 Validate::validate_at(value, path, out);
5625 }
5626 path.pop();
5627 }
5628}
5629
5630#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5632pub struct FreqDroop {
5633 pub priority: i32,
5635 #[serde(rename = "overFreq")]
5637 pub over_freq: crate::types::Decimal,
5638 #[serde(rename = "underFreq")]
5640 pub under_freq: crate::types::Decimal,
5641 #[serde(rename = "overDroop")]
5643 pub over_droop: crate::types::Decimal,
5644 #[serde(rename = "underDroop")]
5646 pub under_droop: crate::types::Decimal,
5647 #[serde(rename = "responseTime")]
5649 pub response_time: crate::types::Decimal,
5650 #[serde(rename = "startTime")]
5652 #[serde(default, skip_serializing_if = "Option::is_none")]
5653 pub start_time: Option<crate::types::DateTime>,
5654 #[serde(default, skip_serializing_if = "Option::is_none")]
5656 pub duration: Option<crate::types::Decimal>,
5657 #[serde(rename = "customData")]
5659 #[serde(default, skip_serializing_if = "Option::is_none")]
5660 pub custom_data: Option<crate::types::CustomData>,
5661}
5662
5663impl FreqDroop {
5664 #[must_use]
5666 pub fn new(
5667 priority: i32,
5668 over_freq: impl Into<crate::types::Decimal>,
5669 under_freq: impl Into<crate::types::Decimal>,
5670 over_droop: impl Into<crate::types::Decimal>,
5671 under_droop: impl Into<crate::types::Decimal>,
5672 response_time: impl Into<crate::types::Decimal>,
5673 ) -> Self {
5674 Self {
5675 priority,
5676 over_freq: over_freq.into(),
5677 under_freq: under_freq.into(),
5678 over_droop: over_droop.into(),
5679 under_droop: under_droop.into(),
5680 response_time: response_time.into(),
5681 start_time: None,
5682 duration: None,
5683 custom_data: None,
5684 }
5685 }
5686
5687 #[must_use]
5689 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
5690 self.start_time = Some(value.into());
5691 self
5692 }
5693
5694 #[must_use]
5696 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
5697 self.duration = Some(value.into());
5698 self
5699 }
5700
5701 #[must_use]
5703 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5704 self.custom_data = Some(value);
5705 self
5706 }
5707}
5708
5709impl Validate for FreqDroop {
5710 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5711 path.push_key("priority");
5712 validate::int_range(i64::from(self.priority), Some(0.0), None, path, out);
5713 path.pop();
5714 path.push_key("customData");
5715 if let Some(value) = &self.custom_data {
5716 Validate::validate_at(value, path, out);
5717 }
5718 path.pop();
5719 }
5720}
5721
5722#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5724pub struct FreqDroopGet {
5725 #[serde(rename = "freqDroop")]
5727 pub freq_droop: FreqDroop,
5728 pub id: String,
5730 #[serde(rename = "isDefault")]
5732 pub is_default: bool,
5733 #[serde(rename = "isSuperseded")]
5735 pub is_superseded: bool,
5736 #[serde(rename = "customData")]
5738 #[serde(default, skip_serializing_if = "Option::is_none")]
5739 pub custom_data: Option<crate::types::CustomData>,
5740}
5741
5742impl FreqDroopGet {
5743 #[must_use]
5745 pub fn new(
5746 freq_droop: FreqDroop,
5747 id: impl Into<String>,
5748 is_default: bool,
5749 is_superseded: bool,
5750 ) -> Self {
5751 Self {
5752 freq_droop,
5753 id: id.into(),
5754 is_default,
5755 is_superseded,
5756 custom_data: None,
5757 }
5758 }
5759
5760 #[must_use]
5762 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5763 self.custom_data = Some(value);
5764 self
5765 }
5766}
5767
5768impl Validate for FreqDroopGet {
5769 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5770 path.push_key("freqDroop");
5771 Validate::validate_at(&self.freq_droop, path, out);
5772 path.pop();
5773 path.push_key("id");
5774 validate::string(self.id.as_str(), None, Some(36), path, out);
5775 path.pop();
5776 path.push_key("customData");
5777 if let Some(value) = &self.custom_data {
5778 Validate::validate_at(value, path, out);
5779 }
5780 path.pop();
5781 }
5782}
5783
5784#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5788pub struct GetVariableData {
5789 pub component: Component,
5791 pub variable: Variable,
5793 #[serde(rename = "attributeType")]
5795 #[serde(default, skip_serializing_if = "Option::is_none")]
5796 pub attribute_type: Option<Attribute>,
5797 #[serde(rename = "customData")]
5799 #[serde(default, skip_serializing_if = "Option::is_none")]
5800 pub custom_data: Option<crate::types::CustomData>,
5801}
5802
5803impl GetVariableData {
5804 #[must_use]
5806 pub fn new(component: Component, variable: Variable) -> Self {
5807 Self {
5808 component,
5809 variable,
5810 attribute_type: None,
5811 custom_data: None,
5812 }
5813 }
5814
5815 #[must_use]
5817 pub fn with_attribute_type(mut self, value: Attribute) -> Self {
5818 self.attribute_type = Some(value);
5819 self
5820 }
5821
5822 #[must_use]
5824 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5825 self.custom_data = Some(value);
5826 self
5827 }
5828}
5829
5830impl Validate for GetVariableData {
5831 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5832 path.push_key("component");
5833 Validate::validate_at(&self.component, path, out);
5834 path.pop();
5835 path.push_key("variable");
5836 Validate::validate_at(&self.variable, path, out);
5837 path.pop();
5838 path.push_key("attributeType");
5839 if let Some(value) = &self.attribute_type {
5840 Validate::validate_at(value, path, out);
5841 }
5842 path.pop();
5843 path.push_key("customData");
5844 if let Some(value) = &self.custom_data {
5845 Validate::validate_at(value, path, out);
5846 }
5847 path.pop();
5848 }
5849}
5850
5851#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5855pub struct GetVariableResult {
5856 #[serde(rename = "attributeStatus")]
5858 pub attribute_status: GetVariableStatus,
5859 pub component: Component,
5861 pub variable: Variable,
5863 #[serde(rename = "attributeStatusInfo")]
5865 #[serde(default, skip_serializing_if = "Option::is_none")]
5866 pub attribute_status_info: Option<StatusInfo>,
5867 #[serde(rename = "attributeType")]
5869 #[serde(default, skip_serializing_if = "Option::is_none")]
5870 pub attribute_type: Option<Attribute>,
5871 #[serde(rename = "attributeValue")]
5875 #[serde(default, skip_serializing_if = "Option::is_none")]
5876 pub attribute_value: Option<String>,
5877 #[serde(rename = "customData")]
5879 #[serde(default, skip_serializing_if = "Option::is_none")]
5880 pub custom_data: Option<crate::types::CustomData>,
5881}
5882
5883impl GetVariableResult {
5884 #[must_use]
5886 pub fn new(
5887 attribute_status: GetVariableStatus,
5888 component: Component,
5889 variable: Variable,
5890 ) -> Self {
5891 Self {
5892 attribute_status,
5893 component,
5894 variable,
5895 attribute_status_info: None,
5896 attribute_type: None,
5897 attribute_value: None,
5898 custom_data: None,
5899 }
5900 }
5901
5902 #[must_use]
5904 pub fn with_attribute_status_info(mut self, value: StatusInfo) -> Self {
5905 self.attribute_status_info = Some(value);
5906 self
5907 }
5908
5909 #[must_use]
5911 pub fn with_attribute_type(mut self, value: Attribute) -> Self {
5912 self.attribute_type = Some(value);
5913 self
5914 }
5915
5916 #[must_use]
5918 pub fn with_attribute_value(mut self, value: impl Into<String>) -> Self {
5919 self.attribute_value = Some(value.into());
5920 self
5921 }
5922
5923 #[must_use]
5925 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
5926 self.custom_data = Some(value);
5927 self
5928 }
5929}
5930
5931impl Validate for GetVariableResult {
5932 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
5933 path.push_key("attributeStatus");
5934 Validate::validate_at(&self.attribute_status, path, out);
5935 path.pop();
5936 path.push_key("component");
5937 Validate::validate_at(&self.component, path, out);
5938 path.pop();
5939 path.push_key("variable");
5940 Validate::validate_at(&self.variable, path, out);
5941 path.pop();
5942 path.push_key("attributeStatusInfo");
5943 if let Some(value) = &self.attribute_status_info {
5944 Validate::validate_at(value, path, out);
5945 }
5946 path.pop();
5947 path.push_key("attributeType");
5948 if let Some(value) = &self.attribute_type {
5949 Validate::validate_at(value, path, out);
5950 }
5951 path.pop();
5952 path.push_key("attributeValue");
5953 if let Some(value) = &self.attribute_value {
5954 validate::string(value.as_str(), None, Some(2500), path, out);
5955 }
5956 path.pop();
5957 path.push_key("customData");
5958 if let Some(value) = &self.custom_data {
5959 Validate::validate_at(value, path, out);
5960 }
5961 path.pop();
5962 }
5963}
5964
5965#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5967pub struct Gradient {
5968 pub priority: i32,
5970 pub gradient: crate::types::Decimal,
5972 #[serde(rename = "softGradient")]
5974 pub soft_gradient: crate::types::Decimal,
5975 #[serde(rename = "customData")]
5977 #[serde(default, skip_serializing_if = "Option::is_none")]
5978 pub custom_data: Option<crate::types::CustomData>,
5979}
5980
5981impl Gradient {
5982 #[must_use]
5984 pub fn new(
5985 priority: i32,
5986 gradient: impl Into<crate::types::Decimal>,
5987 soft_gradient: impl Into<crate::types::Decimal>,
5988 ) -> Self {
5989 Self {
5990 priority,
5991 gradient: gradient.into(),
5992 soft_gradient: soft_gradient.into(),
5993 custom_data: None,
5994 }
5995 }
5996
5997 #[must_use]
5999 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6000 self.custom_data = Some(value);
6001 self
6002 }
6003}
6004
6005impl Validate for Gradient {
6006 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6007 path.push_key("priority");
6008 validate::int_range(i64::from(self.priority), Some(0.0), None, path, out);
6009 path.pop();
6010 path.push_key("customData");
6011 if let Some(value) = &self.custom_data {
6012 Validate::validate_at(value, path, out);
6013 }
6014 path.pop();
6015 }
6016}
6017
6018#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6020pub struct GradientGet {
6021 pub gradient: Gradient,
6023 pub id: String,
6025 #[serde(rename = "customData")]
6027 #[serde(default, skip_serializing_if = "Option::is_none")]
6028 pub custom_data: Option<crate::types::CustomData>,
6029}
6030
6031impl GradientGet {
6032 #[must_use]
6034 pub fn new(gradient: Gradient, id: impl Into<String>) -> Self {
6035 Self {
6036 gradient,
6037 id: id.into(),
6038 custom_data: None,
6039 }
6040 }
6041
6042 #[must_use]
6044 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6045 self.custom_data = Some(value);
6046 self
6047 }
6048}
6049
6050impl Validate for GradientGet {
6051 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6052 path.push_key("gradient");
6053 Validate::validate_at(&self.gradient, path, out);
6054 path.pop();
6055 path.push_key("id");
6056 validate::string(self.id.as_str(), None, Some(36), path, out);
6057 path.pop();
6058 path.push_key("customData");
6059 if let Some(value) = &self.custom_data {
6060 Validate::validate_at(value, path, out);
6061 }
6062 path.pop();
6063 }
6064}
6065
6066#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
6068pub struct Hysteresis {
6069 #[serde(rename = "hysteresisHigh")]
6071 #[serde(default, skip_serializing_if = "Option::is_none")]
6072 pub hysteresis_high: Option<crate::types::Decimal>,
6073 #[serde(rename = "hysteresisLow")]
6075 #[serde(default, skip_serializing_if = "Option::is_none")]
6076 pub hysteresis_low: Option<crate::types::Decimal>,
6077 #[serde(rename = "hysteresisDelay")]
6079 #[serde(default, skip_serializing_if = "Option::is_none")]
6080 pub hysteresis_delay: Option<crate::types::Decimal>,
6081 #[serde(rename = "hysteresisGradient")]
6083 #[serde(default, skip_serializing_if = "Option::is_none")]
6084 pub hysteresis_gradient: Option<crate::types::Decimal>,
6085 #[serde(rename = "customData")]
6087 #[serde(default, skip_serializing_if = "Option::is_none")]
6088 pub custom_data: Option<crate::types::CustomData>,
6089}
6090
6091impl Hysteresis {
6092 #[must_use]
6094 pub fn new() -> Self {
6095 Self::default()
6096 }
6097
6098 #[must_use]
6100 pub fn with_hysteresis_high(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6101 self.hysteresis_high = Some(value.into());
6102 self
6103 }
6104
6105 #[must_use]
6107 pub fn with_hysteresis_low(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6108 self.hysteresis_low = Some(value.into());
6109 self
6110 }
6111
6112 #[must_use]
6114 pub fn with_hysteresis_delay(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6115 self.hysteresis_delay = Some(value.into());
6116 self
6117 }
6118
6119 #[must_use]
6121 pub fn with_hysteresis_gradient(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6122 self.hysteresis_gradient = Some(value.into());
6123 self
6124 }
6125
6126 #[must_use]
6128 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6129 self.custom_data = Some(value);
6130 self
6131 }
6132}
6133
6134impl Validate for Hysteresis {
6135 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6136 path.push_key("customData");
6137 if let Some(value) = &self.custom_data {
6138 Validate::validate_at(value, path, out);
6139 }
6140 path.pop();
6141 }
6142}
6143
6144#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6148pub struct IdToken {
6149 #[serde(rename = "idToken")]
6151 pub id_token: String,
6152 pub r#type: String,
6154 #[serde(rename = "additionalInfo")]
6156 #[serde(default, skip_serializing_if = "Option::is_none")]
6157 pub additional_info: Option<Vec<AdditionalInfo>>,
6158 #[serde(rename = "customData")]
6160 #[serde(default, skip_serializing_if = "Option::is_none")]
6161 pub custom_data: Option<crate::types::CustomData>,
6162}
6163
6164impl IdToken {
6165 #[must_use]
6167 pub fn new(id_token: impl Into<String>, r#type: impl Into<String>) -> Self {
6168 Self {
6169 id_token: id_token.into(),
6170 r#type: r#type.into(),
6171 additional_info: None,
6172 custom_data: None,
6173 }
6174 }
6175
6176 #[must_use]
6178 pub fn with_additional_info(mut self, value: Vec<AdditionalInfo>) -> Self {
6179 self.additional_info = Some(value);
6180 self
6181 }
6182
6183 #[must_use]
6185 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6186 self.custom_data = Some(value);
6187 self
6188 }
6189}
6190
6191impl Validate for IdToken {
6192 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6193 path.push_key("idToken");
6194 validate::string(self.id_token.as_str(), None, Some(255), path, out);
6195 path.pop();
6196 path.push_key("type");
6197 validate::string(self.r#type.as_str(), None, Some(20), path, out);
6198 path.pop();
6199 path.push_key("additionalInfo");
6200 if let Some(value) = &self.additional_info {
6201 validate::list_len(value.len(), Some(1), None, path, out);
6202 for (index, item) in value.iter().enumerate() {
6203 path.push_index(index);
6204 Validate::validate_at(item, path, out);
6205 path.pop();
6206 }
6207 }
6208 path.pop();
6209 path.push_key("customData");
6210 if let Some(value) = &self.custom_data {
6211 Validate::validate_at(value, path, out);
6212 }
6213 path.pop();
6214 }
6215}
6216
6217#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6222pub struct IdTokenInfo {
6223 pub status: AuthorizationStatus,
6225 #[serde(rename = "cacheExpiryDateTime")]
6227 #[serde(default, skip_serializing_if = "Option::is_none")]
6228 pub cache_expiry_date_time: Option<crate::types::DateTime>,
6229 #[serde(rename = "chargingPriority")]
6231 #[serde(default, skip_serializing_if = "Option::is_none")]
6232 pub charging_priority: Option<i32>,
6233 #[serde(rename = "groupIdToken")]
6235 #[serde(default, skip_serializing_if = "Option::is_none")]
6236 pub group_id_token: Option<IdToken>,
6237 #[serde(default, skip_serializing_if = "Option::is_none")]
6239 pub language1: Option<String>,
6240 #[serde(default, skip_serializing_if = "Option::is_none")]
6242 pub language2: Option<String>,
6243 #[serde(rename = "evseId")]
6245 #[serde(default, skip_serializing_if = "Option::is_none")]
6246 pub evse_id: Option<Vec<i32>>,
6247 #[serde(rename = "personalMessage")]
6249 #[serde(default, skip_serializing_if = "Option::is_none")]
6250 pub personal_message: Option<MessageContent>,
6251 #[serde(rename = "customData")]
6253 #[serde(default, skip_serializing_if = "Option::is_none")]
6254 pub custom_data: Option<crate::types::CustomData>,
6255}
6256
6257impl IdTokenInfo {
6258 #[must_use]
6260 pub fn new(status: AuthorizationStatus) -> Self {
6261 Self {
6262 status,
6263 cache_expiry_date_time: None,
6264 charging_priority: None,
6265 group_id_token: None,
6266 language1: None,
6267 language2: None,
6268 evse_id: None,
6269 personal_message: None,
6270 custom_data: None,
6271 }
6272 }
6273
6274 #[must_use]
6276 pub fn with_cache_expiry_date_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6277 self.cache_expiry_date_time = Some(value.into());
6278 self
6279 }
6280
6281 #[must_use]
6283 pub fn with_charging_priority(mut self, value: i32) -> Self {
6284 self.charging_priority = Some(value);
6285 self
6286 }
6287
6288 #[must_use]
6290 pub fn with_group_id_token(mut self, value: IdToken) -> Self {
6291 self.group_id_token = Some(value);
6292 self
6293 }
6294
6295 #[must_use]
6297 pub fn with_language1(mut self, value: impl Into<String>) -> Self {
6298 self.language1 = Some(value.into());
6299 self
6300 }
6301
6302 #[must_use]
6304 pub fn with_language2(mut self, value: impl Into<String>) -> Self {
6305 self.language2 = Some(value.into());
6306 self
6307 }
6308
6309 #[must_use]
6311 pub fn with_evse_id(mut self, value: Vec<i32>) -> Self {
6312 self.evse_id = Some(value);
6313 self
6314 }
6315
6316 #[must_use]
6318 pub fn with_personal_message(mut self, value: MessageContent) -> Self {
6319 self.personal_message = Some(value);
6320 self
6321 }
6322
6323 #[must_use]
6325 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6326 self.custom_data = Some(value);
6327 self
6328 }
6329}
6330
6331impl Validate for IdTokenInfo {
6332 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6333 path.push_key("status");
6334 Validate::validate_at(&self.status, path, out);
6335 path.pop();
6336 path.push_key("groupIdToken");
6337 if let Some(value) = &self.group_id_token {
6338 Validate::validate_at(value, path, out);
6339 }
6340 path.pop();
6341 path.push_key("language1");
6342 if let Some(value) = &self.language1 {
6343 validate::string(value.as_str(), None, Some(8), path, out);
6344 }
6345 path.pop();
6346 path.push_key("language2");
6347 if let Some(value) = &self.language2 {
6348 validate::string(value.as_str(), None, Some(8), path, out);
6349 }
6350 path.pop();
6351 path.push_key("evseId");
6352 if let Some(value) = &self.evse_id {
6353 validate::list_len(value.len(), Some(1), None, path, out);
6354 for (index, item) in value.iter().enumerate() {
6355 path.push_index(index);
6356 validate::int_range(i64::from(*item), Some(0.0), None, path, out);
6357 path.pop();
6358 }
6359 }
6360 path.pop();
6361 path.push_key("personalMessage");
6362 if let Some(value) = &self.personal_message {
6363 Validate::validate_at(value, path, out);
6364 }
6365 path.pop();
6366 path.push_key("customData");
6367 if let Some(value) = &self.custom_data {
6368 Validate::validate_at(value, path, out);
6369 }
6370 path.pop();
6371 }
6372}
6373
6374#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6376pub struct LimitAtSoC {
6377 pub soc: i32,
6379 pub limit: crate::types::Decimal,
6382 #[serde(rename = "customData")]
6384 #[serde(default, skip_serializing_if = "Option::is_none")]
6385 pub custom_data: Option<crate::types::CustomData>,
6386}
6387
6388impl LimitAtSoC {
6389 #[must_use]
6391 pub fn new(soc: i32, limit: impl Into<crate::types::Decimal>) -> Self {
6392 Self {
6393 soc,
6394 limit: limit.into(),
6395 custom_data: None,
6396 }
6397 }
6398
6399 #[must_use]
6401 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6402 self.custom_data = Some(value);
6403 self
6404 }
6405}
6406
6407impl Validate for LimitAtSoC {
6408 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6409 path.push_key("soc");
6410 validate::int_range(i64::from(self.soc), Some(0.0), Some(100.0), path, out);
6411 path.pop();
6412 path.push_key("customData");
6413 if let Some(value) = &self.custom_data {
6414 Validate::validate_at(value, path, out);
6415 }
6416 path.pop();
6417 }
6418}
6419
6420#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6422pub struct LimitMaxDischarge {
6423 pub priority: i32,
6425 #[serde(rename = "pctMaxDischargePower")]
6429 #[serde(default, skip_serializing_if = "Option::is_none")]
6430 pub pct_max_discharge_power: Option<crate::types::Decimal>,
6431 #[serde(rename = "powerMonitoringMustTrip")]
6433 #[serde(default, skip_serializing_if = "Option::is_none")]
6434 pub power_monitoring_must_trip: Option<DERCurve>,
6435 #[serde(rename = "startTime")]
6437 #[serde(default, skip_serializing_if = "Option::is_none")]
6438 pub start_time: Option<crate::types::DateTime>,
6439 #[serde(default, skip_serializing_if = "Option::is_none")]
6441 pub duration: Option<crate::types::Decimal>,
6442 #[serde(rename = "customData")]
6444 #[serde(default, skip_serializing_if = "Option::is_none")]
6445 pub custom_data: Option<crate::types::CustomData>,
6446}
6447
6448impl LimitMaxDischarge {
6449 #[must_use]
6451 pub fn new(priority: i32) -> Self {
6452 Self {
6453 priority,
6454 pct_max_discharge_power: None,
6455 power_monitoring_must_trip: None,
6456 start_time: None,
6457 duration: None,
6458 custom_data: None,
6459 }
6460 }
6461
6462 #[must_use]
6464 pub fn with_pct_max_discharge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6465 self.pct_max_discharge_power = Some(value.into());
6466 self
6467 }
6468
6469 #[must_use]
6471 pub fn with_power_monitoring_must_trip(mut self, value: DERCurve) -> Self {
6472 self.power_monitoring_must_trip = Some(value);
6473 self
6474 }
6475
6476 #[must_use]
6478 pub fn with_start_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6479 self.start_time = Some(value.into());
6480 self
6481 }
6482
6483 #[must_use]
6485 pub fn with_duration(mut self, value: impl Into<crate::types::Decimal>) -> Self {
6486 self.duration = Some(value.into());
6487 self
6488 }
6489
6490 #[must_use]
6492 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6493 self.custom_data = Some(value);
6494 self
6495 }
6496}
6497
6498impl Validate for LimitMaxDischarge {
6499 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6500 path.push_key("priority");
6501 validate::int_range(i64::from(self.priority), Some(0.0), None, path, out);
6502 path.pop();
6503 path.push_key("powerMonitoringMustTrip");
6504 if let Some(value) = &self.power_monitoring_must_trip {
6505 Validate::validate_at(value, path, out);
6506 }
6507 path.pop();
6508 path.push_key("customData");
6509 if let Some(value) = &self.custom_data {
6510 Validate::validate_at(value, path, out);
6511 }
6512 path.pop();
6513 }
6514}
6515
6516#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6518pub struct LimitMaxDischargeGet {
6519 pub id: String,
6521 #[serde(rename = "isDefault")]
6523 pub is_default: bool,
6524 #[serde(rename = "isSuperseded")]
6526 pub is_superseded: bool,
6527 #[serde(rename = "limitMaxDischarge")]
6529 pub limit_max_discharge: LimitMaxDischarge,
6530 #[serde(rename = "customData")]
6532 #[serde(default, skip_serializing_if = "Option::is_none")]
6533 pub custom_data: Option<crate::types::CustomData>,
6534}
6535
6536impl LimitMaxDischargeGet {
6537 #[must_use]
6539 pub fn new(
6540 id: impl Into<String>,
6541 is_default: bool,
6542 is_superseded: bool,
6543 limit_max_discharge: LimitMaxDischarge,
6544 ) -> Self {
6545 Self {
6546 id: id.into(),
6547 is_default,
6548 is_superseded,
6549 limit_max_discharge,
6550 custom_data: None,
6551 }
6552 }
6553
6554 #[must_use]
6556 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6557 self.custom_data = Some(value);
6558 self
6559 }
6560}
6561
6562impl Validate for LimitMaxDischargeGet {
6563 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6564 path.push_key("id");
6565 validate::string(self.id.as_str(), None, Some(36), path, out);
6566 path.pop();
6567 path.push_key("limitMaxDischarge");
6568 Validate::validate_at(&self.limit_max_discharge, path, out);
6569 path.pop();
6570 path.push_key("customData");
6571 if let Some(value) = &self.custom_data {
6572 Validate::validate_at(value, path, out);
6573 }
6574 path.pop();
6575 }
6576}
6577
6578#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6582pub struct LogParameters {
6583 #[serde(rename = "remoteLocation")]
6585 pub remote_location: String,
6586 #[serde(rename = "oldestTimestamp")]
6588 #[serde(default, skip_serializing_if = "Option::is_none")]
6589 pub oldest_timestamp: Option<crate::types::DateTime>,
6590 #[serde(rename = "latestTimestamp")]
6592 #[serde(default, skip_serializing_if = "Option::is_none")]
6593 pub latest_timestamp: Option<crate::types::DateTime>,
6594 #[serde(rename = "customData")]
6596 #[serde(default, skip_serializing_if = "Option::is_none")]
6597 pub custom_data: Option<crate::types::CustomData>,
6598}
6599
6600impl LogParameters {
6601 #[must_use]
6603 pub fn new(remote_location: impl Into<String>) -> Self {
6604 Self {
6605 remote_location: remote_location.into(),
6606 oldest_timestamp: None,
6607 latest_timestamp: None,
6608 custom_data: None,
6609 }
6610 }
6611
6612 #[must_use]
6614 pub fn with_oldest_timestamp(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6615 self.oldest_timestamp = Some(value.into());
6616 self
6617 }
6618
6619 #[must_use]
6621 pub fn with_latest_timestamp(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6622 self.latest_timestamp = Some(value.into());
6623 self
6624 }
6625
6626 #[must_use]
6628 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6629 self.custom_data = Some(value);
6630 self
6631 }
6632}
6633
6634impl Validate for LogParameters {
6635 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6636 path.push_key("remoteLocation");
6637 validate::string(self.remote_location.as_str(), None, Some(2000), path, out);
6638 path.pop();
6639 path.push_key("customData");
6640 if let Some(value) = &self.custom_data {
6641 Validate::validate_at(value, path, out);
6642 }
6643 path.pop();
6644 }
6645}
6646
6647#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6651pub struct MessageContent {
6652 pub format: MessageFormat,
6654 pub content: String,
6658 #[serde(default, skip_serializing_if = "Option::is_none")]
6660 pub language: Option<String>,
6661 #[serde(rename = "customData")]
6663 #[serde(default, skip_serializing_if = "Option::is_none")]
6664 pub custom_data: Option<crate::types::CustomData>,
6665}
6666
6667impl MessageContent {
6668 #[must_use]
6670 pub fn new(format: MessageFormat, content: impl Into<String>) -> Self {
6671 Self {
6672 format,
6673 content: content.into(),
6674 language: None,
6675 custom_data: None,
6676 }
6677 }
6678
6679 #[must_use]
6681 pub fn with_language(mut self, value: impl Into<String>) -> Self {
6682 self.language = Some(value.into());
6683 self
6684 }
6685
6686 #[must_use]
6688 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6689 self.custom_data = Some(value);
6690 self
6691 }
6692}
6693
6694impl Validate for MessageContent {
6695 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6696 path.push_key("format");
6697 Validate::validate_at(&self.format, path, out);
6698 path.pop();
6699 path.push_key("content");
6700 validate::string(self.content.as_str(), None, Some(1024), path, out);
6701 path.pop();
6702 path.push_key("language");
6703 if let Some(value) = &self.language {
6704 validate::string(value.as_str(), None, Some(8), path, out);
6705 }
6706 path.pop();
6707 path.push_key("customData");
6708 if let Some(value) = &self.custom_data {
6709 Validate::validate_at(value, path, out);
6710 }
6711 path.pop();
6712 }
6713}
6714
6715#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6719pub struct MessageInfo {
6720 pub id: i32,
6722 pub priority: MessagePriority,
6724 pub message: MessageContent,
6726 #[serde(default, skip_serializing_if = "Option::is_none")]
6728 pub display: Option<Component>,
6729 #[serde(default, skip_serializing_if = "Option::is_none")]
6731 pub state: Option<MessageState>,
6732 #[serde(rename = "startDateTime")]
6734 #[serde(default, skip_serializing_if = "Option::is_none")]
6735 pub start_date_time: Option<crate::types::DateTime>,
6736 #[serde(rename = "endDateTime")]
6738 #[serde(default, skip_serializing_if = "Option::is_none")]
6739 pub end_date_time: Option<crate::types::DateTime>,
6740 #[serde(rename = "transactionId")]
6744 #[serde(default, skip_serializing_if = "Option::is_none")]
6745 pub transaction_id: Option<String>,
6746 #[serde(rename = "messageExtra")]
6748 #[serde(default, skip_serializing_if = "Option::is_none")]
6749 pub message_extra: Option<Vec<MessageContent>>,
6750 #[serde(rename = "customData")]
6752 #[serde(default, skip_serializing_if = "Option::is_none")]
6753 pub custom_data: Option<crate::types::CustomData>,
6754}
6755
6756impl MessageInfo {
6757 #[must_use]
6759 pub fn new(id: i32, priority: MessagePriority, message: MessageContent) -> Self {
6760 Self {
6761 id,
6762 priority,
6763 message,
6764 display: None,
6765 state: None,
6766 start_date_time: None,
6767 end_date_time: None,
6768 transaction_id: None,
6769 message_extra: None,
6770 custom_data: None,
6771 }
6772 }
6773
6774 #[must_use]
6776 pub fn with_display(mut self, value: Component) -> Self {
6777 self.display = Some(value);
6778 self
6779 }
6780
6781 #[must_use]
6783 pub fn with_state(mut self, value: MessageState) -> Self {
6784 self.state = Some(value);
6785 self
6786 }
6787
6788 #[must_use]
6790 pub fn with_start_date_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6791 self.start_date_time = Some(value.into());
6792 self
6793 }
6794
6795 #[must_use]
6797 pub fn with_end_date_time(mut self, value: impl Into<crate::types::DateTime>) -> Self {
6798 self.end_date_time = Some(value.into());
6799 self
6800 }
6801
6802 #[must_use]
6804 pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
6805 self.transaction_id = Some(value.into());
6806 self
6807 }
6808
6809 #[must_use]
6811 pub fn with_message_extra(mut self, value: Vec<MessageContent>) -> Self {
6812 self.message_extra = Some(value);
6813 self
6814 }
6815
6816 #[must_use]
6818 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6819 self.custom_data = Some(value);
6820 self
6821 }
6822}
6823
6824impl Validate for MessageInfo {
6825 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6826 path.push_key("id");
6827 validate::int_range(i64::from(self.id), Some(0.0), None, path, out);
6828 path.pop();
6829 path.push_key("priority");
6830 Validate::validate_at(&self.priority, path, out);
6831 path.pop();
6832 path.push_key("message");
6833 Validate::validate_at(&self.message, path, out);
6834 path.pop();
6835 path.push_key("display");
6836 if let Some(value) = &self.display {
6837 Validate::validate_at(value, path, out);
6838 }
6839 path.pop();
6840 path.push_key("state");
6841 if let Some(value) = &self.state {
6842 Validate::validate_at(value, path, out);
6843 }
6844 path.pop();
6845 path.push_key("transactionId");
6846 if let Some(value) = &self.transaction_id {
6847 validate::string(value.as_str(), None, Some(36), path, out);
6848 }
6849 path.pop();
6850 path.push_key("messageExtra");
6851 if let Some(value) = &self.message_extra {
6852 validate::list_len(value.len(), Some(1), Some(4), path, out);
6853 for (index, item) in value.iter().enumerate() {
6854 path.push_index(index);
6855 Validate::validate_at(item, path, out);
6856 path.pop();
6857 }
6858 }
6859 path.pop();
6860 path.push_key("customData");
6861 if let Some(value) = &self.custom_data {
6862 Validate::validate_at(value, path, out);
6863 }
6864 path.pop();
6865 }
6866}
6867
6868#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6872pub struct MeterValue {
6873 #[serde(rename = "sampledValue")]
6875 pub sampled_value: Vec<SampledValue>,
6876 pub timestamp: crate::types::DateTime,
6878 #[serde(rename = "customData")]
6880 #[serde(default, skip_serializing_if = "Option::is_none")]
6881 pub custom_data: Option<crate::types::CustomData>,
6882}
6883
6884impl MeterValue {
6885 #[must_use]
6887 pub fn new(
6888 sampled_value: Vec<SampledValue>,
6889 timestamp: impl Into<crate::types::DateTime>,
6890 ) -> Self {
6891 Self {
6892 sampled_value,
6893 timestamp: timestamp.into(),
6894 custom_data: None,
6895 }
6896 }
6897
6898 #[must_use]
6900 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6901 self.custom_data = Some(value);
6902 self
6903 }
6904}
6905
6906impl Validate for MeterValue {
6907 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6908 path.push_key("sampledValue");
6909 validate::list_len(self.sampled_value.len(), Some(1), None, path, out);
6910 for (index, item) in self.sampled_value.iter().enumerate() {
6911 path.push_index(index);
6912 Validate::validate_at(item, path, out);
6913 path.pop();
6914 }
6915 path.pop();
6916 path.push_key("customData");
6917 if let Some(value) = &self.custom_data {
6918 Validate::validate_at(value, path, out);
6919 }
6920 path.pop();
6921 }
6922}
6923
6924#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
6928pub struct Modem {
6929 #[serde(default, skip_serializing_if = "Option::is_none")]
6931 pub iccid: Option<String>,
6932 #[serde(default, skip_serializing_if = "Option::is_none")]
6934 pub imsi: Option<String>,
6935 #[serde(rename = "customData")]
6937 #[serde(default, skip_serializing_if = "Option::is_none")]
6938 pub custom_data: Option<crate::types::CustomData>,
6939}
6940
6941impl Modem {
6942 #[must_use]
6944 pub fn new() -> Self {
6945 Self::default()
6946 }
6947
6948 #[must_use]
6950 pub fn with_iccid(mut self, value: impl Into<String>) -> Self {
6951 self.iccid = Some(value.into());
6952 self
6953 }
6954
6955 #[must_use]
6957 pub fn with_imsi(mut self, value: impl Into<String>) -> Self {
6958 self.imsi = Some(value.into());
6959 self
6960 }
6961
6962 #[must_use]
6964 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
6965 self.custom_data = Some(value);
6966 self
6967 }
6968}
6969
6970impl Validate for Modem {
6971 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
6972 path.push_key("iccid");
6973 if let Some(value) = &self.iccid {
6974 validate::string(value.as_str(), None, Some(20), path, out);
6975 }
6976 path.pop();
6977 path.push_key("imsi");
6978 if let Some(value) = &self.imsi {
6979 validate::string(value.as_str(), None, Some(20), path, out);
6980 }
6981 path.pop();
6982 path.push_key("customData");
6983 if let Some(value) = &self.custom_data {
6984 Validate::validate_at(value, path, out);
6985 }
6986 path.pop();
6987 }
6988}
6989
6990#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
6994pub struct MonitoringData {
6995 pub component: Component,
6997 pub variable: Variable,
6999 #[serde(rename = "variableMonitoring")]
7001 pub variable_monitoring: Vec<VariableMonitoring>,
7002 #[serde(rename = "customData")]
7004 #[serde(default, skip_serializing_if = "Option::is_none")]
7005 pub custom_data: Option<crate::types::CustomData>,
7006}
7007
7008impl MonitoringData {
7009 #[must_use]
7011 pub fn new(
7012 component: Component,
7013 variable: Variable,
7014 variable_monitoring: Vec<VariableMonitoring>,
7015 ) -> Self {
7016 Self {
7017 component,
7018 variable,
7019 variable_monitoring,
7020 custom_data: None,
7021 }
7022 }
7023
7024 #[must_use]
7026 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7027 self.custom_data = Some(value);
7028 self
7029 }
7030}
7031
7032impl Validate for MonitoringData {
7033 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7034 path.push_key("component");
7035 Validate::validate_at(&self.component, path, out);
7036 path.pop();
7037 path.push_key("variable");
7038 Validate::validate_at(&self.variable, path, out);
7039 path.pop();
7040 path.push_key("variableMonitoring");
7041 validate::list_len(self.variable_monitoring.len(), Some(1), None, path, out);
7042 for (index, item) in self.variable_monitoring.iter().enumerate() {
7043 path.push_index(index);
7044 Validate::validate_at(item, path, out);
7045 path.pop();
7046 }
7047 path.pop();
7048 path.push_key("customData");
7049 if let Some(value) = &self.custom_data {
7050 Validate::validate_at(value, path, out);
7051 }
7052 path.pop();
7053 }
7054}
7055
7056#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7060pub struct NetworkConnectionProfile {
7061 #[serde(rename = "ocppInterface")]
7063 pub ocpp_interface: OCPPInterface,
7064 #[serde(rename = "ocppTransport")]
7066 pub ocpp_transport: OCPPTransport,
7067 #[serde(rename = "messageTimeout")]
7071 pub message_timeout: i32,
7072 #[serde(rename = "ocppCsmsUrl")]
7075 pub ocpp_csms_url: String,
7076 #[serde(rename = "securityProfile")]
7078 pub security_profile: i32,
7079 #[serde(default, skip_serializing_if = "Option::is_none")]
7081 pub apn: Option<APN>,
7082 #[serde(rename = "ocppVersion")]
7084 #[serde(default, skip_serializing_if = "Option::is_none")]
7085 pub ocpp_version: Option<OCPPVersion>,
7086 #[serde(default, skip_serializing_if = "Option::is_none")]
7088 pub identity: Option<String>,
7089 #[serde(rename = "basicAuthPassword")]
7091 #[serde(default, skip_serializing_if = "Option::is_none")]
7092 pub basic_auth_password: Option<String>,
7093 #[serde(default, skip_serializing_if = "Option::is_none")]
7095 pub vpn: Option<VPN>,
7096 #[serde(rename = "customData")]
7098 #[serde(default, skip_serializing_if = "Option::is_none")]
7099 pub custom_data: Option<crate::types::CustomData>,
7100}
7101
7102impl NetworkConnectionProfile {
7103 #[must_use]
7105 pub fn new(
7106 ocpp_interface: OCPPInterface,
7107 ocpp_transport: OCPPTransport,
7108 message_timeout: i32,
7109 ocpp_csms_url: impl Into<String>,
7110 security_profile: i32,
7111 ) -> Self {
7112 Self {
7113 ocpp_interface,
7114 ocpp_transport,
7115 message_timeout,
7116 ocpp_csms_url: ocpp_csms_url.into(),
7117 security_profile,
7118 apn: None,
7119 ocpp_version: None,
7120 identity: None,
7121 basic_auth_password: None,
7122 vpn: None,
7123 custom_data: None,
7124 }
7125 }
7126
7127 #[must_use]
7129 pub fn with_apn(mut self, value: APN) -> Self {
7130 self.apn = Some(value);
7131 self
7132 }
7133
7134 #[must_use]
7136 pub fn with_ocpp_version(mut self, value: OCPPVersion) -> Self {
7137 self.ocpp_version = Some(value);
7138 self
7139 }
7140
7141 #[must_use]
7143 pub fn with_identity(mut self, value: impl Into<String>) -> Self {
7144 self.identity = Some(value.into());
7145 self
7146 }
7147
7148 #[must_use]
7150 pub fn with_basic_auth_password(mut self, value: impl Into<String>) -> Self {
7151 self.basic_auth_password = Some(value.into());
7152 self
7153 }
7154
7155 #[must_use]
7157 pub fn with_vpn(mut self, value: VPN) -> Self {
7158 self.vpn = Some(value);
7159 self
7160 }
7161
7162 #[must_use]
7164 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7165 self.custom_data = Some(value);
7166 self
7167 }
7168}
7169
7170impl Validate for NetworkConnectionProfile {
7171 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7172 path.push_key("ocppInterface");
7173 Validate::validate_at(&self.ocpp_interface, path, out);
7174 path.pop();
7175 path.push_key("ocppTransport");
7176 Validate::validate_at(&self.ocpp_transport, path, out);
7177 path.pop();
7178 path.push_key("ocppCsmsUrl");
7179 validate::string(self.ocpp_csms_url.as_str(), None, Some(2000), path, out);
7180 path.pop();
7181 path.push_key("securityProfile");
7182 validate::int_range(i64::from(self.security_profile), Some(0.0), None, path, out);
7183 path.pop();
7184 path.push_key("apn");
7185 if let Some(value) = &self.apn {
7186 Validate::validate_at(value, path, out);
7187 }
7188 path.pop();
7189 path.push_key("ocppVersion");
7190 if let Some(value) = &self.ocpp_version {
7191 Validate::validate_at(value, path, out);
7192 }
7193 path.pop();
7194 path.push_key("identity");
7195 if let Some(value) = &self.identity {
7196 validate::string(value.as_str(), None, Some(48), path, out);
7197 }
7198 path.pop();
7199 path.push_key("basicAuthPassword");
7200 if let Some(value) = &self.basic_auth_password {
7201 validate::string(value.as_str(), None, Some(64), path, out);
7202 }
7203 path.pop();
7204 path.push_key("vpn");
7205 if let Some(value) = &self.vpn {
7206 Validate::validate_at(value, path, out);
7207 }
7208 path.pop();
7209 path.push_key("customData");
7210 if let Some(value) = &self.custom_data {
7211 Validate::validate_at(value, path, out);
7212 }
7213 path.pop();
7214 }
7215}
7216
7217#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7221pub struct OCSPRequestData {
7222 #[serde(rename = "hashAlgorithm")]
7224 pub hash_algorithm: HashAlgorithm,
7225 #[serde(rename = "issuerNameHash")]
7230 pub issuer_name_hash: String,
7231 #[serde(rename = "issuerKeyHash")]
7235 pub issuer_key_hash: String,
7236 #[serde(rename = "serialNumber")]
7240 pub serial_number: String,
7241 #[serde(rename = "responderURL")]
7243 pub responder_url: String,
7244 #[serde(rename = "customData")]
7246 #[serde(default, skip_serializing_if = "Option::is_none")]
7247 pub custom_data: Option<crate::types::CustomData>,
7248}
7249
7250impl OCSPRequestData {
7251 #[must_use]
7253 pub fn new(
7254 hash_algorithm: HashAlgorithm,
7255 issuer_name_hash: impl Into<String>,
7256 issuer_key_hash: impl Into<String>,
7257 serial_number: impl Into<String>,
7258 responder_url: impl Into<String>,
7259 ) -> Self {
7260 Self {
7261 hash_algorithm,
7262 issuer_name_hash: issuer_name_hash.into(),
7263 issuer_key_hash: issuer_key_hash.into(),
7264 serial_number: serial_number.into(),
7265 responder_url: responder_url.into(),
7266 custom_data: None,
7267 }
7268 }
7269
7270 #[must_use]
7272 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7273 self.custom_data = Some(value);
7274 self
7275 }
7276}
7277
7278impl Validate for OCSPRequestData {
7279 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7280 path.push_key("hashAlgorithm");
7281 Validate::validate_at(&self.hash_algorithm, path, out);
7282 path.pop();
7283 path.push_key("issuerNameHash");
7284 validate::string(self.issuer_name_hash.as_str(), None, Some(128), path, out);
7285 path.pop();
7286 path.push_key("issuerKeyHash");
7287 validate::string(self.issuer_key_hash.as_str(), None, Some(128), path, out);
7288 path.pop();
7289 path.push_key("serialNumber");
7290 validate::string(self.serial_number.as_str(), None, Some(40), path, out);
7291 path.pop();
7292 path.push_key("responderURL");
7293 validate::string(self.responder_url.as_str(), None, Some(2000), path, out);
7294 path.pop();
7295 path.push_key("customData");
7296 if let Some(value) = &self.custom_data {
7297 Validate::validate_at(value, path, out);
7298 }
7299 path.pop();
7300 }
7301}
7302
7303#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7307pub struct OverstayRule {
7308 #[serde(rename = "overstayFee")]
7310 pub overstay_fee: RationalNumber,
7311 #[serde(rename = "startTime")]
7313 pub start_time: i32,
7314 #[serde(rename = "overstayFeePeriod")]
7316 pub overstay_fee_period: i32,
7317 #[serde(rename = "overstayRuleDescription")]
7319 #[serde(default, skip_serializing_if = "Option::is_none")]
7320 pub overstay_rule_description: Option<String>,
7321 #[serde(rename = "customData")]
7323 #[serde(default, skip_serializing_if = "Option::is_none")]
7324 pub custom_data: Option<crate::types::CustomData>,
7325}
7326
7327impl OverstayRule {
7328 #[must_use]
7330 pub fn new(overstay_fee: RationalNumber, start_time: i32, overstay_fee_period: i32) -> Self {
7331 Self {
7332 overstay_fee,
7333 start_time,
7334 overstay_fee_period,
7335 overstay_rule_description: None,
7336 custom_data: None,
7337 }
7338 }
7339
7340 #[must_use]
7342 pub fn with_overstay_rule_description(mut self, value: impl Into<String>) -> Self {
7343 self.overstay_rule_description = Some(value.into());
7344 self
7345 }
7346
7347 #[must_use]
7349 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7350 self.custom_data = Some(value);
7351 self
7352 }
7353}
7354
7355impl Validate for OverstayRule {
7356 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7357 path.push_key("overstayFee");
7358 Validate::validate_at(&self.overstay_fee, path, out);
7359 path.pop();
7360 path.push_key("overstayRuleDescription");
7361 if let Some(value) = &self.overstay_rule_description {
7362 validate::string(value.as_str(), None, Some(32), path, out);
7363 }
7364 path.pop();
7365 path.push_key("customData");
7366 if let Some(value) = &self.custom_data {
7367 Validate::validate_at(value, path, out);
7368 }
7369 path.pop();
7370 }
7371}
7372
7373#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7377pub struct OverstayRuleList {
7378 #[serde(rename = "overstayRule")]
7380 pub overstay_rule: Vec<OverstayRule>,
7381 #[serde(rename = "overstayPowerThreshold")]
7383 #[serde(default, skip_serializing_if = "Option::is_none")]
7384 pub overstay_power_threshold: Option<RationalNumber>,
7385 #[serde(rename = "overstayTimeThreshold")]
7387 #[serde(default, skip_serializing_if = "Option::is_none")]
7388 pub overstay_time_threshold: Option<i32>,
7389 #[serde(rename = "customData")]
7391 #[serde(default, skip_serializing_if = "Option::is_none")]
7392 pub custom_data: Option<crate::types::CustomData>,
7393}
7394
7395impl OverstayRuleList {
7396 #[must_use]
7398 pub fn new(overstay_rule: Vec<OverstayRule>) -> Self {
7399 Self {
7400 overstay_rule,
7401 overstay_power_threshold: None,
7402 overstay_time_threshold: None,
7403 custom_data: None,
7404 }
7405 }
7406
7407 #[must_use]
7409 pub fn with_overstay_power_threshold(mut self, value: RationalNumber) -> Self {
7410 self.overstay_power_threshold = Some(value);
7411 self
7412 }
7413
7414 #[must_use]
7416 pub fn with_overstay_time_threshold(mut self, value: i32) -> Self {
7417 self.overstay_time_threshold = Some(value);
7418 self
7419 }
7420
7421 #[must_use]
7423 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7424 self.custom_data = Some(value);
7425 self
7426 }
7427}
7428
7429impl Validate for OverstayRuleList {
7430 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7431 path.push_key("overstayRule");
7432 validate::list_len(self.overstay_rule.len(), Some(1), Some(5), path, out);
7433 for (index, item) in self.overstay_rule.iter().enumerate() {
7434 path.push_index(index);
7435 Validate::validate_at(item, path, out);
7436 path.pop();
7437 }
7438 path.pop();
7439 path.push_key("overstayPowerThreshold");
7440 if let Some(value) = &self.overstay_power_threshold {
7441 Validate::validate_at(value, path, out);
7442 }
7443 path.pop();
7444 path.push_key("customData");
7445 if let Some(value) = &self.custom_data {
7446 Validate::validate_at(value, path, out);
7447 }
7448 path.pop();
7449 }
7450}
7451
7452#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7454pub struct PeriodicEventStreamParams {
7455 #[serde(default, skip_serializing_if = "Option::is_none")]
7457 pub interval: Option<i32>,
7458 #[serde(default, skip_serializing_if = "Option::is_none")]
7460 pub values: Option<i32>,
7461 #[serde(rename = "customData")]
7463 #[serde(default, skip_serializing_if = "Option::is_none")]
7464 pub custom_data: Option<crate::types::CustomData>,
7465}
7466
7467impl PeriodicEventStreamParams {
7468 #[must_use]
7470 pub fn new() -> Self {
7471 Self::default()
7472 }
7473
7474 #[must_use]
7476 pub fn with_interval(mut self, value: i32) -> Self {
7477 self.interval = Some(value);
7478 self
7479 }
7480
7481 #[must_use]
7483 pub fn with_values(mut self, value: i32) -> Self {
7484 self.values = Some(value);
7485 self
7486 }
7487
7488 #[must_use]
7490 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7491 self.custom_data = Some(value);
7492 self
7493 }
7494}
7495
7496impl Validate for PeriodicEventStreamParams {
7497 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7498 path.push_key("interval");
7499 if let Some(value) = &self.interval {
7500 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
7501 }
7502 path.pop();
7503 path.push_key("values");
7504 if let Some(value) = &self.values {
7505 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
7506 }
7507 path.pop();
7508 path.push_key("customData");
7509 if let Some(value) = &self.custom_data {
7510 Validate::validate_at(value, path, out);
7511 }
7512 path.pop();
7513 }
7514}
7515
7516#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7520pub struct Price {
7521 #[serde(rename = "exclTax")]
7523 #[serde(default, skip_serializing_if = "Option::is_none")]
7524 pub excl_tax: Option<crate::types::Decimal>,
7525 #[serde(rename = "inclTax")]
7527 #[serde(default, skip_serializing_if = "Option::is_none")]
7528 pub incl_tax: Option<crate::types::Decimal>,
7529 #[serde(rename = "taxRates")]
7531 #[serde(default, skip_serializing_if = "Option::is_none")]
7532 pub tax_rates: Option<Vec<TaxRate>>,
7533 #[serde(rename = "customData")]
7535 #[serde(default, skip_serializing_if = "Option::is_none")]
7536 pub custom_data: Option<crate::types::CustomData>,
7537}
7538
7539impl Price {
7540 #[must_use]
7542 pub fn new() -> Self {
7543 Self::default()
7544 }
7545
7546 #[must_use]
7548 pub fn with_excl_tax(mut self, value: impl Into<crate::types::Decimal>) -> Self {
7549 self.excl_tax = Some(value.into());
7550 self
7551 }
7552
7553 #[must_use]
7555 pub fn with_incl_tax(mut self, value: impl Into<crate::types::Decimal>) -> Self {
7556 self.incl_tax = Some(value.into());
7557 self
7558 }
7559
7560 #[must_use]
7562 pub fn with_tax_rates(mut self, value: Vec<TaxRate>) -> Self {
7563 self.tax_rates = Some(value);
7564 self
7565 }
7566
7567 #[must_use]
7569 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7570 self.custom_data = Some(value);
7571 self
7572 }
7573}
7574
7575impl Validate for Price {
7576 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7577 path.push_key("taxRates");
7578 if let Some(value) = &self.tax_rates {
7579 validate::list_len(value.len(), Some(1), Some(5), path, out);
7580 for (index, item) in value.iter().enumerate() {
7581 path.push_index(index);
7582 Validate::validate_at(item, path, out);
7583 path.pop();
7584 }
7585 }
7586 path.pop();
7587 path.push_key("customData");
7588 if let Some(value) = &self.custom_data {
7589 Validate::validate_at(value, path, out);
7590 }
7591 path.pop();
7592 }
7593}
7594
7595#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7599pub struct PriceLevelSchedule {
7600 #[serde(rename = "priceLevelScheduleEntries")]
7602 pub price_level_schedule_entries: Vec<PriceLevelScheduleEntry>,
7603 #[serde(rename = "timeAnchor")]
7605 pub time_anchor: crate::types::DateTime,
7606 #[serde(rename = "priceScheduleId")]
7608 pub price_schedule_id: i32,
7609 #[serde(rename = "numberOfPriceLevels")]
7611 pub number_of_price_levels: i32,
7612 #[serde(rename = "priceScheduleDescription")]
7614 #[serde(default, skip_serializing_if = "Option::is_none")]
7615 pub price_schedule_description: Option<String>,
7616 #[serde(rename = "customData")]
7618 #[serde(default, skip_serializing_if = "Option::is_none")]
7619 pub custom_data: Option<crate::types::CustomData>,
7620}
7621
7622impl PriceLevelSchedule {
7623 #[must_use]
7625 pub fn new(
7626 price_level_schedule_entries: Vec<PriceLevelScheduleEntry>,
7627 time_anchor: impl Into<crate::types::DateTime>,
7628 price_schedule_id: i32,
7629 number_of_price_levels: i32,
7630 ) -> Self {
7631 Self {
7632 price_level_schedule_entries,
7633 time_anchor: time_anchor.into(),
7634 price_schedule_id,
7635 number_of_price_levels,
7636 price_schedule_description: None,
7637 custom_data: None,
7638 }
7639 }
7640
7641 #[must_use]
7643 pub fn with_price_schedule_description(mut self, value: impl Into<String>) -> Self {
7644 self.price_schedule_description = Some(value.into());
7645 self
7646 }
7647
7648 #[must_use]
7650 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7651 self.custom_data = Some(value);
7652 self
7653 }
7654}
7655
7656impl Validate for PriceLevelSchedule {
7657 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7658 path.push_key("priceLevelScheduleEntries");
7659 validate::list_len(
7660 self.price_level_schedule_entries.len(),
7661 Some(1),
7662 Some(100),
7663 path,
7664 out,
7665 );
7666 for (index, item) in self.price_level_schedule_entries.iter().enumerate() {
7667 path.push_index(index);
7668 Validate::validate_at(item, path, out);
7669 path.pop();
7670 }
7671 path.pop();
7672 path.push_key("priceScheduleId");
7673 validate::int_range(
7674 i64::from(self.price_schedule_id),
7675 Some(0.0),
7676 None,
7677 path,
7678 out,
7679 );
7680 path.pop();
7681 path.push_key("numberOfPriceLevels");
7682 validate::int_range(
7683 i64::from(self.number_of_price_levels),
7684 Some(0.0),
7685 None,
7686 path,
7687 out,
7688 );
7689 path.pop();
7690 path.push_key("priceScheduleDescription");
7691 if let Some(value) = &self.price_schedule_description {
7692 validate::string(value.as_str(), None, Some(32), path, out);
7693 }
7694 path.pop();
7695 path.push_key("customData");
7696 if let Some(value) = &self.custom_data {
7697 Validate::validate_at(value, path, out);
7698 }
7699 path.pop();
7700 }
7701}
7702
7703#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7707pub struct PriceLevelScheduleEntry {
7708 pub duration: i32,
7710 #[serde(rename = "priceLevel")]
7712 pub price_level: i32,
7713 #[serde(rename = "customData")]
7715 #[serde(default, skip_serializing_if = "Option::is_none")]
7716 pub custom_data: Option<crate::types::CustomData>,
7717}
7718
7719impl PriceLevelScheduleEntry {
7720 #[must_use]
7722 pub fn new(duration: i32, price_level: i32) -> Self {
7723 Self {
7724 duration,
7725 price_level,
7726 custom_data: None,
7727 }
7728 }
7729
7730 #[must_use]
7732 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7733 self.custom_data = Some(value);
7734 self
7735 }
7736}
7737
7738impl Validate for PriceLevelScheduleEntry {
7739 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7740 path.push_key("priceLevel");
7741 validate::int_range(i64::from(self.price_level), Some(0.0), None, path, out);
7742 path.pop();
7743 path.push_key("customData");
7744 if let Some(value) = &self.custom_data {
7745 Validate::validate_at(value, path, out);
7746 }
7747 path.pop();
7748 }
7749}
7750
7751#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7755pub struct PriceRule {
7756 #[serde(rename = "energyFee")]
7758 pub energy_fee: RationalNumber,
7759 #[serde(rename = "powerRangeStart")]
7761 pub power_range_start: RationalNumber,
7762 #[serde(rename = "parkingFeePeriod")]
7765 #[serde(default, skip_serializing_if = "Option::is_none")]
7766 pub parking_fee_period: Option<i32>,
7767 #[serde(rename = "carbonDioxideEmission")]
7769 #[serde(default, skip_serializing_if = "Option::is_none")]
7770 pub carbon_dioxide_emission: Option<i32>,
7771 #[serde(rename = "renewableGenerationPercentage")]
7773 #[serde(default, skip_serializing_if = "Option::is_none")]
7774 pub renewable_generation_percentage: Option<i32>,
7775 #[serde(rename = "parkingFee")]
7777 #[serde(default, skip_serializing_if = "Option::is_none")]
7778 pub parking_fee: Option<RationalNumber>,
7779 #[serde(rename = "customData")]
7781 #[serde(default, skip_serializing_if = "Option::is_none")]
7782 pub custom_data: Option<crate::types::CustomData>,
7783}
7784
7785impl PriceRule {
7786 #[must_use]
7788 pub fn new(energy_fee: RationalNumber, power_range_start: RationalNumber) -> Self {
7789 Self {
7790 energy_fee,
7791 power_range_start,
7792 parking_fee_period: None,
7793 carbon_dioxide_emission: None,
7794 renewable_generation_percentage: None,
7795 parking_fee: None,
7796 custom_data: None,
7797 }
7798 }
7799
7800 #[must_use]
7802 pub fn with_parking_fee_period(mut self, value: i32) -> Self {
7803 self.parking_fee_period = Some(value);
7804 self
7805 }
7806
7807 #[must_use]
7809 pub fn with_carbon_dioxide_emission(mut self, value: i32) -> Self {
7810 self.carbon_dioxide_emission = Some(value);
7811 self
7812 }
7813
7814 #[must_use]
7816 pub fn with_renewable_generation_percentage(mut self, value: i32) -> Self {
7817 self.renewable_generation_percentage = Some(value);
7818 self
7819 }
7820
7821 #[must_use]
7823 pub fn with_parking_fee(mut self, value: RationalNumber) -> Self {
7824 self.parking_fee = Some(value);
7825 self
7826 }
7827
7828 #[must_use]
7830 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7831 self.custom_data = Some(value);
7832 self
7833 }
7834}
7835
7836impl Validate for PriceRule {
7837 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7838 path.push_key("energyFee");
7839 Validate::validate_at(&self.energy_fee, path, out);
7840 path.pop();
7841 path.push_key("powerRangeStart");
7842 Validate::validate_at(&self.power_range_start, path, out);
7843 path.pop();
7844 path.push_key("carbonDioxideEmission");
7845 if let Some(value) = &self.carbon_dioxide_emission {
7846 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
7847 }
7848 path.pop();
7849 path.push_key("renewableGenerationPercentage");
7850 if let Some(value) = &self.renewable_generation_percentage {
7851 validate::int_range(i64::from(*value), Some(0.0), Some(100.0), path, out);
7852 }
7853 path.pop();
7854 path.push_key("parkingFee");
7855 if let Some(value) = &self.parking_fee {
7856 Validate::validate_at(value, path, out);
7857 }
7858 path.pop();
7859 path.push_key("customData");
7860 if let Some(value) = &self.custom_data {
7861 Validate::validate_at(value, path, out);
7862 }
7863 path.pop();
7864 }
7865}
7866
7867#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7871pub struct PriceRuleStack {
7872 pub duration: i32,
7874 #[serde(rename = "priceRule")]
7876 pub price_rule: Vec<PriceRule>,
7877 #[serde(rename = "customData")]
7879 #[serde(default, skip_serializing_if = "Option::is_none")]
7880 pub custom_data: Option<crate::types::CustomData>,
7881}
7882
7883impl PriceRuleStack {
7884 #[must_use]
7886 pub fn new(duration: i32, price_rule: Vec<PriceRule>) -> Self {
7887 Self {
7888 duration,
7889 price_rule,
7890 custom_data: None,
7891 }
7892 }
7893
7894 #[must_use]
7896 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7897 self.custom_data = Some(value);
7898 self
7899 }
7900}
7901
7902impl Validate for PriceRuleStack {
7903 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7904 path.push_key("priceRule");
7905 validate::list_len(self.price_rule.len(), Some(1), Some(8), path, out);
7906 for (index, item) in self.price_rule.iter().enumerate() {
7907 path.push_index(index);
7908 Validate::validate_at(item, path, out);
7909 path.pop();
7910 }
7911 path.pop();
7912 path.push_key("customData");
7913 if let Some(value) = &self.custom_data {
7914 Validate::validate_at(value, path, out);
7915 }
7916 path.pop();
7917 }
7918}
7919
7920#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7924pub struct RationalNumber {
7925 pub exponent: i32,
7927 pub value: i32,
7929 #[serde(rename = "customData")]
7931 #[serde(default, skip_serializing_if = "Option::is_none")]
7932 pub custom_data: Option<crate::types::CustomData>,
7933}
7934
7935impl RationalNumber {
7936 #[must_use]
7938 pub fn new(exponent: i32, value: i32) -> Self {
7939 Self {
7940 exponent,
7941 value,
7942 custom_data: None,
7943 }
7944 }
7945
7946 #[must_use]
7948 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
7949 self.custom_data = Some(value);
7950 self
7951 }
7952}
7953
7954impl Validate for RationalNumber {
7955 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
7956 path.push_key("customData");
7957 if let Some(value) = &self.custom_data {
7958 Validate::validate_at(value, path, out);
7959 }
7960 path.pop();
7961 }
7962}
7963
7964#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
7966pub struct ReactivePowerParams {
7967 #[serde(rename = "vRef")]
7969 #[serde(default, skip_serializing_if = "Option::is_none")]
7970 pub v_ref: Option<crate::types::Decimal>,
7971 #[serde(rename = "autonomousVRefEnable")]
7973 #[serde(default, skip_serializing_if = "Option::is_none")]
7974 pub autonomous_v_ref_enable: Option<bool>,
7975 #[serde(rename = "autonomousVRefTimeConstant")]
7977 #[serde(default, skip_serializing_if = "Option::is_none")]
7978 pub autonomous_v_ref_time_constant: Option<crate::types::Decimal>,
7979 #[serde(rename = "customData")]
7981 #[serde(default, skip_serializing_if = "Option::is_none")]
7982 pub custom_data: Option<crate::types::CustomData>,
7983}
7984
7985impl ReactivePowerParams {
7986 #[must_use]
7988 pub fn new() -> Self {
7989 Self::default()
7990 }
7991
7992 #[must_use]
7994 pub fn with_v_ref(mut self, value: impl Into<crate::types::Decimal>) -> Self {
7995 self.v_ref = Some(value.into());
7996 self
7997 }
7998
7999 #[must_use]
8001 pub fn with_autonomous_v_ref_enable(mut self, value: bool) -> Self {
8002 self.autonomous_v_ref_enable = Some(value);
8003 self
8004 }
8005
8006 #[must_use]
8008 pub fn with_autonomous_v_ref_time_constant(
8009 mut self,
8010 value: impl Into<crate::types::Decimal>,
8011 ) -> Self {
8012 self.autonomous_v_ref_time_constant = Some(value.into());
8013 self
8014 }
8015
8016 #[must_use]
8018 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8019 self.custom_data = Some(value);
8020 self
8021 }
8022}
8023
8024impl Validate for ReactivePowerParams {
8025 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8026 path.push_key("customData");
8027 if let Some(value) = &self.custom_data {
8028 Validate::validate_at(value, path, out);
8029 }
8030 path.pop();
8031 }
8032}
8033
8034#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8036pub struct RelativeTimeInterval {
8037 pub start: i32,
8039 #[serde(default, skip_serializing_if = "Option::is_none")]
8041 pub duration: Option<i32>,
8042 #[serde(rename = "customData")]
8044 #[serde(default, skip_serializing_if = "Option::is_none")]
8045 pub custom_data: Option<crate::types::CustomData>,
8046}
8047
8048impl RelativeTimeInterval {
8049 #[must_use]
8051 pub fn new(start: i32) -> Self {
8052 Self {
8053 start,
8054 duration: None,
8055 custom_data: None,
8056 }
8057 }
8058
8059 #[must_use]
8061 pub fn with_duration(mut self, value: i32) -> Self {
8062 self.duration = Some(value);
8063 self
8064 }
8065
8066 #[must_use]
8068 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8069 self.custom_data = Some(value);
8070 self
8071 }
8072}
8073
8074impl Validate for RelativeTimeInterval {
8075 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8076 path.push_key("customData");
8077 if let Some(value) = &self.custom_data {
8078 Validate::validate_at(value, path, out);
8079 }
8080 path.pop();
8081 }
8082}
8083
8084#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8088pub struct ReportData {
8089 pub component: Component,
8091 pub variable: Variable,
8093 #[serde(rename = "variableAttribute")]
8095 pub variable_attribute: Vec<VariableAttribute>,
8096 #[serde(rename = "variableCharacteristics")]
8098 #[serde(default, skip_serializing_if = "Option::is_none")]
8099 pub variable_characteristics: Option<VariableCharacteristics>,
8100 #[serde(rename = "customData")]
8102 #[serde(default, skip_serializing_if = "Option::is_none")]
8103 pub custom_data: Option<crate::types::CustomData>,
8104}
8105
8106impl ReportData {
8107 #[must_use]
8109 pub fn new(
8110 component: Component,
8111 variable: Variable,
8112 variable_attribute: Vec<VariableAttribute>,
8113 ) -> Self {
8114 Self {
8115 component,
8116 variable,
8117 variable_attribute,
8118 variable_characteristics: None,
8119 custom_data: None,
8120 }
8121 }
8122
8123 #[must_use]
8125 pub fn with_variable_characteristics(mut self, value: VariableCharacteristics) -> Self {
8126 self.variable_characteristics = Some(value);
8127 self
8128 }
8129
8130 #[must_use]
8132 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8133 self.custom_data = Some(value);
8134 self
8135 }
8136}
8137
8138impl Validate for ReportData {
8139 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8140 path.push_key("component");
8141 Validate::validate_at(&self.component, path, out);
8142 path.pop();
8143 path.push_key("variable");
8144 Validate::validate_at(&self.variable, path, out);
8145 path.pop();
8146 path.push_key("variableAttribute");
8147 validate::list_len(self.variable_attribute.len(), Some(1), Some(4), path, out);
8148 for (index, item) in self.variable_attribute.iter().enumerate() {
8149 path.push_index(index);
8150 Validate::validate_at(item, path, out);
8151 path.pop();
8152 }
8153 path.pop();
8154 path.push_key("variableCharacteristics");
8155 if let Some(value) = &self.variable_characteristics {
8156 Validate::validate_at(value, path, out);
8157 }
8158 path.pop();
8159 path.push_key("customData");
8160 if let Some(value) = &self.custom_data {
8161 Validate::validate_at(value, path, out);
8162 }
8163 path.pop();
8164 }
8165}
8166
8167#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8172pub struct SalesTariff {
8173 pub id: i32,
8175 #[serde(rename = "salesTariffEntry")]
8177 pub sales_tariff_entry: Vec<SalesTariffEntry>,
8178 #[serde(rename = "salesTariffDescription")]
8180 #[serde(default, skip_serializing_if = "Option::is_none")]
8181 pub sales_tariff_description: Option<String>,
8182 #[serde(rename = "numEPriceLevels")]
8184 #[serde(default, skip_serializing_if = "Option::is_none")]
8185 pub num_e_price_levels: Option<i32>,
8186 #[serde(rename = "customData")]
8188 #[serde(default, skip_serializing_if = "Option::is_none")]
8189 pub custom_data: Option<crate::types::CustomData>,
8190}
8191
8192impl SalesTariff {
8193 #[must_use]
8195 pub fn new(id: i32, sales_tariff_entry: Vec<SalesTariffEntry>) -> Self {
8196 Self {
8197 id,
8198 sales_tariff_entry,
8199 sales_tariff_description: None,
8200 num_e_price_levels: None,
8201 custom_data: None,
8202 }
8203 }
8204
8205 #[must_use]
8207 pub fn with_sales_tariff_description(mut self, value: impl Into<String>) -> Self {
8208 self.sales_tariff_description = Some(value.into());
8209 self
8210 }
8211
8212 #[must_use]
8214 pub fn with_num_e_price_levels(mut self, value: i32) -> Self {
8215 self.num_e_price_levels = Some(value);
8216 self
8217 }
8218
8219 #[must_use]
8221 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8222 self.custom_data = Some(value);
8223 self
8224 }
8225}
8226
8227impl Validate for SalesTariff {
8228 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8229 path.push_key("id");
8230 validate::int_range(i64::from(self.id), Some(0.0), None, path, out);
8231 path.pop();
8232 path.push_key("salesTariffEntry");
8233 validate::list_len(
8234 self.sales_tariff_entry.len(),
8235 Some(1),
8236 Some(1024),
8237 path,
8238 out,
8239 );
8240 for (index, item) in self.sales_tariff_entry.iter().enumerate() {
8241 path.push_index(index);
8242 Validate::validate_at(item, path, out);
8243 path.pop();
8244 }
8245 path.pop();
8246 path.push_key("salesTariffDescription");
8247 if let Some(value) = &self.sales_tariff_description {
8248 validate::string(value.as_str(), None, Some(32), path, out);
8249 }
8250 path.pop();
8251 path.push_key("numEPriceLevels");
8252 if let Some(value) = &self.num_e_price_levels {
8253 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
8254 }
8255 path.pop();
8256 path.push_key("customData");
8257 if let Some(value) = &self.custom_data {
8258 Validate::validate_at(value, path, out);
8259 }
8260 path.pop();
8261 }
8262}
8263
8264#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8266pub struct SalesTariffEntry {
8267 #[serde(rename = "relativeTimeInterval")]
8269 pub relative_time_interval: RelativeTimeInterval,
8270 #[serde(rename = "ePriceLevel")]
8272 #[serde(default, skip_serializing_if = "Option::is_none")]
8273 pub e_price_level: Option<i32>,
8274 #[serde(rename = "consumptionCost")]
8276 #[serde(default, skip_serializing_if = "Option::is_none")]
8277 pub consumption_cost: Option<Vec<ConsumptionCost>>,
8278 #[serde(rename = "customData")]
8280 #[serde(default, skip_serializing_if = "Option::is_none")]
8281 pub custom_data: Option<crate::types::CustomData>,
8282}
8283
8284impl SalesTariffEntry {
8285 #[must_use]
8287 pub fn new(relative_time_interval: RelativeTimeInterval) -> Self {
8288 Self {
8289 relative_time_interval,
8290 e_price_level: None,
8291 consumption_cost: None,
8292 custom_data: None,
8293 }
8294 }
8295
8296 #[must_use]
8298 pub fn with_e_price_level(mut self, value: i32) -> Self {
8299 self.e_price_level = Some(value);
8300 self
8301 }
8302
8303 #[must_use]
8305 pub fn with_consumption_cost(mut self, value: Vec<ConsumptionCost>) -> Self {
8306 self.consumption_cost = Some(value);
8307 self
8308 }
8309
8310 #[must_use]
8312 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8313 self.custom_data = Some(value);
8314 self
8315 }
8316}
8317
8318impl Validate for SalesTariffEntry {
8319 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8320 path.push_key("relativeTimeInterval");
8321 Validate::validate_at(&self.relative_time_interval, path, out);
8322 path.pop();
8323 path.push_key("ePriceLevel");
8324 if let Some(value) = &self.e_price_level {
8325 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
8326 }
8327 path.pop();
8328 path.push_key("consumptionCost");
8329 if let Some(value) = &self.consumption_cost {
8330 validate::list_len(value.len(), Some(1), Some(3), path, out);
8331 for (index, item) in value.iter().enumerate() {
8332 path.push_index(index);
8333 Validate::validate_at(item, path, out);
8334 path.pop();
8335 }
8336 }
8337 path.pop();
8338 path.push_key("customData");
8339 if let Some(value) = &self.custom_data {
8340 Validate::validate_at(value, path, out);
8341 }
8342 path.pop();
8343 }
8344}
8345
8346#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8352pub struct SampledValue {
8353 pub value: crate::types::Decimal,
8355 #[serde(default, skip_serializing_if = "Option::is_none")]
8357 pub measurand: Option<Measurand>,
8358 #[serde(default, skip_serializing_if = "Option::is_none")]
8360 pub context: Option<ReadingContext>,
8361 #[serde(default, skip_serializing_if = "Option::is_none")]
8363 pub phase: Option<Phase>,
8364 #[serde(default, skip_serializing_if = "Option::is_none")]
8366 pub location: Option<Location>,
8367 #[serde(rename = "signedMeterValue")]
8369 #[serde(default, skip_serializing_if = "Option::is_none")]
8370 pub signed_meter_value: Option<SignedMeterValue>,
8371 #[serde(rename = "unitOfMeasure")]
8373 #[serde(default, skip_serializing_if = "Option::is_none")]
8374 pub unit_of_measure: Option<UnitOfMeasure>,
8375 #[serde(rename = "customData")]
8377 #[serde(default, skip_serializing_if = "Option::is_none")]
8378 pub custom_data: Option<crate::types::CustomData>,
8379}
8380
8381impl SampledValue {
8382 #[must_use]
8384 pub fn new(value: impl Into<crate::types::Decimal>) -> Self {
8385 Self {
8386 value: value.into(),
8387 measurand: None,
8388 context: None,
8389 phase: None,
8390 location: None,
8391 signed_meter_value: None,
8392 unit_of_measure: None,
8393 custom_data: None,
8394 }
8395 }
8396
8397 #[must_use]
8399 pub fn with_measurand(mut self, value: Measurand) -> Self {
8400 self.measurand = Some(value);
8401 self
8402 }
8403
8404 #[must_use]
8406 pub fn with_context(mut self, value: ReadingContext) -> Self {
8407 self.context = Some(value);
8408 self
8409 }
8410
8411 #[must_use]
8413 pub fn with_phase(mut self, value: Phase) -> Self {
8414 self.phase = Some(value);
8415 self
8416 }
8417
8418 #[must_use]
8420 pub fn with_location(mut self, value: Location) -> Self {
8421 self.location = Some(value);
8422 self
8423 }
8424
8425 #[must_use]
8427 pub fn with_signed_meter_value(mut self, value: SignedMeterValue) -> Self {
8428 self.signed_meter_value = Some(value);
8429 self
8430 }
8431
8432 #[must_use]
8434 pub fn with_unit_of_measure(mut self, value: UnitOfMeasure) -> Self {
8435 self.unit_of_measure = Some(value);
8436 self
8437 }
8438
8439 #[must_use]
8441 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8442 self.custom_data = Some(value);
8443 self
8444 }
8445}
8446
8447impl Validate for SampledValue {
8448 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8449 path.push_key("measurand");
8450 if let Some(value) = &self.measurand {
8451 Validate::validate_at(value, path, out);
8452 }
8453 path.pop();
8454 path.push_key("context");
8455 if let Some(value) = &self.context {
8456 Validate::validate_at(value, path, out);
8457 }
8458 path.pop();
8459 path.push_key("phase");
8460 if let Some(value) = &self.phase {
8461 Validate::validate_at(value, path, out);
8462 }
8463 path.pop();
8464 path.push_key("location");
8465 if let Some(value) = &self.location {
8466 Validate::validate_at(value, path, out);
8467 }
8468 path.pop();
8469 path.push_key("signedMeterValue");
8470 if let Some(value) = &self.signed_meter_value {
8471 Validate::validate_at(value, path, out);
8472 }
8473 path.pop();
8474 path.push_key("unitOfMeasure");
8475 if let Some(value) = &self.unit_of_measure {
8476 Validate::validate_at(value, path, out);
8477 }
8478 path.pop();
8479 path.push_key("customData");
8480 if let Some(value) = &self.custom_data {
8481 Validate::validate_at(value, path, out);
8482 }
8483 path.pop();
8484 }
8485}
8486
8487#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8491pub struct SetMonitoringData {
8492 pub value: crate::types::Decimal,
8495 pub r#type: Monitor,
8497 pub severity: i32,
8521 pub component: Component,
8523 pub variable: Variable,
8525 #[serde(default, skip_serializing_if = "Option::is_none")]
8527 pub id: Option<i32>,
8528 #[serde(rename = "periodicEventStream")]
8530 #[serde(default, skip_serializing_if = "Option::is_none")]
8531 pub periodic_event_stream: Option<PeriodicEventStreamParams>,
8532 #[serde(default, skip_serializing_if = "Option::is_none")]
8535 pub transaction: Option<bool>,
8536 #[serde(rename = "customData")]
8538 #[serde(default, skip_serializing_if = "Option::is_none")]
8539 pub custom_data: Option<crate::types::CustomData>,
8540}
8541
8542impl SetMonitoringData {
8543 #[must_use]
8545 pub fn new(
8546 value: impl Into<crate::types::Decimal>,
8547 r#type: Monitor,
8548 severity: i32,
8549 component: Component,
8550 variable: Variable,
8551 ) -> Self {
8552 Self {
8553 value: value.into(),
8554 r#type,
8555 severity,
8556 component,
8557 variable,
8558 id: None,
8559 periodic_event_stream: None,
8560 transaction: None,
8561 custom_data: None,
8562 }
8563 }
8564
8565 #[must_use]
8567 pub fn with_id(mut self, value: i32) -> Self {
8568 self.id = Some(value);
8569 self
8570 }
8571
8572 #[must_use]
8574 pub fn with_periodic_event_stream(mut self, value: PeriodicEventStreamParams) -> Self {
8575 self.periodic_event_stream = Some(value);
8576 self
8577 }
8578
8579 #[must_use]
8581 pub fn with_transaction(mut self, value: bool) -> Self {
8582 self.transaction = Some(value);
8583 self
8584 }
8585
8586 #[must_use]
8588 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8589 self.custom_data = Some(value);
8590 self
8591 }
8592}
8593
8594impl Validate for SetMonitoringData {
8595 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8596 path.push_key("type");
8597 Validate::validate_at(&self.r#type, path, out);
8598 path.pop();
8599 path.push_key("severity");
8600 validate::int_range(i64::from(self.severity), Some(0.0), None, path, out);
8601 path.pop();
8602 path.push_key("component");
8603 Validate::validate_at(&self.component, path, out);
8604 path.pop();
8605 path.push_key("variable");
8606 Validate::validate_at(&self.variable, path, out);
8607 path.pop();
8608 path.push_key("id");
8609 if let Some(value) = &self.id {
8610 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
8611 }
8612 path.pop();
8613 path.push_key("periodicEventStream");
8614 if let Some(value) = &self.periodic_event_stream {
8615 Validate::validate_at(value, path, out);
8616 }
8617 path.pop();
8618 path.push_key("customData");
8619 if let Some(value) = &self.custom_data {
8620 Validate::validate_at(value, path, out);
8621 }
8622 path.pop();
8623 }
8624}
8625
8626#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8630pub struct SetMonitoringResult {
8631 pub status: SetMonitoringStatus,
8633 pub r#type: Monitor,
8635 pub component: Component,
8637 pub variable: Variable,
8639 pub severity: i32,
8663 #[serde(default, skip_serializing_if = "Option::is_none")]
8665 pub id: Option<i32>,
8666 #[serde(rename = "statusInfo")]
8668 #[serde(default, skip_serializing_if = "Option::is_none")]
8669 pub status_info: Option<StatusInfo>,
8670 #[serde(rename = "customData")]
8672 #[serde(default, skip_serializing_if = "Option::is_none")]
8673 pub custom_data: Option<crate::types::CustomData>,
8674}
8675
8676impl SetMonitoringResult {
8677 #[must_use]
8679 pub fn new(
8680 status: SetMonitoringStatus,
8681 r#type: Monitor,
8682 component: Component,
8683 variable: Variable,
8684 severity: i32,
8685 ) -> Self {
8686 Self {
8687 status,
8688 r#type,
8689 component,
8690 variable,
8691 severity,
8692 id: None,
8693 status_info: None,
8694 custom_data: None,
8695 }
8696 }
8697
8698 #[must_use]
8700 pub fn with_id(mut self, value: i32) -> Self {
8701 self.id = Some(value);
8702 self
8703 }
8704
8705 #[must_use]
8707 pub fn with_status_info(mut self, value: StatusInfo) -> Self {
8708 self.status_info = Some(value);
8709 self
8710 }
8711
8712 #[must_use]
8714 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8715 self.custom_data = Some(value);
8716 self
8717 }
8718}
8719
8720impl Validate for SetMonitoringResult {
8721 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8722 path.push_key("status");
8723 Validate::validate_at(&self.status, path, out);
8724 path.pop();
8725 path.push_key("type");
8726 Validate::validate_at(&self.r#type, path, out);
8727 path.pop();
8728 path.push_key("component");
8729 Validate::validate_at(&self.component, path, out);
8730 path.pop();
8731 path.push_key("variable");
8732 Validate::validate_at(&self.variable, path, out);
8733 path.pop();
8734 path.push_key("severity");
8735 validate::int_range(i64::from(self.severity), Some(0.0), None, path, out);
8736 path.pop();
8737 path.push_key("id");
8738 if let Some(value) = &self.id {
8739 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
8740 }
8741 path.pop();
8742 path.push_key("statusInfo");
8743 if let Some(value) = &self.status_info {
8744 Validate::validate_at(value, path, out);
8745 }
8746 path.pop();
8747 path.push_key("customData");
8748 if let Some(value) = &self.custom_data {
8749 Validate::validate_at(value, path, out);
8750 }
8751 path.pop();
8752 }
8753}
8754
8755#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8757pub struct SetVariableData {
8758 #[serde(rename = "attributeValue")]
8763 pub attribute_value: String,
8764 pub component: Component,
8766 pub variable: Variable,
8768 #[serde(rename = "attributeType")]
8770 #[serde(default, skip_serializing_if = "Option::is_none")]
8771 pub attribute_type: Option<Attribute>,
8772 #[serde(rename = "customData")]
8774 #[serde(default, skip_serializing_if = "Option::is_none")]
8775 pub custom_data: Option<crate::types::CustomData>,
8776}
8777
8778impl SetVariableData {
8779 #[must_use]
8781 pub fn new(
8782 attribute_value: impl Into<String>,
8783 component: Component,
8784 variable: Variable,
8785 ) -> Self {
8786 Self {
8787 attribute_value: attribute_value.into(),
8788 component,
8789 variable,
8790 attribute_type: None,
8791 custom_data: None,
8792 }
8793 }
8794
8795 #[must_use]
8797 pub fn with_attribute_type(mut self, value: Attribute) -> Self {
8798 self.attribute_type = Some(value);
8799 self
8800 }
8801
8802 #[must_use]
8804 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8805 self.custom_data = Some(value);
8806 self
8807 }
8808}
8809
8810impl Validate for SetVariableData {
8811 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8812 path.push_key("attributeValue");
8813 validate::string(self.attribute_value.as_str(), None, Some(2500), path, out);
8814 path.pop();
8815 path.push_key("component");
8816 Validate::validate_at(&self.component, path, out);
8817 path.pop();
8818 path.push_key("variable");
8819 Validate::validate_at(&self.variable, path, out);
8820 path.pop();
8821 path.push_key("attributeType");
8822 if let Some(value) = &self.attribute_type {
8823 Validate::validate_at(value, path, out);
8824 }
8825 path.pop();
8826 path.push_key("customData");
8827 if let Some(value) = &self.custom_data {
8828 Validate::validate_at(value, path, out);
8829 }
8830 path.pop();
8831 }
8832}
8833
8834#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8836pub struct SetVariableResult {
8837 #[serde(rename = "attributeStatus")]
8839 pub attribute_status: SetVariableStatus,
8840 pub component: Component,
8842 pub variable: Variable,
8844 #[serde(rename = "attributeType")]
8846 #[serde(default, skip_serializing_if = "Option::is_none")]
8847 pub attribute_type: Option<Attribute>,
8848 #[serde(rename = "attributeStatusInfo")]
8850 #[serde(default, skip_serializing_if = "Option::is_none")]
8851 pub attribute_status_info: Option<StatusInfo>,
8852 #[serde(rename = "customData")]
8854 #[serde(default, skip_serializing_if = "Option::is_none")]
8855 pub custom_data: Option<crate::types::CustomData>,
8856}
8857
8858impl SetVariableResult {
8859 #[must_use]
8861 pub fn new(
8862 attribute_status: SetVariableStatus,
8863 component: Component,
8864 variable: Variable,
8865 ) -> Self {
8866 Self {
8867 attribute_status,
8868 component,
8869 variable,
8870 attribute_type: None,
8871 attribute_status_info: None,
8872 custom_data: None,
8873 }
8874 }
8875
8876 #[must_use]
8878 pub fn with_attribute_type(mut self, value: Attribute) -> Self {
8879 self.attribute_type = Some(value);
8880 self
8881 }
8882
8883 #[must_use]
8885 pub fn with_attribute_status_info(mut self, value: StatusInfo) -> Self {
8886 self.attribute_status_info = Some(value);
8887 self
8888 }
8889
8890 #[must_use]
8892 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8893 self.custom_data = Some(value);
8894 self
8895 }
8896}
8897
8898impl Validate for SetVariableResult {
8899 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8900 path.push_key("attributeStatus");
8901 Validate::validate_at(&self.attribute_status, path, out);
8902 path.pop();
8903 path.push_key("component");
8904 Validate::validate_at(&self.component, path, out);
8905 path.pop();
8906 path.push_key("variable");
8907 Validate::validate_at(&self.variable, path, out);
8908 path.pop();
8909 path.push_key("attributeType");
8910 if let Some(value) = &self.attribute_type {
8911 Validate::validate_at(value, path, out);
8912 }
8913 path.pop();
8914 path.push_key("attributeStatusInfo");
8915 if let Some(value) = &self.attribute_status_info {
8916 Validate::validate_at(value, path, out);
8917 }
8918 path.pop();
8919 path.push_key("customData");
8920 if let Some(value) = &self.custom_data {
8921 Validate::validate_at(value, path, out);
8922 }
8923 path.pop();
8924 }
8925}
8926
8927#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
8931pub struct SignedMeterValue {
8932 #[serde(rename = "signedMeterData")]
8934 pub signed_meter_data: String,
8935 #[serde(rename = "encodingMethod")]
8937 pub encoding_method: String,
8938 #[serde(rename = "signingMethod")]
8940 #[serde(default, skip_serializing_if = "Option::is_none")]
8941 pub signing_method: Option<String>,
8942 #[serde(rename = "publicKey")]
8944 #[serde(default, skip_serializing_if = "Option::is_none")]
8945 pub public_key: Option<String>,
8946 #[serde(rename = "customData")]
8948 #[serde(default, skip_serializing_if = "Option::is_none")]
8949 pub custom_data: Option<crate::types::CustomData>,
8950}
8951
8952impl SignedMeterValue {
8953 #[must_use]
8955 pub fn new(signed_meter_data: impl Into<String>, encoding_method: impl Into<String>) -> Self {
8956 Self {
8957 signed_meter_data: signed_meter_data.into(),
8958 encoding_method: encoding_method.into(),
8959 signing_method: None,
8960 public_key: None,
8961 custom_data: None,
8962 }
8963 }
8964
8965 #[must_use]
8967 pub fn with_signing_method(mut self, value: impl Into<String>) -> Self {
8968 self.signing_method = Some(value.into());
8969 self
8970 }
8971
8972 #[must_use]
8974 pub fn with_public_key(mut self, value: impl Into<String>) -> Self {
8975 self.public_key = Some(value.into());
8976 self
8977 }
8978
8979 #[must_use]
8981 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
8982 self.custom_data = Some(value);
8983 self
8984 }
8985}
8986
8987impl Validate for SignedMeterValue {
8988 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
8989 path.push_key("signedMeterData");
8990 validate::string(
8991 self.signed_meter_data.as_str(),
8992 None,
8993 Some(32768),
8994 path,
8995 out,
8996 );
8997 path.pop();
8998 path.push_key("encodingMethod");
8999 validate::string(self.encoding_method.as_str(), None, Some(50), path, out);
9000 path.pop();
9001 path.push_key("signingMethod");
9002 if let Some(value) = &self.signing_method {
9003 validate::string(value.as_str(), None, Some(50), path, out);
9004 }
9005 path.pop();
9006 path.push_key("publicKey");
9007 if let Some(value) = &self.public_key {
9008 validate::string(value.as_str(), None, Some(2500), path, out);
9009 }
9010 path.pop();
9011 path.push_key("customData");
9012 if let Some(value) = &self.custom_data {
9013 Validate::validate_at(value, path, out);
9014 }
9015 path.pop();
9016 }
9017}
9018
9019#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9023pub struct StatusInfo {
9024 #[serde(rename = "reasonCode")]
9026 pub reason_code: String,
9027 #[serde(rename = "additionalInfo")]
9029 #[serde(default, skip_serializing_if = "Option::is_none")]
9030 pub additional_info: Option<String>,
9031 #[serde(rename = "customData")]
9033 #[serde(default, skip_serializing_if = "Option::is_none")]
9034 pub custom_data: Option<crate::types::CustomData>,
9035}
9036
9037impl StatusInfo {
9038 #[must_use]
9040 pub fn new(reason_code: impl Into<String>) -> Self {
9041 Self {
9042 reason_code: reason_code.into(),
9043 additional_info: None,
9044 custom_data: None,
9045 }
9046 }
9047
9048 #[must_use]
9050 pub fn with_additional_info(mut self, value: impl Into<String>) -> Self {
9051 self.additional_info = Some(value.into());
9052 self
9053 }
9054
9055 #[must_use]
9057 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9058 self.custom_data = Some(value);
9059 self
9060 }
9061}
9062
9063impl Validate for StatusInfo {
9064 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9065 path.push_key("reasonCode");
9066 validate::string(self.reason_code.as_str(), None, Some(20), path, out);
9067 path.pop();
9068 path.push_key("additionalInfo");
9069 if let Some(value) = &self.additional_info {
9070 validate::string(value.as_str(), None, Some(1024), path, out);
9071 }
9072 path.pop();
9073 path.push_key("customData");
9074 if let Some(value) = &self.custom_data {
9075 Validate::validate_at(value, path, out);
9076 }
9077 path.pop();
9078 }
9079}
9080
9081#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9083pub struct StreamDataElement {
9084 pub t: crate::types::Decimal,
9086 pub v: String,
9088 #[serde(rename = "customData")]
9090 #[serde(default, skip_serializing_if = "Option::is_none")]
9091 pub custom_data: Option<crate::types::CustomData>,
9092}
9093
9094impl StreamDataElement {
9095 #[must_use]
9097 pub fn new(t: impl Into<crate::types::Decimal>, v: impl Into<String>) -> Self {
9098 Self {
9099 t: t.into(),
9100 v: v.into(),
9101 custom_data: None,
9102 }
9103 }
9104
9105 #[must_use]
9107 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9108 self.custom_data = Some(value);
9109 self
9110 }
9111}
9112
9113impl Validate for StreamDataElement {
9114 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9115 path.push_key("v");
9116 validate::string(self.v.as_str(), None, Some(2500), path, out);
9117 path.pop();
9118 path.push_key("customData");
9119 if let Some(value) = &self.custom_data {
9120 Validate::validate_at(value, path, out);
9121 }
9122 path.pop();
9123 }
9124}
9125
9126#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9139pub struct Tariff {
9140 #[serde(rename = "tariffId")]
9142 pub tariff_id: String,
9143 pub currency: String,
9145 #[serde(default, skip_serializing_if = "Option::is_none")]
9147 pub description: Option<Vec<MessageContent>>,
9148 #[serde(default, skip_serializing_if = "Option::is_none")]
9150 pub energy: Option<TariffEnergy>,
9151 #[serde(rename = "validFrom")]
9153 #[serde(default, skip_serializing_if = "Option::is_none")]
9154 pub valid_from: Option<crate::types::DateTime>,
9155 #[serde(rename = "chargingTime")]
9157 #[serde(default, skip_serializing_if = "Option::is_none")]
9158 pub charging_time: Option<TariffTime>,
9159 #[serde(rename = "idleTime")]
9161 #[serde(default, skip_serializing_if = "Option::is_none")]
9162 pub idle_time: Option<TariffTime>,
9163 #[serde(rename = "fixedFee")]
9165 #[serde(default, skip_serializing_if = "Option::is_none")]
9166 pub fixed_fee: Option<TariffFixed>,
9167 #[serde(rename = "reservationTime")]
9169 #[serde(default, skip_serializing_if = "Option::is_none")]
9170 pub reservation_time: Option<TariffTime>,
9171 #[serde(rename = "reservationFixed")]
9173 #[serde(default, skip_serializing_if = "Option::is_none")]
9174 pub reservation_fixed: Option<TariffFixed>,
9175 #[serde(rename = "minCost")]
9177 #[serde(default, skip_serializing_if = "Option::is_none")]
9178 pub min_cost: Option<Price>,
9179 #[serde(rename = "maxCost")]
9181 #[serde(default, skip_serializing_if = "Option::is_none")]
9182 pub max_cost: Option<Price>,
9183 #[serde(rename = "customData")]
9185 #[serde(default, skip_serializing_if = "Option::is_none")]
9186 pub custom_data: Option<crate::types::CustomData>,
9187}
9188
9189impl Tariff {
9190 #[must_use]
9192 pub fn new(tariff_id: impl Into<String>, currency: impl Into<String>) -> Self {
9193 Self {
9194 tariff_id: tariff_id.into(),
9195 currency: currency.into(),
9196 description: None,
9197 energy: None,
9198 valid_from: None,
9199 charging_time: None,
9200 idle_time: None,
9201 fixed_fee: None,
9202 reservation_time: None,
9203 reservation_fixed: None,
9204 min_cost: None,
9205 max_cost: None,
9206 custom_data: None,
9207 }
9208 }
9209
9210 #[must_use]
9212 pub fn with_description(mut self, value: Vec<MessageContent>) -> Self {
9213 self.description = Some(value);
9214 self
9215 }
9216
9217 #[must_use]
9219 pub fn with_energy(mut self, value: TariffEnergy) -> Self {
9220 self.energy = Some(value);
9221 self
9222 }
9223
9224 #[must_use]
9226 pub fn with_valid_from(mut self, value: impl Into<crate::types::DateTime>) -> Self {
9227 self.valid_from = Some(value.into());
9228 self
9229 }
9230
9231 #[must_use]
9233 pub fn with_charging_time(mut self, value: TariffTime) -> Self {
9234 self.charging_time = Some(value);
9235 self
9236 }
9237
9238 #[must_use]
9240 pub fn with_idle_time(mut self, value: TariffTime) -> Self {
9241 self.idle_time = Some(value);
9242 self
9243 }
9244
9245 #[must_use]
9247 pub fn with_fixed_fee(mut self, value: TariffFixed) -> Self {
9248 self.fixed_fee = Some(value);
9249 self
9250 }
9251
9252 #[must_use]
9254 pub fn with_reservation_time(mut self, value: TariffTime) -> Self {
9255 self.reservation_time = Some(value);
9256 self
9257 }
9258
9259 #[must_use]
9261 pub fn with_reservation_fixed(mut self, value: TariffFixed) -> Self {
9262 self.reservation_fixed = Some(value);
9263 self
9264 }
9265
9266 #[must_use]
9268 pub fn with_min_cost(mut self, value: Price) -> Self {
9269 self.min_cost = Some(value);
9270 self
9271 }
9272
9273 #[must_use]
9275 pub fn with_max_cost(mut self, value: Price) -> Self {
9276 self.max_cost = Some(value);
9277 self
9278 }
9279
9280 #[must_use]
9282 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9283 self.custom_data = Some(value);
9284 self
9285 }
9286}
9287
9288impl Validate for Tariff {
9289 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9290 path.push_key("tariffId");
9291 validate::string(self.tariff_id.as_str(), None, Some(60), path, out);
9292 path.pop();
9293 path.push_key("currency");
9294 validate::string(self.currency.as_str(), None, Some(3), path, out);
9295 path.pop();
9296 path.push_key("description");
9297 if let Some(value) = &self.description {
9298 validate::list_len(value.len(), Some(1), Some(10), path, out);
9299 for (index, item) in value.iter().enumerate() {
9300 path.push_index(index);
9301 Validate::validate_at(item, path, out);
9302 path.pop();
9303 }
9304 }
9305 path.pop();
9306 path.push_key("energy");
9307 if let Some(value) = &self.energy {
9308 Validate::validate_at(value, path, out);
9309 }
9310 path.pop();
9311 path.push_key("chargingTime");
9312 if let Some(value) = &self.charging_time {
9313 Validate::validate_at(value, path, out);
9314 }
9315 path.pop();
9316 path.push_key("idleTime");
9317 if let Some(value) = &self.idle_time {
9318 Validate::validate_at(value, path, out);
9319 }
9320 path.pop();
9321 path.push_key("fixedFee");
9322 if let Some(value) = &self.fixed_fee {
9323 Validate::validate_at(value, path, out);
9324 }
9325 path.pop();
9326 path.push_key("reservationTime");
9327 if let Some(value) = &self.reservation_time {
9328 Validate::validate_at(value, path, out);
9329 }
9330 path.pop();
9331 path.push_key("reservationFixed");
9332 if let Some(value) = &self.reservation_fixed {
9333 Validate::validate_at(value, path, out);
9334 }
9335 path.pop();
9336 path.push_key("minCost");
9337 if let Some(value) = &self.min_cost {
9338 Validate::validate_at(value, path, out);
9339 }
9340 path.pop();
9341 path.push_key("maxCost");
9342 if let Some(value) = &self.max_cost {
9343 Validate::validate_at(value, path, out);
9344 }
9345 path.pop();
9346 path.push_key("customData");
9347 if let Some(value) = &self.custom_data {
9348 Validate::validate_at(value, path, out);
9349 }
9350 path.pop();
9351 }
9352}
9353
9354#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9358pub struct TariffAssignment {
9359 #[serde(rename = "tariffId")]
9361 pub tariff_id: String,
9362 #[serde(rename = "tariffKind")]
9364 pub tariff_kind: TariffKind,
9365 #[serde(rename = "validFrom")]
9367 #[serde(default, skip_serializing_if = "Option::is_none")]
9368 pub valid_from: Option<crate::types::DateTime>,
9369 #[serde(rename = "evseIds")]
9371 #[serde(default, skip_serializing_if = "Option::is_none")]
9372 pub evse_ids: Option<Vec<i32>>,
9373 #[serde(rename = "idTokens")]
9375 #[serde(default, skip_serializing_if = "Option::is_none")]
9376 pub id_tokens: Option<Vec<String>>,
9377 #[serde(rename = "customData")]
9379 #[serde(default, skip_serializing_if = "Option::is_none")]
9380 pub custom_data: Option<crate::types::CustomData>,
9381}
9382
9383impl TariffAssignment {
9384 #[must_use]
9386 pub fn new(tariff_id: impl Into<String>, tariff_kind: TariffKind) -> Self {
9387 Self {
9388 tariff_id: tariff_id.into(),
9389 tariff_kind,
9390 valid_from: None,
9391 evse_ids: None,
9392 id_tokens: None,
9393 custom_data: None,
9394 }
9395 }
9396
9397 #[must_use]
9399 pub fn with_valid_from(mut self, value: impl Into<crate::types::DateTime>) -> Self {
9400 self.valid_from = Some(value.into());
9401 self
9402 }
9403
9404 #[must_use]
9406 pub fn with_evse_ids(mut self, value: Vec<i32>) -> Self {
9407 self.evse_ids = Some(value);
9408 self
9409 }
9410
9411 #[must_use]
9413 pub fn with_id_tokens(mut self, value: impl IntoIterator<Item = impl Into<String>>) -> Self {
9414 self.id_tokens = Some(value.into_iter().map(Into::into).collect());
9415 self
9416 }
9417
9418 #[must_use]
9420 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9421 self.custom_data = Some(value);
9422 self
9423 }
9424}
9425
9426impl Validate for TariffAssignment {
9427 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9428 path.push_key("tariffId");
9429 validate::string(self.tariff_id.as_str(), None, Some(60), path, out);
9430 path.pop();
9431 path.push_key("tariffKind");
9432 Validate::validate_at(&self.tariff_kind, path, out);
9433 path.pop();
9434 path.push_key("evseIds");
9435 if let Some(value) = &self.evse_ids {
9436 validate::list_len(value.len(), Some(1), None, path, out);
9437 for (index, item) in value.iter().enumerate() {
9438 path.push_index(index);
9439 validate::int_range(i64::from(*item), Some(0.0), None, path, out);
9440 path.pop();
9441 }
9442 }
9443 path.pop();
9444 path.push_key("idTokens");
9445 if let Some(value) = &self.id_tokens {
9446 validate::list_len(value.len(), Some(1), None, path, out);
9447 for (index, item) in value.iter().enumerate() {
9448 path.push_index(index);
9449 validate::string(item.as_str(), None, Some(255), path, out);
9450 path.pop();
9451 }
9452 }
9453 path.pop();
9454 path.push_key("customData");
9455 if let Some(value) = &self.custom_data {
9456 Validate::validate_at(value, path, out);
9457 }
9458 path.pop();
9459 }
9460}
9461
9462#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
9475pub struct TariffConditions {
9476 #[serde(rename = "startTimeOfDay")]
9481 #[serde(default, skip_serializing_if = "Option::is_none")]
9482 pub start_time_of_day: Option<String>,
9483 #[serde(rename = "endTimeOfDay")]
9487 #[serde(default, skip_serializing_if = "Option::is_none")]
9488 pub end_time_of_day: Option<String>,
9489 #[serde(rename = "dayOfWeek")]
9491 #[serde(default, skip_serializing_if = "Option::is_none")]
9492 pub day_of_week: Option<Vec<DayOfWeek>>,
9493 #[serde(rename = "validFromDate")]
9499 #[serde(default, skip_serializing_if = "Option::is_none")]
9500 pub valid_from_date: Option<String>,
9501 #[serde(rename = "validToDate")]
9504 #[serde(default, skip_serializing_if = "Option::is_none")]
9505 pub valid_to_date: Option<String>,
9506 #[serde(rename = "evseKind")]
9508 #[serde(default, skip_serializing_if = "Option::is_none")]
9509 pub evse_kind: Option<EvseKind>,
9510 #[serde(rename = "minEnergy")]
9513 #[serde(default, skip_serializing_if = "Option::is_none")]
9514 pub min_energy: Option<crate::types::Decimal>,
9515 #[serde(rename = "maxEnergy")]
9518 #[serde(default, skip_serializing_if = "Option::is_none")]
9519 pub max_energy: Option<crate::types::Decimal>,
9520 #[serde(rename = "minCurrent")]
9524 #[serde(default, skip_serializing_if = "Option::is_none")]
9525 pub min_current: Option<crate::types::Decimal>,
9526 #[serde(rename = "maxCurrent")]
9530 #[serde(default, skip_serializing_if = "Option::is_none")]
9531 pub max_current: Option<crate::types::Decimal>,
9532 #[serde(rename = "minPower")]
9537 #[serde(default, skip_serializing_if = "Option::is_none")]
9538 pub min_power: Option<crate::types::Decimal>,
9539 #[serde(rename = "maxPower")]
9544 #[serde(default, skip_serializing_if = "Option::is_none")]
9545 pub max_power: Option<crate::types::Decimal>,
9546 #[serde(rename = "minTime")]
9550 #[serde(default, skip_serializing_if = "Option::is_none")]
9551 pub min_time: Option<i32>,
9552 #[serde(rename = "maxTime")]
9556 #[serde(default, skip_serializing_if = "Option::is_none")]
9557 pub max_time: Option<i32>,
9558 #[serde(rename = "minChargingTime")]
9562 #[serde(default, skip_serializing_if = "Option::is_none")]
9563 pub min_charging_time: Option<i32>,
9564 #[serde(rename = "maxChargingTime")]
9568 #[serde(default, skip_serializing_if = "Option::is_none")]
9569 pub max_charging_time: Option<i32>,
9570 #[serde(rename = "minIdleTime")]
9574 #[serde(default, skip_serializing_if = "Option::is_none")]
9575 pub min_idle_time: Option<i32>,
9576 #[serde(rename = "maxIdleTime")]
9580 #[serde(default, skip_serializing_if = "Option::is_none")]
9581 pub max_idle_time: Option<i32>,
9582 #[serde(rename = "customData")]
9584 #[serde(default, skip_serializing_if = "Option::is_none")]
9585 pub custom_data: Option<crate::types::CustomData>,
9586}
9587
9588impl TariffConditions {
9589 #[must_use]
9591 pub fn new() -> Self {
9592 Self::default()
9593 }
9594
9595 #[must_use]
9597 pub fn with_start_time_of_day(mut self, value: impl Into<String>) -> Self {
9598 self.start_time_of_day = Some(value.into());
9599 self
9600 }
9601
9602 #[must_use]
9604 pub fn with_end_time_of_day(mut self, value: impl Into<String>) -> Self {
9605 self.end_time_of_day = Some(value.into());
9606 self
9607 }
9608
9609 #[must_use]
9611 pub fn with_day_of_week(mut self, value: Vec<DayOfWeek>) -> Self {
9612 self.day_of_week = Some(value);
9613 self
9614 }
9615
9616 #[must_use]
9618 pub fn with_valid_from_date(mut self, value: impl Into<String>) -> Self {
9619 self.valid_from_date = Some(value.into());
9620 self
9621 }
9622
9623 #[must_use]
9625 pub fn with_valid_to_date(mut self, value: impl Into<String>) -> Self {
9626 self.valid_to_date = Some(value.into());
9627 self
9628 }
9629
9630 #[must_use]
9632 pub fn with_evse_kind(mut self, value: EvseKind) -> Self {
9633 self.evse_kind = Some(value);
9634 self
9635 }
9636
9637 #[must_use]
9639 pub fn with_min_energy(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9640 self.min_energy = Some(value.into());
9641 self
9642 }
9643
9644 #[must_use]
9646 pub fn with_max_energy(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9647 self.max_energy = Some(value.into());
9648 self
9649 }
9650
9651 #[must_use]
9653 pub fn with_min_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9654 self.min_current = Some(value.into());
9655 self
9656 }
9657
9658 #[must_use]
9660 pub fn with_max_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9661 self.max_current = Some(value.into());
9662 self
9663 }
9664
9665 #[must_use]
9667 pub fn with_min_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9668 self.min_power = Some(value.into());
9669 self
9670 }
9671
9672 #[must_use]
9674 pub fn with_max_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
9675 self.max_power = Some(value.into());
9676 self
9677 }
9678
9679 #[must_use]
9681 pub fn with_min_time(mut self, value: i32) -> Self {
9682 self.min_time = Some(value);
9683 self
9684 }
9685
9686 #[must_use]
9688 pub fn with_max_time(mut self, value: i32) -> Self {
9689 self.max_time = Some(value);
9690 self
9691 }
9692
9693 #[must_use]
9695 pub fn with_min_charging_time(mut self, value: i32) -> Self {
9696 self.min_charging_time = Some(value);
9697 self
9698 }
9699
9700 #[must_use]
9702 pub fn with_max_charging_time(mut self, value: i32) -> Self {
9703 self.max_charging_time = Some(value);
9704 self
9705 }
9706
9707 #[must_use]
9709 pub fn with_min_idle_time(mut self, value: i32) -> Self {
9710 self.min_idle_time = Some(value);
9711 self
9712 }
9713
9714 #[must_use]
9716 pub fn with_max_idle_time(mut self, value: i32) -> Self {
9717 self.max_idle_time = Some(value);
9718 self
9719 }
9720
9721 #[must_use]
9723 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9724 self.custom_data = Some(value);
9725 self
9726 }
9727}
9728
9729impl Validate for TariffConditions {
9730 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9731 path.push_key("dayOfWeek");
9732 if let Some(value) = &self.day_of_week {
9733 validate::list_len(value.len(), Some(1), Some(7), path, out);
9734 for (index, item) in value.iter().enumerate() {
9735 path.push_index(index);
9736 Validate::validate_at(item, path, out);
9737 path.pop();
9738 }
9739 }
9740 path.pop();
9741 path.push_key("evseKind");
9742 if let Some(value) = &self.evse_kind {
9743 Validate::validate_at(value, path, out);
9744 }
9745 path.pop();
9746 path.push_key("customData");
9747 if let Some(value) = &self.custom_data {
9748 Validate::validate_at(value, path, out);
9749 }
9750 path.pop();
9751 }
9752}
9753
9754#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
9763pub struct TariffConditionsFixed {
9764 #[serde(rename = "startTimeOfDay")]
9769 #[serde(default, skip_serializing_if = "Option::is_none")]
9770 pub start_time_of_day: Option<String>,
9771 #[serde(rename = "endTimeOfDay")]
9775 #[serde(default, skip_serializing_if = "Option::is_none")]
9776 pub end_time_of_day: Option<String>,
9777 #[serde(rename = "dayOfWeek")]
9779 #[serde(default, skip_serializing_if = "Option::is_none")]
9780 pub day_of_week: Option<Vec<DayOfWeek>>,
9781 #[serde(rename = "validFromDate")]
9787 #[serde(default, skip_serializing_if = "Option::is_none")]
9788 pub valid_from_date: Option<String>,
9789 #[serde(rename = "validToDate")]
9792 #[serde(default, skip_serializing_if = "Option::is_none")]
9793 pub valid_to_date: Option<String>,
9794 #[serde(rename = "evseKind")]
9796 #[serde(default, skip_serializing_if = "Option::is_none")]
9797 pub evse_kind: Option<EvseKind>,
9798 #[serde(rename = "paymentBrand")]
9801 #[serde(default, skip_serializing_if = "Option::is_none")]
9802 pub payment_brand: Option<String>,
9803 #[serde(rename = "paymentRecognition")]
9806 #[serde(default, skip_serializing_if = "Option::is_none")]
9807 pub payment_recognition: Option<String>,
9808 #[serde(rename = "customData")]
9810 #[serde(default, skip_serializing_if = "Option::is_none")]
9811 pub custom_data: Option<crate::types::CustomData>,
9812}
9813
9814impl TariffConditionsFixed {
9815 #[must_use]
9817 pub fn new() -> Self {
9818 Self::default()
9819 }
9820
9821 #[must_use]
9823 pub fn with_start_time_of_day(mut self, value: impl Into<String>) -> Self {
9824 self.start_time_of_day = Some(value.into());
9825 self
9826 }
9827
9828 #[must_use]
9830 pub fn with_end_time_of_day(mut self, value: impl Into<String>) -> Self {
9831 self.end_time_of_day = Some(value.into());
9832 self
9833 }
9834
9835 #[must_use]
9837 pub fn with_day_of_week(mut self, value: Vec<DayOfWeek>) -> Self {
9838 self.day_of_week = Some(value);
9839 self
9840 }
9841
9842 #[must_use]
9844 pub fn with_valid_from_date(mut self, value: impl Into<String>) -> Self {
9845 self.valid_from_date = Some(value.into());
9846 self
9847 }
9848
9849 #[must_use]
9851 pub fn with_valid_to_date(mut self, value: impl Into<String>) -> Self {
9852 self.valid_to_date = Some(value.into());
9853 self
9854 }
9855
9856 #[must_use]
9858 pub fn with_evse_kind(mut self, value: EvseKind) -> Self {
9859 self.evse_kind = Some(value);
9860 self
9861 }
9862
9863 #[must_use]
9865 pub fn with_payment_brand(mut self, value: impl Into<String>) -> Self {
9866 self.payment_brand = Some(value.into());
9867 self
9868 }
9869
9870 #[must_use]
9872 pub fn with_payment_recognition(mut self, value: impl Into<String>) -> Self {
9873 self.payment_recognition = Some(value.into());
9874 self
9875 }
9876
9877 #[must_use]
9879 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9880 self.custom_data = Some(value);
9881 self
9882 }
9883}
9884
9885impl Validate for TariffConditionsFixed {
9886 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9887 path.push_key("dayOfWeek");
9888 if let Some(value) = &self.day_of_week {
9889 validate::list_len(value.len(), Some(1), Some(7), path, out);
9890 for (index, item) in value.iter().enumerate() {
9891 path.push_index(index);
9892 Validate::validate_at(item, path, out);
9893 path.pop();
9894 }
9895 }
9896 path.pop();
9897 path.push_key("evseKind");
9898 if let Some(value) = &self.evse_kind {
9899 Validate::validate_at(value, path, out);
9900 }
9901 path.pop();
9902 path.push_key("paymentBrand");
9903 if let Some(value) = &self.payment_brand {
9904 validate::string(value.as_str(), None, Some(20), path, out);
9905 }
9906 path.pop();
9907 path.push_key("paymentRecognition");
9908 if let Some(value) = &self.payment_recognition {
9909 validate::string(value.as_str(), None, Some(20), path, out);
9910 }
9911 path.pop();
9912 path.push_key("customData");
9913 if let Some(value) = &self.custom_data {
9914 Validate::validate_at(value, path, out);
9915 }
9916 path.pop();
9917 }
9918}
9919
9920#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9924pub struct TariffEnergy {
9925 pub prices: Vec<TariffEnergyPrice>,
9927 #[serde(rename = "taxRates")]
9929 #[serde(default, skip_serializing_if = "Option::is_none")]
9930 pub tax_rates: Option<Vec<TaxRate>>,
9931 #[serde(rename = "customData")]
9933 #[serde(default, skip_serializing_if = "Option::is_none")]
9934 pub custom_data: Option<crate::types::CustomData>,
9935}
9936
9937impl TariffEnergy {
9938 #[must_use]
9940 pub fn new(prices: Vec<TariffEnergyPrice>) -> Self {
9941 Self {
9942 prices,
9943 tax_rates: None,
9944 custom_data: None,
9945 }
9946 }
9947
9948 #[must_use]
9950 pub fn with_tax_rates(mut self, value: Vec<TaxRate>) -> Self {
9951 self.tax_rates = Some(value);
9952 self
9953 }
9954
9955 #[must_use]
9957 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
9958 self.custom_data = Some(value);
9959 self
9960 }
9961}
9962
9963impl Validate for TariffEnergy {
9964 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
9965 path.push_key("prices");
9966 validate::list_len(self.prices.len(), Some(1), None, path, out);
9967 for (index, item) in self.prices.iter().enumerate() {
9968 path.push_index(index);
9969 Validate::validate_at(item, path, out);
9970 path.pop();
9971 }
9972 path.pop();
9973 path.push_key("taxRates");
9974 if let Some(value) = &self.tax_rates {
9975 validate::list_len(value.len(), Some(1), Some(5), path, out);
9976 for (index, item) in value.iter().enumerate() {
9977 path.push_index(index);
9978 Validate::validate_at(item, path, out);
9979 path.pop();
9980 }
9981 }
9982 path.pop();
9983 path.push_key("customData");
9984 if let Some(value) = &self.custom_data {
9985 Validate::validate_at(value, path, out);
9986 }
9987 path.pop();
9988 }
9989}
9990
9991#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9995pub struct TariffEnergyPrice {
9996 #[serde(rename = "priceKwh")]
9998 pub price_kwh: crate::types::Decimal,
9999 #[serde(default, skip_serializing_if = "Option::is_none")]
10001 pub conditions: Option<TariffConditions>,
10002 #[serde(rename = "customData")]
10004 #[serde(default, skip_serializing_if = "Option::is_none")]
10005 pub custom_data: Option<crate::types::CustomData>,
10006}
10007
10008impl TariffEnergyPrice {
10009 #[must_use]
10011 pub fn new(price_kwh: impl Into<crate::types::Decimal>) -> Self {
10012 Self {
10013 price_kwh: price_kwh.into(),
10014 conditions: None,
10015 custom_data: None,
10016 }
10017 }
10018
10019 #[must_use]
10021 pub fn with_conditions(mut self, value: TariffConditions) -> Self {
10022 self.conditions = Some(value);
10023 self
10024 }
10025
10026 #[must_use]
10028 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10029 self.custom_data = Some(value);
10030 self
10031 }
10032}
10033
10034impl Validate for TariffEnergyPrice {
10035 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10036 path.push_key("conditions");
10037 if let Some(value) = &self.conditions {
10038 Validate::validate_at(value, path, out);
10039 }
10040 path.pop();
10041 path.push_key("customData");
10042 if let Some(value) = &self.custom_data {
10043 Validate::validate_at(value, path, out);
10044 }
10045 path.pop();
10046 }
10047}
10048
10049#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10051pub struct TariffFixed {
10052 pub prices: Vec<TariffFixedPrice>,
10054 #[serde(rename = "taxRates")]
10056 #[serde(default, skip_serializing_if = "Option::is_none")]
10057 pub tax_rates: Option<Vec<TaxRate>>,
10058 #[serde(rename = "customData")]
10060 #[serde(default, skip_serializing_if = "Option::is_none")]
10061 pub custom_data: Option<crate::types::CustomData>,
10062}
10063
10064impl TariffFixed {
10065 #[must_use]
10067 pub fn new(prices: Vec<TariffFixedPrice>) -> Self {
10068 Self {
10069 prices,
10070 tax_rates: None,
10071 custom_data: None,
10072 }
10073 }
10074
10075 #[must_use]
10077 pub fn with_tax_rates(mut self, value: Vec<TaxRate>) -> Self {
10078 self.tax_rates = Some(value);
10079 self
10080 }
10081
10082 #[must_use]
10084 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10085 self.custom_data = Some(value);
10086 self
10087 }
10088}
10089
10090impl Validate for TariffFixed {
10091 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10092 path.push_key("prices");
10093 validate::list_len(self.prices.len(), Some(1), None, path, out);
10094 for (index, item) in self.prices.iter().enumerate() {
10095 path.push_index(index);
10096 Validate::validate_at(item, path, out);
10097 path.pop();
10098 }
10099 path.pop();
10100 path.push_key("taxRates");
10101 if let Some(value) = &self.tax_rates {
10102 validate::list_len(value.len(), Some(1), Some(5), path, out);
10103 for (index, item) in value.iter().enumerate() {
10104 path.push_index(index);
10105 Validate::validate_at(item, path, out);
10106 path.pop();
10107 }
10108 }
10109 path.pop();
10110 path.push_key("customData");
10111 if let Some(value) = &self.custom_data {
10112 Validate::validate_at(value, path, out);
10113 }
10114 path.pop();
10115 }
10116}
10117
10118#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10122pub struct TariffFixedPrice {
10123 #[serde(rename = "priceFixed")]
10125 pub price_fixed: crate::types::Decimal,
10126 #[serde(default, skip_serializing_if = "Option::is_none")]
10128 pub conditions: Option<TariffConditionsFixed>,
10129 #[serde(rename = "customData")]
10131 #[serde(default, skip_serializing_if = "Option::is_none")]
10132 pub custom_data: Option<crate::types::CustomData>,
10133}
10134
10135impl TariffFixedPrice {
10136 #[must_use]
10138 pub fn new(price_fixed: impl Into<crate::types::Decimal>) -> Self {
10139 Self {
10140 price_fixed: price_fixed.into(),
10141 conditions: None,
10142 custom_data: None,
10143 }
10144 }
10145
10146 #[must_use]
10148 pub fn with_conditions(mut self, value: TariffConditionsFixed) -> Self {
10149 self.conditions = Some(value);
10150 self
10151 }
10152
10153 #[must_use]
10155 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10156 self.custom_data = Some(value);
10157 self
10158 }
10159}
10160
10161impl Validate for TariffFixedPrice {
10162 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10163 path.push_key("conditions");
10164 if let Some(value) = &self.conditions {
10165 Validate::validate_at(value, path, out);
10166 }
10167 path.pop();
10168 path.push_key("customData");
10169 if let Some(value) = &self.custom_data {
10170 Validate::validate_at(value, path, out);
10171 }
10172 path.pop();
10173 }
10174}
10175
10176#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10180pub struct TariffTime {
10181 pub prices: Vec<TariffTimePrice>,
10183 #[serde(rename = "taxRates")]
10185 #[serde(default, skip_serializing_if = "Option::is_none")]
10186 pub tax_rates: Option<Vec<TaxRate>>,
10187 #[serde(rename = "customData")]
10189 #[serde(default, skip_serializing_if = "Option::is_none")]
10190 pub custom_data: Option<crate::types::CustomData>,
10191}
10192
10193impl TariffTime {
10194 #[must_use]
10196 pub fn new(prices: Vec<TariffTimePrice>) -> Self {
10197 Self {
10198 prices,
10199 tax_rates: None,
10200 custom_data: None,
10201 }
10202 }
10203
10204 #[must_use]
10206 pub fn with_tax_rates(mut self, value: Vec<TaxRate>) -> Self {
10207 self.tax_rates = Some(value);
10208 self
10209 }
10210
10211 #[must_use]
10213 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10214 self.custom_data = Some(value);
10215 self
10216 }
10217}
10218
10219impl Validate for TariffTime {
10220 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10221 path.push_key("prices");
10222 validate::list_len(self.prices.len(), Some(1), None, path, out);
10223 for (index, item) in self.prices.iter().enumerate() {
10224 path.push_index(index);
10225 Validate::validate_at(item, path, out);
10226 path.pop();
10227 }
10228 path.pop();
10229 path.push_key("taxRates");
10230 if let Some(value) = &self.tax_rates {
10231 validate::list_len(value.len(), Some(1), Some(5), path, out);
10232 for (index, item) in value.iter().enumerate() {
10233 path.push_index(index);
10234 Validate::validate_at(item, path, out);
10235 path.pop();
10236 }
10237 }
10238 path.pop();
10239 path.push_key("customData");
10240 if let Some(value) = &self.custom_data {
10241 Validate::validate_at(value, path, out);
10242 }
10243 path.pop();
10244 }
10245}
10246
10247#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10251pub struct TariffTimePrice {
10252 #[serde(rename = "priceMinute")]
10254 pub price_minute: crate::types::Decimal,
10255 #[serde(default, skip_serializing_if = "Option::is_none")]
10257 pub conditions: Option<TariffConditions>,
10258 #[serde(rename = "customData")]
10260 #[serde(default, skip_serializing_if = "Option::is_none")]
10261 pub custom_data: Option<crate::types::CustomData>,
10262}
10263
10264impl TariffTimePrice {
10265 #[must_use]
10267 pub fn new(price_minute: impl Into<crate::types::Decimal>) -> Self {
10268 Self {
10269 price_minute: price_minute.into(),
10270 conditions: None,
10271 custom_data: None,
10272 }
10273 }
10274
10275 #[must_use]
10277 pub fn with_conditions(mut self, value: TariffConditions) -> Self {
10278 self.conditions = Some(value);
10279 self
10280 }
10281
10282 #[must_use]
10284 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10285 self.custom_data = Some(value);
10286 self
10287 }
10288}
10289
10290impl Validate for TariffTimePrice {
10291 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10292 path.push_key("conditions");
10293 if let Some(value) = &self.conditions {
10294 Validate::validate_at(value, path, out);
10295 }
10296 path.pop();
10297 path.push_key("customData");
10298 if let Some(value) = &self.custom_data {
10299 Validate::validate_at(value, path, out);
10300 }
10301 path.pop();
10302 }
10303}
10304
10305#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10309pub struct TaxRate {
10310 pub r#type: String,
10312 pub tax: crate::types::Decimal,
10314 #[serde(default, skip_serializing_if = "Option::is_none")]
10319 pub stack: Option<i32>,
10320 #[serde(rename = "customData")]
10322 #[serde(default, skip_serializing_if = "Option::is_none")]
10323 pub custom_data: Option<crate::types::CustomData>,
10324}
10325
10326impl TaxRate {
10327 #[must_use]
10329 pub fn new(r#type: impl Into<String>, tax: impl Into<crate::types::Decimal>) -> Self {
10330 Self {
10331 r#type: r#type.into(),
10332 tax: tax.into(),
10333 stack: None,
10334 custom_data: None,
10335 }
10336 }
10337
10338 #[must_use]
10340 pub fn with_stack(mut self, value: i32) -> Self {
10341 self.stack = Some(value);
10342 self
10343 }
10344
10345 #[must_use]
10347 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10348 self.custom_data = Some(value);
10349 self
10350 }
10351}
10352
10353impl Validate for TaxRate {
10354 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10355 path.push_key("type");
10356 validate::string(self.r#type.as_str(), None, Some(20), path, out);
10357 path.pop();
10358 path.push_key("stack");
10359 if let Some(value) = &self.stack {
10360 validate::int_range(i64::from(*value), Some(0.0), None, path, out);
10361 }
10362 path.pop();
10363 path.push_key("customData");
10364 if let Some(value) = &self.custom_data {
10365 Validate::validate_at(value, path, out);
10366 }
10367 path.pop();
10368 }
10369}
10370
10371#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10375pub struct TaxRule {
10376 #[serde(rename = "taxRuleID")]
10378 pub tax_rule_id: i32,
10379 #[serde(rename = "appliesToEnergyFee")]
10381 pub applies_to_energy_fee: bool,
10382 #[serde(rename = "appliesToParkingFee")]
10384 pub applies_to_parking_fee: bool,
10385 #[serde(rename = "appliesToOverstayFee")]
10387 pub applies_to_overstay_fee: bool,
10388 #[serde(rename = "appliesToMinimumMaximumCost")]
10390 pub applies_to_minimum_maximum_cost: bool,
10391 #[serde(rename = "taxRate")]
10393 pub tax_rate: RationalNumber,
10394 #[serde(rename = "taxRuleName")]
10396 #[serde(default, skip_serializing_if = "Option::is_none")]
10397 pub tax_rule_name: Option<String>,
10398 #[serde(rename = "taxIncludedInPrice")]
10400 #[serde(default, skip_serializing_if = "Option::is_none")]
10401 pub tax_included_in_price: Option<bool>,
10402 #[serde(rename = "customData")]
10404 #[serde(default, skip_serializing_if = "Option::is_none")]
10405 pub custom_data: Option<crate::types::CustomData>,
10406}
10407
10408impl TaxRule {
10409 #[must_use]
10411 pub fn new(
10412 tax_rule_id: i32,
10413 applies_to_energy_fee: bool,
10414 applies_to_parking_fee: bool,
10415 applies_to_overstay_fee: bool,
10416 applies_to_minimum_maximum_cost: bool,
10417 tax_rate: RationalNumber,
10418 ) -> Self {
10419 Self {
10420 tax_rule_id,
10421 applies_to_energy_fee,
10422 applies_to_parking_fee,
10423 applies_to_overstay_fee,
10424 applies_to_minimum_maximum_cost,
10425 tax_rate,
10426 tax_rule_name: None,
10427 tax_included_in_price: None,
10428 custom_data: None,
10429 }
10430 }
10431
10432 #[must_use]
10434 pub fn with_tax_rule_name(mut self, value: impl Into<String>) -> Self {
10435 self.tax_rule_name = Some(value.into());
10436 self
10437 }
10438
10439 #[must_use]
10441 pub fn with_tax_included_in_price(mut self, value: bool) -> Self {
10442 self.tax_included_in_price = Some(value);
10443 self
10444 }
10445
10446 #[must_use]
10448 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10449 self.custom_data = Some(value);
10450 self
10451 }
10452}
10453
10454impl Validate for TaxRule {
10455 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10456 path.push_key("taxRuleID");
10457 validate::int_range(i64::from(self.tax_rule_id), Some(0.0), None, path, out);
10458 path.pop();
10459 path.push_key("taxRate");
10460 Validate::validate_at(&self.tax_rate, path, out);
10461 path.pop();
10462 path.push_key("taxRuleName");
10463 if let Some(value) = &self.tax_rule_name {
10464 validate::string(value.as_str(), None, Some(100), path, out);
10465 }
10466 path.pop();
10467 path.push_key("customData");
10468 if let Some(value) = &self.custom_data {
10469 Validate::validate_at(value, path, out);
10470 }
10471 path.pop();
10472 }
10473}
10474
10475#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10479pub struct TotalCost {
10480 pub currency: String,
10482 #[serde(rename = "typeOfCost")]
10484 pub type_of_cost: TariffCost,
10485 pub total: TotalPrice,
10487 #[serde(default, skip_serializing_if = "Option::is_none")]
10489 pub fixed: Option<Price>,
10490 #[serde(default, skip_serializing_if = "Option::is_none")]
10492 pub energy: Option<Price>,
10493 #[serde(rename = "chargingTime")]
10495 #[serde(default, skip_serializing_if = "Option::is_none")]
10496 pub charging_time: Option<Price>,
10497 #[serde(rename = "idleTime")]
10499 #[serde(default, skip_serializing_if = "Option::is_none")]
10500 pub idle_time: Option<Price>,
10501 #[serde(rename = "reservationTime")]
10503 #[serde(default, skip_serializing_if = "Option::is_none")]
10504 pub reservation_time: Option<Price>,
10505 #[serde(rename = "reservationFixed")]
10507 #[serde(default, skip_serializing_if = "Option::is_none")]
10508 pub reservation_fixed: Option<Price>,
10509 #[serde(rename = "customData")]
10511 #[serde(default, skip_serializing_if = "Option::is_none")]
10512 pub custom_data: Option<crate::types::CustomData>,
10513}
10514
10515impl TotalCost {
10516 #[must_use]
10518 pub fn new(currency: impl Into<String>, type_of_cost: TariffCost, total: TotalPrice) -> Self {
10519 Self {
10520 currency: currency.into(),
10521 type_of_cost,
10522 total,
10523 fixed: None,
10524 energy: None,
10525 charging_time: None,
10526 idle_time: None,
10527 reservation_time: None,
10528 reservation_fixed: None,
10529 custom_data: None,
10530 }
10531 }
10532
10533 #[must_use]
10535 pub fn with_fixed(mut self, value: Price) -> Self {
10536 self.fixed = Some(value);
10537 self
10538 }
10539
10540 #[must_use]
10542 pub fn with_energy(mut self, value: Price) -> Self {
10543 self.energy = Some(value);
10544 self
10545 }
10546
10547 #[must_use]
10549 pub fn with_charging_time(mut self, value: Price) -> Self {
10550 self.charging_time = Some(value);
10551 self
10552 }
10553
10554 #[must_use]
10556 pub fn with_idle_time(mut self, value: Price) -> Self {
10557 self.idle_time = Some(value);
10558 self
10559 }
10560
10561 #[must_use]
10563 pub fn with_reservation_time(mut self, value: Price) -> Self {
10564 self.reservation_time = Some(value);
10565 self
10566 }
10567
10568 #[must_use]
10570 pub fn with_reservation_fixed(mut self, value: Price) -> Self {
10571 self.reservation_fixed = Some(value);
10572 self
10573 }
10574
10575 #[must_use]
10577 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10578 self.custom_data = Some(value);
10579 self
10580 }
10581}
10582
10583impl Validate for TotalCost {
10584 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10585 path.push_key("currency");
10586 validate::string(self.currency.as_str(), None, Some(3), path, out);
10587 path.pop();
10588 path.push_key("typeOfCost");
10589 Validate::validate_at(&self.type_of_cost, path, out);
10590 path.pop();
10591 path.push_key("total");
10592 Validate::validate_at(&self.total, path, out);
10593 path.pop();
10594 path.push_key("fixed");
10595 if let Some(value) = &self.fixed {
10596 Validate::validate_at(value, path, out);
10597 }
10598 path.pop();
10599 path.push_key("energy");
10600 if let Some(value) = &self.energy {
10601 Validate::validate_at(value, path, out);
10602 }
10603 path.pop();
10604 path.push_key("chargingTime");
10605 if let Some(value) = &self.charging_time {
10606 Validate::validate_at(value, path, out);
10607 }
10608 path.pop();
10609 path.push_key("idleTime");
10610 if let Some(value) = &self.idle_time {
10611 Validate::validate_at(value, path, out);
10612 }
10613 path.pop();
10614 path.push_key("reservationTime");
10615 if let Some(value) = &self.reservation_time {
10616 Validate::validate_at(value, path, out);
10617 }
10618 path.pop();
10619 path.push_key("reservationFixed");
10620 if let Some(value) = &self.reservation_fixed {
10621 Validate::validate_at(value, path, out);
10622 }
10623 path.pop();
10624 path.push_key("customData");
10625 if let Some(value) = &self.custom_data {
10626 Validate::validate_at(value, path, out);
10627 }
10628 path.pop();
10629 }
10630}
10631
10632#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
10636pub struct TotalPrice {
10637 #[serde(rename = "exclTax")]
10639 #[serde(default, skip_serializing_if = "Option::is_none")]
10640 pub excl_tax: Option<crate::types::Decimal>,
10641 #[serde(rename = "inclTax")]
10643 #[serde(default, skip_serializing_if = "Option::is_none")]
10644 pub incl_tax: Option<crate::types::Decimal>,
10645 #[serde(rename = "customData")]
10647 #[serde(default, skip_serializing_if = "Option::is_none")]
10648 pub custom_data: Option<crate::types::CustomData>,
10649}
10650
10651impl TotalPrice {
10652 #[must_use]
10654 pub fn new() -> Self {
10655 Self::default()
10656 }
10657
10658 #[must_use]
10660 pub fn with_excl_tax(mut self, value: impl Into<crate::types::Decimal>) -> Self {
10661 self.excl_tax = Some(value.into());
10662 self
10663 }
10664
10665 #[must_use]
10667 pub fn with_incl_tax(mut self, value: impl Into<crate::types::Decimal>) -> Self {
10668 self.incl_tax = Some(value.into());
10669 self
10670 }
10671
10672 #[must_use]
10674 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10675 self.custom_data = Some(value);
10676 self
10677 }
10678}
10679
10680impl Validate for TotalPrice {
10681 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10682 path.push_key("customData");
10683 if let Some(value) = &self.custom_data {
10684 Validate::validate_at(value, path, out);
10685 }
10686 path.pop();
10687 }
10688}
10689
10690#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10694pub struct TotalUsage {
10695 pub energy: crate::types::Decimal,
10697 #[serde(rename = "chargingTime")]
10699 pub charging_time: i32,
10700 #[serde(rename = "idleTime")]
10702 pub idle_time: i32,
10703 #[serde(rename = "reservationTime")]
10705 #[serde(default, skip_serializing_if = "Option::is_none")]
10706 pub reservation_time: Option<i32>,
10707 #[serde(rename = "customData")]
10709 #[serde(default, skip_serializing_if = "Option::is_none")]
10710 pub custom_data: Option<crate::types::CustomData>,
10711}
10712
10713impl TotalUsage {
10714 #[must_use]
10716 pub fn new(
10717 energy: impl Into<crate::types::Decimal>,
10718 charging_time: i32,
10719 idle_time: i32,
10720 ) -> Self {
10721 Self {
10722 energy: energy.into(),
10723 charging_time,
10724 idle_time,
10725 reservation_time: None,
10726 custom_data: None,
10727 }
10728 }
10729
10730 #[must_use]
10732 pub fn with_reservation_time(mut self, value: i32) -> Self {
10733 self.reservation_time = Some(value);
10734 self
10735 }
10736
10737 #[must_use]
10739 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10740 self.custom_data = Some(value);
10741 self
10742 }
10743}
10744
10745impl Validate for TotalUsage {
10746 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10747 path.push_key("customData");
10748 if let Some(value) = &self.custom_data {
10749 Validate::validate_at(value, path, out);
10750 }
10751 path.pop();
10752 }
10753}
10754
10755#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
10757pub struct Transaction {
10758 #[serde(rename = "transactionId")]
10760 pub transaction_id: String,
10761 #[serde(rename = "chargingState")]
10763 #[serde(default, skip_serializing_if = "Option::is_none")]
10764 pub charging_state: Option<ChargingState>,
10765 #[serde(rename = "timeSpentCharging")]
10767 #[serde(default, skip_serializing_if = "Option::is_none")]
10768 pub time_spent_charging: Option<i32>,
10769 #[serde(rename = "stoppedReason")]
10771 #[serde(default, skip_serializing_if = "Option::is_none")]
10772 pub stopped_reason: Option<Reason>,
10773 #[serde(rename = "remoteStartId")]
10775 #[serde(default, skip_serializing_if = "Option::is_none")]
10776 pub remote_start_id: Option<i32>,
10777 #[serde(rename = "operationMode")]
10779 #[serde(default, skip_serializing_if = "Option::is_none")]
10780 pub operation_mode: Option<OperationMode>,
10781 #[serde(rename = "tariffId")]
10783 #[serde(default, skip_serializing_if = "Option::is_none")]
10784 pub tariff_id: Option<String>,
10785 #[serde(rename = "transactionLimit")]
10787 #[serde(default, skip_serializing_if = "Option::is_none")]
10788 pub transaction_limit: Option<TransactionLimit>,
10789 #[serde(rename = "customData")]
10791 #[serde(default, skip_serializing_if = "Option::is_none")]
10792 pub custom_data: Option<crate::types::CustomData>,
10793}
10794
10795impl Transaction {
10796 #[must_use]
10798 pub fn new(transaction_id: impl Into<String>) -> Self {
10799 Self {
10800 transaction_id: transaction_id.into(),
10801 charging_state: None,
10802 time_spent_charging: None,
10803 stopped_reason: None,
10804 remote_start_id: None,
10805 operation_mode: None,
10806 tariff_id: None,
10807 transaction_limit: None,
10808 custom_data: None,
10809 }
10810 }
10811
10812 #[must_use]
10814 pub fn with_charging_state(mut self, value: ChargingState) -> Self {
10815 self.charging_state = Some(value);
10816 self
10817 }
10818
10819 #[must_use]
10821 pub fn with_time_spent_charging(mut self, value: i32) -> Self {
10822 self.time_spent_charging = Some(value);
10823 self
10824 }
10825
10826 #[must_use]
10828 pub fn with_stopped_reason(mut self, value: Reason) -> Self {
10829 self.stopped_reason = Some(value);
10830 self
10831 }
10832
10833 #[must_use]
10835 pub fn with_remote_start_id(mut self, value: i32) -> Self {
10836 self.remote_start_id = Some(value);
10837 self
10838 }
10839
10840 #[must_use]
10842 pub fn with_operation_mode(mut self, value: OperationMode) -> Self {
10843 self.operation_mode = Some(value);
10844 self
10845 }
10846
10847 #[must_use]
10849 pub fn with_tariff_id(mut self, value: impl Into<String>) -> Self {
10850 self.tariff_id = Some(value.into());
10851 self
10852 }
10853
10854 #[must_use]
10856 pub fn with_transaction_limit(mut self, value: TransactionLimit) -> Self {
10857 self.transaction_limit = Some(value);
10858 self
10859 }
10860
10861 #[must_use]
10863 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10864 self.custom_data = Some(value);
10865 self
10866 }
10867}
10868
10869impl Validate for Transaction {
10870 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10871 path.push_key("transactionId");
10872 validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
10873 path.pop();
10874 path.push_key("chargingState");
10875 if let Some(value) = &self.charging_state {
10876 Validate::validate_at(value, path, out);
10877 }
10878 path.pop();
10879 path.push_key("stoppedReason");
10880 if let Some(value) = &self.stopped_reason {
10881 Validate::validate_at(value, path, out);
10882 }
10883 path.pop();
10884 path.push_key("operationMode");
10885 if let Some(value) = &self.operation_mode {
10886 Validate::validate_at(value, path, out);
10887 }
10888 path.pop();
10889 path.push_key("tariffId");
10890 if let Some(value) = &self.tariff_id {
10891 validate::string(value.as_str(), None, Some(60), path, out);
10892 }
10893 path.pop();
10894 path.push_key("transactionLimit");
10895 if let Some(value) = &self.transaction_limit {
10896 Validate::validate_at(value, path, out);
10897 }
10898 path.pop();
10899 path.push_key("customData");
10900 if let Some(value) = &self.custom_data {
10901 Validate::validate_at(value, path, out);
10902 }
10903 path.pop();
10904 }
10905}
10906
10907#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
10911pub struct TransactionLimit {
10912 #[serde(rename = "maxCost")]
10914 #[serde(default, skip_serializing_if = "Option::is_none")]
10915 pub max_cost: Option<crate::types::Decimal>,
10916 #[serde(rename = "maxEnergy")]
10918 #[serde(default, skip_serializing_if = "Option::is_none")]
10919 pub max_energy: Option<crate::types::Decimal>,
10920 #[serde(rename = "maxTime")]
10922 #[serde(default, skip_serializing_if = "Option::is_none")]
10923 pub max_time: Option<i32>,
10924 #[serde(rename = "maxSoC")]
10926 #[serde(default, skip_serializing_if = "Option::is_none")]
10927 pub max_so_c: Option<i32>,
10928 #[serde(rename = "customData")]
10930 #[serde(default, skip_serializing_if = "Option::is_none")]
10931 pub custom_data: Option<crate::types::CustomData>,
10932}
10933
10934impl TransactionLimit {
10935 #[must_use]
10937 pub fn new() -> Self {
10938 Self::default()
10939 }
10940
10941 #[must_use]
10943 pub fn with_max_cost(mut self, value: impl Into<crate::types::Decimal>) -> Self {
10944 self.max_cost = Some(value.into());
10945 self
10946 }
10947
10948 #[must_use]
10950 pub fn with_max_energy(mut self, value: impl Into<crate::types::Decimal>) -> Self {
10951 self.max_energy = Some(value.into());
10952 self
10953 }
10954
10955 #[must_use]
10957 pub fn with_max_time(mut self, value: i32) -> Self {
10958 self.max_time = Some(value);
10959 self
10960 }
10961
10962 #[must_use]
10964 pub fn with_max_so_c(mut self, value: i32) -> Self {
10965 self.max_so_c = Some(value);
10966 self
10967 }
10968
10969 #[must_use]
10971 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
10972 self.custom_data = Some(value);
10973 self
10974 }
10975}
10976
10977impl Validate for TransactionLimit {
10978 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
10979 path.push_key("maxSoC");
10980 if let Some(value) = &self.max_so_c {
10981 validate::int_range(i64::from(*value), Some(0.0), Some(100.0), path, out);
10982 }
10983 path.pop();
10984 path.push_key("customData");
10985 if let Some(value) = &self.custom_data {
10986 Validate::validate_at(value, path, out);
10987 }
10988 path.pop();
10989 }
10990}
10991
10992#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
10996pub struct UnitOfMeasure {
10997 #[serde(default, skip_serializing_if = "Option::is_none")]
11002 pub unit: Option<String>,
11003 #[serde(default, skip_serializing_if = "Option::is_none")]
11007 pub multiplier: Option<i32>,
11008 #[serde(rename = "customData")]
11010 #[serde(default, skip_serializing_if = "Option::is_none")]
11011 pub custom_data: Option<crate::types::CustomData>,
11012}
11013
11014impl UnitOfMeasure {
11015 #[must_use]
11017 pub fn new() -> Self {
11018 Self::default()
11019 }
11020
11021 #[must_use]
11023 pub fn with_unit(mut self, value: impl Into<String>) -> Self {
11024 self.unit = Some(value.into());
11025 self
11026 }
11027
11028 #[must_use]
11030 pub fn with_multiplier(mut self, value: i32) -> Self {
11031 self.multiplier = Some(value);
11032 self
11033 }
11034
11035 #[must_use]
11037 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11038 self.custom_data = Some(value);
11039 self
11040 }
11041}
11042
11043impl Validate for UnitOfMeasure {
11044 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11045 path.push_key("unit");
11046 if let Some(value) = &self.unit {
11047 validate::string(value.as_str(), None, Some(20), path, out);
11048 }
11049 path.pop();
11050 path.push_key("customData");
11051 if let Some(value) = &self.custom_data {
11052 Validate::validate_at(value, path, out);
11053 }
11054 path.pop();
11055 }
11056}
11057
11058#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
11063pub struct V2XChargingParameters {
11064 #[serde(rename = "minChargePower")]
11069 #[serde(default, skip_serializing_if = "Option::is_none")]
11070 pub min_charge_power: Option<crate::types::Decimal>,
11071 #[serde(rename = "minChargePower_L2")]
11075 #[serde(default, skip_serializing_if = "Option::is_none")]
11076 pub min_charge_power_l2: Option<crate::types::Decimal>,
11077 #[serde(rename = "minChargePower_L3")]
11081 #[serde(default, skip_serializing_if = "Option::is_none")]
11082 pub min_charge_power_l3: Option<crate::types::Decimal>,
11083 #[serde(rename = "maxChargePower")]
11091 #[serde(default, skip_serializing_if = "Option::is_none")]
11092 pub max_charge_power: Option<crate::types::Decimal>,
11093 #[serde(rename = "maxChargePower_L2")]
11097 #[serde(default, skip_serializing_if = "Option::is_none")]
11098 pub max_charge_power_l2: Option<crate::types::Decimal>,
11099 #[serde(rename = "maxChargePower_L3")]
11103 #[serde(default, skip_serializing_if = "Option::is_none")]
11104 pub max_charge_power_l3: Option<crate::types::Decimal>,
11105 #[serde(rename = "minDischargePower")]
11113 #[serde(default, skip_serializing_if = "Option::is_none")]
11114 pub min_discharge_power: Option<crate::types::Decimal>,
11115 #[serde(rename = "minDischargePower_L2")]
11119 #[serde(default, skip_serializing_if = "Option::is_none")]
11120 pub min_discharge_power_l2: Option<crate::types::Decimal>,
11121 #[serde(rename = "minDischargePower_L3")]
11125 #[serde(default, skip_serializing_if = "Option::is_none")]
11126 pub min_discharge_power_l3: Option<crate::types::Decimal>,
11127 #[serde(rename = "maxDischargePower")]
11132 #[serde(default, skip_serializing_if = "Option::is_none")]
11133 pub max_discharge_power: Option<crate::types::Decimal>,
11134 #[serde(rename = "maxDischargePower_L2")]
11138 #[serde(default, skip_serializing_if = "Option::is_none")]
11139 pub max_discharge_power_l2: Option<crate::types::Decimal>,
11140 #[serde(rename = "maxDischargePower_L3")]
11144 #[serde(default, skip_serializing_if = "Option::is_none")]
11145 pub max_discharge_power_l3: Option<crate::types::Decimal>,
11146 #[serde(rename = "minChargeCurrent")]
11150 #[serde(default, skip_serializing_if = "Option::is_none")]
11151 pub min_charge_current: Option<crate::types::Decimal>,
11152 #[serde(rename = "maxChargeCurrent")]
11156 #[serde(default, skip_serializing_if = "Option::is_none")]
11157 pub max_charge_current: Option<crate::types::Decimal>,
11158 #[serde(rename = "minDischargeCurrent")]
11162 #[serde(default, skip_serializing_if = "Option::is_none")]
11163 pub min_discharge_current: Option<crate::types::Decimal>,
11164 #[serde(rename = "maxDischargeCurrent")]
11168 #[serde(default, skip_serializing_if = "Option::is_none")]
11169 pub max_discharge_current: Option<crate::types::Decimal>,
11170 #[serde(rename = "minVoltage")]
11174 #[serde(default, skip_serializing_if = "Option::is_none")]
11175 pub min_voltage: Option<crate::types::Decimal>,
11176 #[serde(rename = "maxVoltage")]
11180 #[serde(default, skip_serializing_if = "Option::is_none")]
11181 pub max_voltage: Option<crate::types::Decimal>,
11182 #[serde(rename = "evTargetEnergyRequest")]
11186 #[serde(default, skip_serializing_if = "Option::is_none")]
11187 pub ev_target_energy_request: Option<crate::types::Decimal>,
11188 #[serde(rename = "evMinEnergyRequest")]
11192 #[serde(default, skip_serializing_if = "Option::is_none")]
11193 pub ev_min_energy_request: Option<crate::types::Decimal>,
11194 #[serde(rename = "evMaxEnergyRequest")]
11198 #[serde(default, skip_serializing_if = "Option::is_none")]
11199 pub ev_max_energy_request: Option<crate::types::Decimal>,
11200 #[serde(rename = "evMinV2XEnergyRequest")]
11205 #[serde(default, skip_serializing_if = "Option::is_none")]
11206 pub ev_min_v2_x_energy_request: Option<crate::types::Decimal>,
11207 #[serde(rename = "evMaxV2XEnergyRequest")]
11212 #[serde(default, skip_serializing_if = "Option::is_none")]
11213 pub ev_max_v2_x_energy_request: Option<crate::types::Decimal>,
11214 #[serde(rename = "targetSoC")]
11218 #[serde(default, skip_serializing_if = "Option::is_none")]
11219 pub target_so_c: Option<i32>,
11220 #[serde(rename = "customData")]
11222 #[serde(default, skip_serializing_if = "Option::is_none")]
11223 pub custom_data: Option<crate::types::CustomData>,
11224}
11225
11226impl V2XChargingParameters {
11227 #[must_use]
11229 pub fn new() -> Self {
11230 Self::default()
11231 }
11232
11233 #[must_use]
11235 pub fn with_min_charge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11236 self.min_charge_power = Some(value.into());
11237 self
11238 }
11239
11240 #[must_use]
11242 pub fn with_min_charge_power_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11243 self.min_charge_power_l2 = Some(value.into());
11244 self
11245 }
11246
11247 #[must_use]
11249 pub fn with_min_charge_power_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11250 self.min_charge_power_l3 = Some(value.into());
11251 self
11252 }
11253
11254 #[must_use]
11256 pub fn with_max_charge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11257 self.max_charge_power = Some(value.into());
11258 self
11259 }
11260
11261 #[must_use]
11263 pub fn with_max_charge_power_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11264 self.max_charge_power_l2 = Some(value.into());
11265 self
11266 }
11267
11268 #[must_use]
11270 pub fn with_max_charge_power_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11271 self.max_charge_power_l3 = Some(value.into());
11272 self
11273 }
11274
11275 #[must_use]
11277 pub fn with_min_discharge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11278 self.min_discharge_power = Some(value.into());
11279 self
11280 }
11281
11282 #[must_use]
11284 pub fn with_min_discharge_power_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11285 self.min_discharge_power_l2 = Some(value.into());
11286 self
11287 }
11288
11289 #[must_use]
11291 pub fn with_min_discharge_power_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11292 self.min_discharge_power_l3 = Some(value.into());
11293 self
11294 }
11295
11296 #[must_use]
11298 pub fn with_max_discharge_power(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11299 self.max_discharge_power = Some(value.into());
11300 self
11301 }
11302
11303 #[must_use]
11305 pub fn with_max_discharge_power_l2(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11306 self.max_discharge_power_l2 = Some(value.into());
11307 self
11308 }
11309
11310 #[must_use]
11312 pub fn with_max_discharge_power_l3(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11313 self.max_discharge_power_l3 = Some(value.into());
11314 self
11315 }
11316
11317 #[must_use]
11319 pub fn with_min_charge_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11320 self.min_charge_current = Some(value.into());
11321 self
11322 }
11323
11324 #[must_use]
11326 pub fn with_max_charge_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11327 self.max_charge_current = Some(value.into());
11328 self
11329 }
11330
11331 #[must_use]
11333 pub fn with_min_discharge_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11334 self.min_discharge_current = Some(value.into());
11335 self
11336 }
11337
11338 #[must_use]
11340 pub fn with_max_discharge_current(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11341 self.max_discharge_current = Some(value.into());
11342 self
11343 }
11344
11345 #[must_use]
11347 pub fn with_min_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11348 self.min_voltage = Some(value.into());
11349 self
11350 }
11351
11352 #[must_use]
11354 pub fn with_max_voltage(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11355 self.max_voltage = Some(value.into());
11356 self
11357 }
11358
11359 #[must_use]
11361 pub fn with_ev_target_energy_request(
11362 mut self,
11363 value: impl Into<crate::types::Decimal>,
11364 ) -> Self {
11365 self.ev_target_energy_request = Some(value.into());
11366 self
11367 }
11368
11369 #[must_use]
11371 pub fn with_ev_min_energy_request(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11372 self.ev_min_energy_request = Some(value.into());
11373 self
11374 }
11375
11376 #[must_use]
11378 pub fn with_ev_max_energy_request(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11379 self.ev_max_energy_request = Some(value.into());
11380 self
11381 }
11382
11383 #[must_use]
11385 pub fn with_ev_min_v2_x_energy_request(
11386 mut self,
11387 value: impl Into<crate::types::Decimal>,
11388 ) -> Self {
11389 self.ev_min_v2_x_energy_request = Some(value.into());
11390 self
11391 }
11392
11393 #[must_use]
11395 pub fn with_ev_max_v2_x_energy_request(
11396 mut self,
11397 value: impl Into<crate::types::Decimal>,
11398 ) -> Self {
11399 self.ev_max_v2_x_energy_request = Some(value.into());
11400 self
11401 }
11402
11403 #[must_use]
11405 pub fn with_target_so_c(mut self, value: i32) -> Self {
11406 self.target_so_c = Some(value);
11407 self
11408 }
11409
11410 #[must_use]
11412 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11413 self.custom_data = Some(value);
11414 self
11415 }
11416}
11417
11418impl Validate for V2XChargingParameters {
11419 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11420 path.push_key("targetSoC");
11421 if let Some(value) = &self.target_so_c {
11422 validate::int_range(i64::from(*value), Some(0.0), Some(100.0), path, out);
11423 }
11424 path.pop();
11425 path.push_key("customData");
11426 if let Some(value) = &self.custom_data {
11427 Validate::validate_at(value, path, out);
11428 }
11429 path.pop();
11430 }
11431}
11432
11433#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11437pub struct V2XFreqWattPoint {
11438 pub frequency: crate::types::Decimal,
11440 pub power: crate::types::Decimal,
11442 #[serde(rename = "customData")]
11444 #[serde(default, skip_serializing_if = "Option::is_none")]
11445 pub custom_data: Option<crate::types::CustomData>,
11446}
11447
11448impl V2XFreqWattPoint {
11449 #[must_use]
11451 pub fn new(
11452 frequency: impl Into<crate::types::Decimal>,
11453 power: impl Into<crate::types::Decimal>,
11454 ) -> Self {
11455 Self {
11456 frequency: frequency.into(),
11457 power: power.into(),
11458 custom_data: None,
11459 }
11460 }
11461
11462 #[must_use]
11464 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11465 self.custom_data = Some(value);
11466 self
11467 }
11468}
11469
11470impl Validate for V2XFreqWattPoint {
11471 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11472 path.push_key("customData");
11473 if let Some(value) = &self.custom_data {
11474 Validate::validate_at(value, path, out);
11475 }
11476 path.pop();
11477 }
11478}
11479
11480#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11484pub struct V2XSignalWattPoint {
11485 pub signal: i32,
11487 pub power: crate::types::Decimal,
11489 #[serde(rename = "customData")]
11491 #[serde(default, skip_serializing_if = "Option::is_none")]
11492 pub custom_data: Option<crate::types::CustomData>,
11493}
11494
11495impl V2XSignalWattPoint {
11496 #[must_use]
11498 pub fn new(signal: i32, power: impl Into<crate::types::Decimal>) -> Self {
11499 Self {
11500 signal,
11501 power: power.into(),
11502 custom_data: None,
11503 }
11504 }
11505
11506 #[must_use]
11508 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11509 self.custom_data = Some(value);
11510 self
11511 }
11512}
11513
11514impl Validate for V2XSignalWattPoint {
11515 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11516 path.push_key("customData");
11517 if let Some(value) = &self.custom_data {
11518 Validate::validate_at(value, path, out);
11519 }
11520 path.pop();
11521 }
11522}
11523
11524#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11528pub struct VPN {
11529 pub server: String,
11531 pub user: String,
11533 pub password: String,
11535 pub key: String,
11537 pub r#type: VPNEnum,
11539 #[serde(default, skip_serializing_if = "Option::is_none")]
11541 pub group: Option<String>,
11542 #[serde(rename = "customData")]
11544 #[serde(default, skip_serializing_if = "Option::is_none")]
11545 pub custom_data: Option<crate::types::CustomData>,
11546}
11547
11548impl VPN {
11549 #[must_use]
11551 pub fn new(
11552 server: impl Into<String>,
11553 user: impl Into<String>,
11554 password: impl Into<String>,
11555 key: impl Into<String>,
11556 r#type: VPNEnum,
11557 ) -> Self {
11558 Self {
11559 server: server.into(),
11560 user: user.into(),
11561 password: password.into(),
11562 key: key.into(),
11563 r#type,
11564 group: None,
11565 custom_data: None,
11566 }
11567 }
11568
11569 #[must_use]
11571 pub fn with_group(mut self, value: impl Into<String>) -> Self {
11572 self.group = Some(value.into());
11573 self
11574 }
11575
11576 #[must_use]
11578 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11579 self.custom_data = Some(value);
11580 self
11581 }
11582}
11583
11584impl Validate for VPN {
11585 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11586 path.push_key("server");
11587 validate::string(self.server.as_str(), None, Some(2000), path, out);
11588 path.pop();
11589 path.push_key("user");
11590 validate::string(self.user.as_str(), None, Some(50), path, out);
11591 path.pop();
11592 path.push_key("password");
11593 validate::string(self.password.as_str(), None, Some(64), path, out);
11594 path.pop();
11595 path.push_key("key");
11596 validate::string(self.key.as_str(), None, Some(255), path, out);
11597 path.pop();
11598 path.push_key("type");
11599 Validate::validate_at(&self.r#type, path, out);
11600 path.pop();
11601 path.push_key("group");
11602 if let Some(value) = &self.group {
11603 validate::string(value.as_str(), None, Some(50), path, out);
11604 }
11605 path.pop();
11606 path.push_key("customData");
11607 if let Some(value) = &self.custom_data {
11608 Validate::validate_at(value, path, out);
11609 }
11610 path.pop();
11611 }
11612}
11613
11614#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11618pub struct Variable {
11619 pub name: String,
11621 #[serde(default, skip_serializing_if = "Option::is_none")]
11623 pub instance: Option<String>,
11624 #[serde(rename = "customData")]
11626 #[serde(default, skip_serializing_if = "Option::is_none")]
11627 pub custom_data: Option<crate::types::CustomData>,
11628}
11629
11630impl Variable {
11631 #[must_use]
11633 pub fn new(name: impl Into<String>) -> Self {
11634 Self {
11635 name: name.into(),
11636 instance: None,
11637 custom_data: None,
11638 }
11639 }
11640
11641 #[must_use]
11643 pub fn with_instance(mut self, value: impl Into<String>) -> Self {
11644 self.instance = Some(value.into());
11645 self
11646 }
11647
11648 #[must_use]
11650 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11651 self.custom_data = Some(value);
11652 self
11653 }
11654}
11655
11656impl Validate for Variable {
11657 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11658 path.push_key("name");
11659 validate::string(self.name.as_str(), None, Some(50), path, out);
11660 path.pop();
11661 path.push_key("instance");
11662 if let Some(value) = &self.instance {
11663 validate::string(value.as_str(), None, Some(50), path, out);
11664 }
11665 path.pop();
11666 path.push_key("customData");
11667 if let Some(value) = &self.custom_data {
11668 Validate::validate_at(value, path, out);
11669 }
11670 path.pop();
11671 }
11672}
11673
11674#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
11678pub struct VariableAttribute {
11679 #[serde(default, skip_serializing_if = "Option::is_none")]
11681 pub r#type: Option<Attribute>,
11682 #[serde(default, skip_serializing_if = "Option::is_none")]
11686 pub value: Option<String>,
11687 #[serde(default, skip_serializing_if = "Option::is_none")]
11689 pub mutability: Option<Mutability>,
11690 #[serde(default, skip_serializing_if = "Option::is_none")]
11693 pub persistent: Option<bool>,
11694 #[serde(default, skip_serializing_if = "Option::is_none")]
11697 pub constant: Option<bool>,
11698 #[serde(rename = "customData")]
11700 #[serde(default, skip_serializing_if = "Option::is_none")]
11701 pub custom_data: Option<crate::types::CustomData>,
11702}
11703
11704impl VariableAttribute {
11705 #[must_use]
11707 pub fn new() -> Self {
11708 Self::default()
11709 }
11710
11711 #[must_use]
11713 pub fn with_type(mut self, value: Attribute) -> Self {
11714 self.r#type = Some(value);
11715 self
11716 }
11717
11718 #[must_use]
11720 pub fn with_value(mut self, value: impl Into<String>) -> Self {
11721 self.value = Some(value.into());
11722 self
11723 }
11724
11725 #[must_use]
11727 pub fn with_mutability(mut self, value: Mutability) -> Self {
11728 self.mutability = Some(value);
11729 self
11730 }
11731
11732 #[must_use]
11734 pub fn with_persistent(mut self, value: bool) -> Self {
11735 self.persistent = Some(value);
11736 self
11737 }
11738
11739 #[must_use]
11741 pub fn with_constant(mut self, value: bool) -> Self {
11742 self.constant = Some(value);
11743 self
11744 }
11745
11746 #[must_use]
11748 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11749 self.custom_data = Some(value);
11750 self
11751 }
11752}
11753
11754impl Validate for VariableAttribute {
11755 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11756 path.push_key("type");
11757 if let Some(value) = &self.r#type {
11758 Validate::validate_at(value, path, out);
11759 }
11760 path.pop();
11761 path.push_key("value");
11762 if let Some(value) = &self.value {
11763 validate::string(value.as_str(), None, Some(2500), path, out);
11764 }
11765 path.pop();
11766 path.push_key("mutability");
11767 if let Some(value) = &self.mutability {
11768 Validate::validate_at(value, path, out);
11769 }
11770 path.pop();
11771 path.push_key("customData");
11772 if let Some(value) = &self.custom_data {
11773 Validate::validate_at(value, path, out);
11774 }
11775 path.pop();
11776 }
11777}
11778
11779#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11783pub struct VariableCharacteristics {
11784 #[serde(rename = "dataType")]
11786 pub data_type: Data,
11787 #[serde(rename = "supportsMonitoring")]
11789 pub supports_monitoring: bool,
11790 #[serde(default, skip_serializing_if = "Option::is_none")]
11792 pub unit: Option<String>,
11793 #[serde(rename = "minLimit")]
11795 #[serde(default, skip_serializing_if = "Option::is_none")]
11796 pub min_limit: Option<crate::types::Decimal>,
11797 #[serde(rename = "maxLimit")]
11799 #[serde(default, skip_serializing_if = "Option::is_none")]
11800 pub max_limit: Option<crate::types::Decimal>,
11801 #[serde(rename = "maxElements")]
11803 #[serde(default, skip_serializing_if = "Option::is_none")]
11804 pub max_elements: Option<i32>,
11805 #[serde(rename = "valuesList")]
11819 #[serde(default, skip_serializing_if = "Option::is_none")]
11820 pub values_list: Option<String>,
11821 #[serde(rename = "customData")]
11823 #[serde(default, skip_serializing_if = "Option::is_none")]
11824 pub custom_data: Option<crate::types::CustomData>,
11825}
11826
11827impl VariableCharacteristics {
11828 #[must_use]
11830 pub fn new(data_type: Data, supports_monitoring: bool) -> Self {
11831 Self {
11832 data_type,
11833 supports_monitoring,
11834 unit: None,
11835 min_limit: None,
11836 max_limit: None,
11837 max_elements: None,
11838 values_list: None,
11839 custom_data: None,
11840 }
11841 }
11842
11843 #[must_use]
11845 pub fn with_unit(mut self, value: impl Into<String>) -> Self {
11846 self.unit = Some(value.into());
11847 self
11848 }
11849
11850 #[must_use]
11852 pub fn with_min_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11853 self.min_limit = Some(value.into());
11854 self
11855 }
11856
11857 #[must_use]
11859 pub fn with_max_limit(mut self, value: impl Into<crate::types::Decimal>) -> Self {
11860 self.max_limit = Some(value.into());
11861 self
11862 }
11863
11864 #[must_use]
11866 pub fn with_max_elements(mut self, value: i32) -> Self {
11867 self.max_elements = Some(value);
11868 self
11869 }
11870
11871 #[must_use]
11873 pub fn with_values_list(mut self, value: impl Into<String>) -> Self {
11874 self.values_list = Some(value.into());
11875 self
11876 }
11877
11878 #[must_use]
11880 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11881 self.custom_data = Some(value);
11882 self
11883 }
11884}
11885
11886impl Validate for VariableCharacteristics {
11887 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11888 path.push_key("dataType");
11889 Validate::validate_at(&self.data_type, path, out);
11890 path.pop();
11891 path.push_key("unit");
11892 if let Some(value) = &self.unit {
11893 validate::string(value.as_str(), None, Some(16), path, out);
11894 }
11895 path.pop();
11896 path.push_key("maxElements");
11897 if let Some(value) = &self.max_elements {
11898 validate::int_range(i64::from(*value), Some(1.0), None, path, out);
11899 }
11900 path.pop();
11901 path.push_key("valuesList");
11902 if let Some(value) = &self.values_list {
11903 validate::string(value.as_str(), None, Some(1000), path, out);
11904 }
11905 path.pop();
11906 path.push_key("customData");
11907 if let Some(value) = &self.custom_data {
11908 Validate::validate_at(value, path, out);
11909 }
11910 path.pop();
11911 }
11912}
11913
11914#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
11918pub struct VariableMonitoring {
11919 pub id: i32,
11921 pub transaction: bool,
11923 pub value: crate::types::Decimal,
11926 pub r#type: Monitor,
11928 pub severity: i32,
11952 #[serde(rename = "eventNotificationType")]
11954 pub event_notification_type: EventNotification,
11955 #[serde(rename = "customData")]
11957 #[serde(default, skip_serializing_if = "Option::is_none")]
11958 pub custom_data: Option<crate::types::CustomData>,
11959}
11960
11961impl VariableMonitoring {
11962 #[must_use]
11964 pub fn new(
11965 id: i32,
11966 transaction: bool,
11967 value: impl Into<crate::types::Decimal>,
11968 r#type: Monitor,
11969 severity: i32,
11970 event_notification_type: EventNotification,
11971 ) -> Self {
11972 Self {
11973 id,
11974 transaction,
11975 value: value.into(),
11976 r#type,
11977 severity,
11978 event_notification_type,
11979 custom_data: None,
11980 }
11981 }
11982
11983 #[must_use]
11985 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
11986 self.custom_data = Some(value);
11987 self
11988 }
11989}
11990
11991impl Validate for VariableMonitoring {
11992 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
11993 path.push_key("id");
11994 validate::int_range(i64::from(self.id), Some(0.0), None, path, out);
11995 path.pop();
11996 path.push_key("type");
11997 Validate::validate_at(&self.r#type, path, out);
11998 path.pop();
11999 path.push_key("severity");
12000 validate::int_range(i64::from(self.severity), Some(0.0), None, path, out);
12001 path.pop();
12002 path.push_key("eventNotificationType");
12003 Validate::validate_at(&self.event_notification_type, path, out);
12004 path.pop();
12005 path.push_key("customData");
12006 if let Some(value) = &self.custom_data {
12007 Validate::validate_at(value, path, out);
12008 }
12009 path.pop();
12010 }
12011}
12012
12013#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
12015pub struct VoltageParams {
12016 #[serde(rename = "hv10MinMeanValue")]
12022 #[serde(default, skip_serializing_if = "Option::is_none")]
12023 pub hv10_min_mean_value: Option<crate::types::Decimal>,
12024 #[serde(rename = "hv10MinMeanTripDelay")]
12028 #[serde(default, skip_serializing_if = "Option::is_none")]
12029 pub hv10_min_mean_trip_delay: Option<crate::types::Decimal>,
12030 #[serde(rename = "powerDuringCessation")]
12032 #[serde(default, skip_serializing_if = "Option::is_none")]
12033 pub power_during_cessation: Option<PowerDuringCessation>,
12034 #[serde(rename = "customData")]
12036 #[serde(default, skip_serializing_if = "Option::is_none")]
12037 pub custom_data: Option<crate::types::CustomData>,
12038}
12039
12040impl VoltageParams {
12041 #[must_use]
12043 pub fn new() -> Self {
12044 Self::default()
12045 }
12046
12047 #[must_use]
12049 pub fn with_hv10_min_mean_value(mut self, value: impl Into<crate::types::Decimal>) -> Self {
12050 self.hv10_min_mean_value = Some(value.into());
12051 self
12052 }
12053
12054 #[must_use]
12056 pub fn with_hv10_min_mean_trip_delay(
12057 mut self,
12058 value: impl Into<crate::types::Decimal>,
12059 ) -> Self {
12060 self.hv10_min_mean_trip_delay = Some(value.into());
12061 self
12062 }
12063
12064 #[must_use]
12066 pub fn with_power_during_cessation(mut self, value: PowerDuringCessation) -> Self {
12067 self.power_during_cessation = Some(value);
12068 self
12069 }
12070
12071 #[must_use]
12073 pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
12074 self.custom_data = Some(value);
12075 self
12076 }
12077}
12078
12079impl Validate for VoltageParams {
12080 fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
12081 path.push_key("powerDuringCessation");
12082 if let Some(value) = &self.power_during_cessation {
12083 Validate::validate_at(value, path, out);
12084 }
12085 path.pop();
12086 path.push_key("customData");
12087 if let Some(value) = &self.custom_data {
12088 Validate::validate_at(value, path, out);
12089 }
12090 path.pop();
12091 }
12092}