v230
1from typing import Any, List, Optional, TypeVar, Callable, Type, cast 2from enum import Enum 3 4 5T = TypeVar("T") 6EnumT = TypeVar("EnumT", bound=Enum) 7 8 9def from_float(x: Any) -> float: 10 assert isinstance(x, (float, int)) and not isinstance(x, bool) 11 return float(x) 12 13 14def from_int(x: Any) -> int: 15 assert isinstance(x, int) and not isinstance(x, bool) 16 return x 17 18 19def to_float(x: Any) -> float: 20 assert isinstance(x, (int, float)) 21 return x 22 23 24def from_none(x: Any) -> Any: 25 assert x is None 26 return x 27 28 29def from_list(f: Callable[[Any], T], x: Any) -> List[T]: 30 assert isinstance(x, list) 31 return [f(y) for y in x] 32 33 34def from_union(fs, x): 35 for f in fs: 36 try: 37 return f(x) 38 except: 39 pass 40 assert False 41 42 43def from_str(x: Any) -> str: 44 assert isinstance(x, str) 45 return x 46 47 48def to_class(c: Type[T], x: Any) -> dict: 49 assert isinstance(x, c) 50 return cast(Any, x).to_dict() 51 52 53def to_enum(c: Type[EnumT], x: Any) -> EnumT: 54 assert isinstance(x, c) 55 return x.value 56 57 58def from_bool(x: Any) -> bool: 59 assert isinstance(x, bool) 60 return x 61 62 63class ChargingProfilePeriod: 64 limit: float 65 start_period: int 66 67 def __init__(self, limit: float, start_period: int) -> None: 68 self.limit = limit 69 self.start_period = start_period 70 71 @staticmethod 72 def from_dict(obj: Any) -> 'ChargingProfilePeriod': 73 assert isinstance(obj, dict) 74 limit = from_float(obj.get("limit")) 75 start_period = from_int(obj.get("start_period")) 76 return ChargingProfilePeriod(limit, start_period) 77 78 def to_dict(self) -> dict: 79 result: dict = {} 80 result["limit"] = to_float(self.limit) 81 result["start_period"] = from_int(self.start_period) 82 return result 83 84 85class ChargingRateUnit(Enum): 86 A = "A" 87 W = "W" 88 89 90class ChargingProfile: 91 charging_profile_period: Optional[List[ChargingProfilePeriod]] 92 charging_rate_unit: ChargingRateUnit 93 duration: Optional[int] 94 min_charging_rate: Optional[float] 95 start_date_time: Optional[str] 96 97 def __init__(self, charging_profile_period: Optional[List[ChargingProfilePeriod]], charging_rate_unit: ChargingRateUnit, duration: Optional[int], min_charging_rate: Optional[float], start_date_time: Optional[str]) -> None: 98 self.charging_profile_period = charging_profile_period 99 self.charging_rate_unit = charging_rate_unit 100 self.duration = duration 101 self.min_charging_rate = min_charging_rate 102 self.start_date_time = start_date_time 103 104 @staticmethod 105 def from_dict(obj: Any) -> 'ChargingProfile': 106 assert isinstance(obj, dict) 107 charging_profile_period = from_union([from_none, lambda x: from_list(ChargingProfilePeriod.from_dict, x)], obj.get("charging_profile_period")) 108 charging_rate_unit = ChargingRateUnit(obj.get("charging_rate_unit")) 109 duration = from_union([from_none, from_int], obj.get("duration")) 110 min_charging_rate = from_union([from_none, from_float], obj.get("min_charging_rate")) 111 start_date_time = from_union([from_none, from_str], obj.get("start_date_time")) 112 return ChargingProfile(charging_profile_period, charging_rate_unit, duration, min_charging_rate, start_date_time) 113 114 def to_dict(self) -> dict: 115 result: dict = {} 116 if self.charging_profile_period is not None: 117 result["charging_profile_period"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ChargingProfilePeriod, x), x)], self.charging_profile_period) 118 result["charging_rate_unit"] = to_enum(ChargingRateUnit, self.charging_rate_unit) 119 if self.duration is not None: 120 result["duration"] = from_union([from_none, from_int], self.duration) 121 if self.min_charging_rate is not None: 122 result["min_charging_rate"] = from_union([from_none, to_float], self.min_charging_rate) 123 if self.start_date_time is not None: 124 result["start_date_time"] = from_union([from_none, from_str], self.start_date_time) 125 return result 126 127 128class ActiveChargingProfile: 129 charging_profile: ChargingProfile 130 start_date_time: str 131 132 def __init__(self, charging_profile: ChargingProfile, start_date_time: str) -> None: 133 self.charging_profile = charging_profile 134 self.start_date_time = start_date_time 135 136 @staticmethod 137 def from_dict(obj: Any) -> 'ActiveChargingProfile': 138 assert isinstance(obj, dict) 139 charging_profile = ChargingProfile.from_dict(obj.get("charging_profile")) 140 start_date_time = from_str(obj.get("start_date_time")) 141 return ActiveChargingProfile(charging_profile, start_date_time) 142 143 def to_dict(self) -> dict: 144 result: dict = {} 145 result["charging_profile"] = to_class(ChargingProfile, self.charging_profile) 146 result["start_date_time"] = from_str(self.start_date_time) 147 return result 148 149 150class ChargingProfileResultType(Enum): 151 ACCEPTED = "ACCEPTED" 152 REJECTED = "REJECTED" 153 UNKNOWN = "UNKNOWN" 154 155 156class ActiveChargingProfileResult: 157 profile: Optional[ActiveChargingProfile] 158 result: ChargingProfileResultType 159 160 def __init__(self, profile: Optional[ActiveChargingProfile], result: ChargingProfileResultType) -> None: 161 self.profile = profile 162 self.result = result 163 164 @staticmethod 165 def from_dict(obj: Any) -> 'ActiveChargingProfileResult': 166 assert isinstance(obj, dict) 167 profile = from_union([ActiveChargingProfile.from_dict, from_none], obj.get("profile")) 168 result = ChargingProfileResultType(obj.get("result")) 169 return ActiveChargingProfileResult(profile, result) 170 171 def to_dict(self) -> dict: 172 result: dict = {} 173 if self.profile is not None: 174 result["profile"] = from_union([lambda x: to_class(ActiveChargingProfile, x), from_none], self.profile) 175 result["result"] = to_enum(ChargingProfileResultType, self.result) 176 return result 177 178 179class AllowedType(Enum): 180 ALLOWED = "ALLOWED" 181 BLOCKED = "BLOCKED" 182 EXPIRED = "EXPIRED" 183 NOT_ALLOWED = "NOT_ALLOWED" 184 NO_CREDIT = "NO_CREDIT" 185 186 187class DisplayText: 188 language: str 189 text: str 190 191 def __init__(self, language: str, text: str) -> None: 192 self.language = language 193 self.text = text 194 195 @staticmethod 196 def from_dict(obj: Any) -> 'DisplayText': 197 assert isinstance(obj, dict) 198 language = from_str(obj.get("language")) 199 text = from_str(obj.get("text")) 200 return DisplayText(language, text) 201 202 def to_dict(self) -> dict: 203 result: dict = {} 204 result["language"] = from_str(self.language) 205 result["text"] = from_str(self.text) 206 return result 207 208 209class LocationReferences: 210 evse_uids: Optional[List[str]] 211 location_id: str 212 213 def __init__(self, evse_uids: Optional[List[str]], location_id: str) -> None: 214 self.evse_uids = evse_uids 215 self.location_id = location_id 216 217 @staticmethod 218 def from_dict(obj: Any) -> 'LocationReferences': 219 assert isinstance(obj, dict) 220 evse_uids = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("evse_uids")) 221 location_id = from_str(obj.get("location_id")) 222 return LocationReferences(evse_uids, location_id) 223 224 def to_dict(self) -> dict: 225 result: dict = {} 226 if self.evse_uids is not None: 227 result["evse_uids"] = from_union([from_none, lambda x: from_list(from_str, x)], self.evse_uids) 228 result["location_id"] = from_str(self.location_id) 229 return result 230 231 232class ProfileType(Enum): 233 CHEAP = "CHEAP" 234 FAST = "FAST" 235 GREEN = "GREEN" 236 REGULAR = "REGULAR" 237 238 239class EnergyContract: 240 contract_id: Optional[str] 241 supplier_name: str 242 243 def __init__(self, contract_id: Optional[str], supplier_name: str) -> None: 244 self.contract_id = contract_id 245 self.supplier_name = supplier_name 246 247 @staticmethod 248 def from_dict(obj: Any) -> 'EnergyContract': 249 assert isinstance(obj, dict) 250 contract_id = from_union([from_none, from_str], obj.get("contract_id")) 251 supplier_name = from_str(obj.get("supplier_name")) 252 return EnergyContract(contract_id, supplier_name) 253 254 def to_dict(self) -> dict: 255 result: dict = {} 256 if self.contract_id is not None: 257 result["contract_id"] = from_union([from_none, from_str], self.contract_id) 258 result["supplier_name"] = from_str(self.supplier_name) 259 return result 260 261 262class TokenType(Enum): 263 AD_HOC_USER = "AD_HOC_USER" 264 APP_USER = "APP_USER" 265 EMAID = "EMAID" 266 OTHER = "OTHER" 267 RFID = "RFID" 268 269 270class WhitelistType(Enum): 271 ALLOWED = "ALLOWED" 272 ALLOWED_OFFLINE = "ALLOWED_OFFLINE" 273 ALWAYS = "ALWAYS" 274 NEVER = "NEVER" 275 276 277class Token: 278 contract_id: str 279 country_code: str 280 default_profile_type: Optional[ProfileType] 281 energy_contract: Optional[EnergyContract] 282 group_id: Optional[str] 283 issuer: str 284 language: Optional[str] 285 last_updated: str 286 party_id: str 287 type: TokenType 288 uid: str 289 valid: bool 290 visual_number: Optional[str] 291 whitelist: WhitelistType 292 293 def __init__(self, contract_id: str, country_code: str, default_profile_type: Optional[ProfileType], energy_contract: Optional[EnergyContract], group_id: Optional[str], issuer: str, language: Optional[str], last_updated: str, party_id: str, type: TokenType, uid: str, valid: bool, visual_number: Optional[str], whitelist: WhitelistType) -> None: 294 self.contract_id = contract_id 295 self.country_code = country_code 296 self.default_profile_type = default_profile_type 297 self.energy_contract = energy_contract 298 self.group_id = group_id 299 self.issuer = issuer 300 self.language = language 301 self.last_updated = last_updated 302 self.party_id = party_id 303 self.type = type 304 self.uid = uid 305 self.valid = valid 306 self.visual_number = visual_number 307 self.whitelist = whitelist 308 309 @staticmethod 310 def from_dict(obj: Any) -> 'Token': 311 assert isinstance(obj, dict) 312 contract_id = from_str(obj.get("contract_id")) 313 country_code = from_str(obj.get("country_code")) 314 default_profile_type = from_union([from_none, ProfileType], obj.get("default_profile_type")) 315 energy_contract = from_union([from_none, EnergyContract.from_dict], obj.get("energy_contract")) 316 group_id = from_union([from_none, from_str], obj.get("group_id")) 317 issuer = from_str(obj.get("issuer")) 318 language = from_union([from_none, from_str], obj.get("language")) 319 last_updated = from_str(obj.get("last_updated")) 320 party_id = from_str(obj.get("party_id")) 321 type = TokenType(obj.get("type")) 322 uid = from_str(obj.get("uid")) 323 valid = from_bool(obj.get("valid")) 324 visual_number = from_union([from_none, from_str], obj.get("visual_number")) 325 whitelist = WhitelistType(obj.get("whitelist")) 326 return Token(contract_id, country_code, default_profile_type, energy_contract, group_id, issuer, language, last_updated, party_id, type, uid, valid, visual_number, whitelist) 327 328 def to_dict(self) -> dict: 329 result: dict = {} 330 result["contract_id"] = from_str(self.contract_id) 331 result["country_code"] = from_str(self.country_code) 332 if self.default_profile_type is not None: 333 result["default_profile_type"] = from_union([from_none, lambda x: to_enum(ProfileType, x)], self.default_profile_type) 334 if self.energy_contract is not None: 335 result["energy_contract"] = from_union([from_none, lambda x: to_class(EnergyContract, x)], self.energy_contract) 336 if self.group_id is not None: 337 result["group_id"] = from_union([from_none, from_str], self.group_id) 338 result["issuer"] = from_str(self.issuer) 339 if self.language is not None: 340 result["language"] = from_union([from_none, from_str], self.language) 341 result["last_updated"] = from_str(self.last_updated) 342 result["party_id"] = from_str(self.party_id) 343 result["type"] = to_enum(TokenType, self.type) 344 result["uid"] = from_str(self.uid) 345 result["valid"] = from_bool(self.valid) 346 if self.visual_number is not None: 347 result["visual_number"] = from_union([from_none, from_str], self.visual_number) 348 result["whitelist"] = to_enum(WhitelistType, self.whitelist) 349 return result 350 351 352class AuthorizationInfo: 353 allowed: AllowedType 354 authorization_reference: Optional[str] 355 info: Optional[DisplayText] 356 location: Optional[LocationReferences] 357 token: Token 358 359 def __init__(self, allowed: AllowedType, authorization_reference: Optional[str], info: Optional[DisplayText], location: Optional[LocationReferences], token: Token) -> None: 360 self.allowed = allowed 361 self.authorization_reference = authorization_reference 362 self.info = info 363 self.location = location 364 self.token = token 365 366 @staticmethod 367 def from_dict(obj: Any) -> 'AuthorizationInfo': 368 assert isinstance(obj, dict) 369 allowed = AllowedType(obj.get("allowed")) 370 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 371 info = from_union([from_none, DisplayText.from_dict], obj.get("info")) 372 location = from_union([from_none, LocationReferences.from_dict], obj.get("location")) 373 token = Token.from_dict(obj.get("token")) 374 return AuthorizationInfo(allowed, authorization_reference, info, location, token) 375 376 def to_dict(self) -> dict: 377 result: dict = {} 378 result["allowed"] = to_enum(AllowedType, self.allowed) 379 if self.authorization_reference is not None: 380 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 381 if self.info is not None: 382 result["info"] = from_union([from_none, lambda x: to_class(DisplayText, x)], self.info) 383 if self.location is not None: 384 result["location"] = from_union([from_none, lambda x: to_class(LocationReferences, x)], self.location) 385 result["token"] = to_class(Token, self.token) 386 return result 387 388 389class CancelReservation: 390 reservation_id: str 391 response_url: str 392 393 def __init__(self, reservation_id: str, response_url: str) -> None: 394 self.reservation_id = reservation_id 395 self.response_url = response_url 396 397 @staticmethod 398 def from_dict(obj: Any) -> 'CancelReservation': 399 assert isinstance(obj, dict) 400 reservation_id = from_str(obj.get("reservation_id")) 401 response_url = from_str(obj.get("response_url")) 402 return CancelReservation(reservation_id, response_url) 403 404 def to_dict(self) -> dict: 405 result: dict = {} 406 result["reservation_id"] = from_str(self.reservation_id) 407 result["response_url"] = from_str(self.response_url) 408 return result 409 410 411class AuthMethod(Enum): 412 AUTH_REQUEST = "AUTH_REQUEST" 413 COMMAND = "COMMAND" 414 WHITELIST = "WHITELIST" 415 416 417class ConnectorFormat(Enum): 418 CABLE = "CABLE" 419 SOCKET = "SOCKET" 420 421 422class PowerType(Enum): 423 AC_1__PHASE = "AC_1_PHASE" 424 AC_2__PHASE = "AC_2_PHASE" 425 AC_2__PHASE_SPLIT = "AC_2_PHASE_SPLIT" 426 AC_3__PHASE = "AC_3_PHASE" 427 DC = "DC" 428 429 430class ConnectorType(Enum): 431 CHADEMO = "CHADEMO" 432 CHAOJI = "CHAOJI" 433 DOMESTIC_A = "DOMESTIC_A" 434 DOMESTIC_B = "DOMESTIC_B" 435 DOMESTIC_C = "DOMESTIC_C" 436 DOMESTIC_D = "DOMESTIC_D" 437 DOMESTIC_E = "DOMESTIC_E" 438 DOMESTIC_F = "DOMESTIC_F" 439 DOMESTIC_G = "DOMESTIC_G" 440 DOMESTIC_H = "DOMESTIC_H" 441 DOMESTIC_I = "DOMESTIC_I" 442 DOMESTIC_J = "DOMESTIC_J" 443 DOMESTIC_K = "DOMESTIC_K" 444 DOMESTIC_L = "DOMESTIC_L" 445 DOMESTIC_M = "DOMESTIC_M" 446 DOMESTIC_N = "DOMESTIC_N" 447 DOMESTIC_O = "DOMESTIC_O" 448 GBT_AC = "GBT_AC" 449 GBT_DC = "GBT_DC" 450 IEC_60309_2__SINGLE_16 = "IEC_60309_2_single_16" 451 IEC_60309_2__THREE_16 = "IEC_60309_2_three_16" 452 IEC_60309_2__THREE_32 = "IEC_60309_2_three_32" 453 IEC_60309_2__THREE_64 = "IEC_60309_2_three_64" 454 IEC_62196__T1 = "IEC_62196_T1" 455 IEC_62196__T1_COMBO = "IEC_62196_T1_COMBO" 456 IEC_62196__T2 = "IEC_62196_T2" 457 IEC_62196__T2_COMBO = "IEC_62196_T2_COMBO" 458 IEC_62196__T3_A = "IEC_62196_T3A" 459 IEC_62196__T3_C = "IEC_62196_T3C" 460 MCS = "MCS" 461 NEMA_10_30 = "NEMA_10_30" 462 NEMA_10_50 = "NEMA_10_50" 463 NEMA_14_30 = "NEMA_14_30" 464 NEMA_14_50 = "NEMA_14_50" 465 NEMA_5_20 = "NEMA_5_20" 466 NEMA_6_30 = "NEMA_6_30" 467 NEMA_6_50 = "NEMA_6_50" 468 PANTOGRAPH_BOTTOM_UP = "PANTOGRAPH_BOTTOM_UP" 469 PANTOGRAPH_TOP_DOWN = "PANTOGRAPH_TOP_DOWN" 470 SAE_J3400 = "SAE_J3400" 471 TESLA_R = "TESLA_R" 472 TESLA_S = "TESLA_S" 473 474 475class GeoLocation: 476 latitude: str 477 longitude: str 478 479 def __init__(self, latitude: str, longitude: str) -> None: 480 self.latitude = latitude 481 self.longitude = longitude 482 483 @staticmethod 484 def from_dict(obj: Any) -> 'GeoLocation': 485 assert isinstance(obj, dict) 486 latitude = from_str(obj.get("latitude")) 487 longitude = from_str(obj.get("longitude")) 488 return GeoLocation(latitude, longitude) 489 490 def to_dict(self) -> dict: 491 result: dict = {} 492 result["latitude"] = from_str(self.latitude) 493 result["longitude"] = from_str(self.longitude) 494 return result 495 496 497class CdrLocation: 498 address: str 499 city: str 500 connector_format: ConnectorFormat 501 connector_id: str 502 connector_power_type: PowerType 503 connector_standard: ConnectorType 504 coordinates: GeoLocation 505 country: str 506 evse_id: str 507 evse_uid: str 508 id: str 509 name: Optional[str] 510 postal_code: Optional[str] 511 state: Optional[str] 512 513 def __init__(self, address: str, city: str, connector_format: ConnectorFormat, connector_id: str, connector_power_type: PowerType, connector_standard: ConnectorType, coordinates: GeoLocation, country: str, evse_id: str, evse_uid: str, id: str, name: Optional[str], postal_code: Optional[str], state: Optional[str]) -> None: 514 self.address = address 515 self.city = city 516 self.connector_format = connector_format 517 self.connector_id = connector_id 518 self.connector_power_type = connector_power_type 519 self.connector_standard = connector_standard 520 self.coordinates = coordinates 521 self.country = country 522 self.evse_id = evse_id 523 self.evse_uid = evse_uid 524 self.id = id 525 self.name = name 526 self.postal_code = postal_code 527 self.state = state 528 529 @staticmethod 530 def from_dict(obj: Any) -> 'CdrLocation': 531 assert isinstance(obj, dict) 532 address = from_str(obj.get("address")) 533 city = from_str(obj.get("city")) 534 connector_format = ConnectorFormat(obj.get("connector_format")) 535 connector_id = from_str(obj.get("connector_id")) 536 connector_power_type = PowerType(obj.get("connector_power_type")) 537 connector_standard = ConnectorType(obj.get("connector_standard")) 538 coordinates = GeoLocation.from_dict(obj.get("coordinates")) 539 country = from_str(obj.get("country")) 540 evse_id = from_str(obj.get("evse_id")) 541 evse_uid = from_str(obj.get("evse_uid")) 542 id = from_str(obj.get("id")) 543 name = from_union([from_none, from_str], obj.get("name")) 544 postal_code = from_union([from_none, from_str], obj.get("postal_code")) 545 state = from_union([from_none, from_str], obj.get("state")) 546 return CdrLocation(address, city, connector_format, connector_id, connector_power_type, connector_standard, coordinates, country, evse_id, evse_uid, id, name, postal_code, state) 547 548 def to_dict(self) -> dict: 549 result: dict = {} 550 result["address"] = from_str(self.address) 551 result["city"] = from_str(self.city) 552 result["connector_format"] = to_enum(ConnectorFormat, self.connector_format) 553 result["connector_id"] = from_str(self.connector_id) 554 result["connector_power_type"] = to_enum(PowerType, self.connector_power_type) 555 result["connector_standard"] = to_enum(ConnectorType, self.connector_standard) 556 result["coordinates"] = to_class(GeoLocation, self.coordinates) 557 result["country"] = from_str(self.country) 558 result["evse_id"] = from_str(self.evse_id) 559 result["evse_uid"] = from_str(self.evse_uid) 560 result["id"] = from_str(self.id) 561 if self.name is not None: 562 result["name"] = from_union([from_none, from_str], self.name) 563 if self.postal_code is not None: 564 result["postal_code"] = from_union([from_none, from_str], self.postal_code) 565 if self.state is not None: 566 result["state"] = from_union([from_none, from_str], self.state) 567 return result 568 569 570class CdrToken: 571 contract_id: str 572 country_code: str 573 party_id: str 574 type: TokenType 575 uid: str 576 577 def __init__(self, contract_id: str, country_code: str, party_id: str, type: TokenType, uid: str) -> None: 578 self.contract_id = contract_id 579 self.country_code = country_code 580 self.party_id = party_id 581 self.type = type 582 self.uid = uid 583 584 @staticmethod 585 def from_dict(obj: Any) -> 'CdrToken': 586 assert isinstance(obj, dict) 587 contract_id = from_str(obj.get("contract_id")) 588 country_code = from_str(obj.get("country_code")) 589 party_id = from_str(obj.get("party_id")) 590 type = TokenType(obj.get("type")) 591 uid = from_str(obj.get("uid")) 592 return CdrToken(contract_id, country_code, party_id, type, uid) 593 594 def to_dict(self) -> dict: 595 result: dict = {} 596 result["contract_id"] = from_str(self.contract_id) 597 result["country_code"] = from_str(self.country_code) 598 result["party_id"] = from_str(self.party_id) 599 result["type"] = to_enum(TokenType, self.type) 600 result["uid"] = from_str(self.uid) 601 return result 602 603 604class CdrDimensionType(Enum): 605 CURRENT = "CURRENT" 606 ENERGY = "ENERGY" 607 ENERGY_EXPORT = "ENERGY_EXPORT" 608 ENERGY_IMPORT = "ENERGY_IMPORT" 609 MAX_CURRENT = "MAX_CURRENT" 610 MAX_POWER = "MAX_POWER" 611 MIN_CURRENT = "MIN_CURRENT" 612 MIN_POWER = "MIN_POWER" 613 PARKING_TIME = "PARKING_TIME" 614 POWER = "POWER" 615 RESERVATION_TIME = "RESERVATION_TIME" 616 STATE_OF_CHARGE = "STATE_OF_CHARGE" 617 TIME = "TIME" 618 619 620class CdrDimension: 621 type: CdrDimensionType 622 volume: float 623 624 def __init__(self, type: CdrDimensionType, volume: float) -> None: 625 self.type = type 626 self.volume = volume 627 628 @staticmethod 629 def from_dict(obj: Any) -> 'CdrDimension': 630 assert isinstance(obj, dict) 631 type = CdrDimensionType(obj.get("type")) 632 volume = from_float(obj.get("volume")) 633 return CdrDimension(type, volume) 634 635 def to_dict(self) -> dict: 636 result: dict = {} 637 result["type"] = to_enum(CdrDimensionType, self.type) 638 result["volume"] = to_float(self.volume) 639 return result 640 641 642class ChargingPeriod: 643 dimensions: List[CdrDimension] 644 start_date_time: str 645 tariff_id: Optional[str] 646 647 def __init__(self, dimensions: List[CdrDimension], start_date_time: str, tariff_id: Optional[str]) -> None: 648 self.dimensions = dimensions 649 self.start_date_time = start_date_time 650 self.tariff_id = tariff_id 651 652 @staticmethod 653 def from_dict(obj: Any) -> 'ChargingPeriod': 654 assert isinstance(obj, dict) 655 dimensions = from_list(CdrDimension.from_dict, obj.get("dimensions")) 656 start_date_time = from_str(obj.get("start_date_time")) 657 tariff_id = from_union([from_none, from_str], obj.get("tariff_id")) 658 return ChargingPeriod(dimensions, start_date_time, tariff_id) 659 660 def to_dict(self) -> dict: 661 result: dict = {} 662 result["dimensions"] = from_list(lambda x: to_class(CdrDimension, x), self.dimensions) 663 result["start_date_time"] = from_str(self.start_date_time) 664 if self.tariff_id is not None: 665 result["tariff_id"] = from_union([from_none, from_str], self.tariff_id) 666 return result 667 668 669class SignedValue: 670 nature: str 671 plain_data: str 672 signed_data: str 673 674 def __init__(self, nature: str, plain_data: str, signed_data: str) -> None: 675 self.nature = nature 676 self.plain_data = plain_data 677 self.signed_data = signed_data 678 679 @staticmethod 680 def from_dict(obj: Any) -> 'SignedValue': 681 assert isinstance(obj, dict) 682 nature = from_str(obj.get("nature")) 683 plain_data = from_str(obj.get("plain_data")) 684 signed_data = from_str(obj.get("signed_data")) 685 return SignedValue(nature, plain_data, signed_data) 686 687 def to_dict(self) -> dict: 688 result: dict = {} 689 result["nature"] = from_str(self.nature) 690 result["plain_data"] = from_str(self.plain_data) 691 result["signed_data"] = from_str(self.signed_data) 692 return result 693 694 695class SignedData: 696 encoding_method: str 697 encoding_method_version: Optional[int] 698 public_key: Optional[str] 699 signed_values: List[SignedValue] 700 url: Optional[str] 701 702 def __init__(self, encoding_method: str, encoding_method_version: Optional[int], public_key: Optional[str], signed_values: List[SignedValue], url: Optional[str]) -> None: 703 self.encoding_method = encoding_method 704 self.encoding_method_version = encoding_method_version 705 self.public_key = public_key 706 self.signed_values = signed_values 707 self.url = url 708 709 @staticmethod 710 def from_dict(obj: Any) -> 'SignedData': 711 assert isinstance(obj, dict) 712 encoding_method = from_str(obj.get("encoding_method")) 713 encoding_method_version = from_union([from_none, from_int], obj.get("encoding_method_version")) 714 public_key = from_union([from_none, from_str], obj.get("public_key")) 715 signed_values = from_list(SignedValue.from_dict, obj.get("signed_values")) 716 url = from_union([from_none, from_str], obj.get("url")) 717 return SignedData(encoding_method, encoding_method_version, public_key, signed_values, url) 718 719 def to_dict(self) -> dict: 720 result: dict = {} 721 result["encoding_method"] = from_str(self.encoding_method) 722 if self.encoding_method_version is not None: 723 result["encoding_method_version"] = from_union([from_none, from_int], self.encoding_method_version) 724 if self.public_key is not None: 725 result["public_key"] = from_union([from_none, from_str], self.public_key) 726 result["signed_values"] = from_list(lambda x: to_class(SignedValue, x), self.signed_values) 727 if self.url is not None: 728 result["url"] = from_union([from_none, from_str], self.url) 729 return result 730 731 732class TariffDimensionType(Enum): 733 ENERGY = "ENERGY" 734 FLAT = "FLAT" 735 PARKING_TIME = "PARKING_TIME" 736 TIME = "TIME" 737 738 739class PriceComponent: 740 price: float 741 step_size: int 742 type: TariffDimensionType 743 vat: Optional[float] 744 745 def __init__(self, price: float, step_size: int, type: TariffDimensionType, vat: Optional[float]) -> None: 746 self.price = price 747 self.step_size = step_size 748 self.type = type 749 self.vat = vat 750 751 @staticmethod 752 def from_dict(obj: Any) -> 'PriceComponent': 753 assert isinstance(obj, dict) 754 price = from_float(obj.get("price")) 755 step_size = from_int(obj.get("step_size")) 756 type = TariffDimensionType(obj.get("type")) 757 vat = from_union([from_none, from_float], obj.get("vat")) 758 return PriceComponent(price, step_size, type, vat) 759 760 def to_dict(self) -> dict: 761 result: dict = {} 762 result["price"] = to_float(self.price) 763 result["step_size"] = from_int(self.step_size) 764 result["type"] = to_enum(TariffDimensionType, self.type) 765 if self.vat is not None: 766 result["vat"] = from_union([from_none, to_float], self.vat) 767 return result 768 769 770class DayOfWeek(Enum): 771 FRIDAY = "FRIDAY" 772 MONDAY = "MONDAY" 773 SATURDAY = "SATURDAY" 774 SUNDAY = "SUNDAY" 775 THURSDAY = "THURSDAY" 776 TUESDAY = "TUESDAY" 777 WEDNESDAY = "WEDNESDAY" 778 779 780class ReservationRestrictionType(Enum): 781 RESERVATION = "RESERVATION" 782 RESERVATION_EXPIRES = "RESERVATION_EXPIRES" 783 784 785class TariffRestrictions: 786 day_of_week: Optional[List[DayOfWeek]] 787 end_date: Optional[str] 788 end_time: Optional[str] 789 max_current: Optional[float] 790 max_duration: Optional[int] 791 max_kwh: Optional[float] 792 max_power: Optional[float] 793 min_current: Optional[float] 794 min_duration: Optional[int] 795 min_kwh: Optional[float] 796 min_power: Optional[float] 797 reservation: Optional[ReservationRestrictionType] 798 start_date: Optional[str] 799 start_time: Optional[str] 800 801 def __init__(self, day_of_week: Optional[List[DayOfWeek]], end_date: Optional[str], end_time: Optional[str], max_current: Optional[float], max_duration: Optional[int], max_kwh: Optional[float], max_power: Optional[float], min_current: Optional[float], min_duration: Optional[int], min_kwh: Optional[float], min_power: Optional[float], reservation: Optional[ReservationRestrictionType], start_date: Optional[str], start_time: Optional[str]) -> None: 802 self.day_of_week = day_of_week 803 self.end_date = end_date 804 self.end_time = end_time 805 self.max_current = max_current 806 self.max_duration = max_duration 807 self.max_kwh = max_kwh 808 self.max_power = max_power 809 self.min_current = min_current 810 self.min_duration = min_duration 811 self.min_kwh = min_kwh 812 self.min_power = min_power 813 self.reservation = reservation 814 self.start_date = start_date 815 self.start_time = start_time 816 817 @staticmethod 818 def from_dict(obj: Any) -> 'TariffRestrictions': 819 assert isinstance(obj, dict) 820 day_of_week = from_union([from_none, lambda x: from_list(DayOfWeek, x)], obj.get("day_of_week")) 821 end_date = from_union([from_none, from_str], obj.get("end_date")) 822 end_time = from_union([from_none, from_str], obj.get("end_time")) 823 max_current = from_union([from_none, from_float], obj.get("max_current")) 824 max_duration = from_union([from_none, from_int], obj.get("max_duration")) 825 max_kwh = from_union([from_none, from_float], obj.get("max_kwh")) 826 max_power = from_union([from_none, from_float], obj.get("max_power")) 827 min_current = from_union([from_none, from_float], obj.get("min_current")) 828 min_duration = from_union([from_none, from_int], obj.get("min_duration")) 829 min_kwh = from_union([from_none, from_float], obj.get("min_kwh")) 830 min_power = from_union([from_none, from_float], obj.get("min_power")) 831 reservation = from_union([from_none, ReservationRestrictionType], obj.get("reservation")) 832 start_date = from_union([from_none, from_str], obj.get("start_date")) 833 start_time = from_union([from_none, from_str], obj.get("start_time")) 834 return TariffRestrictions(day_of_week, end_date, end_time, max_current, max_duration, max_kwh, max_power, min_current, min_duration, min_kwh, min_power, reservation, start_date, start_time) 835 836 def to_dict(self) -> dict: 837 result: dict = {} 838 if self.day_of_week is not None: 839 result["day_of_week"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(DayOfWeek, x), x)], self.day_of_week) 840 if self.end_date is not None: 841 result["end_date"] = from_union([from_none, from_str], self.end_date) 842 if self.end_time is not None: 843 result["end_time"] = from_union([from_none, from_str], self.end_time) 844 if self.max_current is not None: 845 result["max_current"] = from_union([from_none, to_float], self.max_current) 846 if self.max_duration is not None: 847 result["max_duration"] = from_union([from_none, from_int], self.max_duration) 848 if self.max_kwh is not None: 849 result["max_kwh"] = from_union([from_none, to_float], self.max_kwh) 850 if self.max_power is not None: 851 result["max_power"] = from_union([from_none, to_float], self.max_power) 852 if self.min_current is not None: 853 result["min_current"] = from_union([from_none, to_float], self.min_current) 854 if self.min_duration is not None: 855 result["min_duration"] = from_union([from_none, from_int], self.min_duration) 856 if self.min_kwh is not None: 857 result["min_kwh"] = from_union([from_none, to_float], self.min_kwh) 858 if self.min_power is not None: 859 result["min_power"] = from_union([from_none, to_float], self.min_power) 860 if self.reservation is not None: 861 result["reservation"] = from_union([from_none, lambda x: to_enum(ReservationRestrictionType, x)], self.reservation) 862 if self.start_date is not None: 863 result["start_date"] = from_union([from_none, from_str], self.start_date) 864 if self.start_time is not None: 865 result["start_time"] = from_union([from_none, from_str], self.start_time) 866 return result 867 868 869class TariffElement: 870 price_components: List[PriceComponent] 871 restrictions: Optional[TariffRestrictions] 872 873 def __init__(self, price_components: List[PriceComponent], restrictions: Optional[TariffRestrictions]) -> None: 874 self.price_components = price_components 875 self.restrictions = restrictions 876 877 @staticmethod 878 def from_dict(obj: Any) -> 'TariffElement': 879 assert isinstance(obj, dict) 880 price_components = from_list(PriceComponent.from_dict, obj.get("price_components")) 881 restrictions = from_union([from_none, TariffRestrictions.from_dict], obj.get("restrictions")) 882 return TariffElement(price_components, restrictions) 883 884 def to_dict(self) -> dict: 885 result: dict = {} 886 result["price_components"] = from_list(lambda x: to_class(PriceComponent, x), self.price_components) 887 if self.restrictions is not None: 888 result["restrictions"] = from_union([from_none, lambda x: to_class(TariffRestrictions, x)], self.restrictions) 889 return result 890 891 892class EnergySourceCategory(Enum): 893 COAL = "COAL" 894 GAS = "GAS" 895 GENERAL_FOSSIL = "GENERAL_FOSSIL" 896 GENERAL_GREEN = "GENERAL_GREEN" 897 NUCLEAR = "NUCLEAR" 898 SOLAR = "SOLAR" 899 WATER = "WATER" 900 WIND = "WIND" 901 902 903class EnergySource: 904 percentage: float 905 source: EnergySourceCategory 906 907 def __init__(self, percentage: float, source: EnergySourceCategory) -> None: 908 self.percentage = percentage 909 self.source = source 910 911 @staticmethod 912 def from_dict(obj: Any) -> 'EnergySource': 913 assert isinstance(obj, dict) 914 percentage = from_float(obj.get("percentage")) 915 source = EnergySourceCategory(obj.get("source")) 916 return EnergySource(percentage, source) 917 918 def to_dict(self) -> dict: 919 result: dict = {} 920 result["percentage"] = to_float(self.percentage) 921 result["source"] = to_enum(EnergySourceCategory, self.source) 922 return result 923 924 925class EnvironmentalImpactCategory(Enum): 926 CARBON_DIOXIDE = "CARBON_DIOXIDE" 927 NUCLEAR_WASTE = "NUCLEAR_WASTE" 928 929 930class EnvironmentalImpact: 931 amount: float 932 category: EnvironmentalImpactCategory 933 934 def __init__(self, amount: float, category: EnvironmentalImpactCategory) -> None: 935 self.amount = amount 936 self.category = category 937 938 @staticmethod 939 def from_dict(obj: Any) -> 'EnvironmentalImpact': 940 assert isinstance(obj, dict) 941 amount = from_float(obj.get("amount")) 942 category = EnvironmentalImpactCategory(obj.get("category")) 943 return EnvironmentalImpact(amount, category) 944 945 def to_dict(self) -> dict: 946 result: dict = {} 947 result["amount"] = to_float(self.amount) 948 result["category"] = to_enum(EnvironmentalImpactCategory, self.category) 949 return result 950 951 952class EnergyMix: 953 energy_product_name: Optional[str] 954 energy_sources: Optional[List[EnergySource]] 955 environ_impact: Optional[List[EnvironmentalImpact]] 956 is_green_energy: bool 957 supplier_name: Optional[str] 958 959 def __init__(self, energy_product_name: Optional[str], energy_sources: Optional[List[EnergySource]], environ_impact: Optional[List[EnvironmentalImpact]], is_green_energy: bool, supplier_name: Optional[str]) -> None: 960 self.energy_product_name = energy_product_name 961 self.energy_sources = energy_sources 962 self.environ_impact = environ_impact 963 self.is_green_energy = is_green_energy 964 self.supplier_name = supplier_name 965 966 @staticmethod 967 def from_dict(obj: Any) -> 'EnergyMix': 968 assert isinstance(obj, dict) 969 energy_product_name = from_union([from_none, from_str], obj.get("energy_product_name")) 970 energy_sources = from_union([from_none, lambda x: from_list(EnergySource.from_dict, x)], obj.get("energy_sources")) 971 environ_impact = from_union([from_none, lambda x: from_list(EnvironmentalImpact.from_dict, x)], obj.get("environ_impact")) 972 is_green_energy = from_bool(obj.get("is_green_energy")) 973 supplier_name = from_union([from_none, from_str], obj.get("supplier_name")) 974 return EnergyMix(energy_product_name, energy_sources, environ_impact, is_green_energy, supplier_name) 975 976 def to_dict(self) -> dict: 977 result: dict = {} 978 if self.energy_product_name is not None: 979 result["energy_product_name"] = from_union([from_none, from_str], self.energy_product_name) 980 if self.energy_sources is not None: 981 result["energy_sources"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EnergySource, x), x)], self.energy_sources) 982 if self.environ_impact is not None: 983 result["environ_impact"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EnvironmentalImpact, x), x)], self.environ_impact) 984 result["is_green_energy"] = from_bool(self.is_green_energy) 985 if self.supplier_name is not None: 986 result["supplier_name"] = from_union([from_none, from_str], self.supplier_name) 987 return result 988 989 990class PriceLimit: 991 after_taxes: Optional[float] 992 before_taxes: float 993 994 def __init__(self, after_taxes: Optional[float], before_taxes: float) -> None: 995 self.after_taxes = after_taxes 996 self.before_taxes = before_taxes 997 998 @staticmethod 999 def from_dict(obj: Any) -> 'PriceLimit': 1000 assert isinstance(obj, dict) 1001 after_taxes = from_union([from_none, from_float], obj.get("after_taxes")) 1002 before_taxes = from_float(obj.get("before_taxes")) 1003 return PriceLimit(after_taxes, before_taxes) 1004 1005 def to_dict(self) -> dict: 1006 result: dict = {} 1007 if self.after_taxes is not None: 1008 result["after_taxes"] = from_union([from_none, to_float], self.after_taxes) 1009 result["before_taxes"] = to_float(self.before_taxes) 1010 return result 1011 1012 1013class TaxIncluded(Enum): 1014 NO = "NO" 1015 N_A = "N/A" 1016 YES = "YES" 1017 1018 1019class TariffType(Enum): 1020 AD_HOC_PAYMENT = "AD_HOC_PAYMENT" 1021 PROFILE_CHEAP = "PROFILE_CHEAP" 1022 PROFILE_FAST = "PROFILE_FAST" 1023 PROFILE_GREEN = "PROFILE_GREEN" 1024 REGULAR = "REGULAR" 1025 1026 1027class Tariff: 1028 country_code: str 1029 currency: str 1030 elements: List[TariffElement] 1031 end_date_time: Optional[str] 1032 energy_mix: Optional[EnergyMix] 1033 id: str 1034 last_updated: str 1035 max_price: Optional[PriceLimit] 1036 min_price: Optional[PriceLimit] 1037 party_id: str 1038 start_date_time: Optional[str] 1039 tariff_alt_text: Optional[List[DisplayText]] 1040 tariff_alt_url: Optional[str] 1041 tax_included: TaxIncluded 1042 type: Optional[TariffType] 1043 1044 def __init__(self, country_code: str, currency: str, elements: List[TariffElement], end_date_time: Optional[str], energy_mix: Optional[EnergyMix], id: str, last_updated: str, max_price: Optional[PriceLimit], min_price: Optional[PriceLimit], party_id: str, start_date_time: Optional[str], tariff_alt_text: Optional[List[DisplayText]], tariff_alt_url: Optional[str], tax_included: TaxIncluded, type: Optional[TariffType]) -> None: 1045 self.country_code = country_code 1046 self.currency = currency 1047 self.elements = elements 1048 self.end_date_time = end_date_time 1049 self.energy_mix = energy_mix 1050 self.id = id 1051 self.last_updated = last_updated 1052 self.max_price = max_price 1053 self.min_price = min_price 1054 self.party_id = party_id 1055 self.start_date_time = start_date_time 1056 self.tariff_alt_text = tariff_alt_text 1057 self.tariff_alt_url = tariff_alt_url 1058 self.tax_included = tax_included 1059 self.type = type 1060 1061 @staticmethod 1062 def from_dict(obj: Any) -> 'Tariff': 1063 assert isinstance(obj, dict) 1064 country_code = from_str(obj.get("country_code")) 1065 currency = from_str(obj.get("currency")) 1066 elements = from_list(TariffElement.from_dict, obj.get("elements")) 1067 end_date_time = from_union([from_none, from_str], obj.get("end_date_time")) 1068 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 1069 id = from_str(obj.get("id")) 1070 last_updated = from_str(obj.get("last_updated")) 1071 max_price = from_union([from_none, PriceLimit.from_dict], obj.get("max_price")) 1072 min_price = from_union([from_none, PriceLimit.from_dict], obj.get("min_price")) 1073 party_id = from_str(obj.get("party_id")) 1074 start_date_time = from_union([from_none, from_str], obj.get("start_date_time")) 1075 tariff_alt_text = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("tariff_alt_text")) 1076 tariff_alt_url = from_union([from_none, from_str], obj.get("tariff_alt_url")) 1077 tax_included = TaxIncluded(obj.get("tax_included")) 1078 type = from_union([from_none, TariffType], obj.get("type")) 1079 return Tariff(country_code, currency, elements, end_date_time, energy_mix, id, last_updated, max_price, min_price, party_id, start_date_time, tariff_alt_text, tariff_alt_url, tax_included, type) 1080 1081 def to_dict(self) -> dict: 1082 result: dict = {} 1083 result["country_code"] = from_str(self.country_code) 1084 result["currency"] = from_str(self.currency) 1085 result["elements"] = from_list(lambda x: to_class(TariffElement, x), self.elements) 1086 if self.end_date_time is not None: 1087 result["end_date_time"] = from_union([from_none, from_str], self.end_date_time) 1088 if self.energy_mix is not None: 1089 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 1090 result["id"] = from_str(self.id) 1091 result["last_updated"] = from_str(self.last_updated) 1092 if self.max_price is not None: 1093 result["max_price"] = from_union([from_none, lambda x: to_class(PriceLimit, x)], self.max_price) 1094 if self.min_price is not None: 1095 result["min_price"] = from_union([from_none, lambda x: to_class(PriceLimit, x)], self.min_price) 1096 result["party_id"] = from_str(self.party_id) 1097 if self.start_date_time is not None: 1098 result["start_date_time"] = from_union([from_none, from_str], self.start_date_time) 1099 if self.tariff_alt_text is not None: 1100 result["tariff_alt_text"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.tariff_alt_text) 1101 if self.tariff_alt_url is not None: 1102 result["tariff_alt_url"] = from_union([from_none, from_str], self.tariff_alt_url) 1103 result["tax_included"] = to_enum(TaxIncluded, self.tax_included) 1104 if self.type is not None: 1105 result["type"] = from_union([from_none, lambda x: to_enum(TariffType, x)], self.type) 1106 return result 1107 1108 1109class TaxAmount: 1110 account_number: Optional[str] 1111 amount: float 1112 name: str 1113 percentage: Optional[float] 1114 1115 def __init__(self, account_number: Optional[str], amount: float, name: str, percentage: Optional[float]) -> None: 1116 self.account_number = account_number 1117 self.amount = amount 1118 self.name = name 1119 self.percentage = percentage 1120 1121 @staticmethod 1122 def from_dict(obj: Any) -> 'TaxAmount': 1123 assert isinstance(obj, dict) 1124 account_number = from_union([from_none, from_str], obj.get("account_number")) 1125 amount = from_float(obj.get("amount")) 1126 name = from_str(obj.get("name")) 1127 percentage = from_union([from_none, from_float], obj.get("percentage")) 1128 return TaxAmount(account_number, amount, name, percentage) 1129 1130 def to_dict(self) -> dict: 1131 result: dict = {} 1132 if self.account_number is not None: 1133 result["account_number"] = from_union([from_none, from_str], self.account_number) 1134 result["amount"] = to_float(self.amount) 1135 result["name"] = from_str(self.name) 1136 if self.percentage is not None: 1137 result["percentage"] = from_union([from_none, to_float], self.percentage) 1138 return result 1139 1140 1141class Price: 1142 before_taxes: float 1143 taxes: Optional[List[TaxAmount]] 1144 1145 def __init__(self, before_taxes: float, taxes: Optional[List[TaxAmount]]) -> None: 1146 self.before_taxes = before_taxes 1147 self.taxes = taxes 1148 1149 @staticmethod 1150 def from_dict(obj: Any) -> 'Price': 1151 assert isinstance(obj, dict) 1152 before_taxes = from_float(obj.get("before_taxes")) 1153 taxes = from_union([from_none, lambda x: from_list(TaxAmount.from_dict, x)], obj.get("taxes")) 1154 return Price(before_taxes, taxes) 1155 1156 def to_dict(self) -> dict: 1157 result: dict = {} 1158 result["before_taxes"] = to_float(self.before_taxes) 1159 if self.taxes is not None: 1160 result["taxes"] = from_union([from_none, lambda x: from_list(lambda x: to_class(TaxAmount, x), x)], self.taxes) 1161 return result 1162 1163 1164class Cdr: 1165 auth_method: AuthMethod 1166 authorization_reference: Optional[str] 1167 cdr_location: CdrLocation 1168 cdr_token: CdrToken 1169 charging_periods: List[ChargingPeriod] 1170 country_code: str 1171 credit: Optional[bool] 1172 credit_reference_id: Optional[str] 1173 currency: str 1174 end_date_time: str 1175 home_charging_compensation: Optional[bool] 1176 id: str 1177 invoice_reference_id: Optional[str] 1178 last_updated: str 1179 meter_id: Optional[str] 1180 party_id: str 1181 remark: Optional[str] 1182 session_id: Optional[str] 1183 signed_data: Optional[SignedData] 1184 start_date_time: str 1185 tariffs: Optional[List[Tariff]] 1186 total_cost: Price 1187 total_energy: float 1188 total_energy_cost: Optional[Price] 1189 total_fixed_cost: Optional[Price] 1190 total_parking_cost: Optional[Price] 1191 total_parking_time: Optional[float] 1192 total_reservation_cost: Optional[Price] 1193 total_time: float 1194 total_time_cost: Optional[Price] 1195 1196 def __init__(self, auth_method: AuthMethod, authorization_reference: Optional[str], cdr_location: CdrLocation, cdr_token: CdrToken, charging_periods: List[ChargingPeriod], country_code: str, credit: Optional[bool], credit_reference_id: Optional[str], currency: str, end_date_time: str, home_charging_compensation: Optional[bool], id: str, invoice_reference_id: Optional[str], last_updated: str, meter_id: Optional[str], party_id: str, remark: Optional[str], session_id: Optional[str], signed_data: Optional[SignedData], start_date_time: str, tariffs: Optional[List[Tariff]], total_cost: Price, total_energy: float, total_energy_cost: Optional[Price], total_fixed_cost: Optional[Price], total_parking_cost: Optional[Price], total_parking_time: Optional[float], total_reservation_cost: Optional[Price], total_time: float, total_time_cost: Optional[Price]) -> None: 1197 self.auth_method = auth_method 1198 self.authorization_reference = authorization_reference 1199 self.cdr_location = cdr_location 1200 self.cdr_token = cdr_token 1201 self.charging_periods = charging_periods 1202 self.country_code = country_code 1203 self.credit = credit 1204 self.credit_reference_id = credit_reference_id 1205 self.currency = currency 1206 self.end_date_time = end_date_time 1207 self.home_charging_compensation = home_charging_compensation 1208 self.id = id 1209 self.invoice_reference_id = invoice_reference_id 1210 self.last_updated = last_updated 1211 self.meter_id = meter_id 1212 self.party_id = party_id 1213 self.remark = remark 1214 self.session_id = session_id 1215 self.signed_data = signed_data 1216 self.start_date_time = start_date_time 1217 self.tariffs = tariffs 1218 self.total_cost = total_cost 1219 self.total_energy = total_energy 1220 self.total_energy_cost = total_energy_cost 1221 self.total_fixed_cost = total_fixed_cost 1222 self.total_parking_cost = total_parking_cost 1223 self.total_parking_time = total_parking_time 1224 self.total_reservation_cost = total_reservation_cost 1225 self.total_time = total_time 1226 self.total_time_cost = total_time_cost 1227 1228 @staticmethod 1229 def from_dict(obj: Any) -> 'Cdr': 1230 assert isinstance(obj, dict) 1231 auth_method = AuthMethod(obj.get("auth_method")) 1232 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 1233 cdr_location = CdrLocation.from_dict(obj.get("cdr_location")) 1234 cdr_token = CdrToken.from_dict(obj.get("cdr_token")) 1235 charging_periods = from_list(ChargingPeriod.from_dict, obj.get("charging_periods")) 1236 country_code = from_str(obj.get("country_code")) 1237 credit = from_union([from_none, from_bool], obj.get("credit")) 1238 credit_reference_id = from_union([from_none, from_str], obj.get("credit_reference_id")) 1239 currency = from_str(obj.get("currency")) 1240 end_date_time = from_str(obj.get("end_date_time")) 1241 home_charging_compensation = from_union([from_none, from_bool], obj.get("home_charging_compensation")) 1242 id = from_str(obj.get("id")) 1243 invoice_reference_id = from_union([from_none, from_str], obj.get("invoice_reference_id")) 1244 last_updated = from_str(obj.get("last_updated")) 1245 meter_id = from_union([from_none, from_str], obj.get("meter_id")) 1246 party_id = from_str(obj.get("party_id")) 1247 remark = from_union([from_none, from_str], obj.get("remark")) 1248 session_id = from_union([from_none, from_str], obj.get("session_id")) 1249 signed_data = from_union([from_none, SignedData.from_dict], obj.get("signed_data")) 1250 start_date_time = from_str(obj.get("start_date_time")) 1251 tariffs = from_union([from_none, lambda x: from_list(Tariff.from_dict, x)], obj.get("tariffs")) 1252 total_cost = Price.from_dict(obj.get("total_cost")) 1253 total_energy = from_float(obj.get("total_energy")) 1254 total_energy_cost = from_union([from_none, Price.from_dict], obj.get("total_energy_cost")) 1255 total_fixed_cost = from_union([from_none, Price.from_dict], obj.get("total_fixed_cost")) 1256 total_parking_cost = from_union([from_none, Price.from_dict], obj.get("total_parking_cost")) 1257 total_parking_time = from_union([from_none, from_float], obj.get("total_parking_time")) 1258 total_reservation_cost = from_union([from_none, Price.from_dict], obj.get("total_reservation_cost")) 1259 total_time = from_float(obj.get("total_time")) 1260 total_time_cost = from_union([from_none, Price.from_dict], obj.get("total_time_cost")) 1261 return Cdr(auth_method, authorization_reference, cdr_location, cdr_token, charging_periods, country_code, credit, credit_reference_id, currency, end_date_time, home_charging_compensation, id, invoice_reference_id, last_updated, meter_id, party_id, remark, session_id, signed_data, start_date_time, tariffs, total_cost, total_energy, total_energy_cost, total_fixed_cost, total_parking_cost, total_parking_time, total_reservation_cost, total_time, total_time_cost) 1262 1263 def to_dict(self) -> dict: 1264 result: dict = {} 1265 result["auth_method"] = to_enum(AuthMethod, self.auth_method) 1266 if self.authorization_reference is not None: 1267 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 1268 result["cdr_location"] = to_class(CdrLocation, self.cdr_location) 1269 result["cdr_token"] = to_class(CdrToken, self.cdr_token) 1270 result["charging_periods"] = from_list(lambda x: to_class(ChargingPeriod, x), self.charging_periods) 1271 result["country_code"] = from_str(self.country_code) 1272 if self.credit is not None: 1273 result["credit"] = from_union([from_none, from_bool], self.credit) 1274 if self.credit_reference_id is not None: 1275 result["credit_reference_id"] = from_union([from_none, from_str], self.credit_reference_id) 1276 result["currency"] = from_str(self.currency) 1277 result["end_date_time"] = from_str(self.end_date_time) 1278 if self.home_charging_compensation is not None: 1279 result["home_charging_compensation"] = from_union([from_none, from_bool], self.home_charging_compensation) 1280 result["id"] = from_str(self.id) 1281 if self.invoice_reference_id is not None: 1282 result["invoice_reference_id"] = from_union([from_none, from_str], self.invoice_reference_id) 1283 result["last_updated"] = from_str(self.last_updated) 1284 if self.meter_id is not None: 1285 result["meter_id"] = from_union([from_none, from_str], self.meter_id) 1286 result["party_id"] = from_str(self.party_id) 1287 if self.remark is not None: 1288 result["remark"] = from_union([from_none, from_str], self.remark) 1289 if self.session_id is not None: 1290 result["session_id"] = from_union([from_none, from_str], self.session_id) 1291 if self.signed_data is not None: 1292 result["signed_data"] = from_union([from_none, lambda x: to_class(SignedData, x)], self.signed_data) 1293 result["start_date_time"] = from_str(self.start_date_time) 1294 if self.tariffs is not None: 1295 result["tariffs"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Tariff, x), x)], self.tariffs) 1296 result["total_cost"] = to_class(Price, self.total_cost) 1297 result["total_energy"] = to_float(self.total_energy) 1298 if self.total_energy_cost is not None: 1299 result["total_energy_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_energy_cost) 1300 if self.total_fixed_cost is not None: 1301 result["total_fixed_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_fixed_cost) 1302 if self.total_parking_cost is not None: 1303 result["total_parking_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_parking_cost) 1304 if self.total_parking_time is not None: 1305 result["total_parking_time"] = from_union([from_none, to_float], self.total_parking_time) 1306 if self.total_reservation_cost is not None: 1307 result["total_reservation_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_reservation_cost) 1308 result["total_time"] = to_float(self.total_time) 1309 if self.total_time_cost is not None: 1310 result["total_time_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_time_cost) 1311 return result 1312 1313 1314class ChargingPreferences: 1315 departure_time: Optional[str] 1316 discharge_allowed: Optional[bool] 1317 energy_need: Optional[float] 1318 profile_type: ProfileType 1319 1320 def __init__(self, departure_time: Optional[str], discharge_allowed: Optional[bool], energy_need: Optional[float], profile_type: ProfileType) -> None: 1321 self.departure_time = departure_time 1322 self.discharge_allowed = discharge_allowed 1323 self.energy_need = energy_need 1324 self.profile_type = profile_type 1325 1326 @staticmethod 1327 def from_dict(obj: Any) -> 'ChargingPreferences': 1328 assert isinstance(obj, dict) 1329 departure_time = from_union([from_none, from_str], obj.get("departure_time")) 1330 discharge_allowed = from_union([from_none, from_bool], obj.get("discharge_allowed")) 1331 energy_need = from_union([from_none, from_float], obj.get("energy_need")) 1332 profile_type = ProfileType(obj.get("profile_type")) 1333 return ChargingPreferences(departure_time, discharge_allowed, energy_need, profile_type) 1334 1335 def to_dict(self) -> dict: 1336 result: dict = {} 1337 if self.departure_time is not None: 1338 result["departure_time"] = from_union([from_none, from_str], self.departure_time) 1339 if self.discharge_allowed is not None: 1340 result["discharge_allowed"] = from_union([from_none, from_bool], self.discharge_allowed) 1341 if self.energy_need is not None: 1342 result["energy_need"] = from_union([from_none, to_float], self.energy_need) 1343 result["profile_type"] = to_enum(ProfileType, self.profile_type) 1344 return result 1345 1346 1347class ChargingProfileResponseType(Enum): 1348 ACCEPTED = "ACCEPTED" 1349 NOT_SUPPORTED = "NOT_SUPPORTED" 1350 REJECTED = "REJECTED" 1351 TOO_OFTEN = "TOO_OFTEN" 1352 UNKNOWN_SESSION = "UNKNOWN_SESSION" 1353 1354 1355class ChargingProfileResponse: 1356 result: ChargingProfileResponseType 1357 timeout: int 1358 1359 def __init__(self, result: ChargingProfileResponseType, timeout: int) -> None: 1360 self.result = result 1361 self.timeout = timeout 1362 1363 @staticmethod 1364 def from_dict(obj: Any) -> 'ChargingProfileResponse': 1365 assert isinstance(obj, dict) 1366 result = ChargingProfileResponseType(obj.get("result")) 1367 timeout = from_int(obj.get("timeout")) 1368 return ChargingProfileResponse(result, timeout) 1369 1370 def to_dict(self) -> dict: 1371 result: dict = {} 1372 result["result"] = to_enum(ChargingProfileResponseType, self.result) 1373 result["timeout"] = from_int(self.timeout) 1374 return result 1375 1376 1377class ChargingProfileResult: 1378 result: ChargingProfileResultType 1379 1380 def __init__(self, result: ChargingProfileResultType) -> None: 1381 self.result = result 1382 1383 @staticmethod 1384 def from_dict(obj: Any) -> 'ChargingProfileResult': 1385 assert isinstance(obj, dict) 1386 result = ChargingProfileResultType(obj.get("result")) 1387 return ChargingProfileResult(result) 1388 1389 def to_dict(self) -> dict: 1390 result: dict = {} 1391 result["result"] = to_enum(ChargingProfileResultType, self.result) 1392 return result 1393 1394 1395class ClearProfileResult: 1396 result: ChargingProfileResultType 1397 1398 def __init__(self, result: ChargingProfileResultType) -> None: 1399 self.result = result 1400 1401 @staticmethod 1402 def from_dict(obj: Any) -> 'ClearProfileResult': 1403 assert isinstance(obj, dict) 1404 result = ChargingProfileResultType(obj.get("result")) 1405 return ClearProfileResult(result) 1406 1407 def to_dict(self) -> dict: 1408 result: dict = {} 1409 result["result"] = to_enum(ChargingProfileResultType, self.result) 1410 return result 1411 1412 1413class CommandResponseType(Enum): 1414 ACCEPTED = "ACCEPTED" 1415 NOT_SUPPORTED = "NOT_SUPPORTED" 1416 REJECTED = "REJECTED" 1417 UNKNOWN_SESSION = "UNKNOWN_SESSION" 1418 1419 1420class CommandResponse: 1421 message: Optional[List[DisplayText]] 1422 result: CommandResponseType 1423 timeout: int 1424 1425 def __init__(self, message: Optional[List[DisplayText]], result: CommandResponseType, timeout: int) -> None: 1426 self.message = message 1427 self.result = result 1428 self.timeout = timeout 1429 1430 @staticmethod 1431 def from_dict(obj: Any) -> 'CommandResponse': 1432 assert isinstance(obj, dict) 1433 message = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("message")) 1434 result = CommandResponseType(obj.get("result")) 1435 timeout = from_int(obj.get("timeout")) 1436 return CommandResponse(message, result, timeout) 1437 1438 def to_dict(self) -> dict: 1439 result: dict = {} 1440 if self.message is not None: 1441 result["message"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.message) 1442 result["result"] = to_enum(CommandResponseType, self.result) 1443 result["timeout"] = from_int(self.timeout) 1444 return result 1445 1446 1447class CommandResultType(Enum): 1448 ACCEPTED = "ACCEPTED" 1449 CANCELED_RESERVATION = "CANCELED_RESERVATION" 1450 EVSE_INOPERATIVE = "EVSE_INOPERATIVE" 1451 EVSE_OCCUPIED = "EVSE_OCCUPIED" 1452 FAILED = "FAILED" 1453 NOT_SUPPORTED = "NOT_SUPPORTED" 1454 REJECTED = "REJECTED" 1455 TIMEOUT = "TIMEOUT" 1456 UNKNOWN_RESERVATION = "UNKNOWN_RESERVATION" 1457 1458 1459class CommandResult: 1460 message: Optional[List[DisplayText]] 1461 result: CommandResultType 1462 1463 def __init__(self, message: Optional[List[DisplayText]], result: CommandResultType) -> None: 1464 self.message = message 1465 self.result = result 1466 1467 @staticmethod 1468 def from_dict(obj: Any) -> 'CommandResult': 1469 assert isinstance(obj, dict) 1470 message = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("message")) 1471 result = CommandResultType(obj.get("result")) 1472 return CommandResult(message, result) 1473 1474 def to_dict(self) -> dict: 1475 result: dict = {} 1476 if self.message is not None: 1477 result["message"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.message) 1478 result["result"] = to_enum(CommandResultType, self.result) 1479 return result 1480 1481 1482class ConnectorCapability(Enum): 1483 ISO_15118_20__PLUG_AND_CHARGE = "ISO_15118_20_PLUG_AND_CHARGE" 1484 ISO_15118_2__PLUG_AND_CHARGE = "ISO_15118_2_PLUG_AND_CHARGE" 1485 1486 1487class Connector: 1488 capabilities: Optional[List[ConnectorCapability]] 1489 format: ConnectorFormat 1490 id: str 1491 last_updated: str 1492 max_amperage: int 1493 max_electric_power: Optional[int] 1494 max_voltage: int 1495 power_type: PowerType 1496 standard: ConnectorType 1497 tariff_ids: Optional[List[str]] 1498 terms_and_conditions: Optional[str] 1499 1500 def __init__(self, capabilities: Optional[List[ConnectorCapability]], format: ConnectorFormat, id: str, last_updated: str, max_amperage: int, max_electric_power: Optional[int], max_voltage: int, power_type: PowerType, standard: ConnectorType, tariff_ids: Optional[List[str]], terms_and_conditions: Optional[str]) -> None: 1501 self.capabilities = capabilities 1502 self.format = format 1503 self.id = id 1504 self.last_updated = last_updated 1505 self.max_amperage = max_amperage 1506 self.max_electric_power = max_electric_power 1507 self.max_voltage = max_voltage 1508 self.power_type = power_type 1509 self.standard = standard 1510 self.tariff_ids = tariff_ids 1511 self.terms_and_conditions = terms_and_conditions 1512 1513 @staticmethod 1514 def from_dict(obj: Any) -> 'Connector': 1515 assert isinstance(obj, dict) 1516 capabilities = from_union([from_none, lambda x: from_list(ConnectorCapability, x)], obj.get("capabilities")) 1517 format = ConnectorFormat(obj.get("format")) 1518 id = from_str(obj.get("id")) 1519 last_updated = from_str(obj.get("last_updated")) 1520 max_amperage = from_int(obj.get("max_amperage")) 1521 max_electric_power = from_union([from_none, from_int], obj.get("max_electric_power")) 1522 max_voltage = from_int(obj.get("max_voltage")) 1523 power_type = PowerType(obj.get("power_type")) 1524 standard = ConnectorType(obj.get("standard")) 1525 tariff_ids = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("tariff_ids")) 1526 terms_and_conditions = from_union([from_none, from_str], obj.get("terms_and_conditions")) 1527 return Connector(capabilities, format, id, last_updated, max_amperage, max_electric_power, max_voltage, power_type, standard, tariff_ids, terms_and_conditions) 1528 1529 def to_dict(self) -> dict: 1530 result: dict = {} 1531 if self.capabilities is not None: 1532 result["capabilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(ConnectorCapability, x), x)], self.capabilities) 1533 result["format"] = to_enum(ConnectorFormat, self.format) 1534 result["id"] = from_str(self.id) 1535 result["last_updated"] = from_str(self.last_updated) 1536 result["max_amperage"] = from_int(self.max_amperage) 1537 if self.max_electric_power is not None: 1538 result["max_electric_power"] = from_union([from_none, from_int], self.max_electric_power) 1539 result["max_voltage"] = from_int(self.max_voltage) 1540 result["power_type"] = to_enum(PowerType, self.power_type) 1541 result["standard"] = to_enum(ConnectorType, self.standard) 1542 if self.tariff_ids is not None: 1543 result["tariff_ids"] = from_union([from_none, lambda x: from_list(from_str, x)], self.tariff_ids) 1544 if self.terms_and_conditions is not None: 1545 result["terms_and_conditions"] = from_union([from_none, from_str], self.terms_and_conditions) 1546 return result 1547 1548 1549class ImageCategory(Enum): 1550 CHARGER = "CHARGER" 1551 ENTRANCE = "ENTRANCE" 1552 LOCATION = "LOCATION" 1553 NETWORK = "NETWORK" 1554 OPERATOR = "OPERATOR" 1555 OTHER = "OTHER" 1556 OWNER = "OWNER" 1557 1558 1559class Image: 1560 category: ImageCategory 1561 height: Optional[int] 1562 thumbnail: Optional[str] 1563 type: str 1564 url: str 1565 width: Optional[int] 1566 1567 def __init__(self, category: ImageCategory, height: Optional[int], thumbnail: Optional[str], type: str, url: str, width: Optional[int]) -> None: 1568 self.category = category 1569 self.height = height 1570 self.thumbnail = thumbnail 1571 self.type = type 1572 self.url = url 1573 self.width = width 1574 1575 @staticmethod 1576 def from_dict(obj: Any) -> 'Image': 1577 assert isinstance(obj, dict) 1578 category = ImageCategory(obj.get("category")) 1579 height = from_union([from_none, from_int], obj.get("height")) 1580 thumbnail = from_union([from_none, from_str], obj.get("thumbnail")) 1581 type = from_str(obj.get("type")) 1582 url = from_str(obj.get("url")) 1583 width = from_union([from_none, from_int], obj.get("width")) 1584 return Image(category, height, thumbnail, type, url, width) 1585 1586 def to_dict(self) -> dict: 1587 result: dict = {} 1588 result["category"] = to_enum(ImageCategory, self.category) 1589 if self.height is not None: 1590 result["height"] = from_union([from_none, from_int], self.height) 1591 if self.thumbnail is not None: 1592 result["thumbnail"] = from_union([from_none, from_str], self.thumbnail) 1593 result["type"] = from_str(self.type) 1594 result["url"] = from_str(self.url) 1595 if self.width is not None: 1596 result["width"] = from_union([from_none, from_int], self.width) 1597 return result 1598 1599 1600class BusinessDetails: 1601 logo: Optional[Image] 1602 name: str 1603 website: Optional[str] 1604 1605 def __init__(self, logo: Optional[Image], name: str, website: Optional[str]) -> None: 1606 self.logo = logo 1607 self.name = name 1608 self.website = website 1609 1610 @staticmethod 1611 def from_dict(obj: Any) -> 'BusinessDetails': 1612 assert isinstance(obj, dict) 1613 logo = from_union([from_none, Image.from_dict], obj.get("logo")) 1614 name = from_str(obj.get("name")) 1615 website = from_union([from_none, from_str], obj.get("website")) 1616 return BusinessDetails(logo, name, website) 1617 1618 def to_dict(self) -> dict: 1619 result: dict = {} 1620 if self.logo is not None: 1621 result["logo"] = from_union([from_none, lambda x: to_class(Image, x)], self.logo) 1622 result["name"] = from_str(self.name) 1623 if self.website is not None: 1624 result["website"] = from_union([from_none, from_str], self.website) 1625 return result 1626 1627 1628class Role(Enum): 1629 CPO = "CPO" 1630 EMSP = "EMSP" 1631 NAP = "NAP" 1632 NSP = "NSP" 1633 OTHER = "OTHER" 1634 SCSP = "SCSP" 1635 1636 1637class CredentialsRole: 1638 business_details: BusinessDetails 1639 country_code: str 1640 party_id: str 1641 role: Role 1642 1643 def __init__(self, business_details: BusinessDetails, country_code: str, party_id: str, role: Role) -> None: 1644 self.business_details = business_details 1645 self.country_code = country_code 1646 self.party_id = party_id 1647 self.role = role 1648 1649 @staticmethod 1650 def from_dict(obj: Any) -> 'CredentialsRole': 1651 assert isinstance(obj, dict) 1652 business_details = BusinessDetails.from_dict(obj.get("business_details")) 1653 country_code = from_str(obj.get("country_code")) 1654 party_id = from_str(obj.get("party_id")) 1655 role = Role(obj.get("role")) 1656 return CredentialsRole(business_details, country_code, party_id, role) 1657 1658 def to_dict(self) -> dict: 1659 result: dict = {} 1660 result["business_details"] = to_class(BusinessDetails, self.business_details) 1661 result["country_code"] = from_str(self.country_code) 1662 result["party_id"] = from_str(self.party_id) 1663 result["role"] = to_enum(Role, self.role) 1664 return result 1665 1666 1667class Credentials: 1668 hub_party_id: Optional[str] 1669 roles: List[CredentialsRole] 1670 token: str 1671 url: str 1672 1673 def __init__(self, hub_party_id: Optional[str], roles: List[CredentialsRole], token: str, url: str) -> None: 1674 self.hub_party_id = hub_party_id 1675 self.roles = roles 1676 self.token = token 1677 self.url = url 1678 1679 @staticmethod 1680 def from_dict(obj: Any) -> 'Credentials': 1681 assert isinstance(obj, dict) 1682 hub_party_id = from_union([from_none, from_str], obj.get("hub_party_id")) 1683 roles = from_list(CredentialsRole.from_dict, obj.get("roles")) 1684 token = from_str(obj.get("token")) 1685 url = from_str(obj.get("url")) 1686 return Credentials(hub_party_id, roles, token, url) 1687 1688 def to_dict(self) -> dict: 1689 result: dict = {} 1690 if self.hub_party_id is not None: 1691 result["hub_party_id"] = from_union([from_none, from_str], self.hub_party_id) 1692 result["roles"] = from_list(lambda x: to_class(CredentialsRole, x), self.roles) 1693 result["token"] = from_str(self.token) 1694 result["url"] = from_str(self.url) 1695 return result 1696 1697 1698class ModuleID(Enum): 1699 CDRS = "cdrs" 1700 CHARGINGPROFILES = "chargingprofiles" 1701 COMMANDS = "commands" 1702 CREDENTIALS = "credentials" 1703 HUBCLIENTINFO = "hubclientinfo" 1704 LOCATIONS = "locations" 1705 SESSIONS = "sessions" 1706 TARIFFS = "tariffs" 1707 TOKENS = "tokens" 1708 1709 1710class InterfaceRole(Enum): 1711 RECEIVER = "RECEIVER" 1712 SENDER = "SENDER" 1713 1714 1715class Endpoint: 1716 identifier: ModuleID 1717 role: InterfaceRole 1718 url: str 1719 1720 def __init__(self, identifier: ModuleID, role: InterfaceRole, url: str) -> None: 1721 self.identifier = identifier 1722 self.role = role 1723 self.url = url 1724 1725 @staticmethod 1726 def from_dict(obj: Any) -> 'Endpoint': 1727 assert isinstance(obj, dict) 1728 identifier = ModuleID(obj.get("identifier")) 1729 role = InterfaceRole(obj.get("role")) 1730 url = from_str(obj.get("url")) 1731 return Endpoint(identifier, role, url) 1732 1733 def to_dict(self) -> dict: 1734 result: dict = {} 1735 result["identifier"] = to_enum(ModuleID, self.identifier) 1736 result["role"] = to_enum(InterfaceRole, self.role) 1737 result["url"] = from_str(self.url) 1738 return result 1739 1740 1741class Capability(Enum): 1742 CHARGING_PREFERENCES_CAPABLE = "CHARGING_PREFERENCES_CAPABLE" 1743 CHARGING_PROFILE_CAPABLE = "CHARGING_PROFILE_CAPABLE" 1744 CHIP_CARD_SUPPORT = "CHIP_CARD_SUPPORT" 1745 CONTACTLESS_CARD_SUPPORT = "CONTACTLESS_CARD_SUPPORT" 1746 CREDIT_CARD_PAYABLE = "CREDIT_CARD_PAYABLE" 1747 DEBIT_CARD_PAYABLE = "DEBIT_CARD_PAYABLE" 1748 PED_TERMINAL = "PED_TERMINAL" 1749 REMOTE_START_STOP_CAPABLE = "REMOTE_START_STOP_CAPABLE" 1750 RESERVABLE = "RESERVABLE" 1751 RFID_READER = "RFID_READER" 1752 START_SESSION_CONNECTOR_REQUIRED = "START_SESSION_CONNECTOR_REQUIRED" 1753 TOKEN_GROUP_CAPABLE = "TOKEN_GROUP_CAPABLE" 1754 UNLOCK_CAPABLE = "UNLOCK_CAPABLE" 1755 1756 1757class EvsePosition(Enum): 1758 CENTER = "CENTER" 1759 LEFT = "LEFT" 1760 RIGHT = "RIGHT" 1761 1762 1763class EvseParking: 1764 evse_position: Optional[EvsePosition] 1765 parking_id: str 1766 1767 def __init__(self, evse_position: Optional[EvsePosition], parking_id: str) -> None: 1768 self.evse_position = evse_position 1769 self.parking_id = parking_id 1770 1771 @staticmethod 1772 def from_dict(obj: Any) -> 'EvseParking': 1773 assert isinstance(obj, dict) 1774 evse_position = from_union([from_none, EvsePosition], obj.get("evse_position")) 1775 parking_id = from_str(obj.get("parking_id")) 1776 return EvseParking(evse_position, parking_id) 1777 1778 def to_dict(self) -> dict: 1779 result: dict = {} 1780 if self.evse_position is not None: 1781 result["evse_position"] = from_union([from_none, lambda x: to_enum(EvsePosition, x)], self.evse_position) 1782 result["parking_id"] = from_str(self.parking_id) 1783 return result 1784 1785 1786class ParkingRestriction(Enum): 1787 CUSTOMERS = "CUSTOMERS" 1788 DISABLED = "DISABLED" 1789 EMPLOYEES = "EMPLOYEES" 1790 EV_ONLY = "EV_ONLY" 1791 MOTORCYCLES = "MOTORCYCLES" 1792 PLUGGED = "PLUGGED" 1793 TAXIS = "TAXIS" 1794 TENANTS = "TENANTS" 1795 1796 1797class Status(Enum): 1798 AVAILABLE = "AVAILABLE" 1799 BLOCKED = "BLOCKED" 1800 CHARGING = "CHARGING" 1801 INOPERATIVE = "INOPERATIVE" 1802 OUTOFORDER = "OUTOFORDER" 1803 PLANNED = "PLANNED" 1804 REMOVED = "REMOVED" 1805 RESERVED = "RESERVED" 1806 UNKNOWN = "UNKNOWN" 1807 1808 1809class StatusSchedule: 1810 period_begin: str 1811 period_end: Optional[str] 1812 status: Status 1813 1814 def __init__(self, period_begin: str, period_end: Optional[str], status: Status) -> None: 1815 self.period_begin = period_begin 1816 self.period_end = period_end 1817 self.status = status 1818 1819 @staticmethod 1820 def from_dict(obj: Any) -> 'StatusSchedule': 1821 assert isinstance(obj, dict) 1822 period_begin = from_str(obj.get("period_begin")) 1823 period_end = from_union([from_none, from_str], obj.get("period_end")) 1824 status = Status(obj.get("status")) 1825 return StatusSchedule(period_begin, period_end, status) 1826 1827 def to_dict(self) -> dict: 1828 result: dict = {} 1829 result["period_begin"] = from_str(self.period_begin) 1830 if self.period_end is not None: 1831 result["period_end"] = from_union([from_none, from_str], self.period_end) 1832 result["status"] = to_enum(Status, self.status) 1833 return result 1834 1835 1836class Evse: 1837 accepted_service_providers: Optional[List[str]] 1838 capabilities: Optional[List[Capability]] 1839 connectors: List[Connector] 1840 coordinates: Optional[GeoLocation] 1841 directions: Optional[List[DisplayText]] 1842 evse_id: Optional[str] 1843 floor_level: Optional[str] 1844 images: Optional[List[Image]] 1845 last_updated: str 1846 parking: Optional[List[EvseParking]] 1847 parking_restrictions: Optional[List[ParkingRestriction]] 1848 physical_reference: Optional[str] 1849 status: Status 1850 status_schedule: Optional[List[StatusSchedule]] 1851 uid: str 1852 1853 def __init__(self, accepted_service_providers: Optional[List[str]], capabilities: Optional[List[Capability]], connectors: List[Connector], coordinates: Optional[GeoLocation], directions: Optional[List[DisplayText]], evse_id: Optional[str], floor_level: Optional[str], images: Optional[List[Image]], last_updated: str, parking: Optional[List[EvseParking]], parking_restrictions: Optional[List[ParkingRestriction]], physical_reference: Optional[str], status: Status, status_schedule: Optional[List[StatusSchedule]], uid: str) -> None: 1854 self.accepted_service_providers = accepted_service_providers 1855 self.capabilities = capabilities 1856 self.connectors = connectors 1857 self.coordinates = coordinates 1858 self.directions = directions 1859 self.evse_id = evse_id 1860 self.floor_level = floor_level 1861 self.images = images 1862 self.last_updated = last_updated 1863 self.parking = parking 1864 self.parking_restrictions = parking_restrictions 1865 self.physical_reference = physical_reference 1866 self.status = status 1867 self.status_schedule = status_schedule 1868 self.uid = uid 1869 1870 @staticmethod 1871 def from_dict(obj: Any) -> 'Evse': 1872 assert isinstance(obj, dict) 1873 accepted_service_providers = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("accepted_service_providers")) 1874 capabilities = from_union([from_none, lambda x: from_list(Capability, x)], obj.get("capabilities")) 1875 connectors = from_list(Connector.from_dict, obj.get("connectors")) 1876 coordinates = from_union([from_none, GeoLocation.from_dict], obj.get("coordinates")) 1877 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 1878 evse_id = from_union([from_none, from_str], obj.get("evse_id")) 1879 floor_level = from_union([from_none, from_str], obj.get("floor_level")) 1880 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 1881 last_updated = from_str(obj.get("last_updated")) 1882 parking = from_union([from_none, lambda x: from_list(EvseParking.from_dict, x)], obj.get("parking")) 1883 parking_restrictions = from_union([from_none, lambda x: from_list(ParkingRestriction, x)], obj.get("parking_restrictions")) 1884 physical_reference = from_union([from_none, from_str], obj.get("physical_reference")) 1885 status = Status(obj.get("status")) 1886 status_schedule = from_union([from_none, lambda x: from_list(StatusSchedule.from_dict, x)], obj.get("status_schedule")) 1887 uid = from_str(obj.get("uid")) 1888 return Evse(accepted_service_providers, capabilities, connectors, coordinates, directions, evse_id, floor_level, images, last_updated, parking, parking_restrictions, physical_reference, status, status_schedule, uid) 1889 1890 def to_dict(self) -> dict: 1891 result: dict = {} 1892 if self.accepted_service_providers is not None: 1893 result["accepted_service_providers"] = from_union([from_none, lambda x: from_list(from_str, x)], self.accepted_service_providers) 1894 if self.capabilities is not None: 1895 result["capabilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Capability, x), x)], self.capabilities) 1896 result["connectors"] = from_list(lambda x: to_class(Connector, x), self.connectors) 1897 if self.coordinates is not None: 1898 result["coordinates"] = from_union([from_none, lambda x: to_class(GeoLocation, x)], self.coordinates) 1899 if self.directions is not None: 1900 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 1901 if self.evse_id is not None: 1902 result["evse_id"] = from_union([from_none, from_str], self.evse_id) 1903 if self.floor_level is not None: 1904 result["floor_level"] = from_union([from_none, from_str], self.floor_level) 1905 if self.images is not None: 1906 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 1907 result["last_updated"] = from_str(self.last_updated) 1908 if self.parking is not None: 1909 result["parking"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EvseParking, x), x)], self.parking) 1910 if self.parking_restrictions is not None: 1911 result["parking_restrictions"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(ParkingRestriction, x), x)], self.parking_restrictions) 1912 if self.physical_reference is not None: 1913 result["physical_reference"] = from_union([from_none, from_str], self.physical_reference) 1914 result["status"] = to_enum(Status, self.status) 1915 if self.status_schedule is not None: 1916 result["status_schedule"] = from_union([from_none, lambda x: from_list(lambda x: to_class(StatusSchedule, x), x)], self.status_schedule) 1917 result["uid"] = from_str(self.uid) 1918 return result 1919 1920 1921class ConnectionStatus(Enum): 1922 CONNECTED = "CONNECTED" 1923 OFFLINE = "OFFLINE" 1924 PLANNED = "PLANNED" 1925 SUSPENDED = "SUSPENDED" 1926 1927 1928class HubClientInfo: 1929 country_code: str 1930 last_updated: str 1931 party_id: str 1932 role: Role 1933 status: ConnectionStatus 1934 1935 def __init__(self, country_code: str, last_updated: str, party_id: str, role: Role, status: ConnectionStatus) -> None: 1936 self.country_code = country_code 1937 self.last_updated = last_updated 1938 self.party_id = party_id 1939 self.role = role 1940 self.status = status 1941 1942 @staticmethod 1943 def from_dict(obj: Any) -> 'HubClientInfo': 1944 assert isinstance(obj, dict) 1945 country_code = from_str(obj.get("country_code")) 1946 last_updated = from_str(obj.get("last_updated")) 1947 party_id = from_str(obj.get("party_id")) 1948 role = Role(obj.get("role")) 1949 status = ConnectionStatus(obj.get("status")) 1950 return HubClientInfo(country_code, last_updated, party_id, role, status) 1951 1952 def to_dict(self) -> dict: 1953 result: dict = {} 1954 result["country_code"] = from_str(self.country_code) 1955 result["last_updated"] = from_str(self.last_updated) 1956 result["party_id"] = from_str(self.party_id) 1957 result["role"] = to_enum(Role, self.role) 1958 result["status"] = to_enum(ConnectionStatus, self.status) 1959 return result 1960 1961 1962class Facility(Enum): 1963 AIRPORT = "AIRPORT" 1964 BIKE_SHARING = "BIKE_SHARING" 1965 BUS_STOP = "BUS_STOP" 1966 CAFE = "CAFE" 1967 CARPOOL_PARKING = "CARPOOL_PARKING" 1968 FUEL_STATION = "FUEL_STATION" 1969 HOTEL = "HOTEL" 1970 MALL = "MALL" 1971 METRO_STATION = "METRO_STATION" 1972 MUSEUM = "MUSEUM" 1973 NATURE = "NATURE" 1974 PARKING_LOT = "PARKING_LOT" 1975 RECREATION_AREA = "RECREATION_AREA" 1976 RESTAURANT = "RESTAURANT" 1977 SPORT = "SPORT" 1978 SUPERMARKET = "SUPERMARKET" 1979 TAXI_STAND = "TAXI_STAND" 1980 TRAIN_STATION = "TRAIN_STATION" 1981 TRAM_STOP = "TRAM_STOP" 1982 WIFI = "WIFI" 1983 1984 1985class ExceptionalPeriod: 1986 period_begin: str 1987 period_end: str 1988 1989 def __init__(self, period_begin: str, period_end: str) -> None: 1990 self.period_begin = period_begin 1991 self.period_end = period_end 1992 1993 @staticmethod 1994 def from_dict(obj: Any) -> 'ExceptionalPeriod': 1995 assert isinstance(obj, dict) 1996 period_begin = from_str(obj.get("period_begin")) 1997 period_end = from_str(obj.get("period_end")) 1998 return ExceptionalPeriod(period_begin, period_end) 1999 2000 def to_dict(self) -> dict: 2001 result: dict = {} 2002 result["period_begin"] = from_str(self.period_begin) 2003 result["period_end"] = from_str(self.period_end) 2004 return result 2005 2006 2007class RegularHours: 2008 period_begin: str 2009 period_end: str 2010 weekday: int 2011 2012 def __init__(self, period_begin: str, period_end: str, weekday: int) -> None: 2013 self.period_begin = period_begin 2014 self.period_end = period_end 2015 self.weekday = weekday 2016 2017 @staticmethod 2018 def from_dict(obj: Any) -> 'RegularHours': 2019 assert isinstance(obj, dict) 2020 period_begin = from_str(obj.get("period_begin")) 2021 period_end = from_str(obj.get("period_end")) 2022 weekday = from_int(obj.get("weekday")) 2023 return RegularHours(period_begin, period_end, weekday) 2024 2025 def to_dict(self) -> dict: 2026 result: dict = {} 2027 result["period_begin"] = from_str(self.period_begin) 2028 result["period_end"] = from_str(self.period_end) 2029 result["weekday"] = from_int(self.weekday) 2030 return result 2031 2032 2033class Hours: 2034 exceptional_closings: Optional[List[ExceptionalPeriod]] 2035 exceptional_openings: Optional[List[ExceptionalPeriod]] 2036 regular_hours: Optional[List[RegularHours]] 2037 twentyfourseven: bool 2038 2039 def __init__(self, exceptional_closings: Optional[List[ExceptionalPeriod]], exceptional_openings: Optional[List[ExceptionalPeriod]], regular_hours: Optional[List[RegularHours]], twentyfourseven: bool) -> None: 2040 self.exceptional_closings = exceptional_closings 2041 self.exceptional_openings = exceptional_openings 2042 self.regular_hours = regular_hours 2043 self.twentyfourseven = twentyfourseven 2044 2045 @staticmethod 2046 def from_dict(obj: Any) -> 'Hours': 2047 assert isinstance(obj, dict) 2048 exceptional_closings = from_union([from_none, lambda x: from_list(ExceptionalPeriod.from_dict, x)], obj.get("exceptional_closings")) 2049 exceptional_openings = from_union([from_none, lambda x: from_list(ExceptionalPeriod.from_dict, x)], obj.get("exceptional_openings")) 2050 regular_hours = from_union([from_none, lambda x: from_list(RegularHours.from_dict, x)], obj.get("regular_hours")) 2051 twentyfourseven = from_bool(obj.get("twentyfourseven")) 2052 return Hours(exceptional_closings, exceptional_openings, regular_hours, twentyfourseven) 2053 2054 def to_dict(self) -> dict: 2055 result: dict = {} 2056 if self.exceptional_closings is not None: 2057 result["exceptional_closings"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ExceptionalPeriod, x), x)], self.exceptional_closings) 2058 if self.exceptional_openings is not None: 2059 result["exceptional_openings"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ExceptionalPeriod, x), x)], self.exceptional_openings) 2060 if self.regular_hours is not None: 2061 result["regular_hours"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RegularHours, x), x)], self.regular_hours) 2062 result["twentyfourseven"] = from_bool(self.twentyfourseven) 2063 return result 2064 2065 2066class ParkingDirection(Enum): 2067 ANGLE = "ANGLE" 2068 PARALLEL = "PARALLEL" 2069 PERPENDICULAR = "PERPENDICULAR" 2070 2071 2072class VehicleType(Enum): 2073 BUS = "BUS" 2074 DISABLED = "DISABLED" 2075 MOTORCYCLE = "MOTORCYCLE" 2076 PERSONAL_VEHICLE = "PERSONAL_VEHICLE" 2077 PERSONAL_VEHICLE_WITH_TRAILER = "PERSONAL_VEHICLE_WITH_TRAILER" 2078 RIGID = "RIGID" 2079 SEMI_TRACTOR = "SEMI_TRACTOR" 2080 TRUCK_WITH_TRAILER = "TRUCK_WITH_TRAILER" 2081 VAN = "VAN" 2082 2083 2084class Parking: 2085 apds_reference: Optional[str] 2086 dangerous_goods_allowed: Optional[bool] 2087 direction: Optional[ParkingDirection] 2088 drive_through: Optional[bool] 2089 id: str 2090 images: Optional[List[Image]] 2091 lighting: Optional[bool] 2092 max_vehicle_height: Optional[float] 2093 max_vehicle_length: Optional[float] 2094 max_vehicle_weight: Optional[float] 2095 max_vehicle_width: Optional[float] 2096 parking_space_length: Optional[float] 2097 parking_space_width: Optional[float] 2098 physical_reference: Optional[str] 2099 refrigeration_outlet: Optional[bool] 2100 reservation_required: bool 2101 restricted_to_type: bool 2102 roofed: Optional[bool] 2103 standards: Optional[List[str]] 2104 time_limit: Optional[float] 2105 vehicle_types: List[VehicleType] 2106 2107 def __init__(self, apds_reference: Optional[str], dangerous_goods_allowed: Optional[bool], direction: Optional[ParkingDirection], drive_through: Optional[bool], id: str, images: Optional[List[Image]], lighting: Optional[bool], max_vehicle_height: Optional[float], max_vehicle_length: Optional[float], max_vehicle_weight: Optional[float], max_vehicle_width: Optional[float], parking_space_length: Optional[float], parking_space_width: Optional[float], physical_reference: Optional[str], refrigeration_outlet: Optional[bool], reservation_required: bool, restricted_to_type: bool, roofed: Optional[bool], standards: Optional[List[str]], time_limit: Optional[float], vehicle_types: List[VehicleType]) -> None: 2108 self.apds_reference = apds_reference 2109 self.dangerous_goods_allowed = dangerous_goods_allowed 2110 self.direction = direction 2111 self.drive_through = drive_through 2112 self.id = id 2113 self.images = images 2114 self.lighting = lighting 2115 self.max_vehicle_height = max_vehicle_height 2116 self.max_vehicle_length = max_vehicle_length 2117 self.max_vehicle_weight = max_vehicle_weight 2118 self.max_vehicle_width = max_vehicle_width 2119 self.parking_space_length = parking_space_length 2120 self.parking_space_width = parking_space_width 2121 self.physical_reference = physical_reference 2122 self.refrigeration_outlet = refrigeration_outlet 2123 self.reservation_required = reservation_required 2124 self.restricted_to_type = restricted_to_type 2125 self.roofed = roofed 2126 self.standards = standards 2127 self.time_limit = time_limit 2128 self.vehicle_types = vehicle_types 2129 2130 @staticmethod 2131 def from_dict(obj: Any) -> 'Parking': 2132 assert isinstance(obj, dict) 2133 apds_reference = from_union([from_none, from_str], obj.get("apds_reference")) 2134 dangerous_goods_allowed = from_union([from_none, from_bool], obj.get("dangerous_goods_allowed")) 2135 direction = from_union([from_none, ParkingDirection], obj.get("direction")) 2136 drive_through = from_union([from_none, from_bool], obj.get("drive_through")) 2137 id = from_str(obj.get("id")) 2138 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 2139 lighting = from_union([from_none, from_bool], obj.get("lighting")) 2140 max_vehicle_height = from_union([from_none, from_float], obj.get("max_vehicle_height")) 2141 max_vehicle_length = from_union([from_none, from_float], obj.get("max_vehicle_length")) 2142 max_vehicle_weight = from_union([from_none, from_float], obj.get("max_vehicle_weight")) 2143 max_vehicle_width = from_union([from_none, from_float], obj.get("max_vehicle_width")) 2144 parking_space_length = from_union([from_none, from_float], obj.get("parking_space_length")) 2145 parking_space_width = from_union([from_none, from_float], obj.get("parking_space_width")) 2146 physical_reference = from_union([from_none, from_str], obj.get("physical_reference")) 2147 refrigeration_outlet = from_union([from_none, from_bool], obj.get("refrigeration_outlet")) 2148 reservation_required = from_bool(obj.get("reservation_required")) 2149 restricted_to_type = from_bool(obj.get("restricted_to_type")) 2150 roofed = from_union([from_none, from_bool], obj.get("roofed")) 2151 standards = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("standards")) 2152 time_limit = from_union([from_none, from_float], obj.get("time_limit")) 2153 vehicle_types = from_list(VehicleType, obj.get("vehicle_types")) 2154 return Parking(apds_reference, dangerous_goods_allowed, direction, drive_through, id, images, lighting, max_vehicle_height, max_vehicle_length, max_vehicle_weight, max_vehicle_width, parking_space_length, parking_space_width, physical_reference, refrigeration_outlet, reservation_required, restricted_to_type, roofed, standards, time_limit, vehicle_types) 2155 2156 def to_dict(self) -> dict: 2157 result: dict = {} 2158 if self.apds_reference is not None: 2159 result["apds_reference"] = from_union([from_none, from_str], self.apds_reference) 2160 if self.dangerous_goods_allowed is not None: 2161 result["dangerous_goods_allowed"] = from_union([from_none, from_bool], self.dangerous_goods_allowed) 2162 if self.direction is not None: 2163 result["direction"] = from_union([from_none, lambda x: to_enum(ParkingDirection, x)], self.direction) 2164 if self.drive_through is not None: 2165 result["drive_through"] = from_union([from_none, from_bool], self.drive_through) 2166 result["id"] = from_str(self.id) 2167 if self.images is not None: 2168 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 2169 if self.lighting is not None: 2170 result["lighting"] = from_union([from_none, from_bool], self.lighting) 2171 if self.max_vehicle_height is not None: 2172 result["max_vehicle_height"] = from_union([from_none, to_float], self.max_vehicle_height) 2173 if self.max_vehicle_length is not None: 2174 result["max_vehicle_length"] = from_union([from_none, to_float], self.max_vehicle_length) 2175 if self.max_vehicle_weight is not None: 2176 result["max_vehicle_weight"] = from_union([from_none, to_float], self.max_vehicle_weight) 2177 if self.max_vehicle_width is not None: 2178 result["max_vehicle_width"] = from_union([from_none, to_float], self.max_vehicle_width) 2179 if self.parking_space_length is not None: 2180 result["parking_space_length"] = from_union([from_none, to_float], self.parking_space_length) 2181 if self.parking_space_width is not None: 2182 result["parking_space_width"] = from_union([from_none, to_float], self.parking_space_width) 2183 if self.physical_reference is not None: 2184 result["physical_reference"] = from_union([from_none, from_str], self.physical_reference) 2185 if self.refrigeration_outlet is not None: 2186 result["refrigeration_outlet"] = from_union([from_none, from_bool], self.refrigeration_outlet) 2187 result["reservation_required"] = from_bool(self.reservation_required) 2188 result["restricted_to_type"] = from_bool(self.restricted_to_type) 2189 if self.roofed is not None: 2190 result["roofed"] = from_union([from_none, from_bool], self.roofed) 2191 if self.standards is not None: 2192 result["standards"] = from_union([from_none, lambda x: from_list(from_str, x)], self.standards) 2193 if self.time_limit is not None: 2194 result["time_limit"] = from_union([from_none, to_float], self.time_limit) 2195 result["vehicle_types"] = from_list(lambda x: to_enum(VehicleType, x), self.vehicle_types) 2196 return result 2197 2198 2199class ParkingType(Enum): 2200 ALONG_MOTORWAY = "ALONG_MOTORWAY" 2201 ON_DRIVEWAY = "ON_DRIVEWAY" 2202 ON_STREET = "ON_STREET" 2203 PARKING_GARAGE = "PARKING_GARAGE" 2204 PARKING_LOT = "PARKING_LOT" 2205 UNDERGROUND_GARAGE = "UNDERGROUND_GARAGE" 2206 2207 2208class PublishTokenType: 2209 group_id: Optional[str] 2210 issuer: Optional[str] 2211 type: Optional[TokenType] 2212 uid: Optional[str] 2213 visual_number: Optional[str] 2214 2215 def __init__(self, group_id: Optional[str], issuer: Optional[str], type: Optional[TokenType], uid: Optional[str], visual_number: Optional[str]) -> None: 2216 self.group_id = group_id 2217 self.issuer = issuer 2218 self.type = type 2219 self.uid = uid 2220 self.visual_number = visual_number 2221 2222 @staticmethod 2223 def from_dict(obj: Any) -> 'PublishTokenType': 2224 assert isinstance(obj, dict) 2225 group_id = from_union([from_none, from_str], obj.get("group_id")) 2226 issuer = from_union([from_none, from_str], obj.get("issuer")) 2227 type = from_union([from_none, TokenType], obj.get("type")) 2228 uid = from_union([from_none, from_str], obj.get("uid")) 2229 visual_number = from_union([from_none, from_str], obj.get("visual_number")) 2230 return PublishTokenType(group_id, issuer, type, uid, visual_number) 2231 2232 def to_dict(self) -> dict: 2233 result: dict = {} 2234 if self.group_id is not None: 2235 result["group_id"] = from_union([from_none, from_str], self.group_id) 2236 if self.issuer is not None: 2237 result["issuer"] = from_union([from_none, from_str], self.issuer) 2238 if self.type is not None: 2239 result["type"] = from_union([from_none, lambda x: to_enum(TokenType, x)], self.type) 2240 if self.uid is not None: 2241 result["uid"] = from_union([from_none, from_str], self.uid) 2242 if self.visual_number is not None: 2243 result["visual_number"] = from_union([from_none, from_str], self.visual_number) 2244 return result 2245 2246 2247class AdditionalGeoLocation: 2248 latitude: str 2249 longitude: str 2250 name: Optional[DisplayText] 2251 2252 def __init__(self, latitude: str, longitude: str, name: Optional[DisplayText]) -> None: 2253 self.latitude = latitude 2254 self.longitude = longitude 2255 self.name = name 2256 2257 @staticmethod 2258 def from_dict(obj: Any) -> 'AdditionalGeoLocation': 2259 assert isinstance(obj, dict) 2260 latitude = from_str(obj.get("latitude")) 2261 longitude = from_str(obj.get("longitude")) 2262 name = from_union([from_none, DisplayText.from_dict], obj.get("name")) 2263 return AdditionalGeoLocation(latitude, longitude, name) 2264 2265 def to_dict(self) -> dict: 2266 result: dict = {} 2267 result["latitude"] = from_str(self.latitude) 2268 result["longitude"] = from_str(self.longitude) 2269 if self.name is not None: 2270 result["name"] = from_union([from_none, lambda x: to_class(DisplayText, x)], self.name) 2271 return result 2272 2273 2274class Location: 2275 address: str 2276 charging_when_closed: Optional[bool] 2277 city: str 2278 coordinates: GeoLocation 2279 country: str 2280 country_code: str 2281 directions: Optional[List[DisplayText]] 2282 energy_mix: Optional[EnergyMix] 2283 evses: Optional[List[Evse]] 2284 facilities: Optional[List[Facility]] 2285 help_phone: Optional[str] 2286 id: str 2287 images: Optional[List[Image]] 2288 last_updated: str 2289 name: Optional[str] 2290 opening_times: Optional[Hours] 2291 operator: Optional[BusinessDetails] 2292 owner: Optional[BusinessDetails] 2293 parking_places: Optional[List[Parking]] 2294 parking_type: Optional[ParkingType] 2295 party_id: str 2296 postal_code: Optional[str] 2297 publish: bool 2298 publish_allowed_to: Optional[List[PublishTokenType]] 2299 related_locations: Optional[List[AdditionalGeoLocation]] 2300 state: Optional[str] 2301 suboperator: Optional[BusinessDetails] 2302 time_zone: str 2303 2304 def __init__(self, address: str, charging_when_closed: Optional[bool], city: str, coordinates: GeoLocation, country: str, country_code: str, directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], help_phone: Optional[str], id: str, images: Optional[List[Image]], last_updated: str, name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], parking_places: Optional[List[Parking]], parking_type: Optional[ParkingType], party_id: str, postal_code: Optional[str], publish: bool, publish_allowed_to: Optional[List[PublishTokenType]], related_locations: Optional[List[AdditionalGeoLocation]], state: Optional[str], suboperator: Optional[BusinessDetails], time_zone: str) -> None: 2305 self.address = address 2306 self.charging_when_closed = charging_when_closed 2307 self.city = city 2308 self.coordinates = coordinates 2309 self.country = country 2310 self.country_code = country_code 2311 self.directions = directions 2312 self.energy_mix = energy_mix 2313 self.evses = evses 2314 self.facilities = facilities 2315 self.help_phone = help_phone 2316 self.id = id 2317 self.images = images 2318 self.last_updated = last_updated 2319 self.name = name 2320 self.opening_times = opening_times 2321 self.operator = operator 2322 self.owner = owner 2323 self.parking_places = parking_places 2324 self.parking_type = parking_type 2325 self.party_id = party_id 2326 self.postal_code = postal_code 2327 self.publish = publish 2328 self.publish_allowed_to = publish_allowed_to 2329 self.related_locations = related_locations 2330 self.state = state 2331 self.suboperator = suboperator 2332 self.time_zone = time_zone 2333 2334 @staticmethod 2335 def from_dict(obj: Any) -> 'Location': 2336 assert isinstance(obj, dict) 2337 address = from_str(obj.get("address")) 2338 charging_when_closed = from_union([from_none, from_bool], obj.get("charging_when_closed")) 2339 city = from_str(obj.get("city")) 2340 coordinates = GeoLocation.from_dict(obj.get("coordinates")) 2341 country = from_str(obj.get("country")) 2342 country_code = from_str(obj.get("country_code")) 2343 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 2344 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 2345 evses = from_union([from_none, lambda x: from_list(Evse.from_dict, x)], obj.get("evses")) 2346 facilities = from_union([from_none, lambda x: from_list(Facility, x)], obj.get("facilities")) 2347 help_phone = from_union([from_none, from_str], obj.get("help_phone")) 2348 id = from_str(obj.get("id")) 2349 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 2350 last_updated = from_str(obj.get("last_updated")) 2351 name = from_union([from_none, from_str], obj.get("name")) 2352 opening_times = from_union([from_none, Hours.from_dict], obj.get("opening_times")) 2353 operator = from_union([from_none, BusinessDetails.from_dict], obj.get("operator")) 2354 owner = from_union([from_none, BusinessDetails.from_dict], obj.get("owner")) 2355 parking_places = from_union([from_none, lambda x: from_list(Parking.from_dict, x)], obj.get("parking_places")) 2356 parking_type = from_union([from_none, ParkingType], obj.get("parking_type")) 2357 party_id = from_str(obj.get("party_id")) 2358 postal_code = from_union([from_none, from_str], obj.get("postal_code")) 2359 publish = from_bool(obj.get("publish")) 2360 publish_allowed_to = from_union([from_none, lambda x: from_list(PublishTokenType.from_dict, x)], obj.get("publish_allowed_to")) 2361 related_locations = from_union([from_none, lambda x: from_list(AdditionalGeoLocation.from_dict, x)], obj.get("related_locations")) 2362 state = from_union([from_none, from_str], obj.get("state")) 2363 suboperator = from_union([from_none, BusinessDetails.from_dict], obj.get("suboperator")) 2364 time_zone = from_str(obj.get("time_zone")) 2365 return Location(address, charging_when_closed, city, coordinates, country, country_code, directions, energy_mix, evses, facilities, help_phone, id, images, last_updated, name, opening_times, operator, owner, parking_places, parking_type, party_id, postal_code, publish, publish_allowed_to, related_locations, state, suboperator, time_zone) 2366 2367 def to_dict(self) -> dict: 2368 result: dict = {} 2369 result["address"] = from_str(self.address) 2370 if self.charging_when_closed is not None: 2371 result["charging_when_closed"] = from_union([from_none, from_bool], self.charging_when_closed) 2372 result["city"] = from_str(self.city) 2373 result["coordinates"] = to_class(GeoLocation, self.coordinates) 2374 result["country"] = from_str(self.country) 2375 result["country_code"] = from_str(self.country_code) 2376 if self.directions is not None: 2377 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 2378 if self.energy_mix is not None: 2379 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 2380 if self.evses is not None: 2381 result["evses"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Evse, x), x)], self.evses) 2382 if self.facilities is not None: 2383 result["facilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Facility, x), x)], self.facilities) 2384 if self.help_phone is not None: 2385 result["help_phone"] = from_union([from_none, from_str], self.help_phone) 2386 result["id"] = from_str(self.id) 2387 if self.images is not None: 2388 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 2389 result["last_updated"] = from_str(self.last_updated) 2390 if self.name is not None: 2391 result["name"] = from_union([from_none, from_str], self.name) 2392 if self.opening_times is not None: 2393 result["opening_times"] = from_union([from_none, lambda x: to_class(Hours, x)], self.opening_times) 2394 if self.operator is not None: 2395 result["operator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.operator) 2396 if self.owner is not None: 2397 result["owner"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.owner) 2398 if self.parking_places is not None: 2399 result["parking_places"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Parking, x), x)], self.parking_places) 2400 if self.parking_type is not None: 2401 result["parking_type"] = from_union([from_none, lambda x: to_enum(ParkingType, x)], self.parking_type) 2402 result["party_id"] = from_str(self.party_id) 2403 if self.postal_code is not None: 2404 result["postal_code"] = from_union([from_none, from_str], self.postal_code) 2405 result["publish"] = from_bool(self.publish) 2406 if self.publish_allowed_to is not None: 2407 result["publish_allowed_to"] = from_union([from_none, lambda x: from_list(lambda x: to_class(PublishTokenType, x), x)], self.publish_allowed_to) 2408 if self.related_locations is not None: 2409 result["related_locations"] = from_union([from_none, lambda x: from_list(lambda x: to_class(AdditionalGeoLocation, x), x)], self.related_locations) 2410 if self.state is not None: 2411 result["state"] = from_union([from_none, from_str], self.state) 2412 if self.suboperator is not None: 2413 result["suboperator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.suboperator) 2414 result["time_zone"] = from_str(self.time_zone) 2415 return result 2416 2417 2418class ReserveNow: 2419 authorization_reference: Optional[str] 2420 evse_uid: Optional[str] 2421 expiry_date: str 2422 location_id: str 2423 reservation_id: str 2424 response_url: str 2425 token: Token 2426 2427 def __init__(self, authorization_reference: Optional[str], evse_uid: Optional[str], expiry_date: str, location_id: str, reservation_id: str, response_url: str, token: Token) -> None: 2428 self.authorization_reference = authorization_reference 2429 self.evse_uid = evse_uid 2430 self.expiry_date = expiry_date 2431 self.location_id = location_id 2432 self.reservation_id = reservation_id 2433 self.response_url = response_url 2434 self.token = token 2435 2436 @staticmethod 2437 def from_dict(obj: Any) -> 'ReserveNow': 2438 assert isinstance(obj, dict) 2439 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 2440 evse_uid = from_union([from_none, from_str], obj.get("evse_uid")) 2441 expiry_date = from_str(obj.get("expiry_date")) 2442 location_id = from_str(obj.get("location_id")) 2443 reservation_id = from_str(obj.get("reservation_id")) 2444 response_url = from_str(obj.get("response_url")) 2445 token = Token.from_dict(obj.get("token")) 2446 return ReserveNow(authorization_reference, evse_uid, expiry_date, location_id, reservation_id, response_url, token) 2447 2448 def to_dict(self) -> dict: 2449 result: dict = {} 2450 if self.authorization_reference is not None: 2451 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 2452 if self.evse_uid is not None: 2453 result["evse_uid"] = from_union([from_none, from_str], self.evse_uid) 2454 result["expiry_date"] = from_str(self.expiry_date) 2455 result["location_id"] = from_str(self.location_id) 2456 result["reservation_id"] = from_str(self.reservation_id) 2457 result["response_url"] = from_str(self.response_url) 2458 result["token"] = to_class(Token, self.token) 2459 return result 2460 2461 2462class SessionStatus(Enum): 2463 ACTIVE = "ACTIVE" 2464 COMPLETED = "COMPLETED" 2465 INVALID = "INVALID" 2466 PENDING = "PENDING" 2467 RESERVATION = "RESERVATION" 2468 2469 2470class Session: 2471 auth_method: AuthMethod 2472 authorization_reference: Optional[str] 2473 cdr_token: CdrToken 2474 charging_periods: Optional[List[ChargingPeriod]] 2475 connector_id: str 2476 country_code: str 2477 currency: str 2478 end_date_time: Optional[str] 2479 evse_uid: str 2480 id: str 2481 kwh: float 2482 last_updated: str 2483 location_id: str 2484 meter_id: Optional[str] 2485 party_id: str 2486 start_date_time: str 2487 status: SessionStatus 2488 total_cost: Optional[Price] 2489 2490 def __init__(self, auth_method: AuthMethod, authorization_reference: Optional[str], cdr_token: CdrToken, charging_periods: Optional[List[ChargingPeriod]], connector_id: str, country_code: str, currency: str, end_date_time: Optional[str], evse_uid: str, id: str, kwh: float, last_updated: str, location_id: str, meter_id: Optional[str], party_id: str, start_date_time: str, status: SessionStatus, total_cost: Optional[Price]) -> None: 2491 self.auth_method = auth_method 2492 self.authorization_reference = authorization_reference 2493 self.cdr_token = cdr_token 2494 self.charging_periods = charging_periods 2495 self.connector_id = connector_id 2496 self.country_code = country_code 2497 self.currency = currency 2498 self.end_date_time = end_date_time 2499 self.evse_uid = evse_uid 2500 self.id = id 2501 self.kwh = kwh 2502 self.last_updated = last_updated 2503 self.location_id = location_id 2504 self.meter_id = meter_id 2505 self.party_id = party_id 2506 self.start_date_time = start_date_time 2507 self.status = status 2508 self.total_cost = total_cost 2509 2510 @staticmethod 2511 def from_dict(obj: Any) -> 'Session': 2512 assert isinstance(obj, dict) 2513 auth_method = AuthMethod(obj.get("auth_method")) 2514 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 2515 cdr_token = CdrToken.from_dict(obj.get("cdr_token")) 2516 charging_periods = from_union([from_none, lambda x: from_list(ChargingPeriod.from_dict, x)], obj.get("charging_periods")) 2517 connector_id = from_str(obj.get("connector_id")) 2518 country_code = from_str(obj.get("country_code")) 2519 currency = from_str(obj.get("currency")) 2520 end_date_time = from_union([from_none, from_str], obj.get("end_date_time")) 2521 evse_uid = from_str(obj.get("evse_uid")) 2522 id = from_str(obj.get("id")) 2523 kwh = from_float(obj.get("kwh")) 2524 last_updated = from_str(obj.get("last_updated")) 2525 location_id = from_str(obj.get("location_id")) 2526 meter_id = from_union([from_none, from_str], obj.get("meter_id")) 2527 party_id = from_str(obj.get("party_id")) 2528 start_date_time = from_str(obj.get("start_date_time")) 2529 status = SessionStatus(obj.get("status")) 2530 total_cost = from_union([from_none, Price.from_dict], obj.get("total_cost")) 2531 return Session(auth_method, authorization_reference, cdr_token, charging_periods, connector_id, country_code, currency, end_date_time, evse_uid, id, kwh, last_updated, location_id, meter_id, party_id, start_date_time, status, total_cost) 2532 2533 def to_dict(self) -> dict: 2534 result: dict = {} 2535 result["auth_method"] = to_enum(AuthMethod, self.auth_method) 2536 if self.authorization_reference is not None: 2537 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 2538 result["cdr_token"] = to_class(CdrToken, self.cdr_token) 2539 if self.charging_periods is not None: 2540 result["charging_periods"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ChargingPeriod, x), x)], self.charging_periods) 2541 result["connector_id"] = from_str(self.connector_id) 2542 result["country_code"] = from_str(self.country_code) 2543 result["currency"] = from_str(self.currency) 2544 if self.end_date_time is not None: 2545 result["end_date_time"] = from_union([from_none, from_str], self.end_date_time) 2546 result["evse_uid"] = from_str(self.evse_uid) 2547 result["id"] = from_str(self.id) 2548 result["kwh"] = to_float(self.kwh) 2549 result["last_updated"] = from_str(self.last_updated) 2550 result["location_id"] = from_str(self.location_id) 2551 if self.meter_id is not None: 2552 result["meter_id"] = from_union([from_none, from_str], self.meter_id) 2553 result["party_id"] = from_str(self.party_id) 2554 result["start_date_time"] = from_str(self.start_date_time) 2555 result["status"] = to_enum(SessionStatus, self.status) 2556 if self.total_cost is not None: 2557 result["total_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_cost) 2558 return result 2559 2560 2561class SetChargingProfile: 2562 charging_profile: ChargingProfile 2563 response_url: str 2564 2565 def __init__(self, charging_profile: ChargingProfile, response_url: str) -> None: 2566 self.charging_profile = charging_profile 2567 self.response_url = response_url 2568 2569 @staticmethod 2570 def from_dict(obj: Any) -> 'SetChargingProfile': 2571 assert isinstance(obj, dict) 2572 charging_profile = ChargingProfile.from_dict(obj.get("charging_profile")) 2573 response_url = from_str(obj.get("response_url")) 2574 return SetChargingProfile(charging_profile, response_url) 2575 2576 def to_dict(self) -> dict: 2577 result: dict = {} 2578 result["charging_profile"] = to_class(ChargingProfile, self.charging_profile) 2579 result["response_url"] = from_str(self.response_url) 2580 return result 2581 2582 2583class StartSession: 2584 authorization_reference: Optional[str] 2585 connector_id: Optional[str] 2586 evse_uid: Optional[str] 2587 location_id: str 2588 response_url: str 2589 token: Token 2590 2591 def __init__(self, authorization_reference: Optional[str], connector_id: Optional[str], evse_uid: Optional[str], location_id: str, response_url: str, token: Token) -> None: 2592 self.authorization_reference = authorization_reference 2593 self.connector_id = connector_id 2594 self.evse_uid = evse_uid 2595 self.location_id = location_id 2596 self.response_url = response_url 2597 self.token = token 2598 2599 @staticmethod 2600 def from_dict(obj: Any) -> 'StartSession': 2601 assert isinstance(obj, dict) 2602 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 2603 connector_id = from_union([from_none, from_str], obj.get("connector_id")) 2604 evse_uid = from_union([from_none, from_str], obj.get("evse_uid")) 2605 location_id = from_str(obj.get("location_id")) 2606 response_url = from_str(obj.get("response_url")) 2607 token = Token.from_dict(obj.get("token")) 2608 return StartSession(authorization_reference, connector_id, evse_uid, location_id, response_url, token) 2609 2610 def to_dict(self) -> dict: 2611 result: dict = {} 2612 if self.authorization_reference is not None: 2613 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 2614 if self.connector_id is not None: 2615 result["connector_id"] = from_union([from_none, from_str], self.connector_id) 2616 if self.evse_uid is not None: 2617 result["evse_uid"] = from_union([from_none, from_str], self.evse_uid) 2618 result["location_id"] = from_str(self.location_id) 2619 result["response_url"] = from_str(self.response_url) 2620 result["token"] = to_class(Token, self.token) 2621 return result 2622 2623 2624class StopSession: 2625 response_url: str 2626 session_id: str 2627 2628 def __init__(self, response_url: str, session_id: str) -> None: 2629 self.response_url = response_url 2630 self.session_id = session_id 2631 2632 @staticmethod 2633 def from_dict(obj: Any) -> 'StopSession': 2634 assert isinstance(obj, dict) 2635 response_url = from_str(obj.get("response_url")) 2636 session_id = from_str(obj.get("session_id")) 2637 return StopSession(response_url, session_id) 2638 2639 def to_dict(self) -> dict: 2640 result: dict = {} 2641 result["response_url"] = from_str(self.response_url) 2642 result["session_id"] = from_str(self.session_id) 2643 return result 2644 2645 2646class UnlockConnector: 2647 connector_id: str 2648 evse_uid: str 2649 location_id: str 2650 response_url: str 2651 2652 def __init__(self, connector_id: str, evse_uid: str, location_id: str, response_url: str) -> None: 2653 self.connector_id = connector_id 2654 self.evse_uid = evse_uid 2655 self.location_id = location_id 2656 self.response_url = response_url 2657 2658 @staticmethod 2659 def from_dict(obj: Any) -> 'UnlockConnector': 2660 assert isinstance(obj, dict) 2661 connector_id = from_str(obj.get("connector_id")) 2662 evse_uid = from_str(obj.get("evse_uid")) 2663 location_id = from_str(obj.get("location_id")) 2664 response_url = from_str(obj.get("response_url")) 2665 return UnlockConnector(connector_id, evse_uid, location_id, response_url) 2666 2667 def to_dict(self) -> dict: 2668 result: dict = {} 2669 result["connector_id"] = from_str(self.connector_id) 2670 result["evse_uid"] = from_str(self.evse_uid) 2671 result["location_id"] = from_str(self.location_id) 2672 result["response_url"] = from_str(self.response_url) 2673 return result 2674 2675 2676class VersionNumber(Enum): 2677 THE_20 = "2.0" 2678 THE_21 = "2.1" 2679 THE_211 = "2.1.1" 2680 THE_22 = "2.2" 2681 THE_221 = "2.2.1" 2682 THE_230 = "2.3.0" 2683 2684 2685class Version: 2686 url: str 2687 version: VersionNumber 2688 2689 def __init__(self, url: str, version: VersionNumber) -> None: 2690 self.url = url 2691 self.version = version 2692 2693 @staticmethod 2694 def from_dict(obj: Any) -> 'Version': 2695 assert isinstance(obj, dict) 2696 url = from_str(obj.get("url")) 2697 version = VersionNumber(obj.get("version")) 2698 return Version(url, version) 2699 2700 def to_dict(self) -> dict: 2701 result: dict = {} 2702 result["url"] = from_str(self.url) 2703 result["version"] = to_enum(VersionNumber, self.version) 2704 return result 2705 2706 2707class VersionDetails: 2708 endpoints: List[Endpoint] 2709 version: VersionNumber 2710 2711 def __init__(self, endpoints: List[Endpoint], version: VersionNumber) -> None: 2712 self.endpoints = endpoints 2713 self.version = version 2714 2715 @staticmethod 2716 def from_dict(obj: Any) -> 'VersionDetails': 2717 assert isinstance(obj, dict) 2718 endpoints = from_list(Endpoint.from_dict, obj.get("endpoints")) 2719 version = VersionNumber(obj.get("version")) 2720 return VersionDetails(endpoints, version) 2721 2722 def to_dict(self) -> dict: 2723 result: dict = {} 2724 result["endpoints"] = from_list(lambda x: to_class(Endpoint, x), self.endpoints) 2725 result["version"] = to_enum(VersionNumber, self.version) 2726 return result 2727 2728 2729class V230: 2730 active_charging_profile: Optional[ActiveChargingProfile] 2731 active_charging_profile_result: Optional[ActiveChargingProfileResult] 2732 authorization_info: Optional[AuthorizationInfo] 2733 cancel_reservation: Optional[CancelReservation] 2734 cdr: Optional[Cdr] 2735 charging_preferences: Optional[ChargingPreferences] 2736 charging_profile: Optional[ChargingProfile] 2737 charging_profile_response: Optional[ChargingProfileResponse] 2738 charging_profile_result: Optional[ChargingProfileResult] 2739 clear_profile_result: Optional[ClearProfileResult] 2740 command_response: Optional[CommandResponse] 2741 command_result: Optional[CommandResult] 2742 connector: Optional[Connector] 2743 credentials: Optional[Credentials] 2744 endpoint: Optional[Endpoint] 2745 evse: Optional[Evse] 2746 hub_client_info: Optional[HubClientInfo] 2747 location: Optional[Location] 2748 location_references: Optional[LocationReferences] 2749 reserve_now: Optional[ReserveNow] 2750 session: Optional[Session] 2751 set_charging_profile: Optional[SetChargingProfile] 2752 start_session: Optional[StartSession] 2753 stop_session: Optional[StopSession] 2754 tariff: Optional[Tariff] 2755 token: Optional[Token] 2756 unlock_connector: Optional[UnlockConnector] 2757 version: Optional[Version] 2758 version_details: Optional[VersionDetails] 2759 2760 def __init__(self, active_charging_profile: Optional[ActiveChargingProfile], active_charging_profile_result: Optional[ActiveChargingProfileResult], authorization_info: Optional[AuthorizationInfo], cancel_reservation: Optional[CancelReservation], cdr: Optional[Cdr], charging_preferences: Optional[ChargingPreferences], charging_profile: Optional[ChargingProfile], charging_profile_response: Optional[ChargingProfileResponse], charging_profile_result: Optional[ChargingProfileResult], clear_profile_result: Optional[ClearProfileResult], command_response: Optional[CommandResponse], command_result: Optional[CommandResult], connector: Optional[Connector], credentials: Optional[Credentials], endpoint: Optional[Endpoint], evse: Optional[Evse], hub_client_info: Optional[HubClientInfo], location: Optional[Location], location_references: Optional[LocationReferences], reserve_now: Optional[ReserveNow], session: Optional[Session], set_charging_profile: Optional[SetChargingProfile], start_session: Optional[StartSession], stop_session: Optional[StopSession], tariff: Optional[Tariff], token: Optional[Token], unlock_connector: Optional[UnlockConnector], version: Optional[Version], version_details: Optional[VersionDetails]) -> None: 2761 self.active_charging_profile = active_charging_profile 2762 self.active_charging_profile_result = active_charging_profile_result 2763 self.authorization_info = authorization_info 2764 self.cancel_reservation = cancel_reservation 2765 self.cdr = cdr 2766 self.charging_preferences = charging_preferences 2767 self.charging_profile = charging_profile 2768 self.charging_profile_response = charging_profile_response 2769 self.charging_profile_result = charging_profile_result 2770 self.clear_profile_result = clear_profile_result 2771 self.command_response = command_response 2772 self.command_result = command_result 2773 self.connector = connector 2774 self.credentials = credentials 2775 self.endpoint = endpoint 2776 self.evse = evse 2777 self.hub_client_info = hub_client_info 2778 self.location = location 2779 self.location_references = location_references 2780 self.reserve_now = reserve_now 2781 self.session = session 2782 self.set_charging_profile = set_charging_profile 2783 self.start_session = start_session 2784 self.stop_session = stop_session 2785 self.tariff = tariff 2786 self.token = token 2787 self.unlock_connector = unlock_connector 2788 self.version = version 2789 self.version_details = version_details 2790 2791 @staticmethod 2792 def from_dict(obj: Any) -> 'V230': 2793 assert isinstance(obj, dict) 2794 active_charging_profile = from_union([ActiveChargingProfile.from_dict, from_none], obj.get("active_charging_profile")) 2795 active_charging_profile_result = from_union([ActiveChargingProfileResult.from_dict, from_none], obj.get("active_charging_profile_result")) 2796 authorization_info = from_union([AuthorizationInfo.from_dict, from_none], obj.get("authorization_info")) 2797 cancel_reservation = from_union([CancelReservation.from_dict, from_none], obj.get("cancel_reservation")) 2798 cdr = from_union([Cdr.from_dict, from_none], obj.get("cdr")) 2799 charging_preferences = from_union([ChargingPreferences.from_dict, from_none], obj.get("charging_preferences")) 2800 charging_profile = from_union([ChargingProfile.from_dict, from_none], obj.get("charging_profile")) 2801 charging_profile_response = from_union([ChargingProfileResponse.from_dict, from_none], obj.get("charging_profile_response")) 2802 charging_profile_result = from_union([ChargingProfileResult.from_dict, from_none], obj.get("charging_profile_result")) 2803 clear_profile_result = from_union([ClearProfileResult.from_dict, from_none], obj.get("clear_profile_result")) 2804 command_response = from_union([CommandResponse.from_dict, from_none], obj.get("command_response")) 2805 command_result = from_union([CommandResult.from_dict, from_none], obj.get("command_result")) 2806 connector = from_union([Connector.from_dict, from_none], obj.get("connector")) 2807 credentials = from_union([Credentials.from_dict, from_none], obj.get("credentials")) 2808 endpoint = from_union([Endpoint.from_dict, from_none], obj.get("endpoint")) 2809 evse = from_union([Evse.from_dict, from_none], obj.get("evse")) 2810 hub_client_info = from_union([HubClientInfo.from_dict, from_none], obj.get("hub_client_info")) 2811 location = from_union([Location.from_dict, from_none], obj.get("location")) 2812 location_references = from_union([from_none, LocationReferences.from_dict], obj.get("location_references")) 2813 reserve_now = from_union([ReserveNow.from_dict, from_none], obj.get("reserve_now")) 2814 session = from_union([Session.from_dict, from_none], obj.get("session")) 2815 set_charging_profile = from_union([SetChargingProfile.from_dict, from_none], obj.get("set_charging_profile")) 2816 start_session = from_union([StartSession.from_dict, from_none], obj.get("start_session")) 2817 stop_session = from_union([StopSession.from_dict, from_none], obj.get("stop_session")) 2818 tariff = from_union([Tariff.from_dict, from_none], obj.get("tariff")) 2819 token = from_union([Token.from_dict, from_none], obj.get("token")) 2820 unlock_connector = from_union([UnlockConnector.from_dict, from_none], obj.get("unlock_connector")) 2821 version = from_union([Version.from_dict, from_none], obj.get("version")) 2822 version_details = from_union([VersionDetails.from_dict, from_none], obj.get("version_details")) 2823 return V230(active_charging_profile, active_charging_profile_result, authorization_info, cancel_reservation, cdr, charging_preferences, charging_profile, charging_profile_response, charging_profile_result, clear_profile_result, command_response, command_result, connector, credentials, endpoint, evse, hub_client_info, location, location_references, reserve_now, session, set_charging_profile, start_session, stop_session, tariff, token, unlock_connector, version, version_details) 2824 2825 def to_dict(self) -> dict: 2826 result: dict = {} 2827 if self.active_charging_profile is not None: 2828 result["active_charging_profile"] = from_union([lambda x: to_class(ActiveChargingProfile, x), from_none], self.active_charging_profile) 2829 if self.active_charging_profile_result is not None: 2830 result["active_charging_profile_result"] = from_union([lambda x: to_class(ActiveChargingProfileResult, x), from_none], self.active_charging_profile_result) 2831 if self.authorization_info is not None: 2832 result["authorization_info"] = from_union([lambda x: to_class(AuthorizationInfo, x), from_none], self.authorization_info) 2833 if self.cancel_reservation is not None: 2834 result["cancel_reservation"] = from_union([lambda x: to_class(CancelReservation, x), from_none], self.cancel_reservation) 2835 if self.cdr is not None: 2836 result["cdr"] = from_union([lambda x: to_class(Cdr, x), from_none], self.cdr) 2837 if self.charging_preferences is not None: 2838 result["charging_preferences"] = from_union([lambda x: to_class(ChargingPreferences, x), from_none], self.charging_preferences) 2839 if self.charging_profile is not None: 2840 result["charging_profile"] = from_union([lambda x: to_class(ChargingProfile, x), from_none], self.charging_profile) 2841 if self.charging_profile_response is not None: 2842 result["charging_profile_response"] = from_union([lambda x: to_class(ChargingProfileResponse, x), from_none], self.charging_profile_response) 2843 if self.charging_profile_result is not None: 2844 result["charging_profile_result"] = from_union([lambda x: to_class(ChargingProfileResult, x), from_none], self.charging_profile_result) 2845 if self.clear_profile_result is not None: 2846 result["clear_profile_result"] = from_union([lambda x: to_class(ClearProfileResult, x), from_none], self.clear_profile_result) 2847 if self.command_response is not None: 2848 result["command_response"] = from_union([lambda x: to_class(CommandResponse, x), from_none], self.command_response) 2849 if self.command_result is not None: 2850 result["command_result"] = from_union([lambda x: to_class(CommandResult, x), from_none], self.command_result) 2851 if self.connector is not None: 2852 result["connector"] = from_union([lambda x: to_class(Connector, x), from_none], self.connector) 2853 if self.credentials is not None: 2854 result["credentials"] = from_union([lambda x: to_class(Credentials, x), from_none], self.credentials) 2855 if self.endpoint is not None: 2856 result["endpoint"] = from_union([lambda x: to_class(Endpoint, x), from_none], self.endpoint) 2857 if self.evse is not None: 2858 result["evse"] = from_union([lambda x: to_class(Evse, x), from_none], self.evse) 2859 if self.hub_client_info is not None: 2860 result["hub_client_info"] = from_union([lambda x: to_class(HubClientInfo, x), from_none], self.hub_client_info) 2861 if self.location is not None: 2862 result["location"] = from_union([lambda x: to_class(Location, x), from_none], self.location) 2863 if self.location_references is not None: 2864 result["location_references"] = from_union([from_none, lambda x: to_class(LocationReferences, x)], self.location_references) 2865 if self.reserve_now is not None: 2866 result["reserve_now"] = from_union([lambda x: to_class(ReserveNow, x), from_none], self.reserve_now) 2867 if self.session is not None: 2868 result["session"] = from_union([lambda x: to_class(Session, x), from_none], self.session) 2869 if self.set_charging_profile is not None: 2870 result["set_charging_profile"] = from_union([lambda x: to_class(SetChargingProfile, x), from_none], self.set_charging_profile) 2871 if self.start_session is not None: 2872 result["start_session"] = from_union([lambda x: to_class(StartSession, x), from_none], self.start_session) 2873 if self.stop_session is not None: 2874 result["stop_session"] = from_union([lambda x: to_class(StopSession, x), from_none], self.stop_session) 2875 if self.tariff is not None: 2876 result["tariff"] = from_union([lambda x: to_class(Tariff, x), from_none], self.tariff) 2877 if self.token is not None: 2878 result["token"] = from_union([lambda x: to_class(Token, x), from_none], self.token) 2879 if self.unlock_connector is not None: 2880 result["unlock_connector"] = from_union([lambda x: to_class(UnlockConnector, x), from_none], self.unlock_connector) 2881 if self.version is not None: 2882 result["version"] = from_union([lambda x: to_class(Version, x), from_none], self.version) 2883 if self.version_details is not None: 2884 result["version_details"] = from_union([lambda x: to_class(VersionDetails, x), from_none], self.version_details) 2885 return result 2886 2887 2888def v230_from_dict(s: Any) -> V230: 2889 return V230.from_dict(s) 2890 2891 2892def v230_to_dict(x: V230) -> Any: 2893 return to_class(V230, x)
def
from_float(x: Any) -> float:
def
from_int(x: Any) -> int:
def
to_float(x: Any) -> float:
def
from_none(x: Any) -> Any:
def
from_list(f: Callable[[Any], ~T], x: Any) -> List[~T]:
def
from_union(fs, x):
def
from_str(x: Any) -> str:
def
to_class(c: Type[~T], x: Any) -> dict:
def
to_enum(c: Type[~EnumT], x: Any) -> ~EnumT:
def
from_bool(x: Any) -> bool:
class
ChargingProfilePeriod:
64class ChargingProfilePeriod: 65 limit: float 66 start_period: int 67 68 def __init__(self, limit: float, start_period: int) -> None: 69 self.limit = limit 70 self.start_period = start_period 71 72 @staticmethod 73 def from_dict(obj: Any) -> 'ChargingProfilePeriod': 74 assert isinstance(obj, dict) 75 limit = from_float(obj.get("limit")) 76 start_period = from_int(obj.get("start_period")) 77 return ChargingProfilePeriod(limit, start_period) 78 79 def to_dict(self) -> dict: 80 result: dict = {} 81 result["limit"] = to_float(self.limit) 82 result["start_period"] = from_int(self.start_period) 83 return result
class
ChargingRateUnit(enum.Enum):
A =
<ChargingRateUnit.A: 'A'>
W =
<ChargingRateUnit.W: 'W'>
class
ChargingProfile:
91class ChargingProfile: 92 charging_profile_period: Optional[List[ChargingProfilePeriod]] 93 charging_rate_unit: ChargingRateUnit 94 duration: Optional[int] 95 min_charging_rate: Optional[float] 96 start_date_time: Optional[str] 97 98 def __init__(self, charging_profile_period: Optional[List[ChargingProfilePeriod]], charging_rate_unit: ChargingRateUnit, duration: Optional[int], min_charging_rate: Optional[float], start_date_time: Optional[str]) -> None: 99 self.charging_profile_period = charging_profile_period 100 self.charging_rate_unit = charging_rate_unit 101 self.duration = duration 102 self.min_charging_rate = min_charging_rate 103 self.start_date_time = start_date_time 104 105 @staticmethod 106 def from_dict(obj: Any) -> 'ChargingProfile': 107 assert isinstance(obj, dict) 108 charging_profile_period = from_union([from_none, lambda x: from_list(ChargingProfilePeriod.from_dict, x)], obj.get("charging_profile_period")) 109 charging_rate_unit = ChargingRateUnit(obj.get("charging_rate_unit")) 110 duration = from_union([from_none, from_int], obj.get("duration")) 111 min_charging_rate = from_union([from_none, from_float], obj.get("min_charging_rate")) 112 start_date_time = from_union([from_none, from_str], obj.get("start_date_time")) 113 return ChargingProfile(charging_profile_period, charging_rate_unit, duration, min_charging_rate, start_date_time) 114 115 def to_dict(self) -> dict: 116 result: dict = {} 117 if self.charging_profile_period is not None: 118 result["charging_profile_period"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ChargingProfilePeriod, x), x)], self.charging_profile_period) 119 result["charging_rate_unit"] = to_enum(ChargingRateUnit, self.charging_rate_unit) 120 if self.duration is not None: 121 result["duration"] = from_union([from_none, from_int], self.duration) 122 if self.min_charging_rate is not None: 123 result["min_charging_rate"] = from_union([from_none, to_float], self.min_charging_rate) 124 if self.start_date_time is not None: 125 result["start_date_time"] = from_union([from_none, from_str], self.start_date_time) 126 return result
ChargingProfile( charging_profile_period: Optional[List[ChargingProfilePeriod]], charging_rate_unit: ChargingRateUnit, duration: Optional[int], min_charging_rate: Optional[float], start_date_time: Optional[str])
98 def __init__(self, charging_profile_period: Optional[List[ChargingProfilePeriod]], charging_rate_unit: ChargingRateUnit, duration: Optional[int], min_charging_rate: Optional[float], start_date_time: Optional[str]) -> None: 99 self.charging_profile_period = charging_profile_period 100 self.charging_rate_unit = charging_rate_unit 101 self.duration = duration 102 self.min_charging_rate = min_charging_rate 103 self.start_date_time = start_date_time
charging_profile_period: Optional[List[ChargingProfilePeriod]]
charging_rate_unit: ChargingRateUnit
105 @staticmethod 106 def from_dict(obj: Any) -> 'ChargingProfile': 107 assert isinstance(obj, dict) 108 charging_profile_period = from_union([from_none, lambda x: from_list(ChargingProfilePeriod.from_dict, x)], obj.get("charging_profile_period")) 109 charging_rate_unit = ChargingRateUnit(obj.get("charging_rate_unit")) 110 duration = from_union([from_none, from_int], obj.get("duration")) 111 min_charging_rate = from_union([from_none, from_float], obj.get("min_charging_rate")) 112 start_date_time = from_union([from_none, from_str], obj.get("start_date_time")) 113 return ChargingProfile(charging_profile_period, charging_rate_unit, duration, min_charging_rate, start_date_time)
def
to_dict(self) -> dict:
115 def to_dict(self) -> dict: 116 result: dict = {} 117 if self.charging_profile_period is not None: 118 result["charging_profile_period"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ChargingProfilePeriod, x), x)], self.charging_profile_period) 119 result["charging_rate_unit"] = to_enum(ChargingRateUnit, self.charging_rate_unit) 120 if self.duration is not None: 121 result["duration"] = from_union([from_none, from_int], self.duration) 122 if self.min_charging_rate is not None: 123 result["min_charging_rate"] = from_union([from_none, to_float], self.min_charging_rate) 124 if self.start_date_time is not None: 125 result["start_date_time"] = from_union([from_none, from_str], self.start_date_time) 126 return result
class
ActiveChargingProfile:
129class ActiveChargingProfile: 130 charging_profile: ChargingProfile 131 start_date_time: str 132 133 def __init__(self, charging_profile: ChargingProfile, start_date_time: str) -> None: 134 self.charging_profile = charging_profile 135 self.start_date_time = start_date_time 136 137 @staticmethod 138 def from_dict(obj: Any) -> 'ActiveChargingProfile': 139 assert isinstance(obj, dict) 140 charging_profile = ChargingProfile.from_dict(obj.get("charging_profile")) 141 start_date_time = from_str(obj.get("start_date_time")) 142 return ActiveChargingProfile(charging_profile, start_date_time) 143 144 def to_dict(self) -> dict: 145 result: dict = {} 146 result["charging_profile"] = to_class(ChargingProfile, self.charging_profile) 147 result["start_date_time"] = from_str(self.start_date_time) 148 return result
ActiveChargingProfile(charging_profile: ChargingProfile, start_date_time: str)
charging_profile: ChargingProfile
137 @staticmethod 138 def from_dict(obj: Any) -> 'ActiveChargingProfile': 139 assert isinstance(obj, dict) 140 charging_profile = ChargingProfile.from_dict(obj.get("charging_profile")) 141 start_date_time = from_str(obj.get("start_date_time")) 142 return ActiveChargingProfile(charging_profile, start_date_time)
class
ChargingProfileResultType(enum.Enum):
151class ChargingProfileResultType(Enum): 152 ACCEPTED = "ACCEPTED" 153 REJECTED = "REJECTED" 154 UNKNOWN = "UNKNOWN"
ACCEPTED =
<ChargingProfileResultType.ACCEPTED: 'ACCEPTED'>
REJECTED =
<ChargingProfileResultType.REJECTED: 'REJECTED'>
UNKNOWN =
<ChargingProfileResultType.UNKNOWN: 'UNKNOWN'>
class
ActiveChargingProfileResult:
157class ActiveChargingProfileResult: 158 profile: Optional[ActiveChargingProfile] 159 result: ChargingProfileResultType 160 161 def __init__(self, profile: Optional[ActiveChargingProfile], result: ChargingProfileResultType) -> None: 162 self.profile = profile 163 self.result = result 164 165 @staticmethod 166 def from_dict(obj: Any) -> 'ActiveChargingProfileResult': 167 assert isinstance(obj, dict) 168 profile = from_union([ActiveChargingProfile.from_dict, from_none], obj.get("profile")) 169 result = ChargingProfileResultType(obj.get("result")) 170 return ActiveChargingProfileResult(profile, result) 171 172 def to_dict(self) -> dict: 173 result: dict = {} 174 if self.profile is not None: 175 result["profile"] = from_union([lambda x: to_class(ActiveChargingProfile, x), from_none], self.profile) 176 result["result"] = to_enum(ChargingProfileResultType, self.result) 177 return result
ActiveChargingProfileResult( profile: Optional[ActiveChargingProfile], result: ChargingProfileResultType)
profile: Optional[ActiveChargingProfile]
result: ChargingProfileResultType
165 @staticmethod 166 def from_dict(obj: Any) -> 'ActiveChargingProfileResult': 167 assert isinstance(obj, dict) 168 profile = from_union([ActiveChargingProfile.from_dict, from_none], obj.get("profile")) 169 result = ChargingProfileResultType(obj.get("result")) 170 return ActiveChargingProfileResult(profile, result)
class
AllowedType(enum.Enum):
180class AllowedType(Enum): 181 ALLOWED = "ALLOWED" 182 BLOCKED = "BLOCKED" 183 EXPIRED = "EXPIRED" 184 NOT_ALLOWED = "NOT_ALLOWED" 185 NO_CREDIT = "NO_CREDIT"
ALLOWED =
<AllowedType.ALLOWED: 'ALLOWED'>
BLOCKED =
<AllowedType.BLOCKED: 'BLOCKED'>
EXPIRED =
<AllowedType.EXPIRED: 'EXPIRED'>
NOT_ALLOWED =
<AllowedType.NOT_ALLOWED: 'NOT_ALLOWED'>
NO_CREDIT =
<AllowedType.NO_CREDIT: 'NO_CREDIT'>
class
DisplayText:
188class DisplayText: 189 language: str 190 text: str 191 192 def __init__(self, language: str, text: str) -> None: 193 self.language = language 194 self.text = text 195 196 @staticmethod 197 def from_dict(obj: Any) -> 'DisplayText': 198 assert isinstance(obj, dict) 199 language = from_str(obj.get("language")) 200 text = from_str(obj.get("text")) 201 return DisplayText(language, text) 202 203 def to_dict(self) -> dict: 204 result: dict = {} 205 result["language"] = from_str(self.language) 206 result["text"] = from_str(self.text) 207 return result
class
LocationReferences:
210class LocationReferences: 211 evse_uids: Optional[List[str]] 212 location_id: str 213 214 def __init__(self, evse_uids: Optional[List[str]], location_id: str) -> None: 215 self.evse_uids = evse_uids 216 self.location_id = location_id 217 218 @staticmethod 219 def from_dict(obj: Any) -> 'LocationReferences': 220 assert isinstance(obj, dict) 221 evse_uids = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("evse_uids")) 222 location_id = from_str(obj.get("location_id")) 223 return LocationReferences(evse_uids, location_id) 224 225 def to_dict(self) -> dict: 226 result: dict = {} 227 if self.evse_uids is not None: 228 result["evse_uids"] = from_union([from_none, lambda x: from_list(from_str, x)], self.evse_uids) 229 result["location_id"] = from_str(self.location_id) 230 return result
218 @staticmethod 219 def from_dict(obj: Any) -> 'LocationReferences': 220 assert isinstance(obj, dict) 221 evse_uids = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("evse_uids")) 222 location_id = from_str(obj.get("location_id")) 223 return LocationReferences(evse_uids, location_id)
class
ProfileType(enum.Enum):
233class ProfileType(Enum): 234 CHEAP = "CHEAP" 235 FAST = "FAST" 236 GREEN = "GREEN" 237 REGULAR = "REGULAR"
CHEAP =
<ProfileType.CHEAP: 'CHEAP'>
FAST =
<ProfileType.FAST: 'FAST'>
GREEN =
<ProfileType.GREEN: 'GREEN'>
REGULAR =
<ProfileType.REGULAR: 'REGULAR'>
class
EnergyContract:
240class EnergyContract: 241 contract_id: Optional[str] 242 supplier_name: str 243 244 def __init__(self, contract_id: Optional[str], supplier_name: str) -> None: 245 self.contract_id = contract_id 246 self.supplier_name = supplier_name 247 248 @staticmethod 249 def from_dict(obj: Any) -> 'EnergyContract': 250 assert isinstance(obj, dict) 251 contract_id = from_union([from_none, from_str], obj.get("contract_id")) 252 supplier_name = from_str(obj.get("supplier_name")) 253 return EnergyContract(contract_id, supplier_name) 254 255 def to_dict(self) -> dict: 256 result: dict = {} 257 if self.contract_id is not None: 258 result["contract_id"] = from_union([from_none, from_str], self.contract_id) 259 result["supplier_name"] = from_str(self.supplier_name) 260 return result
class
TokenType(enum.Enum):
263class TokenType(Enum): 264 AD_HOC_USER = "AD_HOC_USER" 265 APP_USER = "APP_USER" 266 EMAID = "EMAID" 267 OTHER = "OTHER" 268 RFID = "RFID"
AD_HOC_USER =
<TokenType.AD_HOC_USER: 'AD_HOC_USER'>
APP_USER =
<TokenType.APP_USER: 'APP_USER'>
EMAID =
<TokenType.EMAID: 'EMAID'>
OTHER =
<TokenType.OTHER: 'OTHER'>
RFID =
<TokenType.RFID: 'RFID'>
class
WhitelistType(enum.Enum):
271class WhitelistType(Enum): 272 ALLOWED = "ALLOWED" 273 ALLOWED_OFFLINE = "ALLOWED_OFFLINE" 274 ALWAYS = "ALWAYS" 275 NEVER = "NEVER"
ALLOWED =
<WhitelistType.ALLOWED: 'ALLOWED'>
ALLOWED_OFFLINE =
<WhitelistType.ALLOWED_OFFLINE: 'ALLOWED_OFFLINE'>
ALWAYS =
<WhitelistType.ALWAYS: 'ALWAYS'>
NEVER =
<WhitelistType.NEVER: 'NEVER'>
class
Token:
278class Token: 279 contract_id: str 280 country_code: str 281 default_profile_type: Optional[ProfileType] 282 energy_contract: Optional[EnergyContract] 283 group_id: Optional[str] 284 issuer: str 285 language: Optional[str] 286 last_updated: str 287 party_id: str 288 type: TokenType 289 uid: str 290 valid: bool 291 visual_number: Optional[str] 292 whitelist: WhitelistType 293 294 def __init__(self, contract_id: str, country_code: str, default_profile_type: Optional[ProfileType], energy_contract: Optional[EnergyContract], group_id: Optional[str], issuer: str, language: Optional[str], last_updated: str, party_id: str, type: TokenType, uid: str, valid: bool, visual_number: Optional[str], whitelist: WhitelistType) -> None: 295 self.contract_id = contract_id 296 self.country_code = country_code 297 self.default_profile_type = default_profile_type 298 self.energy_contract = energy_contract 299 self.group_id = group_id 300 self.issuer = issuer 301 self.language = language 302 self.last_updated = last_updated 303 self.party_id = party_id 304 self.type = type 305 self.uid = uid 306 self.valid = valid 307 self.visual_number = visual_number 308 self.whitelist = whitelist 309 310 @staticmethod 311 def from_dict(obj: Any) -> 'Token': 312 assert isinstance(obj, dict) 313 contract_id = from_str(obj.get("contract_id")) 314 country_code = from_str(obj.get("country_code")) 315 default_profile_type = from_union([from_none, ProfileType], obj.get("default_profile_type")) 316 energy_contract = from_union([from_none, EnergyContract.from_dict], obj.get("energy_contract")) 317 group_id = from_union([from_none, from_str], obj.get("group_id")) 318 issuer = from_str(obj.get("issuer")) 319 language = from_union([from_none, from_str], obj.get("language")) 320 last_updated = from_str(obj.get("last_updated")) 321 party_id = from_str(obj.get("party_id")) 322 type = TokenType(obj.get("type")) 323 uid = from_str(obj.get("uid")) 324 valid = from_bool(obj.get("valid")) 325 visual_number = from_union([from_none, from_str], obj.get("visual_number")) 326 whitelist = WhitelistType(obj.get("whitelist")) 327 return Token(contract_id, country_code, default_profile_type, energy_contract, group_id, issuer, language, last_updated, party_id, type, uid, valid, visual_number, whitelist) 328 329 def to_dict(self) -> dict: 330 result: dict = {} 331 result["contract_id"] = from_str(self.contract_id) 332 result["country_code"] = from_str(self.country_code) 333 if self.default_profile_type is not None: 334 result["default_profile_type"] = from_union([from_none, lambda x: to_enum(ProfileType, x)], self.default_profile_type) 335 if self.energy_contract is not None: 336 result["energy_contract"] = from_union([from_none, lambda x: to_class(EnergyContract, x)], self.energy_contract) 337 if self.group_id is not None: 338 result["group_id"] = from_union([from_none, from_str], self.group_id) 339 result["issuer"] = from_str(self.issuer) 340 if self.language is not None: 341 result["language"] = from_union([from_none, from_str], self.language) 342 result["last_updated"] = from_str(self.last_updated) 343 result["party_id"] = from_str(self.party_id) 344 result["type"] = to_enum(TokenType, self.type) 345 result["uid"] = from_str(self.uid) 346 result["valid"] = from_bool(self.valid) 347 if self.visual_number is not None: 348 result["visual_number"] = from_union([from_none, from_str], self.visual_number) 349 result["whitelist"] = to_enum(WhitelistType, self.whitelist) 350 return result
Token( contract_id: str, country_code: str, default_profile_type: Optional[ProfileType], energy_contract: Optional[EnergyContract], group_id: Optional[str], issuer: str, language: Optional[str], last_updated: str, party_id: str, type: TokenType, uid: str, valid: bool, visual_number: Optional[str], whitelist: WhitelistType)
294 def __init__(self, contract_id: str, country_code: str, default_profile_type: Optional[ProfileType], energy_contract: Optional[EnergyContract], group_id: Optional[str], issuer: str, language: Optional[str], last_updated: str, party_id: str, type: TokenType, uid: str, valid: bool, visual_number: Optional[str], whitelist: WhitelistType) -> None: 295 self.contract_id = contract_id 296 self.country_code = country_code 297 self.default_profile_type = default_profile_type 298 self.energy_contract = energy_contract 299 self.group_id = group_id 300 self.issuer = issuer 301 self.language = language 302 self.last_updated = last_updated 303 self.party_id = party_id 304 self.type = type 305 self.uid = uid 306 self.valid = valid 307 self.visual_number = visual_number 308 self.whitelist = whitelist
default_profile_type: Optional[ProfileType]
energy_contract: Optional[EnergyContract]
type: TokenType
whitelist: WhitelistType
310 @staticmethod 311 def from_dict(obj: Any) -> 'Token': 312 assert isinstance(obj, dict) 313 contract_id = from_str(obj.get("contract_id")) 314 country_code = from_str(obj.get("country_code")) 315 default_profile_type = from_union([from_none, ProfileType], obj.get("default_profile_type")) 316 energy_contract = from_union([from_none, EnergyContract.from_dict], obj.get("energy_contract")) 317 group_id = from_union([from_none, from_str], obj.get("group_id")) 318 issuer = from_str(obj.get("issuer")) 319 language = from_union([from_none, from_str], obj.get("language")) 320 last_updated = from_str(obj.get("last_updated")) 321 party_id = from_str(obj.get("party_id")) 322 type = TokenType(obj.get("type")) 323 uid = from_str(obj.get("uid")) 324 valid = from_bool(obj.get("valid")) 325 visual_number = from_union([from_none, from_str], obj.get("visual_number")) 326 whitelist = WhitelistType(obj.get("whitelist")) 327 return Token(contract_id, country_code, default_profile_type, energy_contract, group_id, issuer, language, last_updated, party_id, type, uid, valid, visual_number, whitelist)
def
to_dict(self) -> dict:
329 def to_dict(self) -> dict: 330 result: dict = {} 331 result["contract_id"] = from_str(self.contract_id) 332 result["country_code"] = from_str(self.country_code) 333 if self.default_profile_type is not None: 334 result["default_profile_type"] = from_union([from_none, lambda x: to_enum(ProfileType, x)], self.default_profile_type) 335 if self.energy_contract is not None: 336 result["energy_contract"] = from_union([from_none, lambda x: to_class(EnergyContract, x)], self.energy_contract) 337 if self.group_id is not None: 338 result["group_id"] = from_union([from_none, from_str], self.group_id) 339 result["issuer"] = from_str(self.issuer) 340 if self.language is not None: 341 result["language"] = from_union([from_none, from_str], self.language) 342 result["last_updated"] = from_str(self.last_updated) 343 result["party_id"] = from_str(self.party_id) 344 result["type"] = to_enum(TokenType, self.type) 345 result["uid"] = from_str(self.uid) 346 result["valid"] = from_bool(self.valid) 347 if self.visual_number is not None: 348 result["visual_number"] = from_union([from_none, from_str], self.visual_number) 349 result["whitelist"] = to_enum(WhitelistType, self.whitelist) 350 return result
class
AuthorizationInfo:
353class AuthorizationInfo: 354 allowed: AllowedType 355 authorization_reference: Optional[str] 356 info: Optional[DisplayText] 357 location: Optional[LocationReferences] 358 token: Token 359 360 def __init__(self, allowed: AllowedType, authorization_reference: Optional[str], info: Optional[DisplayText], location: Optional[LocationReferences], token: Token) -> None: 361 self.allowed = allowed 362 self.authorization_reference = authorization_reference 363 self.info = info 364 self.location = location 365 self.token = token 366 367 @staticmethod 368 def from_dict(obj: Any) -> 'AuthorizationInfo': 369 assert isinstance(obj, dict) 370 allowed = AllowedType(obj.get("allowed")) 371 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 372 info = from_union([from_none, DisplayText.from_dict], obj.get("info")) 373 location = from_union([from_none, LocationReferences.from_dict], obj.get("location")) 374 token = Token.from_dict(obj.get("token")) 375 return AuthorizationInfo(allowed, authorization_reference, info, location, token) 376 377 def to_dict(self) -> dict: 378 result: dict = {} 379 result["allowed"] = to_enum(AllowedType, self.allowed) 380 if self.authorization_reference is not None: 381 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 382 if self.info is not None: 383 result["info"] = from_union([from_none, lambda x: to_class(DisplayText, x)], self.info) 384 if self.location is not None: 385 result["location"] = from_union([from_none, lambda x: to_class(LocationReferences, x)], self.location) 386 result["token"] = to_class(Token, self.token) 387 return result
AuthorizationInfo( allowed: AllowedType, authorization_reference: Optional[str], info: Optional[DisplayText], location: Optional[LocationReferences], token: Token)
360 def __init__(self, allowed: AllowedType, authorization_reference: Optional[str], info: Optional[DisplayText], location: Optional[LocationReferences], token: Token) -> None: 361 self.allowed = allowed 362 self.authorization_reference = authorization_reference 363 self.info = info 364 self.location = location 365 self.token = token
allowed: AllowedType
info: Optional[DisplayText]
location: Optional[LocationReferences]
token: Token
367 @staticmethod 368 def from_dict(obj: Any) -> 'AuthorizationInfo': 369 assert isinstance(obj, dict) 370 allowed = AllowedType(obj.get("allowed")) 371 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 372 info = from_union([from_none, DisplayText.from_dict], obj.get("info")) 373 location = from_union([from_none, LocationReferences.from_dict], obj.get("location")) 374 token = Token.from_dict(obj.get("token")) 375 return AuthorizationInfo(allowed, authorization_reference, info, location, token)
def
to_dict(self) -> dict:
377 def to_dict(self) -> dict: 378 result: dict = {} 379 result["allowed"] = to_enum(AllowedType, self.allowed) 380 if self.authorization_reference is not None: 381 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 382 if self.info is not None: 383 result["info"] = from_union([from_none, lambda x: to_class(DisplayText, x)], self.info) 384 if self.location is not None: 385 result["location"] = from_union([from_none, lambda x: to_class(LocationReferences, x)], self.location) 386 result["token"] = to_class(Token, self.token) 387 return result
class
CancelReservation:
390class CancelReservation: 391 reservation_id: str 392 response_url: str 393 394 def __init__(self, reservation_id: str, response_url: str) -> None: 395 self.reservation_id = reservation_id 396 self.response_url = response_url 397 398 @staticmethod 399 def from_dict(obj: Any) -> 'CancelReservation': 400 assert isinstance(obj, dict) 401 reservation_id = from_str(obj.get("reservation_id")) 402 response_url = from_str(obj.get("response_url")) 403 return CancelReservation(reservation_id, response_url) 404 405 def to_dict(self) -> dict: 406 result: dict = {} 407 result["reservation_id"] = from_str(self.reservation_id) 408 result["response_url"] = from_str(self.response_url) 409 return result
class
AuthMethod(enum.Enum):
412class AuthMethod(Enum): 413 AUTH_REQUEST = "AUTH_REQUEST" 414 COMMAND = "COMMAND" 415 WHITELIST = "WHITELIST"
AUTH_REQUEST =
<AuthMethod.AUTH_REQUEST: 'AUTH_REQUEST'>
COMMAND =
<AuthMethod.COMMAND: 'COMMAND'>
WHITELIST =
<AuthMethod.WHITELIST: 'WHITELIST'>
class
ConnectorFormat(enum.Enum):
CABLE =
<ConnectorFormat.CABLE: 'CABLE'>
SOCKET =
<ConnectorFormat.SOCKET: 'SOCKET'>
class
PowerType(enum.Enum):
423class PowerType(Enum): 424 AC_1__PHASE = "AC_1_PHASE" 425 AC_2__PHASE = "AC_2_PHASE" 426 AC_2__PHASE_SPLIT = "AC_2_PHASE_SPLIT" 427 AC_3__PHASE = "AC_3_PHASE" 428 DC = "DC"
AC_1__PHASE =
<PowerType.AC_1__PHASE: 'AC_1_PHASE'>
AC_2__PHASE =
<PowerType.AC_2__PHASE: 'AC_2_PHASE'>
AC_2__PHASE_SPLIT =
<PowerType.AC_2__PHASE_SPLIT: 'AC_2_PHASE_SPLIT'>
AC_3__PHASE =
<PowerType.AC_3__PHASE: 'AC_3_PHASE'>
DC =
<PowerType.DC: 'DC'>
class
ConnectorType(enum.Enum):
431class ConnectorType(Enum): 432 CHADEMO = "CHADEMO" 433 CHAOJI = "CHAOJI" 434 DOMESTIC_A = "DOMESTIC_A" 435 DOMESTIC_B = "DOMESTIC_B" 436 DOMESTIC_C = "DOMESTIC_C" 437 DOMESTIC_D = "DOMESTIC_D" 438 DOMESTIC_E = "DOMESTIC_E" 439 DOMESTIC_F = "DOMESTIC_F" 440 DOMESTIC_G = "DOMESTIC_G" 441 DOMESTIC_H = "DOMESTIC_H" 442 DOMESTIC_I = "DOMESTIC_I" 443 DOMESTIC_J = "DOMESTIC_J" 444 DOMESTIC_K = "DOMESTIC_K" 445 DOMESTIC_L = "DOMESTIC_L" 446 DOMESTIC_M = "DOMESTIC_M" 447 DOMESTIC_N = "DOMESTIC_N" 448 DOMESTIC_O = "DOMESTIC_O" 449 GBT_AC = "GBT_AC" 450 GBT_DC = "GBT_DC" 451 IEC_60309_2__SINGLE_16 = "IEC_60309_2_single_16" 452 IEC_60309_2__THREE_16 = "IEC_60309_2_three_16" 453 IEC_60309_2__THREE_32 = "IEC_60309_2_three_32" 454 IEC_60309_2__THREE_64 = "IEC_60309_2_three_64" 455 IEC_62196__T1 = "IEC_62196_T1" 456 IEC_62196__T1_COMBO = "IEC_62196_T1_COMBO" 457 IEC_62196__T2 = "IEC_62196_T2" 458 IEC_62196__T2_COMBO = "IEC_62196_T2_COMBO" 459 IEC_62196__T3_A = "IEC_62196_T3A" 460 IEC_62196__T3_C = "IEC_62196_T3C" 461 MCS = "MCS" 462 NEMA_10_30 = "NEMA_10_30" 463 NEMA_10_50 = "NEMA_10_50" 464 NEMA_14_30 = "NEMA_14_30" 465 NEMA_14_50 = "NEMA_14_50" 466 NEMA_5_20 = "NEMA_5_20" 467 NEMA_6_30 = "NEMA_6_30" 468 NEMA_6_50 = "NEMA_6_50" 469 PANTOGRAPH_BOTTOM_UP = "PANTOGRAPH_BOTTOM_UP" 470 PANTOGRAPH_TOP_DOWN = "PANTOGRAPH_TOP_DOWN" 471 SAE_J3400 = "SAE_J3400" 472 TESLA_R = "TESLA_R" 473 TESLA_S = "TESLA_S"
CHADEMO =
<ConnectorType.CHADEMO: 'CHADEMO'>
CHAOJI =
<ConnectorType.CHAOJI: 'CHAOJI'>
DOMESTIC_A =
<ConnectorType.DOMESTIC_A: 'DOMESTIC_A'>
DOMESTIC_B =
<ConnectorType.DOMESTIC_B: 'DOMESTIC_B'>
DOMESTIC_C =
<ConnectorType.DOMESTIC_C: 'DOMESTIC_C'>
DOMESTIC_D =
<ConnectorType.DOMESTIC_D: 'DOMESTIC_D'>
DOMESTIC_E =
<ConnectorType.DOMESTIC_E: 'DOMESTIC_E'>
DOMESTIC_F =
<ConnectorType.DOMESTIC_F: 'DOMESTIC_F'>
DOMESTIC_G =
<ConnectorType.DOMESTIC_G: 'DOMESTIC_G'>
DOMESTIC_H =
<ConnectorType.DOMESTIC_H: 'DOMESTIC_H'>
DOMESTIC_I =
<ConnectorType.DOMESTIC_I: 'DOMESTIC_I'>
DOMESTIC_J =
<ConnectorType.DOMESTIC_J: 'DOMESTIC_J'>
DOMESTIC_K =
<ConnectorType.DOMESTIC_K: 'DOMESTIC_K'>
DOMESTIC_L =
<ConnectorType.DOMESTIC_L: 'DOMESTIC_L'>
DOMESTIC_M =
<ConnectorType.DOMESTIC_M: 'DOMESTIC_M'>
DOMESTIC_N =
<ConnectorType.DOMESTIC_N: 'DOMESTIC_N'>
DOMESTIC_O =
<ConnectorType.DOMESTIC_O: 'DOMESTIC_O'>
GBT_AC =
<ConnectorType.GBT_AC: 'GBT_AC'>
GBT_DC =
<ConnectorType.GBT_DC: 'GBT_DC'>
IEC_60309_2__SINGLE_16 =
<ConnectorType.IEC_60309_2__SINGLE_16: 'IEC_60309_2_single_16'>
IEC_60309_2__THREE_16 =
<ConnectorType.IEC_60309_2__THREE_16: 'IEC_60309_2_three_16'>
IEC_60309_2__THREE_32 =
<ConnectorType.IEC_60309_2__THREE_32: 'IEC_60309_2_three_32'>
IEC_60309_2__THREE_64 =
<ConnectorType.IEC_60309_2__THREE_64: 'IEC_60309_2_three_64'>
IEC_62196__T1 =
<ConnectorType.IEC_62196__T1: 'IEC_62196_T1'>
IEC_62196__T1_COMBO =
<ConnectorType.IEC_62196__T1_COMBO: 'IEC_62196_T1_COMBO'>
IEC_62196__T2 =
<ConnectorType.IEC_62196__T2: 'IEC_62196_T2'>
IEC_62196__T2_COMBO =
<ConnectorType.IEC_62196__T2_COMBO: 'IEC_62196_T2_COMBO'>
IEC_62196__T3_A =
<ConnectorType.IEC_62196__T3_A: 'IEC_62196_T3A'>
IEC_62196__T3_C =
<ConnectorType.IEC_62196__T3_C: 'IEC_62196_T3C'>
MCS =
<ConnectorType.MCS: 'MCS'>
NEMA_10_30 =
<ConnectorType.NEMA_10_30: 'NEMA_10_30'>
NEMA_10_50 =
<ConnectorType.NEMA_10_50: 'NEMA_10_50'>
NEMA_14_30 =
<ConnectorType.NEMA_14_30: 'NEMA_14_30'>
NEMA_14_50 =
<ConnectorType.NEMA_14_50: 'NEMA_14_50'>
NEMA_5_20 =
<ConnectorType.NEMA_5_20: 'NEMA_5_20'>
NEMA_6_30 =
<ConnectorType.NEMA_6_30: 'NEMA_6_30'>
NEMA_6_50 =
<ConnectorType.NEMA_6_50: 'NEMA_6_50'>
PANTOGRAPH_BOTTOM_UP =
<ConnectorType.PANTOGRAPH_BOTTOM_UP: 'PANTOGRAPH_BOTTOM_UP'>
PANTOGRAPH_TOP_DOWN =
<ConnectorType.PANTOGRAPH_TOP_DOWN: 'PANTOGRAPH_TOP_DOWN'>
SAE_J3400 =
<ConnectorType.SAE_J3400: 'SAE_J3400'>
TESLA_R =
<ConnectorType.TESLA_R: 'TESLA_R'>
TESLA_S =
<ConnectorType.TESLA_S: 'TESLA_S'>
class
GeoLocation:
476class GeoLocation: 477 latitude: str 478 longitude: str 479 480 def __init__(self, latitude: str, longitude: str) -> None: 481 self.latitude = latitude 482 self.longitude = longitude 483 484 @staticmethod 485 def from_dict(obj: Any) -> 'GeoLocation': 486 assert isinstance(obj, dict) 487 latitude = from_str(obj.get("latitude")) 488 longitude = from_str(obj.get("longitude")) 489 return GeoLocation(latitude, longitude) 490 491 def to_dict(self) -> dict: 492 result: dict = {} 493 result["latitude"] = from_str(self.latitude) 494 result["longitude"] = from_str(self.longitude) 495 return result
class
CdrLocation:
498class CdrLocation: 499 address: str 500 city: str 501 connector_format: ConnectorFormat 502 connector_id: str 503 connector_power_type: PowerType 504 connector_standard: ConnectorType 505 coordinates: GeoLocation 506 country: str 507 evse_id: str 508 evse_uid: str 509 id: str 510 name: Optional[str] 511 postal_code: Optional[str] 512 state: Optional[str] 513 514 def __init__(self, address: str, city: str, connector_format: ConnectorFormat, connector_id: str, connector_power_type: PowerType, connector_standard: ConnectorType, coordinates: GeoLocation, country: str, evse_id: str, evse_uid: str, id: str, name: Optional[str], postal_code: Optional[str], state: Optional[str]) -> None: 515 self.address = address 516 self.city = city 517 self.connector_format = connector_format 518 self.connector_id = connector_id 519 self.connector_power_type = connector_power_type 520 self.connector_standard = connector_standard 521 self.coordinates = coordinates 522 self.country = country 523 self.evse_id = evse_id 524 self.evse_uid = evse_uid 525 self.id = id 526 self.name = name 527 self.postal_code = postal_code 528 self.state = state 529 530 @staticmethod 531 def from_dict(obj: Any) -> 'CdrLocation': 532 assert isinstance(obj, dict) 533 address = from_str(obj.get("address")) 534 city = from_str(obj.get("city")) 535 connector_format = ConnectorFormat(obj.get("connector_format")) 536 connector_id = from_str(obj.get("connector_id")) 537 connector_power_type = PowerType(obj.get("connector_power_type")) 538 connector_standard = ConnectorType(obj.get("connector_standard")) 539 coordinates = GeoLocation.from_dict(obj.get("coordinates")) 540 country = from_str(obj.get("country")) 541 evse_id = from_str(obj.get("evse_id")) 542 evse_uid = from_str(obj.get("evse_uid")) 543 id = from_str(obj.get("id")) 544 name = from_union([from_none, from_str], obj.get("name")) 545 postal_code = from_union([from_none, from_str], obj.get("postal_code")) 546 state = from_union([from_none, from_str], obj.get("state")) 547 return CdrLocation(address, city, connector_format, connector_id, connector_power_type, connector_standard, coordinates, country, evse_id, evse_uid, id, name, postal_code, state) 548 549 def to_dict(self) -> dict: 550 result: dict = {} 551 result["address"] = from_str(self.address) 552 result["city"] = from_str(self.city) 553 result["connector_format"] = to_enum(ConnectorFormat, self.connector_format) 554 result["connector_id"] = from_str(self.connector_id) 555 result["connector_power_type"] = to_enum(PowerType, self.connector_power_type) 556 result["connector_standard"] = to_enum(ConnectorType, self.connector_standard) 557 result["coordinates"] = to_class(GeoLocation, self.coordinates) 558 result["country"] = from_str(self.country) 559 result["evse_id"] = from_str(self.evse_id) 560 result["evse_uid"] = from_str(self.evse_uid) 561 result["id"] = from_str(self.id) 562 if self.name is not None: 563 result["name"] = from_union([from_none, from_str], self.name) 564 if self.postal_code is not None: 565 result["postal_code"] = from_union([from_none, from_str], self.postal_code) 566 if self.state is not None: 567 result["state"] = from_union([from_none, from_str], self.state) 568 return result
CdrLocation( address: str, city: str, connector_format: ConnectorFormat, connector_id: str, connector_power_type: PowerType, connector_standard: ConnectorType, coordinates: GeoLocation, country: str, evse_id: str, evse_uid: str, id: str, name: Optional[str], postal_code: Optional[str], state: Optional[str])
514 def __init__(self, address: str, city: str, connector_format: ConnectorFormat, connector_id: str, connector_power_type: PowerType, connector_standard: ConnectorType, coordinates: GeoLocation, country: str, evse_id: str, evse_uid: str, id: str, name: Optional[str], postal_code: Optional[str], state: Optional[str]) -> None: 515 self.address = address 516 self.city = city 517 self.connector_format = connector_format 518 self.connector_id = connector_id 519 self.connector_power_type = connector_power_type 520 self.connector_standard = connector_standard 521 self.coordinates = coordinates 522 self.country = country 523 self.evse_id = evse_id 524 self.evse_uid = evse_uid 525 self.id = id 526 self.name = name 527 self.postal_code = postal_code 528 self.state = state
connector_format: ConnectorFormat
connector_power_type: PowerType
connector_standard: ConnectorType
coordinates: GeoLocation
530 @staticmethod 531 def from_dict(obj: Any) -> 'CdrLocation': 532 assert isinstance(obj, dict) 533 address = from_str(obj.get("address")) 534 city = from_str(obj.get("city")) 535 connector_format = ConnectorFormat(obj.get("connector_format")) 536 connector_id = from_str(obj.get("connector_id")) 537 connector_power_type = PowerType(obj.get("connector_power_type")) 538 connector_standard = ConnectorType(obj.get("connector_standard")) 539 coordinates = GeoLocation.from_dict(obj.get("coordinates")) 540 country = from_str(obj.get("country")) 541 evse_id = from_str(obj.get("evse_id")) 542 evse_uid = from_str(obj.get("evse_uid")) 543 id = from_str(obj.get("id")) 544 name = from_union([from_none, from_str], obj.get("name")) 545 postal_code = from_union([from_none, from_str], obj.get("postal_code")) 546 state = from_union([from_none, from_str], obj.get("state")) 547 return CdrLocation(address, city, connector_format, connector_id, connector_power_type, connector_standard, coordinates, country, evse_id, evse_uid, id, name, postal_code, state)
def
to_dict(self) -> dict:
549 def to_dict(self) -> dict: 550 result: dict = {} 551 result["address"] = from_str(self.address) 552 result["city"] = from_str(self.city) 553 result["connector_format"] = to_enum(ConnectorFormat, self.connector_format) 554 result["connector_id"] = from_str(self.connector_id) 555 result["connector_power_type"] = to_enum(PowerType, self.connector_power_type) 556 result["connector_standard"] = to_enum(ConnectorType, self.connector_standard) 557 result["coordinates"] = to_class(GeoLocation, self.coordinates) 558 result["country"] = from_str(self.country) 559 result["evse_id"] = from_str(self.evse_id) 560 result["evse_uid"] = from_str(self.evse_uid) 561 result["id"] = from_str(self.id) 562 if self.name is not None: 563 result["name"] = from_union([from_none, from_str], self.name) 564 if self.postal_code is not None: 565 result["postal_code"] = from_union([from_none, from_str], self.postal_code) 566 if self.state is not None: 567 result["state"] = from_union([from_none, from_str], self.state) 568 return result
class
CdrToken:
571class CdrToken: 572 contract_id: str 573 country_code: str 574 party_id: str 575 type: TokenType 576 uid: str 577 578 def __init__(self, contract_id: str, country_code: str, party_id: str, type: TokenType, uid: str) -> None: 579 self.contract_id = contract_id 580 self.country_code = country_code 581 self.party_id = party_id 582 self.type = type 583 self.uid = uid 584 585 @staticmethod 586 def from_dict(obj: Any) -> 'CdrToken': 587 assert isinstance(obj, dict) 588 contract_id = from_str(obj.get("contract_id")) 589 country_code = from_str(obj.get("country_code")) 590 party_id = from_str(obj.get("party_id")) 591 type = TokenType(obj.get("type")) 592 uid = from_str(obj.get("uid")) 593 return CdrToken(contract_id, country_code, party_id, type, uid) 594 595 def to_dict(self) -> dict: 596 result: dict = {} 597 result["contract_id"] = from_str(self.contract_id) 598 result["country_code"] = from_str(self.country_code) 599 result["party_id"] = from_str(self.party_id) 600 result["type"] = to_enum(TokenType, self.type) 601 result["uid"] = from_str(self.uid) 602 return result
CdrToken( contract_id: str, country_code: str, party_id: str, type: TokenType, uid: str)
type: TokenType
585 @staticmethod 586 def from_dict(obj: Any) -> 'CdrToken': 587 assert isinstance(obj, dict) 588 contract_id = from_str(obj.get("contract_id")) 589 country_code = from_str(obj.get("country_code")) 590 party_id = from_str(obj.get("party_id")) 591 type = TokenType(obj.get("type")) 592 uid = from_str(obj.get("uid")) 593 return CdrToken(contract_id, country_code, party_id, type, uid)
def
to_dict(self) -> dict:
595 def to_dict(self) -> dict: 596 result: dict = {} 597 result["contract_id"] = from_str(self.contract_id) 598 result["country_code"] = from_str(self.country_code) 599 result["party_id"] = from_str(self.party_id) 600 result["type"] = to_enum(TokenType, self.type) 601 result["uid"] = from_str(self.uid) 602 return result
class
CdrDimensionType(enum.Enum):
605class CdrDimensionType(Enum): 606 CURRENT = "CURRENT" 607 ENERGY = "ENERGY" 608 ENERGY_EXPORT = "ENERGY_EXPORT" 609 ENERGY_IMPORT = "ENERGY_IMPORT" 610 MAX_CURRENT = "MAX_CURRENT" 611 MAX_POWER = "MAX_POWER" 612 MIN_CURRENT = "MIN_CURRENT" 613 MIN_POWER = "MIN_POWER" 614 PARKING_TIME = "PARKING_TIME" 615 POWER = "POWER" 616 RESERVATION_TIME = "RESERVATION_TIME" 617 STATE_OF_CHARGE = "STATE_OF_CHARGE" 618 TIME = "TIME"
CURRENT =
<CdrDimensionType.CURRENT: 'CURRENT'>
ENERGY =
<CdrDimensionType.ENERGY: 'ENERGY'>
ENERGY_EXPORT =
<CdrDimensionType.ENERGY_EXPORT: 'ENERGY_EXPORT'>
ENERGY_IMPORT =
<CdrDimensionType.ENERGY_IMPORT: 'ENERGY_IMPORT'>
MAX_CURRENT =
<CdrDimensionType.MAX_CURRENT: 'MAX_CURRENT'>
MAX_POWER =
<CdrDimensionType.MAX_POWER: 'MAX_POWER'>
MIN_CURRENT =
<CdrDimensionType.MIN_CURRENT: 'MIN_CURRENT'>
MIN_POWER =
<CdrDimensionType.MIN_POWER: 'MIN_POWER'>
PARKING_TIME =
<CdrDimensionType.PARKING_TIME: 'PARKING_TIME'>
POWER =
<CdrDimensionType.POWER: 'POWER'>
RESERVATION_TIME =
<CdrDimensionType.RESERVATION_TIME: 'RESERVATION_TIME'>
STATE_OF_CHARGE =
<CdrDimensionType.STATE_OF_CHARGE: 'STATE_OF_CHARGE'>
TIME =
<CdrDimensionType.TIME: 'TIME'>
class
CdrDimension:
621class CdrDimension: 622 type: CdrDimensionType 623 volume: float 624 625 def __init__(self, type: CdrDimensionType, volume: float) -> None: 626 self.type = type 627 self.volume = volume 628 629 @staticmethod 630 def from_dict(obj: Any) -> 'CdrDimension': 631 assert isinstance(obj, dict) 632 type = CdrDimensionType(obj.get("type")) 633 volume = from_float(obj.get("volume")) 634 return CdrDimension(type, volume) 635 636 def to_dict(self) -> dict: 637 result: dict = {} 638 result["type"] = to_enum(CdrDimensionType, self.type) 639 result["volume"] = to_float(self.volume) 640 return result
CdrDimension(type: CdrDimensionType, volume: float)
type: CdrDimensionType
class
ChargingPeriod:
643class ChargingPeriod: 644 dimensions: List[CdrDimension] 645 start_date_time: str 646 tariff_id: Optional[str] 647 648 def __init__(self, dimensions: List[CdrDimension], start_date_time: str, tariff_id: Optional[str]) -> None: 649 self.dimensions = dimensions 650 self.start_date_time = start_date_time 651 self.tariff_id = tariff_id 652 653 @staticmethod 654 def from_dict(obj: Any) -> 'ChargingPeriod': 655 assert isinstance(obj, dict) 656 dimensions = from_list(CdrDimension.from_dict, obj.get("dimensions")) 657 start_date_time = from_str(obj.get("start_date_time")) 658 tariff_id = from_union([from_none, from_str], obj.get("tariff_id")) 659 return ChargingPeriod(dimensions, start_date_time, tariff_id) 660 661 def to_dict(self) -> dict: 662 result: dict = {} 663 result["dimensions"] = from_list(lambda x: to_class(CdrDimension, x), self.dimensions) 664 result["start_date_time"] = from_str(self.start_date_time) 665 if self.tariff_id is not None: 666 result["tariff_id"] = from_union([from_none, from_str], self.tariff_id) 667 return result
ChargingPeriod( dimensions: List[CdrDimension], start_date_time: str, tariff_id: Optional[str])
dimensions: List[CdrDimension]
653 @staticmethod 654 def from_dict(obj: Any) -> 'ChargingPeriod': 655 assert isinstance(obj, dict) 656 dimensions = from_list(CdrDimension.from_dict, obj.get("dimensions")) 657 start_date_time = from_str(obj.get("start_date_time")) 658 tariff_id = from_union([from_none, from_str], obj.get("tariff_id")) 659 return ChargingPeriod(dimensions, start_date_time, tariff_id)
def
to_dict(self) -> dict:
661 def to_dict(self) -> dict: 662 result: dict = {} 663 result["dimensions"] = from_list(lambda x: to_class(CdrDimension, x), self.dimensions) 664 result["start_date_time"] = from_str(self.start_date_time) 665 if self.tariff_id is not None: 666 result["tariff_id"] = from_union([from_none, from_str], self.tariff_id) 667 return result
class
SignedValue:
670class SignedValue: 671 nature: str 672 plain_data: str 673 signed_data: str 674 675 def __init__(self, nature: str, plain_data: str, signed_data: str) -> None: 676 self.nature = nature 677 self.plain_data = plain_data 678 self.signed_data = signed_data 679 680 @staticmethod 681 def from_dict(obj: Any) -> 'SignedValue': 682 assert isinstance(obj, dict) 683 nature = from_str(obj.get("nature")) 684 plain_data = from_str(obj.get("plain_data")) 685 signed_data = from_str(obj.get("signed_data")) 686 return SignedValue(nature, plain_data, signed_data) 687 688 def to_dict(self) -> dict: 689 result: dict = {} 690 result["nature"] = from_str(self.nature) 691 result["plain_data"] = from_str(self.plain_data) 692 result["signed_data"] = from_str(self.signed_data) 693 return result
class
SignedData:
696class SignedData: 697 encoding_method: str 698 encoding_method_version: Optional[int] 699 public_key: Optional[str] 700 signed_values: List[SignedValue] 701 url: Optional[str] 702 703 def __init__(self, encoding_method: str, encoding_method_version: Optional[int], public_key: Optional[str], signed_values: List[SignedValue], url: Optional[str]) -> None: 704 self.encoding_method = encoding_method 705 self.encoding_method_version = encoding_method_version 706 self.public_key = public_key 707 self.signed_values = signed_values 708 self.url = url 709 710 @staticmethod 711 def from_dict(obj: Any) -> 'SignedData': 712 assert isinstance(obj, dict) 713 encoding_method = from_str(obj.get("encoding_method")) 714 encoding_method_version = from_union([from_none, from_int], obj.get("encoding_method_version")) 715 public_key = from_union([from_none, from_str], obj.get("public_key")) 716 signed_values = from_list(SignedValue.from_dict, obj.get("signed_values")) 717 url = from_union([from_none, from_str], obj.get("url")) 718 return SignedData(encoding_method, encoding_method_version, public_key, signed_values, url) 719 720 def to_dict(self) -> dict: 721 result: dict = {} 722 result["encoding_method"] = from_str(self.encoding_method) 723 if self.encoding_method_version is not None: 724 result["encoding_method_version"] = from_union([from_none, from_int], self.encoding_method_version) 725 if self.public_key is not None: 726 result["public_key"] = from_union([from_none, from_str], self.public_key) 727 result["signed_values"] = from_list(lambda x: to_class(SignedValue, x), self.signed_values) 728 if self.url is not None: 729 result["url"] = from_union([from_none, from_str], self.url) 730 return result
SignedData( encoding_method: str, encoding_method_version: Optional[int], public_key: Optional[str], signed_values: List[SignedValue], url: Optional[str])
703 def __init__(self, encoding_method: str, encoding_method_version: Optional[int], public_key: Optional[str], signed_values: List[SignedValue], url: Optional[str]) -> None: 704 self.encoding_method = encoding_method 705 self.encoding_method_version = encoding_method_version 706 self.public_key = public_key 707 self.signed_values = signed_values 708 self.url = url
signed_values: List[SignedValue]
710 @staticmethod 711 def from_dict(obj: Any) -> 'SignedData': 712 assert isinstance(obj, dict) 713 encoding_method = from_str(obj.get("encoding_method")) 714 encoding_method_version = from_union([from_none, from_int], obj.get("encoding_method_version")) 715 public_key = from_union([from_none, from_str], obj.get("public_key")) 716 signed_values = from_list(SignedValue.from_dict, obj.get("signed_values")) 717 url = from_union([from_none, from_str], obj.get("url")) 718 return SignedData(encoding_method, encoding_method_version, public_key, signed_values, url)
def
to_dict(self) -> dict:
720 def to_dict(self) -> dict: 721 result: dict = {} 722 result["encoding_method"] = from_str(self.encoding_method) 723 if self.encoding_method_version is not None: 724 result["encoding_method_version"] = from_union([from_none, from_int], self.encoding_method_version) 725 if self.public_key is not None: 726 result["public_key"] = from_union([from_none, from_str], self.public_key) 727 result["signed_values"] = from_list(lambda x: to_class(SignedValue, x), self.signed_values) 728 if self.url is not None: 729 result["url"] = from_union([from_none, from_str], self.url) 730 return result
class
TariffDimensionType(enum.Enum):
733class TariffDimensionType(Enum): 734 ENERGY = "ENERGY" 735 FLAT = "FLAT" 736 PARKING_TIME = "PARKING_TIME" 737 TIME = "TIME"
ENERGY =
<TariffDimensionType.ENERGY: 'ENERGY'>
FLAT =
<TariffDimensionType.FLAT: 'FLAT'>
PARKING_TIME =
<TariffDimensionType.PARKING_TIME: 'PARKING_TIME'>
TIME =
<TariffDimensionType.TIME: 'TIME'>
class
PriceComponent:
740class PriceComponent: 741 price: float 742 step_size: int 743 type: TariffDimensionType 744 vat: Optional[float] 745 746 def __init__(self, price: float, step_size: int, type: TariffDimensionType, vat: Optional[float]) -> None: 747 self.price = price 748 self.step_size = step_size 749 self.type = type 750 self.vat = vat 751 752 @staticmethod 753 def from_dict(obj: Any) -> 'PriceComponent': 754 assert isinstance(obj, dict) 755 price = from_float(obj.get("price")) 756 step_size = from_int(obj.get("step_size")) 757 type = TariffDimensionType(obj.get("type")) 758 vat = from_union([from_none, from_float], obj.get("vat")) 759 return PriceComponent(price, step_size, type, vat) 760 761 def to_dict(self) -> dict: 762 result: dict = {} 763 result["price"] = to_float(self.price) 764 result["step_size"] = from_int(self.step_size) 765 result["type"] = to_enum(TariffDimensionType, self.type) 766 if self.vat is not None: 767 result["vat"] = from_union([from_none, to_float], self.vat) 768 return result
PriceComponent( price: float, step_size: int, type: TariffDimensionType, vat: Optional[float])
type: TariffDimensionType
752 @staticmethod 753 def from_dict(obj: Any) -> 'PriceComponent': 754 assert isinstance(obj, dict) 755 price = from_float(obj.get("price")) 756 step_size = from_int(obj.get("step_size")) 757 type = TariffDimensionType(obj.get("type")) 758 vat = from_union([from_none, from_float], obj.get("vat")) 759 return PriceComponent(price, step_size, type, vat)
def
to_dict(self) -> dict:
761 def to_dict(self) -> dict: 762 result: dict = {} 763 result["price"] = to_float(self.price) 764 result["step_size"] = from_int(self.step_size) 765 result["type"] = to_enum(TariffDimensionType, self.type) 766 if self.vat is not None: 767 result["vat"] = from_union([from_none, to_float], self.vat) 768 return result
class
DayOfWeek(enum.Enum):
771class DayOfWeek(Enum): 772 FRIDAY = "FRIDAY" 773 MONDAY = "MONDAY" 774 SATURDAY = "SATURDAY" 775 SUNDAY = "SUNDAY" 776 THURSDAY = "THURSDAY" 777 TUESDAY = "TUESDAY" 778 WEDNESDAY = "WEDNESDAY"
FRIDAY =
<DayOfWeek.FRIDAY: 'FRIDAY'>
MONDAY =
<DayOfWeek.MONDAY: 'MONDAY'>
SATURDAY =
<DayOfWeek.SATURDAY: 'SATURDAY'>
SUNDAY =
<DayOfWeek.SUNDAY: 'SUNDAY'>
THURSDAY =
<DayOfWeek.THURSDAY: 'THURSDAY'>
TUESDAY =
<DayOfWeek.TUESDAY: 'TUESDAY'>
WEDNESDAY =
<DayOfWeek.WEDNESDAY: 'WEDNESDAY'>
class
ReservationRestrictionType(enum.Enum):
781class ReservationRestrictionType(Enum): 782 RESERVATION = "RESERVATION" 783 RESERVATION_EXPIRES = "RESERVATION_EXPIRES"
RESERVATION =
<ReservationRestrictionType.RESERVATION: 'RESERVATION'>
RESERVATION_EXPIRES =
<ReservationRestrictionType.RESERVATION_EXPIRES: 'RESERVATION_EXPIRES'>
class
TariffRestrictions:
786class TariffRestrictions: 787 day_of_week: Optional[List[DayOfWeek]] 788 end_date: Optional[str] 789 end_time: Optional[str] 790 max_current: Optional[float] 791 max_duration: Optional[int] 792 max_kwh: Optional[float] 793 max_power: Optional[float] 794 min_current: Optional[float] 795 min_duration: Optional[int] 796 min_kwh: Optional[float] 797 min_power: Optional[float] 798 reservation: Optional[ReservationRestrictionType] 799 start_date: Optional[str] 800 start_time: Optional[str] 801 802 def __init__(self, day_of_week: Optional[List[DayOfWeek]], end_date: Optional[str], end_time: Optional[str], max_current: Optional[float], max_duration: Optional[int], max_kwh: Optional[float], max_power: Optional[float], min_current: Optional[float], min_duration: Optional[int], min_kwh: Optional[float], min_power: Optional[float], reservation: Optional[ReservationRestrictionType], start_date: Optional[str], start_time: Optional[str]) -> None: 803 self.day_of_week = day_of_week 804 self.end_date = end_date 805 self.end_time = end_time 806 self.max_current = max_current 807 self.max_duration = max_duration 808 self.max_kwh = max_kwh 809 self.max_power = max_power 810 self.min_current = min_current 811 self.min_duration = min_duration 812 self.min_kwh = min_kwh 813 self.min_power = min_power 814 self.reservation = reservation 815 self.start_date = start_date 816 self.start_time = start_time 817 818 @staticmethod 819 def from_dict(obj: Any) -> 'TariffRestrictions': 820 assert isinstance(obj, dict) 821 day_of_week = from_union([from_none, lambda x: from_list(DayOfWeek, x)], obj.get("day_of_week")) 822 end_date = from_union([from_none, from_str], obj.get("end_date")) 823 end_time = from_union([from_none, from_str], obj.get("end_time")) 824 max_current = from_union([from_none, from_float], obj.get("max_current")) 825 max_duration = from_union([from_none, from_int], obj.get("max_duration")) 826 max_kwh = from_union([from_none, from_float], obj.get("max_kwh")) 827 max_power = from_union([from_none, from_float], obj.get("max_power")) 828 min_current = from_union([from_none, from_float], obj.get("min_current")) 829 min_duration = from_union([from_none, from_int], obj.get("min_duration")) 830 min_kwh = from_union([from_none, from_float], obj.get("min_kwh")) 831 min_power = from_union([from_none, from_float], obj.get("min_power")) 832 reservation = from_union([from_none, ReservationRestrictionType], obj.get("reservation")) 833 start_date = from_union([from_none, from_str], obj.get("start_date")) 834 start_time = from_union([from_none, from_str], obj.get("start_time")) 835 return TariffRestrictions(day_of_week, end_date, end_time, max_current, max_duration, max_kwh, max_power, min_current, min_duration, min_kwh, min_power, reservation, start_date, start_time) 836 837 def to_dict(self) -> dict: 838 result: dict = {} 839 if self.day_of_week is not None: 840 result["day_of_week"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(DayOfWeek, x), x)], self.day_of_week) 841 if self.end_date is not None: 842 result["end_date"] = from_union([from_none, from_str], self.end_date) 843 if self.end_time is not None: 844 result["end_time"] = from_union([from_none, from_str], self.end_time) 845 if self.max_current is not None: 846 result["max_current"] = from_union([from_none, to_float], self.max_current) 847 if self.max_duration is not None: 848 result["max_duration"] = from_union([from_none, from_int], self.max_duration) 849 if self.max_kwh is not None: 850 result["max_kwh"] = from_union([from_none, to_float], self.max_kwh) 851 if self.max_power is not None: 852 result["max_power"] = from_union([from_none, to_float], self.max_power) 853 if self.min_current is not None: 854 result["min_current"] = from_union([from_none, to_float], self.min_current) 855 if self.min_duration is not None: 856 result["min_duration"] = from_union([from_none, from_int], self.min_duration) 857 if self.min_kwh is not None: 858 result["min_kwh"] = from_union([from_none, to_float], self.min_kwh) 859 if self.min_power is not None: 860 result["min_power"] = from_union([from_none, to_float], self.min_power) 861 if self.reservation is not None: 862 result["reservation"] = from_union([from_none, lambda x: to_enum(ReservationRestrictionType, x)], self.reservation) 863 if self.start_date is not None: 864 result["start_date"] = from_union([from_none, from_str], self.start_date) 865 if self.start_time is not None: 866 result["start_time"] = from_union([from_none, from_str], self.start_time) 867 return result
TariffRestrictions( day_of_week: Optional[List[DayOfWeek]], end_date: Optional[str], end_time: Optional[str], max_current: Optional[float], max_duration: Optional[int], max_kwh: Optional[float], max_power: Optional[float], min_current: Optional[float], min_duration: Optional[int], min_kwh: Optional[float], min_power: Optional[float], reservation: Optional[ReservationRestrictionType], start_date: Optional[str], start_time: Optional[str])
802 def __init__(self, day_of_week: Optional[List[DayOfWeek]], end_date: Optional[str], end_time: Optional[str], max_current: Optional[float], max_duration: Optional[int], max_kwh: Optional[float], max_power: Optional[float], min_current: Optional[float], min_duration: Optional[int], min_kwh: Optional[float], min_power: Optional[float], reservation: Optional[ReservationRestrictionType], start_date: Optional[str], start_time: Optional[str]) -> None: 803 self.day_of_week = day_of_week 804 self.end_date = end_date 805 self.end_time = end_time 806 self.max_current = max_current 807 self.max_duration = max_duration 808 self.max_kwh = max_kwh 809 self.max_power = max_power 810 self.min_current = min_current 811 self.min_duration = min_duration 812 self.min_kwh = min_kwh 813 self.min_power = min_power 814 self.reservation = reservation 815 self.start_date = start_date 816 self.start_time = start_time
day_of_week: Optional[List[DayOfWeek]]
reservation: Optional[ReservationRestrictionType]
818 @staticmethod 819 def from_dict(obj: Any) -> 'TariffRestrictions': 820 assert isinstance(obj, dict) 821 day_of_week = from_union([from_none, lambda x: from_list(DayOfWeek, x)], obj.get("day_of_week")) 822 end_date = from_union([from_none, from_str], obj.get("end_date")) 823 end_time = from_union([from_none, from_str], obj.get("end_time")) 824 max_current = from_union([from_none, from_float], obj.get("max_current")) 825 max_duration = from_union([from_none, from_int], obj.get("max_duration")) 826 max_kwh = from_union([from_none, from_float], obj.get("max_kwh")) 827 max_power = from_union([from_none, from_float], obj.get("max_power")) 828 min_current = from_union([from_none, from_float], obj.get("min_current")) 829 min_duration = from_union([from_none, from_int], obj.get("min_duration")) 830 min_kwh = from_union([from_none, from_float], obj.get("min_kwh")) 831 min_power = from_union([from_none, from_float], obj.get("min_power")) 832 reservation = from_union([from_none, ReservationRestrictionType], obj.get("reservation")) 833 start_date = from_union([from_none, from_str], obj.get("start_date")) 834 start_time = from_union([from_none, from_str], obj.get("start_time")) 835 return TariffRestrictions(day_of_week, end_date, end_time, max_current, max_duration, max_kwh, max_power, min_current, min_duration, min_kwh, min_power, reservation, start_date, start_time)
def
to_dict(self) -> dict:
837 def to_dict(self) -> dict: 838 result: dict = {} 839 if self.day_of_week is not None: 840 result["day_of_week"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(DayOfWeek, x), x)], self.day_of_week) 841 if self.end_date is not None: 842 result["end_date"] = from_union([from_none, from_str], self.end_date) 843 if self.end_time is not None: 844 result["end_time"] = from_union([from_none, from_str], self.end_time) 845 if self.max_current is not None: 846 result["max_current"] = from_union([from_none, to_float], self.max_current) 847 if self.max_duration is not None: 848 result["max_duration"] = from_union([from_none, from_int], self.max_duration) 849 if self.max_kwh is not None: 850 result["max_kwh"] = from_union([from_none, to_float], self.max_kwh) 851 if self.max_power is not None: 852 result["max_power"] = from_union([from_none, to_float], self.max_power) 853 if self.min_current is not None: 854 result["min_current"] = from_union([from_none, to_float], self.min_current) 855 if self.min_duration is not None: 856 result["min_duration"] = from_union([from_none, from_int], self.min_duration) 857 if self.min_kwh is not None: 858 result["min_kwh"] = from_union([from_none, to_float], self.min_kwh) 859 if self.min_power is not None: 860 result["min_power"] = from_union([from_none, to_float], self.min_power) 861 if self.reservation is not None: 862 result["reservation"] = from_union([from_none, lambda x: to_enum(ReservationRestrictionType, x)], self.reservation) 863 if self.start_date is not None: 864 result["start_date"] = from_union([from_none, from_str], self.start_date) 865 if self.start_time is not None: 866 result["start_time"] = from_union([from_none, from_str], self.start_time) 867 return result
class
TariffElement:
870class TariffElement: 871 price_components: List[PriceComponent] 872 restrictions: Optional[TariffRestrictions] 873 874 def __init__(self, price_components: List[PriceComponent], restrictions: Optional[TariffRestrictions]) -> None: 875 self.price_components = price_components 876 self.restrictions = restrictions 877 878 @staticmethod 879 def from_dict(obj: Any) -> 'TariffElement': 880 assert isinstance(obj, dict) 881 price_components = from_list(PriceComponent.from_dict, obj.get("price_components")) 882 restrictions = from_union([from_none, TariffRestrictions.from_dict], obj.get("restrictions")) 883 return TariffElement(price_components, restrictions) 884 885 def to_dict(self) -> dict: 886 result: dict = {} 887 result["price_components"] = from_list(lambda x: to_class(PriceComponent, x), self.price_components) 888 if self.restrictions is not None: 889 result["restrictions"] = from_union([from_none, lambda x: to_class(TariffRestrictions, x)], self.restrictions) 890 return result
TariffElement( price_components: List[PriceComponent], restrictions: Optional[TariffRestrictions])
price_components: List[PriceComponent]
restrictions: Optional[TariffRestrictions]
878 @staticmethod 879 def from_dict(obj: Any) -> 'TariffElement': 880 assert isinstance(obj, dict) 881 price_components = from_list(PriceComponent.from_dict, obj.get("price_components")) 882 restrictions = from_union([from_none, TariffRestrictions.from_dict], obj.get("restrictions")) 883 return TariffElement(price_components, restrictions)
def
to_dict(self) -> dict:
885 def to_dict(self) -> dict: 886 result: dict = {} 887 result["price_components"] = from_list(lambda x: to_class(PriceComponent, x), self.price_components) 888 if self.restrictions is not None: 889 result["restrictions"] = from_union([from_none, lambda x: to_class(TariffRestrictions, x)], self.restrictions) 890 return result
class
EnergySourceCategory(enum.Enum):
893class EnergySourceCategory(Enum): 894 COAL = "COAL" 895 GAS = "GAS" 896 GENERAL_FOSSIL = "GENERAL_FOSSIL" 897 GENERAL_GREEN = "GENERAL_GREEN" 898 NUCLEAR = "NUCLEAR" 899 SOLAR = "SOLAR" 900 WATER = "WATER" 901 WIND = "WIND"
COAL =
<EnergySourceCategory.COAL: 'COAL'>
GAS =
<EnergySourceCategory.GAS: 'GAS'>
GENERAL_FOSSIL =
<EnergySourceCategory.GENERAL_FOSSIL: 'GENERAL_FOSSIL'>
GENERAL_GREEN =
<EnergySourceCategory.GENERAL_GREEN: 'GENERAL_GREEN'>
NUCLEAR =
<EnergySourceCategory.NUCLEAR: 'NUCLEAR'>
SOLAR =
<EnergySourceCategory.SOLAR: 'SOLAR'>
WATER =
<EnergySourceCategory.WATER: 'WATER'>
WIND =
<EnergySourceCategory.WIND: 'WIND'>
class
EnergySource:
904class EnergySource: 905 percentage: float 906 source: EnergySourceCategory 907 908 def __init__(self, percentage: float, source: EnergySourceCategory) -> None: 909 self.percentage = percentage 910 self.source = source 911 912 @staticmethod 913 def from_dict(obj: Any) -> 'EnergySource': 914 assert isinstance(obj, dict) 915 percentage = from_float(obj.get("percentage")) 916 source = EnergySourceCategory(obj.get("source")) 917 return EnergySource(percentage, source) 918 919 def to_dict(self) -> dict: 920 result: dict = {} 921 result["percentage"] = to_float(self.percentage) 922 result["source"] = to_enum(EnergySourceCategory, self.source) 923 return result
EnergySource(percentage: float, source: EnergySourceCategory)
source: EnergySourceCategory
class
EnvironmentalImpactCategory(enum.Enum):
926class EnvironmentalImpactCategory(Enum): 927 CARBON_DIOXIDE = "CARBON_DIOXIDE" 928 NUCLEAR_WASTE = "NUCLEAR_WASTE"
CARBON_DIOXIDE =
<EnvironmentalImpactCategory.CARBON_DIOXIDE: 'CARBON_DIOXIDE'>
NUCLEAR_WASTE =
<EnvironmentalImpactCategory.NUCLEAR_WASTE: 'NUCLEAR_WASTE'>
class
EnvironmentalImpact:
931class EnvironmentalImpact: 932 amount: float 933 category: EnvironmentalImpactCategory 934 935 def __init__(self, amount: float, category: EnvironmentalImpactCategory) -> None: 936 self.amount = amount 937 self.category = category 938 939 @staticmethod 940 def from_dict(obj: Any) -> 'EnvironmentalImpact': 941 assert isinstance(obj, dict) 942 amount = from_float(obj.get("amount")) 943 category = EnvironmentalImpactCategory(obj.get("category")) 944 return EnvironmentalImpact(amount, category) 945 946 def to_dict(self) -> dict: 947 result: dict = {} 948 result["amount"] = to_float(self.amount) 949 result["category"] = to_enum(EnvironmentalImpactCategory, self.category) 950 return result
EnvironmentalImpact(amount: float, category: EnvironmentalImpactCategory)
category: EnvironmentalImpactCategory
class
EnergyMix:
953class EnergyMix: 954 energy_product_name: Optional[str] 955 energy_sources: Optional[List[EnergySource]] 956 environ_impact: Optional[List[EnvironmentalImpact]] 957 is_green_energy: bool 958 supplier_name: Optional[str] 959 960 def __init__(self, energy_product_name: Optional[str], energy_sources: Optional[List[EnergySource]], environ_impact: Optional[List[EnvironmentalImpact]], is_green_energy: bool, supplier_name: Optional[str]) -> None: 961 self.energy_product_name = energy_product_name 962 self.energy_sources = energy_sources 963 self.environ_impact = environ_impact 964 self.is_green_energy = is_green_energy 965 self.supplier_name = supplier_name 966 967 @staticmethod 968 def from_dict(obj: Any) -> 'EnergyMix': 969 assert isinstance(obj, dict) 970 energy_product_name = from_union([from_none, from_str], obj.get("energy_product_name")) 971 energy_sources = from_union([from_none, lambda x: from_list(EnergySource.from_dict, x)], obj.get("energy_sources")) 972 environ_impact = from_union([from_none, lambda x: from_list(EnvironmentalImpact.from_dict, x)], obj.get("environ_impact")) 973 is_green_energy = from_bool(obj.get("is_green_energy")) 974 supplier_name = from_union([from_none, from_str], obj.get("supplier_name")) 975 return EnergyMix(energy_product_name, energy_sources, environ_impact, is_green_energy, supplier_name) 976 977 def to_dict(self) -> dict: 978 result: dict = {} 979 if self.energy_product_name is not None: 980 result["energy_product_name"] = from_union([from_none, from_str], self.energy_product_name) 981 if self.energy_sources is not None: 982 result["energy_sources"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EnergySource, x), x)], self.energy_sources) 983 if self.environ_impact is not None: 984 result["environ_impact"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EnvironmentalImpact, x), x)], self.environ_impact) 985 result["is_green_energy"] = from_bool(self.is_green_energy) 986 if self.supplier_name is not None: 987 result["supplier_name"] = from_union([from_none, from_str], self.supplier_name) 988 return result
EnergyMix( energy_product_name: Optional[str], energy_sources: Optional[List[EnergySource]], environ_impact: Optional[List[EnvironmentalImpact]], is_green_energy: bool, supplier_name: Optional[str])
960 def __init__(self, energy_product_name: Optional[str], energy_sources: Optional[List[EnergySource]], environ_impact: Optional[List[EnvironmentalImpact]], is_green_energy: bool, supplier_name: Optional[str]) -> None: 961 self.energy_product_name = energy_product_name 962 self.energy_sources = energy_sources 963 self.environ_impact = environ_impact 964 self.is_green_energy = is_green_energy 965 self.supplier_name = supplier_name
energy_sources: Optional[List[EnergySource]]
environ_impact: Optional[List[EnvironmentalImpact]]
967 @staticmethod 968 def from_dict(obj: Any) -> 'EnergyMix': 969 assert isinstance(obj, dict) 970 energy_product_name = from_union([from_none, from_str], obj.get("energy_product_name")) 971 energy_sources = from_union([from_none, lambda x: from_list(EnergySource.from_dict, x)], obj.get("energy_sources")) 972 environ_impact = from_union([from_none, lambda x: from_list(EnvironmentalImpact.from_dict, x)], obj.get("environ_impact")) 973 is_green_energy = from_bool(obj.get("is_green_energy")) 974 supplier_name = from_union([from_none, from_str], obj.get("supplier_name")) 975 return EnergyMix(energy_product_name, energy_sources, environ_impact, is_green_energy, supplier_name)
def
to_dict(self) -> dict:
977 def to_dict(self) -> dict: 978 result: dict = {} 979 if self.energy_product_name is not None: 980 result["energy_product_name"] = from_union([from_none, from_str], self.energy_product_name) 981 if self.energy_sources is not None: 982 result["energy_sources"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EnergySource, x), x)], self.energy_sources) 983 if self.environ_impact is not None: 984 result["environ_impact"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EnvironmentalImpact, x), x)], self.environ_impact) 985 result["is_green_energy"] = from_bool(self.is_green_energy) 986 if self.supplier_name is not None: 987 result["supplier_name"] = from_union([from_none, from_str], self.supplier_name) 988 return result
class
PriceLimit:
991class PriceLimit: 992 after_taxes: Optional[float] 993 before_taxes: float 994 995 def __init__(self, after_taxes: Optional[float], before_taxes: float) -> None: 996 self.after_taxes = after_taxes 997 self.before_taxes = before_taxes 998 999 @staticmethod 1000 def from_dict(obj: Any) -> 'PriceLimit': 1001 assert isinstance(obj, dict) 1002 after_taxes = from_union([from_none, from_float], obj.get("after_taxes")) 1003 before_taxes = from_float(obj.get("before_taxes")) 1004 return PriceLimit(after_taxes, before_taxes) 1005 1006 def to_dict(self) -> dict: 1007 result: dict = {} 1008 if self.after_taxes is not None: 1009 result["after_taxes"] = from_union([from_none, to_float], self.after_taxes) 1010 result["before_taxes"] = to_float(self.before_taxes) 1011 return result
class
TaxIncluded(enum.Enum):
NO =
<TaxIncluded.NO: 'NO'>
N_A =
<TaxIncluded.N_A: 'N/A'>
YES =
<TaxIncluded.YES: 'YES'>
class
TariffType(enum.Enum):
1020class TariffType(Enum): 1021 AD_HOC_PAYMENT = "AD_HOC_PAYMENT" 1022 PROFILE_CHEAP = "PROFILE_CHEAP" 1023 PROFILE_FAST = "PROFILE_FAST" 1024 PROFILE_GREEN = "PROFILE_GREEN" 1025 REGULAR = "REGULAR"
AD_HOC_PAYMENT =
<TariffType.AD_HOC_PAYMENT: 'AD_HOC_PAYMENT'>
PROFILE_CHEAP =
<TariffType.PROFILE_CHEAP: 'PROFILE_CHEAP'>
PROFILE_FAST =
<TariffType.PROFILE_FAST: 'PROFILE_FAST'>
PROFILE_GREEN =
<TariffType.PROFILE_GREEN: 'PROFILE_GREEN'>
REGULAR =
<TariffType.REGULAR: 'REGULAR'>
class
Tariff:
1028class Tariff: 1029 country_code: str 1030 currency: str 1031 elements: List[TariffElement] 1032 end_date_time: Optional[str] 1033 energy_mix: Optional[EnergyMix] 1034 id: str 1035 last_updated: str 1036 max_price: Optional[PriceLimit] 1037 min_price: Optional[PriceLimit] 1038 party_id: str 1039 start_date_time: Optional[str] 1040 tariff_alt_text: Optional[List[DisplayText]] 1041 tariff_alt_url: Optional[str] 1042 tax_included: TaxIncluded 1043 type: Optional[TariffType] 1044 1045 def __init__(self, country_code: str, currency: str, elements: List[TariffElement], end_date_time: Optional[str], energy_mix: Optional[EnergyMix], id: str, last_updated: str, max_price: Optional[PriceLimit], min_price: Optional[PriceLimit], party_id: str, start_date_time: Optional[str], tariff_alt_text: Optional[List[DisplayText]], tariff_alt_url: Optional[str], tax_included: TaxIncluded, type: Optional[TariffType]) -> None: 1046 self.country_code = country_code 1047 self.currency = currency 1048 self.elements = elements 1049 self.end_date_time = end_date_time 1050 self.energy_mix = energy_mix 1051 self.id = id 1052 self.last_updated = last_updated 1053 self.max_price = max_price 1054 self.min_price = min_price 1055 self.party_id = party_id 1056 self.start_date_time = start_date_time 1057 self.tariff_alt_text = tariff_alt_text 1058 self.tariff_alt_url = tariff_alt_url 1059 self.tax_included = tax_included 1060 self.type = type 1061 1062 @staticmethod 1063 def from_dict(obj: Any) -> 'Tariff': 1064 assert isinstance(obj, dict) 1065 country_code = from_str(obj.get("country_code")) 1066 currency = from_str(obj.get("currency")) 1067 elements = from_list(TariffElement.from_dict, obj.get("elements")) 1068 end_date_time = from_union([from_none, from_str], obj.get("end_date_time")) 1069 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 1070 id = from_str(obj.get("id")) 1071 last_updated = from_str(obj.get("last_updated")) 1072 max_price = from_union([from_none, PriceLimit.from_dict], obj.get("max_price")) 1073 min_price = from_union([from_none, PriceLimit.from_dict], obj.get("min_price")) 1074 party_id = from_str(obj.get("party_id")) 1075 start_date_time = from_union([from_none, from_str], obj.get("start_date_time")) 1076 tariff_alt_text = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("tariff_alt_text")) 1077 tariff_alt_url = from_union([from_none, from_str], obj.get("tariff_alt_url")) 1078 tax_included = TaxIncluded(obj.get("tax_included")) 1079 type = from_union([from_none, TariffType], obj.get("type")) 1080 return Tariff(country_code, currency, elements, end_date_time, energy_mix, id, last_updated, max_price, min_price, party_id, start_date_time, tariff_alt_text, tariff_alt_url, tax_included, type) 1081 1082 def to_dict(self) -> dict: 1083 result: dict = {} 1084 result["country_code"] = from_str(self.country_code) 1085 result["currency"] = from_str(self.currency) 1086 result["elements"] = from_list(lambda x: to_class(TariffElement, x), self.elements) 1087 if self.end_date_time is not None: 1088 result["end_date_time"] = from_union([from_none, from_str], self.end_date_time) 1089 if self.energy_mix is not None: 1090 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 1091 result["id"] = from_str(self.id) 1092 result["last_updated"] = from_str(self.last_updated) 1093 if self.max_price is not None: 1094 result["max_price"] = from_union([from_none, lambda x: to_class(PriceLimit, x)], self.max_price) 1095 if self.min_price is not None: 1096 result["min_price"] = from_union([from_none, lambda x: to_class(PriceLimit, x)], self.min_price) 1097 result["party_id"] = from_str(self.party_id) 1098 if self.start_date_time is not None: 1099 result["start_date_time"] = from_union([from_none, from_str], self.start_date_time) 1100 if self.tariff_alt_text is not None: 1101 result["tariff_alt_text"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.tariff_alt_text) 1102 if self.tariff_alt_url is not None: 1103 result["tariff_alt_url"] = from_union([from_none, from_str], self.tariff_alt_url) 1104 result["tax_included"] = to_enum(TaxIncluded, self.tax_included) 1105 if self.type is not None: 1106 result["type"] = from_union([from_none, lambda x: to_enum(TariffType, x)], self.type) 1107 return result
Tariff( country_code: str, currency: str, elements: List[TariffElement], end_date_time: Optional[str], energy_mix: Optional[EnergyMix], id: str, last_updated: str, max_price: Optional[PriceLimit], min_price: Optional[PriceLimit], party_id: str, start_date_time: Optional[str], tariff_alt_text: Optional[List[DisplayText]], tariff_alt_url: Optional[str], tax_included: TaxIncluded, type: Optional[TariffType])
1045 def __init__(self, country_code: str, currency: str, elements: List[TariffElement], end_date_time: Optional[str], energy_mix: Optional[EnergyMix], id: str, last_updated: str, max_price: Optional[PriceLimit], min_price: Optional[PriceLimit], party_id: str, start_date_time: Optional[str], tariff_alt_text: Optional[List[DisplayText]], tariff_alt_url: Optional[str], tax_included: TaxIncluded, type: Optional[TariffType]) -> None: 1046 self.country_code = country_code 1047 self.currency = currency 1048 self.elements = elements 1049 self.end_date_time = end_date_time 1050 self.energy_mix = energy_mix 1051 self.id = id 1052 self.last_updated = last_updated 1053 self.max_price = max_price 1054 self.min_price = min_price 1055 self.party_id = party_id 1056 self.start_date_time = start_date_time 1057 self.tariff_alt_text = tariff_alt_text 1058 self.tariff_alt_url = tariff_alt_url 1059 self.tax_included = tax_included 1060 self.type = type
elements: List[TariffElement]
energy_mix: Optional[EnergyMix]
max_price: Optional[PriceLimit]
min_price: Optional[PriceLimit]
tariff_alt_text: Optional[List[DisplayText]]
tax_included: TaxIncluded
type: Optional[TariffType]
1062 @staticmethod 1063 def from_dict(obj: Any) -> 'Tariff': 1064 assert isinstance(obj, dict) 1065 country_code = from_str(obj.get("country_code")) 1066 currency = from_str(obj.get("currency")) 1067 elements = from_list(TariffElement.from_dict, obj.get("elements")) 1068 end_date_time = from_union([from_none, from_str], obj.get("end_date_time")) 1069 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 1070 id = from_str(obj.get("id")) 1071 last_updated = from_str(obj.get("last_updated")) 1072 max_price = from_union([from_none, PriceLimit.from_dict], obj.get("max_price")) 1073 min_price = from_union([from_none, PriceLimit.from_dict], obj.get("min_price")) 1074 party_id = from_str(obj.get("party_id")) 1075 start_date_time = from_union([from_none, from_str], obj.get("start_date_time")) 1076 tariff_alt_text = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("tariff_alt_text")) 1077 tariff_alt_url = from_union([from_none, from_str], obj.get("tariff_alt_url")) 1078 tax_included = TaxIncluded(obj.get("tax_included")) 1079 type = from_union([from_none, TariffType], obj.get("type")) 1080 return Tariff(country_code, currency, elements, end_date_time, energy_mix, id, last_updated, max_price, min_price, party_id, start_date_time, tariff_alt_text, tariff_alt_url, tax_included, type)
def
to_dict(self) -> dict:
1082 def to_dict(self) -> dict: 1083 result: dict = {} 1084 result["country_code"] = from_str(self.country_code) 1085 result["currency"] = from_str(self.currency) 1086 result["elements"] = from_list(lambda x: to_class(TariffElement, x), self.elements) 1087 if self.end_date_time is not None: 1088 result["end_date_time"] = from_union([from_none, from_str], self.end_date_time) 1089 if self.energy_mix is not None: 1090 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 1091 result["id"] = from_str(self.id) 1092 result["last_updated"] = from_str(self.last_updated) 1093 if self.max_price is not None: 1094 result["max_price"] = from_union([from_none, lambda x: to_class(PriceLimit, x)], self.max_price) 1095 if self.min_price is not None: 1096 result["min_price"] = from_union([from_none, lambda x: to_class(PriceLimit, x)], self.min_price) 1097 result["party_id"] = from_str(self.party_id) 1098 if self.start_date_time is not None: 1099 result["start_date_time"] = from_union([from_none, from_str], self.start_date_time) 1100 if self.tariff_alt_text is not None: 1101 result["tariff_alt_text"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.tariff_alt_text) 1102 if self.tariff_alt_url is not None: 1103 result["tariff_alt_url"] = from_union([from_none, from_str], self.tariff_alt_url) 1104 result["tax_included"] = to_enum(TaxIncluded, self.tax_included) 1105 if self.type is not None: 1106 result["type"] = from_union([from_none, lambda x: to_enum(TariffType, x)], self.type) 1107 return result
class
TaxAmount:
1110class TaxAmount: 1111 account_number: Optional[str] 1112 amount: float 1113 name: str 1114 percentage: Optional[float] 1115 1116 def __init__(self, account_number: Optional[str], amount: float, name: str, percentage: Optional[float]) -> None: 1117 self.account_number = account_number 1118 self.amount = amount 1119 self.name = name 1120 self.percentage = percentage 1121 1122 @staticmethod 1123 def from_dict(obj: Any) -> 'TaxAmount': 1124 assert isinstance(obj, dict) 1125 account_number = from_union([from_none, from_str], obj.get("account_number")) 1126 amount = from_float(obj.get("amount")) 1127 name = from_str(obj.get("name")) 1128 percentage = from_union([from_none, from_float], obj.get("percentage")) 1129 return TaxAmount(account_number, amount, name, percentage) 1130 1131 def to_dict(self) -> dict: 1132 result: dict = {} 1133 if self.account_number is not None: 1134 result["account_number"] = from_union([from_none, from_str], self.account_number) 1135 result["amount"] = to_float(self.amount) 1136 result["name"] = from_str(self.name) 1137 if self.percentage is not None: 1138 result["percentage"] = from_union([from_none, to_float], self.percentage) 1139 return result
1122 @staticmethod 1123 def from_dict(obj: Any) -> 'TaxAmount': 1124 assert isinstance(obj, dict) 1125 account_number = from_union([from_none, from_str], obj.get("account_number")) 1126 amount = from_float(obj.get("amount")) 1127 name = from_str(obj.get("name")) 1128 percentage = from_union([from_none, from_float], obj.get("percentage")) 1129 return TaxAmount(account_number, amount, name, percentage)
def
to_dict(self) -> dict:
1131 def to_dict(self) -> dict: 1132 result: dict = {} 1133 if self.account_number is not None: 1134 result["account_number"] = from_union([from_none, from_str], self.account_number) 1135 result["amount"] = to_float(self.amount) 1136 result["name"] = from_str(self.name) 1137 if self.percentage is not None: 1138 result["percentage"] = from_union([from_none, to_float], self.percentage) 1139 return result
class
Price:
1142class Price: 1143 before_taxes: float 1144 taxes: Optional[List[TaxAmount]] 1145 1146 def __init__(self, before_taxes: float, taxes: Optional[List[TaxAmount]]) -> None: 1147 self.before_taxes = before_taxes 1148 self.taxes = taxes 1149 1150 @staticmethod 1151 def from_dict(obj: Any) -> 'Price': 1152 assert isinstance(obj, dict) 1153 before_taxes = from_float(obj.get("before_taxes")) 1154 taxes = from_union([from_none, lambda x: from_list(TaxAmount.from_dict, x)], obj.get("taxes")) 1155 return Price(before_taxes, taxes) 1156 1157 def to_dict(self) -> dict: 1158 result: dict = {} 1159 result["before_taxes"] = to_float(self.before_taxes) 1160 if self.taxes is not None: 1161 result["taxes"] = from_union([from_none, lambda x: from_list(lambda x: to_class(TaxAmount, x), x)], self.taxes) 1162 return result
Price(before_taxes: float, taxes: Optional[List[TaxAmount]])
taxes: Optional[List[TaxAmount]]
class
Cdr:
1165class Cdr: 1166 auth_method: AuthMethod 1167 authorization_reference: Optional[str] 1168 cdr_location: CdrLocation 1169 cdr_token: CdrToken 1170 charging_periods: List[ChargingPeriod] 1171 country_code: str 1172 credit: Optional[bool] 1173 credit_reference_id: Optional[str] 1174 currency: str 1175 end_date_time: str 1176 home_charging_compensation: Optional[bool] 1177 id: str 1178 invoice_reference_id: Optional[str] 1179 last_updated: str 1180 meter_id: Optional[str] 1181 party_id: str 1182 remark: Optional[str] 1183 session_id: Optional[str] 1184 signed_data: Optional[SignedData] 1185 start_date_time: str 1186 tariffs: Optional[List[Tariff]] 1187 total_cost: Price 1188 total_energy: float 1189 total_energy_cost: Optional[Price] 1190 total_fixed_cost: Optional[Price] 1191 total_parking_cost: Optional[Price] 1192 total_parking_time: Optional[float] 1193 total_reservation_cost: Optional[Price] 1194 total_time: float 1195 total_time_cost: Optional[Price] 1196 1197 def __init__(self, auth_method: AuthMethod, authorization_reference: Optional[str], cdr_location: CdrLocation, cdr_token: CdrToken, charging_periods: List[ChargingPeriod], country_code: str, credit: Optional[bool], credit_reference_id: Optional[str], currency: str, end_date_time: str, home_charging_compensation: Optional[bool], id: str, invoice_reference_id: Optional[str], last_updated: str, meter_id: Optional[str], party_id: str, remark: Optional[str], session_id: Optional[str], signed_data: Optional[SignedData], start_date_time: str, tariffs: Optional[List[Tariff]], total_cost: Price, total_energy: float, total_energy_cost: Optional[Price], total_fixed_cost: Optional[Price], total_parking_cost: Optional[Price], total_parking_time: Optional[float], total_reservation_cost: Optional[Price], total_time: float, total_time_cost: Optional[Price]) -> None: 1198 self.auth_method = auth_method 1199 self.authorization_reference = authorization_reference 1200 self.cdr_location = cdr_location 1201 self.cdr_token = cdr_token 1202 self.charging_periods = charging_periods 1203 self.country_code = country_code 1204 self.credit = credit 1205 self.credit_reference_id = credit_reference_id 1206 self.currency = currency 1207 self.end_date_time = end_date_time 1208 self.home_charging_compensation = home_charging_compensation 1209 self.id = id 1210 self.invoice_reference_id = invoice_reference_id 1211 self.last_updated = last_updated 1212 self.meter_id = meter_id 1213 self.party_id = party_id 1214 self.remark = remark 1215 self.session_id = session_id 1216 self.signed_data = signed_data 1217 self.start_date_time = start_date_time 1218 self.tariffs = tariffs 1219 self.total_cost = total_cost 1220 self.total_energy = total_energy 1221 self.total_energy_cost = total_energy_cost 1222 self.total_fixed_cost = total_fixed_cost 1223 self.total_parking_cost = total_parking_cost 1224 self.total_parking_time = total_parking_time 1225 self.total_reservation_cost = total_reservation_cost 1226 self.total_time = total_time 1227 self.total_time_cost = total_time_cost 1228 1229 @staticmethod 1230 def from_dict(obj: Any) -> 'Cdr': 1231 assert isinstance(obj, dict) 1232 auth_method = AuthMethod(obj.get("auth_method")) 1233 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 1234 cdr_location = CdrLocation.from_dict(obj.get("cdr_location")) 1235 cdr_token = CdrToken.from_dict(obj.get("cdr_token")) 1236 charging_periods = from_list(ChargingPeriod.from_dict, obj.get("charging_periods")) 1237 country_code = from_str(obj.get("country_code")) 1238 credit = from_union([from_none, from_bool], obj.get("credit")) 1239 credit_reference_id = from_union([from_none, from_str], obj.get("credit_reference_id")) 1240 currency = from_str(obj.get("currency")) 1241 end_date_time = from_str(obj.get("end_date_time")) 1242 home_charging_compensation = from_union([from_none, from_bool], obj.get("home_charging_compensation")) 1243 id = from_str(obj.get("id")) 1244 invoice_reference_id = from_union([from_none, from_str], obj.get("invoice_reference_id")) 1245 last_updated = from_str(obj.get("last_updated")) 1246 meter_id = from_union([from_none, from_str], obj.get("meter_id")) 1247 party_id = from_str(obj.get("party_id")) 1248 remark = from_union([from_none, from_str], obj.get("remark")) 1249 session_id = from_union([from_none, from_str], obj.get("session_id")) 1250 signed_data = from_union([from_none, SignedData.from_dict], obj.get("signed_data")) 1251 start_date_time = from_str(obj.get("start_date_time")) 1252 tariffs = from_union([from_none, lambda x: from_list(Tariff.from_dict, x)], obj.get("tariffs")) 1253 total_cost = Price.from_dict(obj.get("total_cost")) 1254 total_energy = from_float(obj.get("total_energy")) 1255 total_energy_cost = from_union([from_none, Price.from_dict], obj.get("total_energy_cost")) 1256 total_fixed_cost = from_union([from_none, Price.from_dict], obj.get("total_fixed_cost")) 1257 total_parking_cost = from_union([from_none, Price.from_dict], obj.get("total_parking_cost")) 1258 total_parking_time = from_union([from_none, from_float], obj.get("total_parking_time")) 1259 total_reservation_cost = from_union([from_none, Price.from_dict], obj.get("total_reservation_cost")) 1260 total_time = from_float(obj.get("total_time")) 1261 total_time_cost = from_union([from_none, Price.from_dict], obj.get("total_time_cost")) 1262 return Cdr(auth_method, authorization_reference, cdr_location, cdr_token, charging_periods, country_code, credit, credit_reference_id, currency, end_date_time, home_charging_compensation, id, invoice_reference_id, last_updated, meter_id, party_id, remark, session_id, signed_data, start_date_time, tariffs, total_cost, total_energy, total_energy_cost, total_fixed_cost, total_parking_cost, total_parking_time, total_reservation_cost, total_time, total_time_cost) 1263 1264 def to_dict(self) -> dict: 1265 result: dict = {} 1266 result["auth_method"] = to_enum(AuthMethod, self.auth_method) 1267 if self.authorization_reference is not None: 1268 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 1269 result["cdr_location"] = to_class(CdrLocation, self.cdr_location) 1270 result["cdr_token"] = to_class(CdrToken, self.cdr_token) 1271 result["charging_periods"] = from_list(lambda x: to_class(ChargingPeriod, x), self.charging_periods) 1272 result["country_code"] = from_str(self.country_code) 1273 if self.credit is not None: 1274 result["credit"] = from_union([from_none, from_bool], self.credit) 1275 if self.credit_reference_id is not None: 1276 result["credit_reference_id"] = from_union([from_none, from_str], self.credit_reference_id) 1277 result["currency"] = from_str(self.currency) 1278 result["end_date_time"] = from_str(self.end_date_time) 1279 if self.home_charging_compensation is not None: 1280 result["home_charging_compensation"] = from_union([from_none, from_bool], self.home_charging_compensation) 1281 result["id"] = from_str(self.id) 1282 if self.invoice_reference_id is not None: 1283 result["invoice_reference_id"] = from_union([from_none, from_str], self.invoice_reference_id) 1284 result["last_updated"] = from_str(self.last_updated) 1285 if self.meter_id is not None: 1286 result["meter_id"] = from_union([from_none, from_str], self.meter_id) 1287 result["party_id"] = from_str(self.party_id) 1288 if self.remark is not None: 1289 result["remark"] = from_union([from_none, from_str], self.remark) 1290 if self.session_id is not None: 1291 result["session_id"] = from_union([from_none, from_str], self.session_id) 1292 if self.signed_data is not None: 1293 result["signed_data"] = from_union([from_none, lambda x: to_class(SignedData, x)], self.signed_data) 1294 result["start_date_time"] = from_str(self.start_date_time) 1295 if self.tariffs is not None: 1296 result["tariffs"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Tariff, x), x)], self.tariffs) 1297 result["total_cost"] = to_class(Price, self.total_cost) 1298 result["total_energy"] = to_float(self.total_energy) 1299 if self.total_energy_cost is not None: 1300 result["total_energy_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_energy_cost) 1301 if self.total_fixed_cost is not None: 1302 result["total_fixed_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_fixed_cost) 1303 if self.total_parking_cost is not None: 1304 result["total_parking_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_parking_cost) 1305 if self.total_parking_time is not None: 1306 result["total_parking_time"] = from_union([from_none, to_float], self.total_parking_time) 1307 if self.total_reservation_cost is not None: 1308 result["total_reservation_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_reservation_cost) 1309 result["total_time"] = to_float(self.total_time) 1310 if self.total_time_cost is not None: 1311 result["total_time_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_time_cost) 1312 return result
Cdr( auth_method: AuthMethod, authorization_reference: Optional[str], cdr_location: CdrLocation, cdr_token: CdrToken, charging_periods: List[ChargingPeriod], country_code: str, credit: Optional[bool], credit_reference_id: Optional[str], currency: str, end_date_time: str, home_charging_compensation: Optional[bool], id: str, invoice_reference_id: Optional[str], last_updated: str, meter_id: Optional[str], party_id: str, remark: Optional[str], session_id: Optional[str], signed_data: Optional[SignedData], start_date_time: str, tariffs: Optional[List[Tariff]], total_cost: Price, total_energy: float, total_energy_cost: Optional[Price], total_fixed_cost: Optional[Price], total_parking_cost: Optional[Price], total_parking_time: Optional[float], total_reservation_cost: Optional[Price], total_time: float, total_time_cost: Optional[Price])
1197 def __init__(self, auth_method: AuthMethod, authorization_reference: Optional[str], cdr_location: CdrLocation, cdr_token: CdrToken, charging_periods: List[ChargingPeriod], country_code: str, credit: Optional[bool], credit_reference_id: Optional[str], currency: str, end_date_time: str, home_charging_compensation: Optional[bool], id: str, invoice_reference_id: Optional[str], last_updated: str, meter_id: Optional[str], party_id: str, remark: Optional[str], session_id: Optional[str], signed_data: Optional[SignedData], start_date_time: str, tariffs: Optional[List[Tariff]], total_cost: Price, total_energy: float, total_energy_cost: Optional[Price], total_fixed_cost: Optional[Price], total_parking_cost: Optional[Price], total_parking_time: Optional[float], total_reservation_cost: Optional[Price], total_time: float, total_time_cost: Optional[Price]) -> None: 1198 self.auth_method = auth_method 1199 self.authorization_reference = authorization_reference 1200 self.cdr_location = cdr_location 1201 self.cdr_token = cdr_token 1202 self.charging_periods = charging_periods 1203 self.country_code = country_code 1204 self.credit = credit 1205 self.credit_reference_id = credit_reference_id 1206 self.currency = currency 1207 self.end_date_time = end_date_time 1208 self.home_charging_compensation = home_charging_compensation 1209 self.id = id 1210 self.invoice_reference_id = invoice_reference_id 1211 self.last_updated = last_updated 1212 self.meter_id = meter_id 1213 self.party_id = party_id 1214 self.remark = remark 1215 self.session_id = session_id 1216 self.signed_data = signed_data 1217 self.start_date_time = start_date_time 1218 self.tariffs = tariffs 1219 self.total_cost = total_cost 1220 self.total_energy = total_energy 1221 self.total_energy_cost = total_energy_cost 1222 self.total_fixed_cost = total_fixed_cost 1223 self.total_parking_cost = total_parking_cost 1224 self.total_parking_time = total_parking_time 1225 self.total_reservation_cost = total_reservation_cost 1226 self.total_time = total_time 1227 self.total_time_cost = total_time_cost
auth_method: AuthMethod
cdr_location: CdrLocation
cdr_token: CdrToken
charging_periods: List[ChargingPeriod]
signed_data: Optional[SignedData]
tariffs: Optional[List[Tariff]]
total_cost: Price
total_energy_cost: Optional[Price]
total_fixed_cost: Optional[Price]
total_parking_cost: Optional[Price]
total_reservation_cost: Optional[Price]
total_time_cost: Optional[Price]
1229 @staticmethod 1230 def from_dict(obj: Any) -> 'Cdr': 1231 assert isinstance(obj, dict) 1232 auth_method = AuthMethod(obj.get("auth_method")) 1233 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 1234 cdr_location = CdrLocation.from_dict(obj.get("cdr_location")) 1235 cdr_token = CdrToken.from_dict(obj.get("cdr_token")) 1236 charging_periods = from_list(ChargingPeriod.from_dict, obj.get("charging_periods")) 1237 country_code = from_str(obj.get("country_code")) 1238 credit = from_union([from_none, from_bool], obj.get("credit")) 1239 credit_reference_id = from_union([from_none, from_str], obj.get("credit_reference_id")) 1240 currency = from_str(obj.get("currency")) 1241 end_date_time = from_str(obj.get("end_date_time")) 1242 home_charging_compensation = from_union([from_none, from_bool], obj.get("home_charging_compensation")) 1243 id = from_str(obj.get("id")) 1244 invoice_reference_id = from_union([from_none, from_str], obj.get("invoice_reference_id")) 1245 last_updated = from_str(obj.get("last_updated")) 1246 meter_id = from_union([from_none, from_str], obj.get("meter_id")) 1247 party_id = from_str(obj.get("party_id")) 1248 remark = from_union([from_none, from_str], obj.get("remark")) 1249 session_id = from_union([from_none, from_str], obj.get("session_id")) 1250 signed_data = from_union([from_none, SignedData.from_dict], obj.get("signed_data")) 1251 start_date_time = from_str(obj.get("start_date_time")) 1252 tariffs = from_union([from_none, lambda x: from_list(Tariff.from_dict, x)], obj.get("tariffs")) 1253 total_cost = Price.from_dict(obj.get("total_cost")) 1254 total_energy = from_float(obj.get("total_energy")) 1255 total_energy_cost = from_union([from_none, Price.from_dict], obj.get("total_energy_cost")) 1256 total_fixed_cost = from_union([from_none, Price.from_dict], obj.get("total_fixed_cost")) 1257 total_parking_cost = from_union([from_none, Price.from_dict], obj.get("total_parking_cost")) 1258 total_parking_time = from_union([from_none, from_float], obj.get("total_parking_time")) 1259 total_reservation_cost = from_union([from_none, Price.from_dict], obj.get("total_reservation_cost")) 1260 total_time = from_float(obj.get("total_time")) 1261 total_time_cost = from_union([from_none, Price.from_dict], obj.get("total_time_cost")) 1262 return Cdr(auth_method, authorization_reference, cdr_location, cdr_token, charging_periods, country_code, credit, credit_reference_id, currency, end_date_time, home_charging_compensation, id, invoice_reference_id, last_updated, meter_id, party_id, remark, session_id, signed_data, start_date_time, tariffs, total_cost, total_energy, total_energy_cost, total_fixed_cost, total_parking_cost, total_parking_time, total_reservation_cost, total_time, total_time_cost)
def
to_dict(self) -> dict:
1264 def to_dict(self) -> dict: 1265 result: dict = {} 1266 result["auth_method"] = to_enum(AuthMethod, self.auth_method) 1267 if self.authorization_reference is not None: 1268 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 1269 result["cdr_location"] = to_class(CdrLocation, self.cdr_location) 1270 result["cdr_token"] = to_class(CdrToken, self.cdr_token) 1271 result["charging_periods"] = from_list(lambda x: to_class(ChargingPeriod, x), self.charging_periods) 1272 result["country_code"] = from_str(self.country_code) 1273 if self.credit is not None: 1274 result["credit"] = from_union([from_none, from_bool], self.credit) 1275 if self.credit_reference_id is not None: 1276 result["credit_reference_id"] = from_union([from_none, from_str], self.credit_reference_id) 1277 result["currency"] = from_str(self.currency) 1278 result["end_date_time"] = from_str(self.end_date_time) 1279 if self.home_charging_compensation is not None: 1280 result["home_charging_compensation"] = from_union([from_none, from_bool], self.home_charging_compensation) 1281 result["id"] = from_str(self.id) 1282 if self.invoice_reference_id is not None: 1283 result["invoice_reference_id"] = from_union([from_none, from_str], self.invoice_reference_id) 1284 result["last_updated"] = from_str(self.last_updated) 1285 if self.meter_id is not None: 1286 result["meter_id"] = from_union([from_none, from_str], self.meter_id) 1287 result["party_id"] = from_str(self.party_id) 1288 if self.remark is not None: 1289 result["remark"] = from_union([from_none, from_str], self.remark) 1290 if self.session_id is not None: 1291 result["session_id"] = from_union([from_none, from_str], self.session_id) 1292 if self.signed_data is not None: 1293 result["signed_data"] = from_union([from_none, lambda x: to_class(SignedData, x)], self.signed_data) 1294 result["start_date_time"] = from_str(self.start_date_time) 1295 if self.tariffs is not None: 1296 result["tariffs"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Tariff, x), x)], self.tariffs) 1297 result["total_cost"] = to_class(Price, self.total_cost) 1298 result["total_energy"] = to_float(self.total_energy) 1299 if self.total_energy_cost is not None: 1300 result["total_energy_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_energy_cost) 1301 if self.total_fixed_cost is not None: 1302 result["total_fixed_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_fixed_cost) 1303 if self.total_parking_cost is not None: 1304 result["total_parking_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_parking_cost) 1305 if self.total_parking_time is not None: 1306 result["total_parking_time"] = from_union([from_none, to_float], self.total_parking_time) 1307 if self.total_reservation_cost is not None: 1308 result["total_reservation_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_reservation_cost) 1309 result["total_time"] = to_float(self.total_time) 1310 if self.total_time_cost is not None: 1311 result["total_time_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_time_cost) 1312 return result
class
ChargingPreferences:
1315class ChargingPreferences: 1316 departure_time: Optional[str] 1317 discharge_allowed: Optional[bool] 1318 energy_need: Optional[float] 1319 profile_type: ProfileType 1320 1321 def __init__(self, departure_time: Optional[str], discharge_allowed: Optional[bool], energy_need: Optional[float], profile_type: ProfileType) -> None: 1322 self.departure_time = departure_time 1323 self.discharge_allowed = discharge_allowed 1324 self.energy_need = energy_need 1325 self.profile_type = profile_type 1326 1327 @staticmethod 1328 def from_dict(obj: Any) -> 'ChargingPreferences': 1329 assert isinstance(obj, dict) 1330 departure_time = from_union([from_none, from_str], obj.get("departure_time")) 1331 discharge_allowed = from_union([from_none, from_bool], obj.get("discharge_allowed")) 1332 energy_need = from_union([from_none, from_float], obj.get("energy_need")) 1333 profile_type = ProfileType(obj.get("profile_type")) 1334 return ChargingPreferences(departure_time, discharge_allowed, energy_need, profile_type) 1335 1336 def to_dict(self) -> dict: 1337 result: dict = {} 1338 if self.departure_time is not None: 1339 result["departure_time"] = from_union([from_none, from_str], self.departure_time) 1340 if self.discharge_allowed is not None: 1341 result["discharge_allowed"] = from_union([from_none, from_bool], self.discharge_allowed) 1342 if self.energy_need is not None: 1343 result["energy_need"] = from_union([from_none, to_float], self.energy_need) 1344 result["profile_type"] = to_enum(ProfileType, self.profile_type) 1345 return result
ChargingPreferences( departure_time: Optional[str], discharge_allowed: Optional[bool], energy_need: Optional[float], profile_type: ProfileType)
1321 def __init__(self, departure_time: Optional[str], discharge_allowed: Optional[bool], energy_need: Optional[float], profile_type: ProfileType) -> None: 1322 self.departure_time = departure_time 1323 self.discharge_allowed = discharge_allowed 1324 self.energy_need = energy_need 1325 self.profile_type = profile_type
profile_type: ProfileType
1327 @staticmethod 1328 def from_dict(obj: Any) -> 'ChargingPreferences': 1329 assert isinstance(obj, dict) 1330 departure_time = from_union([from_none, from_str], obj.get("departure_time")) 1331 discharge_allowed = from_union([from_none, from_bool], obj.get("discharge_allowed")) 1332 energy_need = from_union([from_none, from_float], obj.get("energy_need")) 1333 profile_type = ProfileType(obj.get("profile_type")) 1334 return ChargingPreferences(departure_time, discharge_allowed, energy_need, profile_type)
def
to_dict(self) -> dict:
1336 def to_dict(self) -> dict: 1337 result: dict = {} 1338 if self.departure_time is not None: 1339 result["departure_time"] = from_union([from_none, from_str], self.departure_time) 1340 if self.discharge_allowed is not None: 1341 result["discharge_allowed"] = from_union([from_none, from_bool], self.discharge_allowed) 1342 if self.energy_need is not None: 1343 result["energy_need"] = from_union([from_none, to_float], self.energy_need) 1344 result["profile_type"] = to_enum(ProfileType, self.profile_type) 1345 return result
class
ChargingProfileResponseType(enum.Enum):
1348class ChargingProfileResponseType(Enum): 1349 ACCEPTED = "ACCEPTED" 1350 NOT_SUPPORTED = "NOT_SUPPORTED" 1351 REJECTED = "REJECTED" 1352 TOO_OFTEN = "TOO_OFTEN" 1353 UNKNOWN_SESSION = "UNKNOWN_SESSION"
ACCEPTED =
<ChargingProfileResponseType.ACCEPTED: 'ACCEPTED'>
NOT_SUPPORTED =
<ChargingProfileResponseType.NOT_SUPPORTED: 'NOT_SUPPORTED'>
REJECTED =
<ChargingProfileResponseType.REJECTED: 'REJECTED'>
TOO_OFTEN =
<ChargingProfileResponseType.TOO_OFTEN: 'TOO_OFTEN'>
UNKNOWN_SESSION =
<ChargingProfileResponseType.UNKNOWN_SESSION: 'UNKNOWN_SESSION'>
class
ChargingProfileResponse:
1356class ChargingProfileResponse: 1357 result: ChargingProfileResponseType 1358 timeout: int 1359 1360 def __init__(self, result: ChargingProfileResponseType, timeout: int) -> None: 1361 self.result = result 1362 self.timeout = timeout 1363 1364 @staticmethod 1365 def from_dict(obj: Any) -> 'ChargingProfileResponse': 1366 assert isinstance(obj, dict) 1367 result = ChargingProfileResponseType(obj.get("result")) 1368 timeout = from_int(obj.get("timeout")) 1369 return ChargingProfileResponse(result, timeout) 1370 1371 def to_dict(self) -> dict: 1372 result: dict = {} 1373 result["result"] = to_enum(ChargingProfileResponseType, self.result) 1374 result["timeout"] = from_int(self.timeout) 1375 return result
ChargingProfileResponse(result: ChargingProfileResponseType, timeout: int)
result: ChargingProfileResponseType
class
ChargingProfileResult:
1378class ChargingProfileResult: 1379 result: ChargingProfileResultType 1380 1381 def __init__(self, result: ChargingProfileResultType) -> None: 1382 self.result = result 1383 1384 @staticmethod 1385 def from_dict(obj: Any) -> 'ChargingProfileResult': 1386 assert isinstance(obj, dict) 1387 result = ChargingProfileResultType(obj.get("result")) 1388 return ChargingProfileResult(result) 1389 1390 def to_dict(self) -> dict: 1391 result: dict = {} 1392 result["result"] = to_enum(ChargingProfileResultType, self.result) 1393 return result
ChargingProfileResult(result: ChargingProfileResultType)
result: ChargingProfileResultType
class
ClearProfileResult:
1396class ClearProfileResult: 1397 result: ChargingProfileResultType 1398 1399 def __init__(self, result: ChargingProfileResultType) -> None: 1400 self.result = result 1401 1402 @staticmethod 1403 def from_dict(obj: Any) -> 'ClearProfileResult': 1404 assert isinstance(obj, dict) 1405 result = ChargingProfileResultType(obj.get("result")) 1406 return ClearProfileResult(result) 1407 1408 def to_dict(self) -> dict: 1409 result: dict = {} 1410 result["result"] = to_enum(ChargingProfileResultType, self.result) 1411 return result
ClearProfileResult(result: ChargingProfileResultType)
result: ChargingProfileResultType
class
CommandResponseType(enum.Enum):
1414class CommandResponseType(Enum): 1415 ACCEPTED = "ACCEPTED" 1416 NOT_SUPPORTED = "NOT_SUPPORTED" 1417 REJECTED = "REJECTED" 1418 UNKNOWN_SESSION = "UNKNOWN_SESSION"
ACCEPTED =
<CommandResponseType.ACCEPTED: 'ACCEPTED'>
NOT_SUPPORTED =
<CommandResponseType.NOT_SUPPORTED: 'NOT_SUPPORTED'>
REJECTED =
<CommandResponseType.REJECTED: 'REJECTED'>
UNKNOWN_SESSION =
<CommandResponseType.UNKNOWN_SESSION: 'UNKNOWN_SESSION'>
class
CommandResponse:
1421class CommandResponse: 1422 message: Optional[List[DisplayText]] 1423 result: CommandResponseType 1424 timeout: int 1425 1426 def __init__(self, message: Optional[List[DisplayText]], result: CommandResponseType, timeout: int) -> None: 1427 self.message = message 1428 self.result = result 1429 self.timeout = timeout 1430 1431 @staticmethod 1432 def from_dict(obj: Any) -> 'CommandResponse': 1433 assert isinstance(obj, dict) 1434 message = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("message")) 1435 result = CommandResponseType(obj.get("result")) 1436 timeout = from_int(obj.get("timeout")) 1437 return CommandResponse(message, result, timeout) 1438 1439 def to_dict(self) -> dict: 1440 result: dict = {} 1441 if self.message is not None: 1442 result["message"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.message) 1443 result["result"] = to_enum(CommandResponseType, self.result) 1444 result["timeout"] = from_int(self.timeout) 1445 return result
CommandResponse( message: Optional[List[DisplayText]], result: CommandResponseType, timeout: int)
message: Optional[List[DisplayText]]
result: CommandResponseType
1431 @staticmethod 1432 def from_dict(obj: Any) -> 'CommandResponse': 1433 assert isinstance(obj, dict) 1434 message = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("message")) 1435 result = CommandResponseType(obj.get("result")) 1436 timeout = from_int(obj.get("timeout")) 1437 return CommandResponse(message, result, timeout)
def
to_dict(self) -> dict:
1439 def to_dict(self) -> dict: 1440 result: dict = {} 1441 if self.message is not None: 1442 result["message"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.message) 1443 result["result"] = to_enum(CommandResponseType, self.result) 1444 result["timeout"] = from_int(self.timeout) 1445 return result
class
CommandResultType(enum.Enum):
1448class CommandResultType(Enum): 1449 ACCEPTED = "ACCEPTED" 1450 CANCELED_RESERVATION = "CANCELED_RESERVATION" 1451 EVSE_INOPERATIVE = "EVSE_INOPERATIVE" 1452 EVSE_OCCUPIED = "EVSE_OCCUPIED" 1453 FAILED = "FAILED" 1454 NOT_SUPPORTED = "NOT_SUPPORTED" 1455 REJECTED = "REJECTED" 1456 TIMEOUT = "TIMEOUT" 1457 UNKNOWN_RESERVATION = "UNKNOWN_RESERVATION"
ACCEPTED =
<CommandResultType.ACCEPTED: 'ACCEPTED'>
CANCELED_RESERVATION =
<CommandResultType.CANCELED_RESERVATION: 'CANCELED_RESERVATION'>
EVSE_INOPERATIVE =
<CommandResultType.EVSE_INOPERATIVE: 'EVSE_INOPERATIVE'>
EVSE_OCCUPIED =
<CommandResultType.EVSE_OCCUPIED: 'EVSE_OCCUPIED'>
FAILED =
<CommandResultType.FAILED: 'FAILED'>
NOT_SUPPORTED =
<CommandResultType.NOT_SUPPORTED: 'NOT_SUPPORTED'>
REJECTED =
<CommandResultType.REJECTED: 'REJECTED'>
TIMEOUT =
<CommandResultType.TIMEOUT: 'TIMEOUT'>
UNKNOWN_RESERVATION =
<CommandResultType.UNKNOWN_RESERVATION: 'UNKNOWN_RESERVATION'>
class
CommandResult:
1460class CommandResult: 1461 message: Optional[List[DisplayText]] 1462 result: CommandResultType 1463 1464 def __init__(self, message: Optional[List[DisplayText]], result: CommandResultType) -> None: 1465 self.message = message 1466 self.result = result 1467 1468 @staticmethod 1469 def from_dict(obj: Any) -> 'CommandResult': 1470 assert isinstance(obj, dict) 1471 message = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("message")) 1472 result = CommandResultType(obj.get("result")) 1473 return CommandResult(message, result) 1474 1475 def to_dict(self) -> dict: 1476 result: dict = {} 1477 if self.message is not None: 1478 result["message"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.message) 1479 result["result"] = to_enum(CommandResultType, self.result) 1480 return result
CommandResult( message: Optional[List[DisplayText]], result: CommandResultType)
message: Optional[List[DisplayText]]
result: CommandResultType
1468 @staticmethod 1469 def from_dict(obj: Any) -> 'CommandResult': 1470 assert isinstance(obj, dict) 1471 message = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("message")) 1472 result = CommandResultType(obj.get("result")) 1473 return CommandResult(message, result)
class
ConnectorCapability(enum.Enum):
1483class ConnectorCapability(Enum): 1484 ISO_15118_20__PLUG_AND_CHARGE = "ISO_15118_20_PLUG_AND_CHARGE" 1485 ISO_15118_2__PLUG_AND_CHARGE = "ISO_15118_2_PLUG_AND_CHARGE"
ISO_15118_20__PLUG_AND_CHARGE =
<ConnectorCapability.ISO_15118_20__PLUG_AND_CHARGE: 'ISO_15118_20_PLUG_AND_CHARGE'>
ISO_15118_2__PLUG_AND_CHARGE =
<ConnectorCapability.ISO_15118_2__PLUG_AND_CHARGE: 'ISO_15118_2_PLUG_AND_CHARGE'>
class
Connector:
1488class Connector: 1489 capabilities: Optional[List[ConnectorCapability]] 1490 format: ConnectorFormat 1491 id: str 1492 last_updated: str 1493 max_amperage: int 1494 max_electric_power: Optional[int] 1495 max_voltage: int 1496 power_type: PowerType 1497 standard: ConnectorType 1498 tariff_ids: Optional[List[str]] 1499 terms_and_conditions: Optional[str] 1500 1501 def __init__(self, capabilities: Optional[List[ConnectorCapability]], format: ConnectorFormat, id: str, last_updated: str, max_amperage: int, max_electric_power: Optional[int], max_voltage: int, power_type: PowerType, standard: ConnectorType, tariff_ids: Optional[List[str]], terms_and_conditions: Optional[str]) -> None: 1502 self.capabilities = capabilities 1503 self.format = format 1504 self.id = id 1505 self.last_updated = last_updated 1506 self.max_amperage = max_amperage 1507 self.max_electric_power = max_electric_power 1508 self.max_voltage = max_voltage 1509 self.power_type = power_type 1510 self.standard = standard 1511 self.tariff_ids = tariff_ids 1512 self.terms_and_conditions = terms_and_conditions 1513 1514 @staticmethod 1515 def from_dict(obj: Any) -> 'Connector': 1516 assert isinstance(obj, dict) 1517 capabilities = from_union([from_none, lambda x: from_list(ConnectorCapability, x)], obj.get("capabilities")) 1518 format = ConnectorFormat(obj.get("format")) 1519 id = from_str(obj.get("id")) 1520 last_updated = from_str(obj.get("last_updated")) 1521 max_amperage = from_int(obj.get("max_amperage")) 1522 max_electric_power = from_union([from_none, from_int], obj.get("max_electric_power")) 1523 max_voltage = from_int(obj.get("max_voltage")) 1524 power_type = PowerType(obj.get("power_type")) 1525 standard = ConnectorType(obj.get("standard")) 1526 tariff_ids = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("tariff_ids")) 1527 terms_and_conditions = from_union([from_none, from_str], obj.get("terms_and_conditions")) 1528 return Connector(capabilities, format, id, last_updated, max_amperage, max_electric_power, max_voltage, power_type, standard, tariff_ids, terms_and_conditions) 1529 1530 def to_dict(self) -> dict: 1531 result: dict = {} 1532 if self.capabilities is not None: 1533 result["capabilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(ConnectorCapability, x), x)], self.capabilities) 1534 result["format"] = to_enum(ConnectorFormat, self.format) 1535 result["id"] = from_str(self.id) 1536 result["last_updated"] = from_str(self.last_updated) 1537 result["max_amperage"] = from_int(self.max_amperage) 1538 if self.max_electric_power is not None: 1539 result["max_electric_power"] = from_union([from_none, from_int], self.max_electric_power) 1540 result["max_voltage"] = from_int(self.max_voltage) 1541 result["power_type"] = to_enum(PowerType, self.power_type) 1542 result["standard"] = to_enum(ConnectorType, self.standard) 1543 if self.tariff_ids is not None: 1544 result["tariff_ids"] = from_union([from_none, lambda x: from_list(from_str, x)], self.tariff_ids) 1545 if self.terms_and_conditions is not None: 1546 result["terms_and_conditions"] = from_union([from_none, from_str], self.terms_and_conditions) 1547 return result
Connector( capabilities: Optional[List[ConnectorCapability]], format: ConnectorFormat, id: str, last_updated: str, max_amperage: int, max_electric_power: Optional[int], max_voltage: int, power_type: PowerType, standard: ConnectorType, tariff_ids: Optional[List[str]], terms_and_conditions: Optional[str])
1501 def __init__(self, capabilities: Optional[List[ConnectorCapability]], format: ConnectorFormat, id: str, last_updated: str, max_amperage: int, max_electric_power: Optional[int], max_voltage: int, power_type: PowerType, standard: ConnectorType, tariff_ids: Optional[List[str]], terms_and_conditions: Optional[str]) -> None: 1502 self.capabilities = capabilities 1503 self.format = format 1504 self.id = id 1505 self.last_updated = last_updated 1506 self.max_amperage = max_amperage 1507 self.max_electric_power = max_electric_power 1508 self.max_voltage = max_voltage 1509 self.power_type = power_type 1510 self.standard = standard 1511 self.tariff_ids = tariff_ids 1512 self.terms_and_conditions = terms_and_conditions
capabilities: Optional[List[ConnectorCapability]]
format: ConnectorFormat
power_type: PowerType
standard: ConnectorType
1514 @staticmethod 1515 def from_dict(obj: Any) -> 'Connector': 1516 assert isinstance(obj, dict) 1517 capabilities = from_union([from_none, lambda x: from_list(ConnectorCapability, x)], obj.get("capabilities")) 1518 format = ConnectorFormat(obj.get("format")) 1519 id = from_str(obj.get("id")) 1520 last_updated = from_str(obj.get("last_updated")) 1521 max_amperage = from_int(obj.get("max_amperage")) 1522 max_electric_power = from_union([from_none, from_int], obj.get("max_electric_power")) 1523 max_voltage = from_int(obj.get("max_voltage")) 1524 power_type = PowerType(obj.get("power_type")) 1525 standard = ConnectorType(obj.get("standard")) 1526 tariff_ids = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("tariff_ids")) 1527 terms_and_conditions = from_union([from_none, from_str], obj.get("terms_and_conditions")) 1528 return Connector(capabilities, format, id, last_updated, max_amperage, max_electric_power, max_voltage, power_type, standard, tariff_ids, terms_and_conditions)
def
to_dict(self) -> dict:
1530 def to_dict(self) -> dict: 1531 result: dict = {} 1532 if self.capabilities is not None: 1533 result["capabilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(ConnectorCapability, x), x)], self.capabilities) 1534 result["format"] = to_enum(ConnectorFormat, self.format) 1535 result["id"] = from_str(self.id) 1536 result["last_updated"] = from_str(self.last_updated) 1537 result["max_amperage"] = from_int(self.max_amperage) 1538 if self.max_electric_power is not None: 1539 result["max_electric_power"] = from_union([from_none, from_int], self.max_electric_power) 1540 result["max_voltage"] = from_int(self.max_voltage) 1541 result["power_type"] = to_enum(PowerType, self.power_type) 1542 result["standard"] = to_enum(ConnectorType, self.standard) 1543 if self.tariff_ids is not None: 1544 result["tariff_ids"] = from_union([from_none, lambda x: from_list(from_str, x)], self.tariff_ids) 1545 if self.terms_and_conditions is not None: 1546 result["terms_and_conditions"] = from_union([from_none, from_str], self.terms_and_conditions) 1547 return result
class
ImageCategory(enum.Enum):
1550class ImageCategory(Enum): 1551 CHARGER = "CHARGER" 1552 ENTRANCE = "ENTRANCE" 1553 LOCATION = "LOCATION" 1554 NETWORK = "NETWORK" 1555 OPERATOR = "OPERATOR" 1556 OTHER = "OTHER" 1557 OWNER = "OWNER"
CHARGER =
<ImageCategory.CHARGER: 'CHARGER'>
ENTRANCE =
<ImageCategory.ENTRANCE: 'ENTRANCE'>
LOCATION =
<ImageCategory.LOCATION: 'LOCATION'>
NETWORK =
<ImageCategory.NETWORK: 'NETWORK'>
OPERATOR =
<ImageCategory.OPERATOR: 'OPERATOR'>
OTHER =
<ImageCategory.OTHER: 'OTHER'>
OWNER =
<ImageCategory.OWNER: 'OWNER'>
class
Image:
1560class Image: 1561 category: ImageCategory 1562 height: Optional[int] 1563 thumbnail: Optional[str] 1564 type: str 1565 url: str 1566 width: Optional[int] 1567 1568 def __init__(self, category: ImageCategory, height: Optional[int], thumbnail: Optional[str], type: str, url: str, width: Optional[int]) -> None: 1569 self.category = category 1570 self.height = height 1571 self.thumbnail = thumbnail 1572 self.type = type 1573 self.url = url 1574 self.width = width 1575 1576 @staticmethod 1577 def from_dict(obj: Any) -> 'Image': 1578 assert isinstance(obj, dict) 1579 category = ImageCategory(obj.get("category")) 1580 height = from_union([from_none, from_int], obj.get("height")) 1581 thumbnail = from_union([from_none, from_str], obj.get("thumbnail")) 1582 type = from_str(obj.get("type")) 1583 url = from_str(obj.get("url")) 1584 width = from_union([from_none, from_int], obj.get("width")) 1585 return Image(category, height, thumbnail, type, url, width) 1586 1587 def to_dict(self) -> dict: 1588 result: dict = {} 1589 result["category"] = to_enum(ImageCategory, self.category) 1590 if self.height is not None: 1591 result["height"] = from_union([from_none, from_int], self.height) 1592 if self.thumbnail is not None: 1593 result["thumbnail"] = from_union([from_none, from_str], self.thumbnail) 1594 result["type"] = from_str(self.type) 1595 result["url"] = from_str(self.url) 1596 if self.width is not None: 1597 result["width"] = from_union([from_none, from_int], self.width) 1598 return result
Image( category: ImageCategory, height: Optional[int], thumbnail: Optional[str], type: str, url: str, width: Optional[int])
1568 def __init__(self, category: ImageCategory, height: Optional[int], thumbnail: Optional[str], type: str, url: str, width: Optional[int]) -> None: 1569 self.category = category 1570 self.height = height 1571 self.thumbnail = thumbnail 1572 self.type = type 1573 self.url = url 1574 self.width = width
category: ImageCategory
1576 @staticmethod 1577 def from_dict(obj: Any) -> 'Image': 1578 assert isinstance(obj, dict) 1579 category = ImageCategory(obj.get("category")) 1580 height = from_union([from_none, from_int], obj.get("height")) 1581 thumbnail = from_union([from_none, from_str], obj.get("thumbnail")) 1582 type = from_str(obj.get("type")) 1583 url = from_str(obj.get("url")) 1584 width = from_union([from_none, from_int], obj.get("width")) 1585 return Image(category, height, thumbnail, type, url, width)
def
to_dict(self) -> dict:
1587 def to_dict(self) -> dict: 1588 result: dict = {} 1589 result["category"] = to_enum(ImageCategory, self.category) 1590 if self.height is not None: 1591 result["height"] = from_union([from_none, from_int], self.height) 1592 if self.thumbnail is not None: 1593 result["thumbnail"] = from_union([from_none, from_str], self.thumbnail) 1594 result["type"] = from_str(self.type) 1595 result["url"] = from_str(self.url) 1596 if self.width is not None: 1597 result["width"] = from_union([from_none, from_int], self.width) 1598 return result
class
BusinessDetails:
1601class BusinessDetails: 1602 logo: Optional[Image] 1603 name: str 1604 website: Optional[str] 1605 1606 def __init__(self, logo: Optional[Image], name: str, website: Optional[str]) -> None: 1607 self.logo = logo 1608 self.name = name 1609 self.website = website 1610 1611 @staticmethod 1612 def from_dict(obj: Any) -> 'BusinessDetails': 1613 assert isinstance(obj, dict) 1614 logo = from_union([from_none, Image.from_dict], obj.get("logo")) 1615 name = from_str(obj.get("name")) 1616 website = from_union([from_none, from_str], obj.get("website")) 1617 return BusinessDetails(logo, name, website) 1618 1619 def to_dict(self) -> dict: 1620 result: dict = {} 1621 if self.logo is not None: 1622 result["logo"] = from_union([from_none, lambda x: to_class(Image, x)], self.logo) 1623 result["name"] = from_str(self.name) 1624 if self.website is not None: 1625 result["website"] = from_union([from_none, from_str], self.website) 1626 return result
BusinessDetails(logo: Optional[Image], name: str, website: Optional[str])
logo: Optional[Image]
1611 @staticmethod 1612 def from_dict(obj: Any) -> 'BusinessDetails': 1613 assert isinstance(obj, dict) 1614 logo = from_union([from_none, Image.from_dict], obj.get("logo")) 1615 name = from_str(obj.get("name")) 1616 website = from_union([from_none, from_str], obj.get("website")) 1617 return BusinessDetails(logo, name, website)
def
to_dict(self) -> dict:
1619 def to_dict(self) -> dict: 1620 result: dict = {} 1621 if self.logo is not None: 1622 result["logo"] = from_union([from_none, lambda x: to_class(Image, x)], self.logo) 1623 result["name"] = from_str(self.name) 1624 if self.website is not None: 1625 result["website"] = from_union([from_none, from_str], self.website) 1626 return result
class
Role(enum.Enum):
1629class Role(Enum): 1630 CPO = "CPO" 1631 EMSP = "EMSP" 1632 NAP = "NAP" 1633 NSP = "NSP" 1634 OTHER = "OTHER" 1635 SCSP = "SCSP"
CPO =
<Role.CPO: 'CPO'>
EMSP =
<Role.EMSP: 'EMSP'>
NAP =
<Role.NAP: 'NAP'>
NSP =
<Role.NSP: 'NSP'>
OTHER =
<Role.OTHER: 'OTHER'>
SCSP =
<Role.SCSP: 'SCSP'>
class
CredentialsRole:
1638class CredentialsRole: 1639 business_details: BusinessDetails 1640 country_code: str 1641 party_id: str 1642 role: Role 1643 1644 def __init__(self, business_details: BusinessDetails, country_code: str, party_id: str, role: Role) -> None: 1645 self.business_details = business_details 1646 self.country_code = country_code 1647 self.party_id = party_id 1648 self.role = role 1649 1650 @staticmethod 1651 def from_dict(obj: Any) -> 'CredentialsRole': 1652 assert isinstance(obj, dict) 1653 business_details = BusinessDetails.from_dict(obj.get("business_details")) 1654 country_code = from_str(obj.get("country_code")) 1655 party_id = from_str(obj.get("party_id")) 1656 role = Role(obj.get("role")) 1657 return CredentialsRole(business_details, country_code, party_id, role) 1658 1659 def to_dict(self) -> dict: 1660 result: dict = {} 1661 result["business_details"] = to_class(BusinessDetails, self.business_details) 1662 result["country_code"] = from_str(self.country_code) 1663 result["party_id"] = from_str(self.party_id) 1664 result["role"] = to_enum(Role, self.role) 1665 return result
CredentialsRole( business_details: BusinessDetails, country_code: str, party_id: str, role: Role)
business_details: BusinessDetails
role: Role
1650 @staticmethod 1651 def from_dict(obj: Any) -> 'CredentialsRole': 1652 assert isinstance(obj, dict) 1653 business_details = BusinessDetails.from_dict(obj.get("business_details")) 1654 country_code = from_str(obj.get("country_code")) 1655 party_id = from_str(obj.get("party_id")) 1656 role = Role(obj.get("role")) 1657 return CredentialsRole(business_details, country_code, party_id, role)
def
to_dict(self) -> dict:
1659 def to_dict(self) -> dict: 1660 result: dict = {} 1661 result["business_details"] = to_class(BusinessDetails, self.business_details) 1662 result["country_code"] = from_str(self.country_code) 1663 result["party_id"] = from_str(self.party_id) 1664 result["role"] = to_enum(Role, self.role) 1665 return result
class
Credentials:
1668class Credentials: 1669 hub_party_id: Optional[str] 1670 roles: List[CredentialsRole] 1671 token: str 1672 url: str 1673 1674 def __init__(self, hub_party_id: Optional[str], roles: List[CredentialsRole], token: str, url: str) -> None: 1675 self.hub_party_id = hub_party_id 1676 self.roles = roles 1677 self.token = token 1678 self.url = url 1679 1680 @staticmethod 1681 def from_dict(obj: Any) -> 'Credentials': 1682 assert isinstance(obj, dict) 1683 hub_party_id = from_union([from_none, from_str], obj.get("hub_party_id")) 1684 roles = from_list(CredentialsRole.from_dict, obj.get("roles")) 1685 token = from_str(obj.get("token")) 1686 url = from_str(obj.get("url")) 1687 return Credentials(hub_party_id, roles, token, url) 1688 1689 def to_dict(self) -> dict: 1690 result: dict = {} 1691 if self.hub_party_id is not None: 1692 result["hub_party_id"] = from_union([from_none, from_str], self.hub_party_id) 1693 result["roles"] = from_list(lambda x: to_class(CredentialsRole, x), self.roles) 1694 result["token"] = from_str(self.token) 1695 result["url"] = from_str(self.url) 1696 return result
Credentials( hub_party_id: Optional[str], roles: List[CredentialsRole], token: str, url: str)
roles: List[CredentialsRole]
1680 @staticmethod 1681 def from_dict(obj: Any) -> 'Credentials': 1682 assert isinstance(obj, dict) 1683 hub_party_id = from_union([from_none, from_str], obj.get("hub_party_id")) 1684 roles = from_list(CredentialsRole.from_dict, obj.get("roles")) 1685 token = from_str(obj.get("token")) 1686 url = from_str(obj.get("url")) 1687 return Credentials(hub_party_id, roles, token, url)
def
to_dict(self) -> dict:
1689 def to_dict(self) -> dict: 1690 result: dict = {} 1691 if self.hub_party_id is not None: 1692 result["hub_party_id"] = from_union([from_none, from_str], self.hub_party_id) 1693 result["roles"] = from_list(lambda x: to_class(CredentialsRole, x), self.roles) 1694 result["token"] = from_str(self.token) 1695 result["url"] = from_str(self.url) 1696 return result
class
ModuleID(enum.Enum):
1699class ModuleID(Enum): 1700 CDRS = "cdrs" 1701 CHARGINGPROFILES = "chargingprofiles" 1702 COMMANDS = "commands" 1703 CREDENTIALS = "credentials" 1704 HUBCLIENTINFO = "hubclientinfo" 1705 LOCATIONS = "locations" 1706 SESSIONS = "sessions" 1707 TARIFFS = "tariffs" 1708 TOKENS = "tokens"
CDRS =
<ModuleID.CDRS: 'cdrs'>
CHARGINGPROFILES =
<ModuleID.CHARGINGPROFILES: 'chargingprofiles'>
COMMANDS =
<ModuleID.COMMANDS: 'commands'>
CREDENTIALS =
<ModuleID.CREDENTIALS: 'credentials'>
HUBCLIENTINFO =
<ModuleID.HUBCLIENTINFO: 'hubclientinfo'>
LOCATIONS =
<ModuleID.LOCATIONS: 'locations'>
SESSIONS =
<ModuleID.SESSIONS: 'sessions'>
TARIFFS =
<ModuleID.TARIFFS: 'tariffs'>
TOKENS =
<ModuleID.TOKENS: 'tokens'>
class
InterfaceRole(enum.Enum):
RECEIVER =
<InterfaceRole.RECEIVER: 'RECEIVER'>
SENDER =
<InterfaceRole.SENDER: 'SENDER'>
class
Endpoint:
1716class Endpoint: 1717 identifier: ModuleID 1718 role: InterfaceRole 1719 url: str 1720 1721 def __init__(self, identifier: ModuleID, role: InterfaceRole, url: str) -> None: 1722 self.identifier = identifier 1723 self.role = role 1724 self.url = url 1725 1726 @staticmethod 1727 def from_dict(obj: Any) -> 'Endpoint': 1728 assert isinstance(obj, dict) 1729 identifier = ModuleID(obj.get("identifier")) 1730 role = InterfaceRole(obj.get("role")) 1731 url = from_str(obj.get("url")) 1732 return Endpoint(identifier, role, url) 1733 1734 def to_dict(self) -> dict: 1735 result: dict = {} 1736 result["identifier"] = to_enum(ModuleID, self.identifier) 1737 result["role"] = to_enum(InterfaceRole, self.role) 1738 result["url"] = from_str(self.url) 1739 return result
Endpoint(identifier: ModuleID, role: InterfaceRole, url: str)
identifier: ModuleID
role: InterfaceRole
class
Capability(enum.Enum):
1742class Capability(Enum): 1743 CHARGING_PREFERENCES_CAPABLE = "CHARGING_PREFERENCES_CAPABLE" 1744 CHARGING_PROFILE_CAPABLE = "CHARGING_PROFILE_CAPABLE" 1745 CHIP_CARD_SUPPORT = "CHIP_CARD_SUPPORT" 1746 CONTACTLESS_CARD_SUPPORT = "CONTACTLESS_CARD_SUPPORT" 1747 CREDIT_CARD_PAYABLE = "CREDIT_CARD_PAYABLE" 1748 DEBIT_CARD_PAYABLE = "DEBIT_CARD_PAYABLE" 1749 PED_TERMINAL = "PED_TERMINAL" 1750 REMOTE_START_STOP_CAPABLE = "REMOTE_START_STOP_CAPABLE" 1751 RESERVABLE = "RESERVABLE" 1752 RFID_READER = "RFID_READER" 1753 START_SESSION_CONNECTOR_REQUIRED = "START_SESSION_CONNECTOR_REQUIRED" 1754 TOKEN_GROUP_CAPABLE = "TOKEN_GROUP_CAPABLE" 1755 UNLOCK_CAPABLE = "UNLOCK_CAPABLE"
CHARGING_PREFERENCES_CAPABLE =
<Capability.CHARGING_PREFERENCES_CAPABLE: 'CHARGING_PREFERENCES_CAPABLE'>
CHARGING_PROFILE_CAPABLE =
<Capability.CHARGING_PROFILE_CAPABLE: 'CHARGING_PROFILE_CAPABLE'>
CHIP_CARD_SUPPORT =
<Capability.CHIP_CARD_SUPPORT: 'CHIP_CARD_SUPPORT'>
CONTACTLESS_CARD_SUPPORT =
<Capability.CONTACTLESS_CARD_SUPPORT: 'CONTACTLESS_CARD_SUPPORT'>
CREDIT_CARD_PAYABLE =
<Capability.CREDIT_CARD_PAYABLE: 'CREDIT_CARD_PAYABLE'>
DEBIT_CARD_PAYABLE =
<Capability.DEBIT_CARD_PAYABLE: 'DEBIT_CARD_PAYABLE'>
PED_TERMINAL =
<Capability.PED_TERMINAL: 'PED_TERMINAL'>
REMOTE_START_STOP_CAPABLE =
<Capability.REMOTE_START_STOP_CAPABLE: 'REMOTE_START_STOP_CAPABLE'>
RESERVABLE =
<Capability.RESERVABLE: 'RESERVABLE'>
RFID_READER =
<Capability.RFID_READER: 'RFID_READER'>
START_SESSION_CONNECTOR_REQUIRED =
<Capability.START_SESSION_CONNECTOR_REQUIRED: 'START_SESSION_CONNECTOR_REQUIRED'>
TOKEN_GROUP_CAPABLE =
<Capability.TOKEN_GROUP_CAPABLE: 'TOKEN_GROUP_CAPABLE'>
UNLOCK_CAPABLE =
<Capability.UNLOCK_CAPABLE: 'UNLOCK_CAPABLE'>
class
EvsePosition(enum.Enum):
CENTER =
<EvsePosition.CENTER: 'CENTER'>
LEFT =
<EvsePosition.LEFT: 'LEFT'>
RIGHT =
<EvsePosition.RIGHT: 'RIGHT'>
class
EvseParking:
1764class EvseParking: 1765 evse_position: Optional[EvsePosition] 1766 parking_id: str 1767 1768 def __init__(self, evse_position: Optional[EvsePosition], parking_id: str) -> None: 1769 self.evse_position = evse_position 1770 self.parking_id = parking_id 1771 1772 @staticmethod 1773 def from_dict(obj: Any) -> 'EvseParking': 1774 assert isinstance(obj, dict) 1775 evse_position = from_union([from_none, EvsePosition], obj.get("evse_position")) 1776 parking_id = from_str(obj.get("parking_id")) 1777 return EvseParking(evse_position, parking_id) 1778 1779 def to_dict(self) -> dict: 1780 result: dict = {} 1781 if self.evse_position is not None: 1782 result["evse_position"] = from_union([from_none, lambda x: to_enum(EvsePosition, x)], self.evse_position) 1783 result["parking_id"] = from_str(self.parking_id) 1784 return result
EvseParking(evse_position: Optional[EvsePosition], parking_id: str)
evse_position: Optional[EvsePosition]
class
ParkingRestriction(enum.Enum):
1787class ParkingRestriction(Enum): 1788 CUSTOMERS = "CUSTOMERS" 1789 DISABLED = "DISABLED" 1790 EMPLOYEES = "EMPLOYEES" 1791 EV_ONLY = "EV_ONLY" 1792 MOTORCYCLES = "MOTORCYCLES" 1793 PLUGGED = "PLUGGED" 1794 TAXIS = "TAXIS" 1795 TENANTS = "TENANTS"
CUSTOMERS =
<ParkingRestriction.CUSTOMERS: 'CUSTOMERS'>
DISABLED =
<ParkingRestriction.DISABLED: 'DISABLED'>
EMPLOYEES =
<ParkingRestriction.EMPLOYEES: 'EMPLOYEES'>
EV_ONLY =
<ParkingRestriction.EV_ONLY: 'EV_ONLY'>
MOTORCYCLES =
<ParkingRestriction.MOTORCYCLES: 'MOTORCYCLES'>
PLUGGED =
<ParkingRestriction.PLUGGED: 'PLUGGED'>
TAXIS =
<ParkingRestriction.TAXIS: 'TAXIS'>
TENANTS =
<ParkingRestriction.TENANTS: 'TENANTS'>
class
Status(enum.Enum):
1798class Status(Enum): 1799 AVAILABLE = "AVAILABLE" 1800 BLOCKED = "BLOCKED" 1801 CHARGING = "CHARGING" 1802 INOPERATIVE = "INOPERATIVE" 1803 OUTOFORDER = "OUTOFORDER" 1804 PLANNED = "PLANNED" 1805 REMOVED = "REMOVED" 1806 RESERVED = "RESERVED" 1807 UNKNOWN = "UNKNOWN"
AVAILABLE =
<Status.AVAILABLE: 'AVAILABLE'>
BLOCKED =
<Status.BLOCKED: 'BLOCKED'>
CHARGING =
<Status.CHARGING: 'CHARGING'>
INOPERATIVE =
<Status.INOPERATIVE: 'INOPERATIVE'>
OUTOFORDER =
<Status.OUTOFORDER: 'OUTOFORDER'>
PLANNED =
<Status.PLANNED: 'PLANNED'>
REMOVED =
<Status.REMOVED: 'REMOVED'>
RESERVED =
<Status.RESERVED: 'RESERVED'>
UNKNOWN =
<Status.UNKNOWN: 'UNKNOWN'>
class
StatusSchedule:
1810class StatusSchedule: 1811 period_begin: str 1812 period_end: Optional[str] 1813 status: Status 1814 1815 def __init__(self, period_begin: str, period_end: Optional[str], status: Status) -> None: 1816 self.period_begin = period_begin 1817 self.period_end = period_end 1818 self.status = status 1819 1820 @staticmethod 1821 def from_dict(obj: Any) -> 'StatusSchedule': 1822 assert isinstance(obj, dict) 1823 period_begin = from_str(obj.get("period_begin")) 1824 period_end = from_union([from_none, from_str], obj.get("period_end")) 1825 status = Status(obj.get("status")) 1826 return StatusSchedule(period_begin, period_end, status) 1827 1828 def to_dict(self) -> dict: 1829 result: dict = {} 1830 result["period_begin"] = from_str(self.period_begin) 1831 if self.period_end is not None: 1832 result["period_end"] = from_union([from_none, from_str], self.period_end) 1833 result["status"] = to_enum(Status, self.status) 1834 return result
StatusSchedule(period_begin: str, period_end: Optional[str], status: Status)
status: Status
1820 @staticmethod 1821 def from_dict(obj: Any) -> 'StatusSchedule': 1822 assert isinstance(obj, dict) 1823 period_begin = from_str(obj.get("period_begin")) 1824 period_end = from_union([from_none, from_str], obj.get("period_end")) 1825 status = Status(obj.get("status")) 1826 return StatusSchedule(period_begin, period_end, status)
def
to_dict(self) -> dict:
1828 def to_dict(self) -> dict: 1829 result: dict = {} 1830 result["period_begin"] = from_str(self.period_begin) 1831 if self.period_end is not None: 1832 result["period_end"] = from_union([from_none, from_str], self.period_end) 1833 result["status"] = to_enum(Status, self.status) 1834 return result
class
Evse:
1837class Evse: 1838 accepted_service_providers: Optional[List[str]] 1839 capabilities: Optional[List[Capability]] 1840 connectors: List[Connector] 1841 coordinates: Optional[GeoLocation] 1842 directions: Optional[List[DisplayText]] 1843 evse_id: Optional[str] 1844 floor_level: Optional[str] 1845 images: Optional[List[Image]] 1846 last_updated: str 1847 parking: Optional[List[EvseParking]] 1848 parking_restrictions: Optional[List[ParkingRestriction]] 1849 physical_reference: Optional[str] 1850 status: Status 1851 status_schedule: Optional[List[StatusSchedule]] 1852 uid: str 1853 1854 def __init__(self, accepted_service_providers: Optional[List[str]], capabilities: Optional[List[Capability]], connectors: List[Connector], coordinates: Optional[GeoLocation], directions: Optional[List[DisplayText]], evse_id: Optional[str], floor_level: Optional[str], images: Optional[List[Image]], last_updated: str, parking: Optional[List[EvseParking]], parking_restrictions: Optional[List[ParkingRestriction]], physical_reference: Optional[str], status: Status, status_schedule: Optional[List[StatusSchedule]], uid: str) -> None: 1855 self.accepted_service_providers = accepted_service_providers 1856 self.capabilities = capabilities 1857 self.connectors = connectors 1858 self.coordinates = coordinates 1859 self.directions = directions 1860 self.evse_id = evse_id 1861 self.floor_level = floor_level 1862 self.images = images 1863 self.last_updated = last_updated 1864 self.parking = parking 1865 self.parking_restrictions = parking_restrictions 1866 self.physical_reference = physical_reference 1867 self.status = status 1868 self.status_schedule = status_schedule 1869 self.uid = uid 1870 1871 @staticmethod 1872 def from_dict(obj: Any) -> 'Evse': 1873 assert isinstance(obj, dict) 1874 accepted_service_providers = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("accepted_service_providers")) 1875 capabilities = from_union([from_none, lambda x: from_list(Capability, x)], obj.get("capabilities")) 1876 connectors = from_list(Connector.from_dict, obj.get("connectors")) 1877 coordinates = from_union([from_none, GeoLocation.from_dict], obj.get("coordinates")) 1878 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 1879 evse_id = from_union([from_none, from_str], obj.get("evse_id")) 1880 floor_level = from_union([from_none, from_str], obj.get("floor_level")) 1881 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 1882 last_updated = from_str(obj.get("last_updated")) 1883 parking = from_union([from_none, lambda x: from_list(EvseParking.from_dict, x)], obj.get("parking")) 1884 parking_restrictions = from_union([from_none, lambda x: from_list(ParkingRestriction, x)], obj.get("parking_restrictions")) 1885 physical_reference = from_union([from_none, from_str], obj.get("physical_reference")) 1886 status = Status(obj.get("status")) 1887 status_schedule = from_union([from_none, lambda x: from_list(StatusSchedule.from_dict, x)], obj.get("status_schedule")) 1888 uid = from_str(obj.get("uid")) 1889 return Evse(accepted_service_providers, capabilities, connectors, coordinates, directions, evse_id, floor_level, images, last_updated, parking, parking_restrictions, physical_reference, status, status_schedule, uid) 1890 1891 def to_dict(self) -> dict: 1892 result: dict = {} 1893 if self.accepted_service_providers is not None: 1894 result["accepted_service_providers"] = from_union([from_none, lambda x: from_list(from_str, x)], self.accepted_service_providers) 1895 if self.capabilities is not None: 1896 result["capabilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Capability, x), x)], self.capabilities) 1897 result["connectors"] = from_list(lambda x: to_class(Connector, x), self.connectors) 1898 if self.coordinates is not None: 1899 result["coordinates"] = from_union([from_none, lambda x: to_class(GeoLocation, x)], self.coordinates) 1900 if self.directions is not None: 1901 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 1902 if self.evse_id is not None: 1903 result["evse_id"] = from_union([from_none, from_str], self.evse_id) 1904 if self.floor_level is not None: 1905 result["floor_level"] = from_union([from_none, from_str], self.floor_level) 1906 if self.images is not None: 1907 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 1908 result["last_updated"] = from_str(self.last_updated) 1909 if self.parking is not None: 1910 result["parking"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EvseParking, x), x)], self.parking) 1911 if self.parking_restrictions is not None: 1912 result["parking_restrictions"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(ParkingRestriction, x), x)], self.parking_restrictions) 1913 if self.physical_reference is not None: 1914 result["physical_reference"] = from_union([from_none, from_str], self.physical_reference) 1915 result["status"] = to_enum(Status, self.status) 1916 if self.status_schedule is not None: 1917 result["status_schedule"] = from_union([from_none, lambda x: from_list(lambda x: to_class(StatusSchedule, x), x)], self.status_schedule) 1918 result["uid"] = from_str(self.uid) 1919 return result
Evse( accepted_service_providers: Optional[List[str]], capabilities: Optional[List[Capability]], connectors: List[Connector], coordinates: Optional[GeoLocation], directions: Optional[List[DisplayText]], evse_id: Optional[str], floor_level: Optional[str], images: Optional[List[Image]], last_updated: str, parking: Optional[List[EvseParking]], parking_restrictions: Optional[List[ParkingRestriction]], physical_reference: Optional[str], status: Status, status_schedule: Optional[List[StatusSchedule]], uid: str)
1854 def __init__(self, accepted_service_providers: Optional[List[str]], capabilities: Optional[List[Capability]], connectors: List[Connector], coordinates: Optional[GeoLocation], directions: Optional[List[DisplayText]], evse_id: Optional[str], floor_level: Optional[str], images: Optional[List[Image]], last_updated: str, parking: Optional[List[EvseParking]], parking_restrictions: Optional[List[ParkingRestriction]], physical_reference: Optional[str], status: Status, status_schedule: Optional[List[StatusSchedule]], uid: str) -> None: 1855 self.accepted_service_providers = accepted_service_providers 1856 self.capabilities = capabilities 1857 self.connectors = connectors 1858 self.coordinates = coordinates 1859 self.directions = directions 1860 self.evse_id = evse_id 1861 self.floor_level = floor_level 1862 self.images = images 1863 self.last_updated = last_updated 1864 self.parking = parking 1865 self.parking_restrictions = parking_restrictions 1866 self.physical_reference = physical_reference 1867 self.status = status 1868 self.status_schedule = status_schedule 1869 self.uid = uid
capabilities: Optional[List[Capability]]
connectors: List[Connector]
coordinates: Optional[GeoLocation]
directions: Optional[List[DisplayText]]
images: Optional[List[Image]]
parking: Optional[List[EvseParking]]
parking_restrictions: Optional[List[ParkingRestriction]]
status: Status
status_schedule: Optional[List[StatusSchedule]]
1871 @staticmethod 1872 def from_dict(obj: Any) -> 'Evse': 1873 assert isinstance(obj, dict) 1874 accepted_service_providers = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("accepted_service_providers")) 1875 capabilities = from_union([from_none, lambda x: from_list(Capability, x)], obj.get("capabilities")) 1876 connectors = from_list(Connector.from_dict, obj.get("connectors")) 1877 coordinates = from_union([from_none, GeoLocation.from_dict], obj.get("coordinates")) 1878 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 1879 evse_id = from_union([from_none, from_str], obj.get("evse_id")) 1880 floor_level = from_union([from_none, from_str], obj.get("floor_level")) 1881 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 1882 last_updated = from_str(obj.get("last_updated")) 1883 parking = from_union([from_none, lambda x: from_list(EvseParking.from_dict, x)], obj.get("parking")) 1884 parking_restrictions = from_union([from_none, lambda x: from_list(ParkingRestriction, x)], obj.get("parking_restrictions")) 1885 physical_reference = from_union([from_none, from_str], obj.get("physical_reference")) 1886 status = Status(obj.get("status")) 1887 status_schedule = from_union([from_none, lambda x: from_list(StatusSchedule.from_dict, x)], obj.get("status_schedule")) 1888 uid = from_str(obj.get("uid")) 1889 return Evse(accepted_service_providers, capabilities, connectors, coordinates, directions, evse_id, floor_level, images, last_updated, parking, parking_restrictions, physical_reference, status, status_schedule, uid)
def
to_dict(self) -> dict:
1891 def to_dict(self) -> dict: 1892 result: dict = {} 1893 if self.accepted_service_providers is not None: 1894 result["accepted_service_providers"] = from_union([from_none, lambda x: from_list(from_str, x)], self.accepted_service_providers) 1895 if self.capabilities is not None: 1896 result["capabilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Capability, x), x)], self.capabilities) 1897 result["connectors"] = from_list(lambda x: to_class(Connector, x), self.connectors) 1898 if self.coordinates is not None: 1899 result["coordinates"] = from_union([from_none, lambda x: to_class(GeoLocation, x)], self.coordinates) 1900 if self.directions is not None: 1901 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 1902 if self.evse_id is not None: 1903 result["evse_id"] = from_union([from_none, from_str], self.evse_id) 1904 if self.floor_level is not None: 1905 result["floor_level"] = from_union([from_none, from_str], self.floor_level) 1906 if self.images is not None: 1907 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 1908 result["last_updated"] = from_str(self.last_updated) 1909 if self.parking is not None: 1910 result["parking"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EvseParking, x), x)], self.parking) 1911 if self.parking_restrictions is not None: 1912 result["parking_restrictions"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(ParkingRestriction, x), x)], self.parking_restrictions) 1913 if self.physical_reference is not None: 1914 result["physical_reference"] = from_union([from_none, from_str], self.physical_reference) 1915 result["status"] = to_enum(Status, self.status) 1916 if self.status_schedule is not None: 1917 result["status_schedule"] = from_union([from_none, lambda x: from_list(lambda x: to_class(StatusSchedule, x), x)], self.status_schedule) 1918 result["uid"] = from_str(self.uid) 1919 return result
class
ConnectionStatus(enum.Enum):
1922class ConnectionStatus(Enum): 1923 CONNECTED = "CONNECTED" 1924 OFFLINE = "OFFLINE" 1925 PLANNED = "PLANNED" 1926 SUSPENDED = "SUSPENDED"
CONNECTED =
<ConnectionStatus.CONNECTED: 'CONNECTED'>
OFFLINE =
<ConnectionStatus.OFFLINE: 'OFFLINE'>
PLANNED =
<ConnectionStatus.PLANNED: 'PLANNED'>
SUSPENDED =
<ConnectionStatus.SUSPENDED: 'SUSPENDED'>
class
HubClientInfo:
1929class HubClientInfo: 1930 country_code: str 1931 last_updated: str 1932 party_id: str 1933 role: Role 1934 status: ConnectionStatus 1935 1936 def __init__(self, country_code: str, last_updated: str, party_id: str, role: Role, status: ConnectionStatus) -> None: 1937 self.country_code = country_code 1938 self.last_updated = last_updated 1939 self.party_id = party_id 1940 self.role = role 1941 self.status = status 1942 1943 @staticmethod 1944 def from_dict(obj: Any) -> 'HubClientInfo': 1945 assert isinstance(obj, dict) 1946 country_code = from_str(obj.get("country_code")) 1947 last_updated = from_str(obj.get("last_updated")) 1948 party_id = from_str(obj.get("party_id")) 1949 role = Role(obj.get("role")) 1950 status = ConnectionStatus(obj.get("status")) 1951 return HubClientInfo(country_code, last_updated, party_id, role, status) 1952 1953 def to_dict(self) -> dict: 1954 result: dict = {} 1955 result["country_code"] = from_str(self.country_code) 1956 result["last_updated"] = from_str(self.last_updated) 1957 result["party_id"] = from_str(self.party_id) 1958 result["role"] = to_enum(Role, self.role) 1959 result["status"] = to_enum(ConnectionStatus, self.status) 1960 return result
HubClientInfo( country_code: str, last_updated: str, party_id: str, role: Role, status: ConnectionStatus)
role: Role
status: ConnectionStatus
1943 @staticmethod 1944 def from_dict(obj: Any) -> 'HubClientInfo': 1945 assert isinstance(obj, dict) 1946 country_code = from_str(obj.get("country_code")) 1947 last_updated = from_str(obj.get("last_updated")) 1948 party_id = from_str(obj.get("party_id")) 1949 role = Role(obj.get("role")) 1950 status = ConnectionStatus(obj.get("status")) 1951 return HubClientInfo(country_code, last_updated, party_id, role, status)
def
to_dict(self) -> dict:
1953 def to_dict(self) -> dict: 1954 result: dict = {} 1955 result["country_code"] = from_str(self.country_code) 1956 result["last_updated"] = from_str(self.last_updated) 1957 result["party_id"] = from_str(self.party_id) 1958 result["role"] = to_enum(Role, self.role) 1959 result["status"] = to_enum(ConnectionStatus, self.status) 1960 return result
class
Facility(enum.Enum):
1963class Facility(Enum): 1964 AIRPORT = "AIRPORT" 1965 BIKE_SHARING = "BIKE_SHARING" 1966 BUS_STOP = "BUS_STOP" 1967 CAFE = "CAFE" 1968 CARPOOL_PARKING = "CARPOOL_PARKING" 1969 FUEL_STATION = "FUEL_STATION" 1970 HOTEL = "HOTEL" 1971 MALL = "MALL" 1972 METRO_STATION = "METRO_STATION" 1973 MUSEUM = "MUSEUM" 1974 NATURE = "NATURE" 1975 PARKING_LOT = "PARKING_LOT" 1976 RECREATION_AREA = "RECREATION_AREA" 1977 RESTAURANT = "RESTAURANT" 1978 SPORT = "SPORT" 1979 SUPERMARKET = "SUPERMARKET" 1980 TAXI_STAND = "TAXI_STAND" 1981 TRAIN_STATION = "TRAIN_STATION" 1982 TRAM_STOP = "TRAM_STOP" 1983 WIFI = "WIFI"
AIRPORT =
<Facility.AIRPORT: 'AIRPORT'>
BIKE_SHARING =
<Facility.BIKE_SHARING: 'BIKE_SHARING'>
BUS_STOP =
<Facility.BUS_STOP: 'BUS_STOP'>
CAFE =
<Facility.CAFE: 'CAFE'>
CARPOOL_PARKING =
<Facility.CARPOOL_PARKING: 'CARPOOL_PARKING'>
FUEL_STATION =
<Facility.FUEL_STATION: 'FUEL_STATION'>
HOTEL =
<Facility.HOTEL: 'HOTEL'>
MALL =
<Facility.MALL: 'MALL'>
METRO_STATION =
<Facility.METRO_STATION: 'METRO_STATION'>
MUSEUM =
<Facility.MUSEUM: 'MUSEUM'>
NATURE =
<Facility.NATURE: 'NATURE'>
PARKING_LOT =
<Facility.PARKING_LOT: 'PARKING_LOT'>
RECREATION_AREA =
<Facility.RECREATION_AREA: 'RECREATION_AREA'>
RESTAURANT =
<Facility.RESTAURANT: 'RESTAURANT'>
SPORT =
<Facility.SPORT: 'SPORT'>
SUPERMARKET =
<Facility.SUPERMARKET: 'SUPERMARKET'>
TAXI_STAND =
<Facility.TAXI_STAND: 'TAXI_STAND'>
TRAIN_STATION =
<Facility.TRAIN_STATION: 'TRAIN_STATION'>
TRAM_STOP =
<Facility.TRAM_STOP: 'TRAM_STOP'>
WIFI =
<Facility.WIFI: 'WIFI'>
class
ExceptionalPeriod:
1986class ExceptionalPeriod: 1987 period_begin: str 1988 period_end: str 1989 1990 def __init__(self, period_begin: str, period_end: str) -> None: 1991 self.period_begin = period_begin 1992 self.period_end = period_end 1993 1994 @staticmethod 1995 def from_dict(obj: Any) -> 'ExceptionalPeriod': 1996 assert isinstance(obj, dict) 1997 period_begin = from_str(obj.get("period_begin")) 1998 period_end = from_str(obj.get("period_end")) 1999 return ExceptionalPeriod(period_begin, period_end) 2000 2001 def to_dict(self) -> dict: 2002 result: dict = {} 2003 result["period_begin"] = from_str(self.period_begin) 2004 result["period_end"] = from_str(self.period_end) 2005 return result
class
RegularHours:
2008class RegularHours: 2009 period_begin: str 2010 period_end: str 2011 weekday: int 2012 2013 def __init__(self, period_begin: str, period_end: str, weekday: int) -> None: 2014 self.period_begin = period_begin 2015 self.period_end = period_end 2016 self.weekday = weekday 2017 2018 @staticmethod 2019 def from_dict(obj: Any) -> 'RegularHours': 2020 assert isinstance(obj, dict) 2021 period_begin = from_str(obj.get("period_begin")) 2022 period_end = from_str(obj.get("period_end")) 2023 weekday = from_int(obj.get("weekday")) 2024 return RegularHours(period_begin, period_end, weekday) 2025 2026 def to_dict(self) -> dict: 2027 result: dict = {} 2028 result["period_begin"] = from_str(self.period_begin) 2029 result["period_end"] = from_str(self.period_end) 2030 result["weekday"] = from_int(self.weekday) 2031 return result
2018 @staticmethod 2019 def from_dict(obj: Any) -> 'RegularHours': 2020 assert isinstance(obj, dict) 2021 period_begin = from_str(obj.get("period_begin")) 2022 period_end = from_str(obj.get("period_end")) 2023 weekday = from_int(obj.get("weekday")) 2024 return RegularHours(period_begin, period_end, weekday)
class
Hours:
2034class Hours: 2035 exceptional_closings: Optional[List[ExceptionalPeriod]] 2036 exceptional_openings: Optional[List[ExceptionalPeriod]] 2037 regular_hours: Optional[List[RegularHours]] 2038 twentyfourseven: bool 2039 2040 def __init__(self, exceptional_closings: Optional[List[ExceptionalPeriod]], exceptional_openings: Optional[List[ExceptionalPeriod]], regular_hours: Optional[List[RegularHours]], twentyfourseven: bool) -> None: 2041 self.exceptional_closings = exceptional_closings 2042 self.exceptional_openings = exceptional_openings 2043 self.regular_hours = regular_hours 2044 self.twentyfourseven = twentyfourseven 2045 2046 @staticmethod 2047 def from_dict(obj: Any) -> 'Hours': 2048 assert isinstance(obj, dict) 2049 exceptional_closings = from_union([from_none, lambda x: from_list(ExceptionalPeriod.from_dict, x)], obj.get("exceptional_closings")) 2050 exceptional_openings = from_union([from_none, lambda x: from_list(ExceptionalPeriod.from_dict, x)], obj.get("exceptional_openings")) 2051 regular_hours = from_union([from_none, lambda x: from_list(RegularHours.from_dict, x)], obj.get("regular_hours")) 2052 twentyfourseven = from_bool(obj.get("twentyfourseven")) 2053 return Hours(exceptional_closings, exceptional_openings, regular_hours, twentyfourseven) 2054 2055 def to_dict(self) -> dict: 2056 result: dict = {} 2057 if self.exceptional_closings is not None: 2058 result["exceptional_closings"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ExceptionalPeriod, x), x)], self.exceptional_closings) 2059 if self.exceptional_openings is not None: 2060 result["exceptional_openings"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ExceptionalPeriod, x), x)], self.exceptional_openings) 2061 if self.regular_hours is not None: 2062 result["regular_hours"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RegularHours, x), x)], self.regular_hours) 2063 result["twentyfourseven"] = from_bool(self.twentyfourseven) 2064 return result
Hours( exceptional_closings: Optional[List[ExceptionalPeriod]], exceptional_openings: Optional[List[ExceptionalPeriod]], regular_hours: Optional[List[RegularHours]], twentyfourseven: bool)
2040 def __init__(self, exceptional_closings: Optional[List[ExceptionalPeriod]], exceptional_openings: Optional[List[ExceptionalPeriod]], regular_hours: Optional[List[RegularHours]], twentyfourseven: bool) -> None: 2041 self.exceptional_closings = exceptional_closings 2042 self.exceptional_openings = exceptional_openings 2043 self.regular_hours = regular_hours 2044 self.twentyfourseven = twentyfourseven
exceptional_closings: Optional[List[ExceptionalPeriod]]
exceptional_openings: Optional[List[ExceptionalPeriod]]
regular_hours: Optional[List[RegularHours]]
2046 @staticmethod 2047 def from_dict(obj: Any) -> 'Hours': 2048 assert isinstance(obj, dict) 2049 exceptional_closings = from_union([from_none, lambda x: from_list(ExceptionalPeriod.from_dict, x)], obj.get("exceptional_closings")) 2050 exceptional_openings = from_union([from_none, lambda x: from_list(ExceptionalPeriod.from_dict, x)], obj.get("exceptional_openings")) 2051 regular_hours = from_union([from_none, lambda x: from_list(RegularHours.from_dict, x)], obj.get("regular_hours")) 2052 twentyfourseven = from_bool(obj.get("twentyfourseven")) 2053 return Hours(exceptional_closings, exceptional_openings, regular_hours, twentyfourseven)
def
to_dict(self) -> dict:
2055 def to_dict(self) -> dict: 2056 result: dict = {} 2057 if self.exceptional_closings is not None: 2058 result["exceptional_closings"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ExceptionalPeriod, x), x)], self.exceptional_closings) 2059 if self.exceptional_openings is not None: 2060 result["exceptional_openings"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ExceptionalPeriod, x), x)], self.exceptional_openings) 2061 if self.regular_hours is not None: 2062 result["regular_hours"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RegularHours, x), x)], self.regular_hours) 2063 result["twentyfourseven"] = from_bool(self.twentyfourseven) 2064 return result
class
ParkingDirection(enum.Enum):
2067class ParkingDirection(Enum): 2068 ANGLE = "ANGLE" 2069 PARALLEL = "PARALLEL" 2070 PERPENDICULAR = "PERPENDICULAR"
ANGLE =
<ParkingDirection.ANGLE: 'ANGLE'>
PARALLEL =
<ParkingDirection.PARALLEL: 'PARALLEL'>
PERPENDICULAR =
<ParkingDirection.PERPENDICULAR: 'PERPENDICULAR'>
class
VehicleType(enum.Enum):
2073class VehicleType(Enum): 2074 BUS = "BUS" 2075 DISABLED = "DISABLED" 2076 MOTORCYCLE = "MOTORCYCLE" 2077 PERSONAL_VEHICLE = "PERSONAL_VEHICLE" 2078 PERSONAL_VEHICLE_WITH_TRAILER = "PERSONAL_VEHICLE_WITH_TRAILER" 2079 RIGID = "RIGID" 2080 SEMI_TRACTOR = "SEMI_TRACTOR" 2081 TRUCK_WITH_TRAILER = "TRUCK_WITH_TRAILER" 2082 VAN = "VAN"
BUS =
<VehicleType.BUS: 'BUS'>
DISABLED =
<VehicleType.DISABLED: 'DISABLED'>
MOTORCYCLE =
<VehicleType.MOTORCYCLE: 'MOTORCYCLE'>
PERSONAL_VEHICLE =
<VehicleType.PERSONAL_VEHICLE: 'PERSONAL_VEHICLE'>
PERSONAL_VEHICLE_WITH_TRAILER =
<VehicleType.PERSONAL_VEHICLE_WITH_TRAILER: 'PERSONAL_VEHICLE_WITH_TRAILER'>
RIGID =
<VehicleType.RIGID: 'RIGID'>
SEMI_TRACTOR =
<VehicleType.SEMI_TRACTOR: 'SEMI_TRACTOR'>
TRUCK_WITH_TRAILER =
<VehicleType.TRUCK_WITH_TRAILER: 'TRUCK_WITH_TRAILER'>
VAN =
<VehicleType.VAN: 'VAN'>
class
Parking:
2085class Parking: 2086 apds_reference: Optional[str] 2087 dangerous_goods_allowed: Optional[bool] 2088 direction: Optional[ParkingDirection] 2089 drive_through: Optional[bool] 2090 id: str 2091 images: Optional[List[Image]] 2092 lighting: Optional[bool] 2093 max_vehicle_height: Optional[float] 2094 max_vehicle_length: Optional[float] 2095 max_vehicle_weight: Optional[float] 2096 max_vehicle_width: Optional[float] 2097 parking_space_length: Optional[float] 2098 parking_space_width: Optional[float] 2099 physical_reference: Optional[str] 2100 refrigeration_outlet: Optional[bool] 2101 reservation_required: bool 2102 restricted_to_type: bool 2103 roofed: Optional[bool] 2104 standards: Optional[List[str]] 2105 time_limit: Optional[float] 2106 vehicle_types: List[VehicleType] 2107 2108 def __init__(self, apds_reference: Optional[str], dangerous_goods_allowed: Optional[bool], direction: Optional[ParkingDirection], drive_through: Optional[bool], id: str, images: Optional[List[Image]], lighting: Optional[bool], max_vehicle_height: Optional[float], max_vehicle_length: Optional[float], max_vehicle_weight: Optional[float], max_vehicle_width: Optional[float], parking_space_length: Optional[float], parking_space_width: Optional[float], physical_reference: Optional[str], refrigeration_outlet: Optional[bool], reservation_required: bool, restricted_to_type: bool, roofed: Optional[bool], standards: Optional[List[str]], time_limit: Optional[float], vehicle_types: List[VehicleType]) -> None: 2109 self.apds_reference = apds_reference 2110 self.dangerous_goods_allowed = dangerous_goods_allowed 2111 self.direction = direction 2112 self.drive_through = drive_through 2113 self.id = id 2114 self.images = images 2115 self.lighting = lighting 2116 self.max_vehicle_height = max_vehicle_height 2117 self.max_vehicle_length = max_vehicle_length 2118 self.max_vehicle_weight = max_vehicle_weight 2119 self.max_vehicle_width = max_vehicle_width 2120 self.parking_space_length = parking_space_length 2121 self.parking_space_width = parking_space_width 2122 self.physical_reference = physical_reference 2123 self.refrigeration_outlet = refrigeration_outlet 2124 self.reservation_required = reservation_required 2125 self.restricted_to_type = restricted_to_type 2126 self.roofed = roofed 2127 self.standards = standards 2128 self.time_limit = time_limit 2129 self.vehicle_types = vehicle_types 2130 2131 @staticmethod 2132 def from_dict(obj: Any) -> 'Parking': 2133 assert isinstance(obj, dict) 2134 apds_reference = from_union([from_none, from_str], obj.get("apds_reference")) 2135 dangerous_goods_allowed = from_union([from_none, from_bool], obj.get("dangerous_goods_allowed")) 2136 direction = from_union([from_none, ParkingDirection], obj.get("direction")) 2137 drive_through = from_union([from_none, from_bool], obj.get("drive_through")) 2138 id = from_str(obj.get("id")) 2139 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 2140 lighting = from_union([from_none, from_bool], obj.get("lighting")) 2141 max_vehicle_height = from_union([from_none, from_float], obj.get("max_vehicle_height")) 2142 max_vehicle_length = from_union([from_none, from_float], obj.get("max_vehicle_length")) 2143 max_vehicle_weight = from_union([from_none, from_float], obj.get("max_vehicle_weight")) 2144 max_vehicle_width = from_union([from_none, from_float], obj.get("max_vehicle_width")) 2145 parking_space_length = from_union([from_none, from_float], obj.get("parking_space_length")) 2146 parking_space_width = from_union([from_none, from_float], obj.get("parking_space_width")) 2147 physical_reference = from_union([from_none, from_str], obj.get("physical_reference")) 2148 refrigeration_outlet = from_union([from_none, from_bool], obj.get("refrigeration_outlet")) 2149 reservation_required = from_bool(obj.get("reservation_required")) 2150 restricted_to_type = from_bool(obj.get("restricted_to_type")) 2151 roofed = from_union([from_none, from_bool], obj.get("roofed")) 2152 standards = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("standards")) 2153 time_limit = from_union([from_none, from_float], obj.get("time_limit")) 2154 vehicle_types = from_list(VehicleType, obj.get("vehicle_types")) 2155 return Parking(apds_reference, dangerous_goods_allowed, direction, drive_through, id, images, lighting, max_vehicle_height, max_vehicle_length, max_vehicle_weight, max_vehicle_width, parking_space_length, parking_space_width, physical_reference, refrigeration_outlet, reservation_required, restricted_to_type, roofed, standards, time_limit, vehicle_types) 2156 2157 def to_dict(self) -> dict: 2158 result: dict = {} 2159 if self.apds_reference is not None: 2160 result["apds_reference"] = from_union([from_none, from_str], self.apds_reference) 2161 if self.dangerous_goods_allowed is not None: 2162 result["dangerous_goods_allowed"] = from_union([from_none, from_bool], self.dangerous_goods_allowed) 2163 if self.direction is not None: 2164 result["direction"] = from_union([from_none, lambda x: to_enum(ParkingDirection, x)], self.direction) 2165 if self.drive_through is not None: 2166 result["drive_through"] = from_union([from_none, from_bool], self.drive_through) 2167 result["id"] = from_str(self.id) 2168 if self.images is not None: 2169 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 2170 if self.lighting is not None: 2171 result["lighting"] = from_union([from_none, from_bool], self.lighting) 2172 if self.max_vehicle_height is not None: 2173 result["max_vehicle_height"] = from_union([from_none, to_float], self.max_vehicle_height) 2174 if self.max_vehicle_length is not None: 2175 result["max_vehicle_length"] = from_union([from_none, to_float], self.max_vehicle_length) 2176 if self.max_vehicle_weight is not None: 2177 result["max_vehicle_weight"] = from_union([from_none, to_float], self.max_vehicle_weight) 2178 if self.max_vehicle_width is not None: 2179 result["max_vehicle_width"] = from_union([from_none, to_float], self.max_vehicle_width) 2180 if self.parking_space_length is not None: 2181 result["parking_space_length"] = from_union([from_none, to_float], self.parking_space_length) 2182 if self.parking_space_width is not None: 2183 result["parking_space_width"] = from_union([from_none, to_float], self.parking_space_width) 2184 if self.physical_reference is not None: 2185 result["physical_reference"] = from_union([from_none, from_str], self.physical_reference) 2186 if self.refrigeration_outlet is not None: 2187 result["refrigeration_outlet"] = from_union([from_none, from_bool], self.refrigeration_outlet) 2188 result["reservation_required"] = from_bool(self.reservation_required) 2189 result["restricted_to_type"] = from_bool(self.restricted_to_type) 2190 if self.roofed is not None: 2191 result["roofed"] = from_union([from_none, from_bool], self.roofed) 2192 if self.standards is not None: 2193 result["standards"] = from_union([from_none, lambda x: from_list(from_str, x)], self.standards) 2194 if self.time_limit is not None: 2195 result["time_limit"] = from_union([from_none, to_float], self.time_limit) 2196 result["vehicle_types"] = from_list(lambda x: to_enum(VehicleType, x), self.vehicle_types) 2197 return result
Parking( apds_reference: Optional[str], dangerous_goods_allowed: Optional[bool], direction: Optional[ParkingDirection], drive_through: Optional[bool], id: str, images: Optional[List[Image]], lighting: Optional[bool], max_vehicle_height: Optional[float], max_vehicle_length: Optional[float], max_vehicle_weight: Optional[float], max_vehicle_width: Optional[float], parking_space_length: Optional[float], parking_space_width: Optional[float], physical_reference: Optional[str], refrigeration_outlet: Optional[bool], reservation_required: bool, restricted_to_type: bool, roofed: Optional[bool], standards: Optional[List[str]], time_limit: Optional[float], vehicle_types: List[VehicleType])
2108 def __init__(self, apds_reference: Optional[str], dangerous_goods_allowed: Optional[bool], direction: Optional[ParkingDirection], drive_through: Optional[bool], id: str, images: Optional[List[Image]], lighting: Optional[bool], max_vehicle_height: Optional[float], max_vehicle_length: Optional[float], max_vehicle_weight: Optional[float], max_vehicle_width: Optional[float], parking_space_length: Optional[float], parking_space_width: Optional[float], physical_reference: Optional[str], refrigeration_outlet: Optional[bool], reservation_required: bool, restricted_to_type: bool, roofed: Optional[bool], standards: Optional[List[str]], time_limit: Optional[float], vehicle_types: List[VehicleType]) -> None: 2109 self.apds_reference = apds_reference 2110 self.dangerous_goods_allowed = dangerous_goods_allowed 2111 self.direction = direction 2112 self.drive_through = drive_through 2113 self.id = id 2114 self.images = images 2115 self.lighting = lighting 2116 self.max_vehicle_height = max_vehicle_height 2117 self.max_vehicle_length = max_vehicle_length 2118 self.max_vehicle_weight = max_vehicle_weight 2119 self.max_vehicle_width = max_vehicle_width 2120 self.parking_space_length = parking_space_length 2121 self.parking_space_width = parking_space_width 2122 self.physical_reference = physical_reference 2123 self.refrigeration_outlet = refrigeration_outlet 2124 self.reservation_required = reservation_required 2125 self.restricted_to_type = restricted_to_type 2126 self.roofed = roofed 2127 self.standards = standards 2128 self.time_limit = time_limit 2129 self.vehicle_types = vehicle_types
direction: Optional[ParkingDirection]
images: Optional[List[Image]]
vehicle_types: List[VehicleType]
2131 @staticmethod 2132 def from_dict(obj: Any) -> 'Parking': 2133 assert isinstance(obj, dict) 2134 apds_reference = from_union([from_none, from_str], obj.get("apds_reference")) 2135 dangerous_goods_allowed = from_union([from_none, from_bool], obj.get("dangerous_goods_allowed")) 2136 direction = from_union([from_none, ParkingDirection], obj.get("direction")) 2137 drive_through = from_union([from_none, from_bool], obj.get("drive_through")) 2138 id = from_str(obj.get("id")) 2139 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 2140 lighting = from_union([from_none, from_bool], obj.get("lighting")) 2141 max_vehicle_height = from_union([from_none, from_float], obj.get("max_vehicle_height")) 2142 max_vehicle_length = from_union([from_none, from_float], obj.get("max_vehicle_length")) 2143 max_vehicle_weight = from_union([from_none, from_float], obj.get("max_vehicle_weight")) 2144 max_vehicle_width = from_union([from_none, from_float], obj.get("max_vehicle_width")) 2145 parking_space_length = from_union([from_none, from_float], obj.get("parking_space_length")) 2146 parking_space_width = from_union([from_none, from_float], obj.get("parking_space_width")) 2147 physical_reference = from_union([from_none, from_str], obj.get("physical_reference")) 2148 refrigeration_outlet = from_union([from_none, from_bool], obj.get("refrigeration_outlet")) 2149 reservation_required = from_bool(obj.get("reservation_required")) 2150 restricted_to_type = from_bool(obj.get("restricted_to_type")) 2151 roofed = from_union([from_none, from_bool], obj.get("roofed")) 2152 standards = from_union([from_none, lambda x: from_list(from_str, x)], obj.get("standards")) 2153 time_limit = from_union([from_none, from_float], obj.get("time_limit")) 2154 vehicle_types = from_list(VehicleType, obj.get("vehicle_types")) 2155 return Parking(apds_reference, dangerous_goods_allowed, direction, drive_through, id, images, lighting, max_vehicle_height, max_vehicle_length, max_vehicle_weight, max_vehicle_width, parking_space_length, parking_space_width, physical_reference, refrigeration_outlet, reservation_required, restricted_to_type, roofed, standards, time_limit, vehicle_types)
def
to_dict(self) -> dict:
2157 def to_dict(self) -> dict: 2158 result: dict = {} 2159 if self.apds_reference is not None: 2160 result["apds_reference"] = from_union([from_none, from_str], self.apds_reference) 2161 if self.dangerous_goods_allowed is not None: 2162 result["dangerous_goods_allowed"] = from_union([from_none, from_bool], self.dangerous_goods_allowed) 2163 if self.direction is not None: 2164 result["direction"] = from_union([from_none, lambda x: to_enum(ParkingDirection, x)], self.direction) 2165 if self.drive_through is not None: 2166 result["drive_through"] = from_union([from_none, from_bool], self.drive_through) 2167 result["id"] = from_str(self.id) 2168 if self.images is not None: 2169 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 2170 if self.lighting is not None: 2171 result["lighting"] = from_union([from_none, from_bool], self.lighting) 2172 if self.max_vehicle_height is not None: 2173 result["max_vehicle_height"] = from_union([from_none, to_float], self.max_vehicle_height) 2174 if self.max_vehicle_length is not None: 2175 result["max_vehicle_length"] = from_union([from_none, to_float], self.max_vehicle_length) 2176 if self.max_vehicle_weight is not None: 2177 result["max_vehicle_weight"] = from_union([from_none, to_float], self.max_vehicle_weight) 2178 if self.max_vehicle_width is not None: 2179 result["max_vehicle_width"] = from_union([from_none, to_float], self.max_vehicle_width) 2180 if self.parking_space_length is not None: 2181 result["parking_space_length"] = from_union([from_none, to_float], self.parking_space_length) 2182 if self.parking_space_width is not None: 2183 result["parking_space_width"] = from_union([from_none, to_float], self.parking_space_width) 2184 if self.physical_reference is not None: 2185 result["physical_reference"] = from_union([from_none, from_str], self.physical_reference) 2186 if self.refrigeration_outlet is not None: 2187 result["refrigeration_outlet"] = from_union([from_none, from_bool], self.refrigeration_outlet) 2188 result["reservation_required"] = from_bool(self.reservation_required) 2189 result["restricted_to_type"] = from_bool(self.restricted_to_type) 2190 if self.roofed is not None: 2191 result["roofed"] = from_union([from_none, from_bool], self.roofed) 2192 if self.standards is not None: 2193 result["standards"] = from_union([from_none, lambda x: from_list(from_str, x)], self.standards) 2194 if self.time_limit is not None: 2195 result["time_limit"] = from_union([from_none, to_float], self.time_limit) 2196 result["vehicle_types"] = from_list(lambda x: to_enum(VehicleType, x), self.vehicle_types) 2197 return result
class
ParkingType(enum.Enum):
2200class ParkingType(Enum): 2201 ALONG_MOTORWAY = "ALONG_MOTORWAY" 2202 ON_DRIVEWAY = "ON_DRIVEWAY" 2203 ON_STREET = "ON_STREET" 2204 PARKING_GARAGE = "PARKING_GARAGE" 2205 PARKING_LOT = "PARKING_LOT" 2206 UNDERGROUND_GARAGE = "UNDERGROUND_GARAGE"
ALONG_MOTORWAY =
<ParkingType.ALONG_MOTORWAY: 'ALONG_MOTORWAY'>
ON_DRIVEWAY =
<ParkingType.ON_DRIVEWAY: 'ON_DRIVEWAY'>
ON_STREET =
<ParkingType.ON_STREET: 'ON_STREET'>
PARKING_GARAGE =
<ParkingType.PARKING_GARAGE: 'PARKING_GARAGE'>
PARKING_LOT =
<ParkingType.PARKING_LOT: 'PARKING_LOT'>
UNDERGROUND_GARAGE =
<ParkingType.UNDERGROUND_GARAGE: 'UNDERGROUND_GARAGE'>
class
PublishTokenType:
2209class PublishTokenType: 2210 group_id: Optional[str] 2211 issuer: Optional[str] 2212 type: Optional[TokenType] 2213 uid: Optional[str] 2214 visual_number: Optional[str] 2215 2216 def __init__(self, group_id: Optional[str], issuer: Optional[str], type: Optional[TokenType], uid: Optional[str], visual_number: Optional[str]) -> None: 2217 self.group_id = group_id 2218 self.issuer = issuer 2219 self.type = type 2220 self.uid = uid 2221 self.visual_number = visual_number 2222 2223 @staticmethod 2224 def from_dict(obj: Any) -> 'PublishTokenType': 2225 assert isinstance(obj, dict) 2226 group_id = from_union([from_none, from_str], obj.get("group_id")) 2227 issuer = from_union([from_none, from_str], obj.get("issuer")) 2228 type = from_union([from_none, TokenType], obj.get("type")) 2229 uid = from_union([from_none, from_str], obj.get("uid")) 2230 visual_number = from_union([from_none, from_str], obj.get("visual_number")) 2231 return PublishTokenType(group_id, issuer, type, uid, visual_number) 2232 2233 def to_dict(self) -> dict: 2234 result: dict = {} 2235 if self.group_id is not None: 2236 result["group_id"] = from_union([from_none, from_str], self.group_id) 2237 if self.issuer is not None: 2238 result["issuer"] = from_union([from_none, from_str], self.issuer) 2239 if self.type is not None: 2240 result["type"] = from_union([from_none, lambda x: to_enum(TokenType, x)], self.type) 2241 if self.uid is not None: 2242 result["uid"] = from_union([from_none, from_str], self.uid) 2243 if self.visual_number is not None: 2244 result["visual_number"] = from_union([from_none, from_str], self.visual_number) 2245 return result
PublishTokenType( group_id: Optional[str], issuer: Optional[str], type: Optional[TokenType], uid: Optional[str], visual_number: Optional[str])
type: Optional[TokenType]
2223 @staticmethod 2224 def from_dict(obj: Any) -> 'PublishTokenType': 2225 assert isinstance(obj, dict) 2226 group_id = from_union([from_none, from_str], obj.get("group_id")) 2227 issuer = from_union([from_none, from_str], obj.get("issuer")) 2228 type = from_union([from_none, TokenType], obj.get("type")) 2229 uid = from_union([from_none, from_str], obj.get("uid")) 2230 visual_number = from_union([from_none, from_str], obj.get("visual_number")) 2231 return PublishTokenType(group_id, issuer, type, uid, visual_number)
def
to_dict(self) -> dict:
2233 def to_dict(self) -> dict: 2234 result: dict = {} 2235 if self.group_id is not None: 2236 result["group_id"] = from_union([from_none, from_str], self.group_id) 2237 if self.issuer is not None: 2238 result["issuer"] = from_union([from_none, from_str], self.issuer) 2239 if self.type is not None: 2240 result["type"] = from_union([from_none, lambda x: to_enum(TokenType, x)], self.type) 2241 if self.uid is not None: 2242 result["uid"] = from_union([from_none, from_str], self.uid) 2243 if self.visual_number is not None: 2244 result["visual_number"] = from_union([from_none, from_str], self.visual_number) 2245 return result
class
AdditionalGeoLocation:
2248class AdditionalGeoLocation: 2249 latitude: str 2250 longitude: str 2251 name: Optional[DisplayText] 2252 2253 def __init__(self, latitude: str, longitude: str, name: Optional[DisplayText]) -> None: 2254 self.latitude = latitude 2255 self.longitude = longitude 2256 self.name = name 2257 2258 @staticmethod 2259 def from_dict(obj: Any) -> 'AdditionalGeoLocation': 2260 assert isinstance(obj, dict) 2261 latitude = from_str(obj.get("latitude")) 2262 longitude = from_str(obj.get("longitude")) 2263 name = from_union([from_none, DisplayText.from_dict], obj.get("name")) 2264 return AdditionalGeoLocation(latitude, longitude, name) 2265 2266 def to_dict(self) -> dict: 2267 result: dict = {} 2268 result["latitude"] = from_str(self.latitude) 2269 result["longitude"] = from_str(self.longitude) 2270 if self.name is not None: 2271 result["name"] = from_union([from_none, lambda x: to_class(DisplayText, x)], self.name) 2272 return result
AdditionalGeoLocation(latitude: str, longitude: str, name: Optional[DisplayText])
name: Optional[DisplayText]
2258 @staticmethod 2259 def from_dict(obj: Any) -> 'AdditionalGeoLocation': 2260 assert isinstance(obj, dict) 2261 latitude = from_str(obj.get("latitude")) 2262 longitude = from_str(obj.get("longitude")) 2263 name = from_union([from_none, DisplayText.from_dict], obj.get("name")) 2264 return AdditionalGeoLocation(latitude, longitude, name)
class
Location:
2275class Location: 2276 address: str 2277 charging_when_closed: Optional[bool] 2278 city: str 2279 coordinates: GeoLocation 2280 country: str 2281 country_code: str 2282 directions: Optional[List[DisplayText]] 2283 energy_mix: Optional[EnergyMix] 2284 evses: Optional[List[Evse]] 2285 facilities: Optional[List[Facility]] 2286 help_phone: Optional[str] 2287 id: str 2288 images: Optional[List[Image]] 2289 last_updated: str 2290 name: Optional[str] 2291 opening_times: Optional[Hours] 2292 operator: Optional[BusinessDetails] 2293 owner: Optional[BusinessDetails] 2294 parking_places: Optional[List[Parking]] 2295 parking_type: Optional[ParkingType] 2296 party_id: str 2297 postal_code: Optional[str] 2298 publish: bool 2299 publish_allowed_to: Optional[List[PublishTokenType]] 2300 related_locations: Optional[List[AdditionalGeoLocation]] 2301 state: Optional[str] 2302 suboperator: Optional[BusinessDetails] 2303 time_zone: str 2304 2305 def __init__(self, address: str, charging_when_closed: Optional[bool], city: str, coordinates: GeoLocation, country: str, country_code: str, directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], help_phone: Optional[str], id: str, images: Optional[List[Image]], last_updated: str, name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], parking_places: Optional[List[Parking]], parking_type: Optional[ParkingType], party_id: str, postal_code: Optional[str], publish: bool, publish_allowed_to: Optional[List[PublishTokenType]], related_locations: Optional[List[AdditionalGeoLocation]], state: Optional[str], suboperator: Optional[BusinessDetails], time_zone: str) -> None: 2306 self.address = address 2307 self.charging_when_closed = charging_when_closed 2308 self.city = city 2309 self.coordinates = coordinates 2310 self.country = country 2311 self.country_code = country_code 2312 self.directions = directions 2313 self.energy_mix = energy_mix 2314 self.evses = evses 2315 self.facilities = facilities 2316 self.help_phone = help_phone 2317 self.id = id 2318 self.images = images 2319 self.last_updated = last_updated 2320 self.name = name 2321 self.opening_times = opening_times 2322 self.operator = operator 2323 self.owner = owner 2324 self.parking_places = parking_places 2325 self.parking_type = parking_type 2326 self.party_id = party_id 2327 self.postal_code = postal_code 2328 self.publish = publish 2329 self.publish_allowed_to = publish_allowed_to 2330 self.related_locations = related_locations 2331 self.state = state 2332 self.suboperator = suboperator 2333 self.time_zone = time_zone 2334 2335 @staticmethod 2336 def from_dict(obj: Any) -> 'Location': 2337 assert isinstance(obj, dict) 2338 address = from_str(obj.get("address")) 2339 charging_when_closed = from_union([from_none, from_bool], obj.get("charging_when_closed")) 2340 city = from_str(obj.get("city")) 2341 coordinates = GeoLocation.from_dict(obj.get("coordinates")) 2342 country = from_str(obj.get("country")) 2343 country_code = from_str(obj.get("country_code")) 2344 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 2345 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 2346 evses = from_union([from_none, lambda x: from_list(Evse.from_dict, x)], obj.get("evses")) 2347 facilities = from_union([from_none, lambda x: from_list(Facility, x)], obj.get("facilities")) 2348 help_phone = from_union([from_none, from_str], obj.get("help_phone")) 2349 id = from_str(obj.get("id")) 2350 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 2351 last_updated = from_str(obj.get("last_updated")) 2352 name = from_union([from_none, from_str], obj.get("name")) 2353 opening_times = from_union([from_none, Hours.from_dict], obj.get("opening_times")) 2354 operator = from_union([from_none, BusinessDetails.from_dict], obj.get("operator")) 2355 owner = from_union([from_none, BusinessDetails.from_dict], obj.get("owner")) 2356 parking_places = from_union([from_none, lambda x: from_list(Parking.from_dict, x)], obj.get("parking_places")) 2357 parking_type = from_union([from_none, ParkingType], obj.get("parking_type")) 2358 party_id = from_str(obj.get("party_id")) 2359 postal_code = from_union([from_none, from_str], obj.get("postal_code")) 2360 publish = from_bool(obj.get("publish")) 2361 publish_allowed_to = from_union([from_none, lambda x: from_list(PublishTokenType.from_dict, x)], obj.get("publish_allowed_to")) 2362 related_locations = from_union([from_none, lambda x: from_list(AdditionalGeoLocation.from_dict, x)], obj.get("related_locations")) 2363 state = from_union([from_none, from_str], obj.get("state")) 2364 suboperator = from_union([from_none, BusinessDetails.from_dict], obj.get("suboperator")) 2365 time_zone = from_str(obj.get("time_zone")) 2366 return Location(address, charging_when_closed, city, coordinates, country, country_code, directions, energy_mix, evses, facilities, help_phone, id, images, last_updated, name, opening_times, operator, owner, parking_places, parking_type, party_id, postal_code, publish, publish_allowed_to, related_locations, state, suboperator, time_zone) 2367 2368 def to_dict(self) -> dict: 2369 result: dict = {} 2370 result["address"] = from_str(self.address) 2371 if self.charging_when_closed is not None: 2372 result["charging_when_closed"] = from_union([from_none, from_bool], self.charging_when_closed) 2373 result["city"] = from_str(self.city) 2374 result["coordinates"] = to_class(GeoLocation, self.coordinates) 2375 result["country"] = from_str(self.country) 2376 result["country_code"] = from_str(self.country_code) 2377 if self.directions is not None: 2378 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 2379 if self.energy_mix is not None: 2380 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 2381 if self.evses is not None: 2382 result["evses"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Evse, x), x)], self.evses) 2383 if self.facilities is not None: 2384 result["facilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Facility, x), x)], self.facilities) 2385 if self.help_phone is not None: 2386 result["help_phone"] = from_union([from_none, from_str], self.help_phone) 2387 result["id"] = from_str(self.id) 2388 if self.images is not None: 2389 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 2390 result["last_updated"] = from_str(self.last_updated) 2391 if self.name is not None: 2392 result["name"] = from_union([from_none, from_str], self.name) 2393 if self.opening_times is not None: 2394 result["opening_times"] = from_union([from_none, lambda x: to_class(Hours, x)], self.opening_times) 2395 if self.operator is not None: 2396 result["operator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.operator) 2397 if self.owner is not None: 2398 result["owner"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.owner) 2399 if self.parking_places is not None: 2400 result["parking_places"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Parking, x), x)], self.parking_places) 2401 if self.parking_type is not None: 2402 result["parking_type"] = from_union([from_none, lambda x: to_enum(ParkingType, x)], self.parking_type) 2403 result["party_id"] = from_str(self.party_id) 2404 if self.postal_code is not None: 2405 result["postal_code"] = from_union([from_none, from_str], self.postal_code) 2406 result["publish"] = from_bool(self.publish) 2407 if self.publish_allowed_to is not None: 2408 result["publish_allowed_to"] = from_union([from_none, lambda x: from_list(lambda x: to_class(PublishTokenType, x), x)], self.publish_allowed_to) 2409 if self.related_locations is not None: 2410 result["related_locations"] = from_union([from_none, lambda x: from_list(lambda x: to_class(AdditionalGeoLocation, x), x)], self.related_locations) 2411 if self.state is not None: 2412 result["state"] = from_union([from_none, from_str], self.state) 2413 if self.suboperator is not None: 2414 result["suboperator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.suboperator) 2415 result["time_zone"] = from_str(self.time_zone) 2416 return result
Location( address: str, charging_when_closed: Optional[bool], city: str, coordinates: GeoLocation, country: str, country_code: str, directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], help_phone: Optional[str], id: str, images: Optional[List[Image]], last_updated: str, name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], parking_places: Optional[List[Parking]], parking_type: Optional[ParkingType], party_id: str, postal_code: Optional[str], publish: bool, publish_allowed_to: Optional[List[PublishTokenType]], related_locations: Optional[List[AdditionalGeoLocation]], state: Optional[str], suboperator: Optional[BusinessDetails], time_zone: str)
2305 def __init__(self, address: str, charging_when_closed: Optional[bool], city: str, coordinates: GeoLocation, country: str, country_code: str, directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], help_phone: Optional[str], id: str, images: Optional[List[Image]], last_updated: str, name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], parking_places: Optional[List[Parking]], parking_type: Optional[ParkingType], party_id: str, postal_code: Optional[str], publish: bool, publish_allowed_to: Optional[List[PublishTokenType]], related_locations: Optional[List[AdditionalGeoLocation]], state: Optional[str], suboperator: Optional[BusinessDetails], time_zone: str) -> None: 2306 self.address = address 2307 self.charging_when_closed = charging_when_closed 2308 self.city = city 2309 self.coordinates = coordinates 2310 self.country = country 2311 self.country_code = country_code 2312 self.directions = directions 2313 self.energy_mix = energy_mix 2314 self.evses = evses 2315 self.facilities = facilities 2316 self.help_phone = help_phone 2317 self.id = id 2318 self.images = images 2319 self.last_updated = last_updated 2320 self.name = name 2321 self.opening_times = opening_times 2322 self.operator = operator 2323 self.owner = owner 2324 self.parking_places = parking_places 2325 self.parking_type = parking_type 2326 self.party_id = party_id 2327 self.postal_code = postal_code 2328 self.publish = publish 2329 self.publish_allowed_to = publish_allowed_to 2330 self.related_locations = related_locations 2331 self.state = state 2332 self.suboperator = suboperator 2333 self.time_zone = time_zone
coordinates: GeoLocation
directions: Optional[List[DisplayText]]
energy_mix: Optional[EnergyMix]
evses: Optional[List[Evse]]
facilities: Optional[List[Facility]]
images: Optional[List[Image]]
opening_times: Optional[Hours]
operator: Optional[BusinessDetails]
owner: Optional[BusinessDetails]
parking_places: Optional[List[Parking]]
parking_type: Optional[ParkingType]
publish_allowed_to: Optional[List[PublishTokenType]]
suboperator: Optional[BusinessDetails]
2335 @staticmethod 2336 def from_dict(obj: Any) -> 'Location': 2337 assert isinstance(obj, dict) 2338 address = from_str(obj.get("address")) 2339 charging_when_closed = from_union([from_none, from_bool], obj.get("charging_when_closed")) 2340 city = from_str(obj.get("city")) 2341 coordinates = GeoLocation.from_dict(obj.get("coordinates")) 2342 country = from_str(obj.get("country")) 2343 country_code = from_str(obj.get("country_code")) 2344 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 2345 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 2346 evses = from_union([from_none, lambda x: from_list(Evse.from_dict, x)], obj.get("evses")) 2347 facilities = from_union([from_none, lambda x: from_list(Facility, x)], obj.get("facilities")) 2348 help_phone = from_union([from_none, from_str], obj.get("help_phone")) 2349 id = from_str(obj.get("id")) 2350 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 2351 last_updated = from_str(obj.get("last_updated")) 2352 name = from_union([from_none, from_str], obj.get("name")) 2353 opening_times = from_union([from_none, Hours.from_dict], obj.get("opening_times")) 2354 operator = from_union([from_none, BusinessDetails.from_dict], obj.get("operator")) 2355 owner = from_union([from_none, BusinessDetails.from_dict], obj.get("owner")) 2356 parking_places = from_union([from_none, lambda x: from_list(Parking.from_dict, x)], obj.get("parking_places")) 2357 parking_type = from_union([from_none, ParkingType], obj.get("parking_type")) 2358 party_id = from_str(obj.get("party_id")) 2359 postal_code = from_union([from_none, from_str], obj.get("postal_code")) 2360 publish = from_bool(obj.get("publish")) 2361 publish_allowed_to = from_union([from_none, lambda x: from_list(PublishTokenType.from_dict, x)], obj.get("publish_allowed_to")) 2362 related_locations = from_union([from_none, lambda x: from_list(AdditionalGeoLocation.from_dict, x)], obj.get("related_locations")) 2363 state = from_union([from_none, from_str], obj.get("state")) 2364 suboperator = from_union([from_none, BusinessDetails.from_dict], obj.get("suboperator")) 2365 time_zone = from_str(obj.get("time_zone")) 2366 return Location(address, charging_when_closed, city, coordinates, country, country_code, directions, energy_mix, evses, facilities, help_phone, id, images, last_updated, name, opening_times, operator, owner, parking_places, parking_type, party_id, postal_code, publish, publish_allowed_to, related_locations, state, suboperator, time_zone)
def
to_dict(self) -> dict:
2368 def to_dict(self) -> dict: 2369 result: dict = {} 2370 result["address"] = from_str(self.address) 2371 if self.charging_when_closed is not None: 2372 result["charging_when_closed"] = from_union([from_none, from_bool], self.charging_when_closed) 2373 result["city"] = from_str(self.city) 2374 result["coordinates"] = to_class(GeoLocation, self.coordinates) 2375 result["country"] = from_str(self.country) 2376 result["country_code"] = from_str(self.country_code) 2377 if self.directions is not None: 2378 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 2379 if self.energy_mix is not None: 2380 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 2381 if self.evses is not None: 2382 result["evses"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Evse, x), x)], self.evses) 2383 if self.facilities is not None: 2384 result["facilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Facility, x), x)], self.facilities) 2385 if self.help_phone is not None: 2386 result["help_phone"] = from_union([from_none, from_str], self.help_phone) 2387 result["id"] = from_str(self.id) 2388 if self.images is not None: 2389 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 2390 result["last_updated"] = from_str(self.last_updated) 2391 if self.name is not None: 2392 result["name"] = from_union([from_none, from_str], self.name) 2393 if self.opening_times is not None: 2394 result["opening_times"] = from_union([from_none, lambda x: to_class(Hours, x)], self.opening_times) 2395 if self.operator is not None: 2396 result["operator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.operator) 2397 if self.owner is not None: 2398 result["owner"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.owner) 2399 if self.parking_places is not None: 2400 result["parking_places"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Parking, x), x)], self.parking_places) 2401 if self.parking_type is not None: 2402 result["parking_type"] = from_union([from_none, lambda x: to_enum(ParkingType, x)], self.parking_type) 2403 result["party_id"] = from_str(self.party_id) 2404 if self.postal_code is not None: 2405 result["postal_code"] = from_union([from_none, from_str], self.postal_code) 2406 result["publish"] = from_bool(self.publish) 2407 if self.publish_allowed_to is not None: 2408 result["publish_allowed_to"] = from_union([from_none, lambda x: from_list(lambda x: to_class(PublishTokenType, x), x)], self.publish_allowed_to) 2409 if self.related_locations is not None: 2410 result["related_locations"] = from_union([from_none, lambda x: from_list(lambda x: to_class(AdditionalGeoLocation, x), x)], self.related_locations) 2411 if self.state is not None: 2412 result["state"] = from_union([from_none, from_str], self.state) 2413 if self.suboperator is not None: 2414 result["suboperator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.suboperator) 2415 result["time_zone"] = from_str(self.time_zone) 2416 return result
class
ReserveNow:
2419class ReserveNow: 2420 authorization_reference: Optional[str] 2421 evse_uid: Optional[str] 2422 expiry_date: str 2423 location_id: str 2424 reservation_id: str 2425 response_url: str 2426 token: Token 2427 2428 def __init__(self, authorization_reference: Optional[str], evse_uid: Optional[str], expiry_date: str, location_id: str, reservation_id: str, response_url: str, token: Token) -> None: 2429 self.authorization_reference = authorization_reference 2430 self.evse_uid = evse_uid 2431 self.expiry_date = expiry_date 2432 self.location_id = location_id 2433 self.reservation_id = reservation_id 2434 self.response_url = response_url 2435 self.token = token 2436 2437 @staticmethod 2438 def from_dict(obj: Any) -> 'ReserveNow': 2439 assert isinstance(obj, dict) 2440 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 2441 evse_uid = from_union([from_none, from_str], obj.get("evse_uid")) 2442 expiry_date = from_str(obj.get("expiry_date")) 2443 location_id = from_str(obj.get("location_id")) 2444 reservation_id = from_str(obj.get("reservation_id")) 2445 response_url = from_str(obj.get("response_url")) 2446 token = Token.from_dict(obj.get("token")) 2447 return ReserveNow(authorization_reference, evse_uid, expiry_date, location_id, reservation_id, response_url, token) 2448 2449 def to_dict(self) -> dict: 2450 result: dict = {} 2451 if self.authorization_reference is not None: 2452 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 2453 if self.evse_uid is not None: 2454 result["evse_uid"] = from_union([from_none, from_str], self.evse_uid) 2455 result["expiry_date"] = from_str(self.expiry_date) 2456 result["location_id"] = from_str(self.location_id) 2457 result["reservation_id"] = from_str(self.reservation_id) 2458 result["response_url"] = from_str(self.response_url) 2459 result["token"] = to_class(Token, self.token) 2460 return result
ReserveNow( authorization_reference: Optional[str], evse_uid: Optional[str], expiry_date: str, location_id: str, reservation_id: str, response_url: str, token: Token)
2428 def __init__(self, authorization_reference: Optional[str], evse_uid: Optional[str], expiry_date: str, location_id: str, reservation_id: str, response_url: str, token: Token) -> None: 2429 self.authorization_reference = authorization_reference 2430 self.evse_uid = evse_uid 2431 self.expiry_date = expiry_date 2432 self.location_id = location_id 2433 self.reservation_id = reservation_id 2434 self.response_url = response_url 2435 self.token = token
token: Token
2437 @staticmethod 2438 def from_dict(obj: Any) -> 'ReserveNow': 2439 assert isinstance(obj, dict) 2440 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 2441 evse_uid = from_union([from_none, from_str], obj.get("evse_uid")) 2442 expiry_date = from_str(obj.get("expiry_date")) 2443 location_id = from_str(obj.get("location_id")) 2444 reservation_id = from_str(obj.get("reservation_id")) 2445 response_url = from_str(obj.get("response_url")) 2446 token = Token.from_dict(obj.get("token")) 2447 return ReserveNow(authorization_reference, evse_uid, expiry_date, location_id, reservation_id, response_url, token)
def
to_dict(self) -> dict:
2449 def to_dict(self) -> dict: 2450 result: dict = {} 2451 if self.authorization_reference is not None: 2452 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 2453 if self.evse_uid is not None: 2454 result["evse_uid"] = from_union([from_none, from_str], self.evse_uid) 2455 result["expiry_date"] = from_str(self.expiry_date) 2456 result["location_id"] = from_str(self.location_id) 2457 result["reservation_id"] = from_str(self.reservation_id) 2458 result["response_url"] = from_str(self.response_url) 2459 result["token"] = to_class(Token, self.token) 2460 return result
class
SessionStatus(enum.Enum):
2463class SessionStatus(Enum): 2464 ACTIVE = "ACTIVE" 2465 COMPLETED = "COMPLETED" 2466 INVALID = "INVALID" 2467 PENDING = "PENDING" 2468 RESERVATION = "RESERVATION"
ACTIVE =
<SessionStatus.ACTIVE: 'ACTIVE'>
COMPLETED =
<SessionStatus.COMPLETED: 'COMPLETED'>
INVALID =
<SessionStatus.INVALID: 'INVALID'>
PENDING =
<SessionStatus.PENDING: 'PENDING'>
RESERVATION =
<SessionStatus.RESERVATION: 'RESERVATION'>
class
Session:
2471class Session: 2472 auth_method: AuthMethod 2473 authorization_reference: Optional[str] 2474 cdr_token: CdrToken 2475 charging_periods: Optional[List[ChargingPeriod]] 2476 connector_id: str 2477 country_code: str 2478 currency: str 2479 end_date_time: Optional[str] 2480 evse_uid: str 2481 id: str 2482 kwh: float 2483 last_updated: str 2484 location_id: str 2485 meter_id: Optional[str] 2486 party_id: str 2487 start_date_time: str 2488 status: SessionStatus 2489 total_cost: Optional[Price] 2490 2491 def __init__(self, auth_method: AuthMethod, authorization_reference: Optional[str], cdr_token: CdrToken, charging_periods: Optional[List[ChargingPeriod]], connector_id: str, country_code: str, currency: str, end_date_time: Optional[str], evse_uid: str, id: str, kwh: float, last_updated: str, location_id: str, meter_id: Optional[str], party_id: str, start_date_time: str, status: SessionStatus, total_cost: Optional[Price]) -> None: 2492 self.auth_method = auth_method 2493 self.authorization_reference = authorization_reference 2494 self.cdr_token = cdr_token 2495 self.charging_periods = charging_periods 2496 self.connector_id = connector_id 2497 self.country_code = country_code 2498 self.currency = currency 2499 self.end_date_time = end_date_time 2500 self.evse_uid = evse_uid 2501 self.id = id 2502 self.kwh = kwh 2503 self.last_updated = last_updated 2504 self.location_id = location_id 2505 self.meter_id = meter_id 2506 self.party_id = party_id 2507 self.start_date_time = start_date_time 2508 self.status = status 2509 self.total_cost = total_cost 2510 2511 @staticmethod 2512 def from_dict(obj: Any) -> 'Session': 2513 assert isinstance(obj, dict) 2514 auth_method = AuthMethod(obj.get("auth_method")) 2515 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 2516 cdr_token = CdrToken.from_dict(obj.get("cdr_token")) 2517 charging_periods = from_union([from_none, lambda x: from_list(ChargingPeriod.from_dict, x)], obj.get("charging_periods")) 2518 connector_id = from_str(obj.get("connector_id")) 2519 country_code = from_str(obj.get("country_code")) 2520 currency = from_str(obj.get("currency")) 2521 end_date_time = from_union([from_none, from_str], obj.get("end_date_time")) 2522 evse_uid = from_str(obj.get("evse_uid")) 2523 id = from_str(obj.get("id")) 2524 kwh = from_float(obj.get("kwh")) 2525 last_updated = from_str(obj.get("last_updated")) 2526 location_id = from_str(obj.get("location_id")) 2527 meter_id = from_union([from_none, from_str], obj.get("meter_id")) 2528 party_id = from_str(obj.get("party_id")) 2529 start_date_time = from_str(obj.get("start_date_time")) 2530 status = SessionStatus(obj.get("status")) 2531 total_cost = from_union([from_none, Price.from_dict], obj.get("total_cost")) 2532 return Session(auth_method, authorization_reference, cdr_token, charging_periods, connector_id, country_code, currency, end_date_time, evse_uid, id, kwh, last_updated, location_id, meter_id, party_id, start_date_time, status, total_cost) 2533 2534 def to_dict(self) -> dict: 2535 result: dict = {} 2536 result["auth_method"] = to_enum(AuthMethod, self.auth_method) 2537 if self.authorization_reference is not None: 2538 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 2539 result["cdr_token"] = to_class(CdrToken, self.cdr_token) 2540 if self.charging_periods is not None: 2541 result["charging_periods"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ChargingPeriod, x), x)], self.charging_periods) 2542 result["connector_id"] = from_str(self.connector_id) 2543 result["country_code"] = from_str(self.country_code) 2544 result["currency"] = from_str(self.currency) 2545 if self.end_date_time is not None: 2546 result["end_date_time"] = from_union([from_none, from_str], self.end_date_time) 2547 result["evse_uid"] = from_str(self.evse_uid) 2548 result["id"] = from_str(self.id) 2549 result["kwh"] = to_float(self.kwh) 2550 result["last_updated"] = from_str(self.last_updated) 2551 result["location_id"] = from_str(self.location_id) 2552 if self.meter_id is not None: 2553 result["meter_id"] = from_union([from_none, from_str], self.meter_id) 2554 result["party_id"] = from_str(self.party_id) 2555 result["start_date_time"] = from_str(self.start_date_time) 2556 result["status"] = to_enum(SessionStatus, self.status) 2557 if self.total_cost is not None: 2558 result["total_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_cost) 2559 return result
Session( auth_method: AuthMethod, authorization_reference: Optional[str], cdr_token: CdrToken, charging_periods: Optional[List[ChargingPeriod]], connector_id: str, country_code: str, currency: str, end_date_time: Optional[str], evse_uid: str, id: str, kwh: float, last_updated: str, location_id: str, meter_id: Optional[str], party_id: str, start_date_time: str, status: SessionStatus, total_cost: Optional[Price])
2491 def __init__(self, auth_method: AuthMethod, authorization_reference: Optional[str], cdr_token: CdrToken, charging_periods: Optional[List[ChargingPeriod]], connector_id: str, country_code: str, currency: str, end_date_time: Optional[str], evse_uid: str, id: str, kwh: float, last_updated: str, location_id: str, meter_id: Optional[str], party_id: str, start_date_time: str, status: SessionStatus, total_cost: Optional[Price]) -> None: 2492 self.auth_method = auth_method 2493 self.authorization_reference = authorization_reference 2494 self.cdr_token = cdr_token 2495 self.charging_periods = charging_periods 2496 self.connector_id = connector_id 2497 self.country_code = country_code 2498 self.currency = currency 2499 self.end_date_time = end_date_time 2500 self.evse_uid = evse_uid 2501 self.id = id 2502 self.kwh = kwh 2503 self.last_updated = last_updated 2504 self.location_id = location_id 2505 self.meter_id = meter_id 2506 self.party_id = party_id 2507 self.start_date_time = start_date_time 2508 self.status = status 2509 self.total_cost = total_cost
auth_method: AuthMethod
cdr_token: CdrToken
charging_periods: Optional[List[ChargingPeriod]]
status: SessionStatus
total_cost: Optional[Price]
2511 @staticmethod 2512 def from_dict(obj: Any) -> 'Session': 2513 assert isinstance(obj, dict) 2514 auth_method = AuthMethod(obj.get("auth_method")) 2515 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 2516 cdr_token = CdrToken.from_dict(obj.get("cdr_token")) 2517 charging_periods = from_union([from_none, lambda x: from_list(ChargingPeriod.from_dict, x)], obj.get("charging_periods")) 2518 connector_id = from_str(obj.get("connector_id")) 2519 country_code = from_str(obj.get("country_code")) 2520 currency = from_str(obj.get("currency")) 2521 end_date_time = from_union([from_none, from_str], obj.get("end_date_time")) 2522 evse_uid = from_str(obj.get("evse_uid")) 2523 id = from_str(obj.get("id")) 2524 kwh = from_float(obj.get("kwh")) 2525 last_updated = from_str(obj.get("last_updated")) 2526 location_id = from_str(obj.get("location_id")) 2527 meter_id = from_union([from_none, from_str], obj.get("meter_id")) 2528 party_id = from_str(obj.get("party_id")) 2529 start_date_time = from_str(obj.get("start_date_time")) 2530 status = SessionStatus(obj.get("status")) 2531 total_cost = from_union([from_none, Price.from_dict], obj.get("total_cost")) 2532 return Session(auth_method, authorization_reference, cdr_token, charging_periods, connector_id, country_code, currency, end_date_time, evse_uid, id, kwh, last_updated, location_id, meter_id, party_id, start_date_time, status, total_cost)
def
to_dict(self) -> dict:
2534 def to_dict(self) -> dict: 2535 result: dict = {} 2536 result["auth_method"] = to_enum(AuthMethod, self.auth_method) 2537 if self.authorization_reference is not None: 2538 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 2539 result["cdr_token"] = to_class(CdrToken, self.cdr_token) 2540 if self.charging_periods is not None: 2541 result["charging_periods"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ChargingPeriod, x), x)], self.charging_periods) 2542 result["connector_id"] = from_str(self.connector_id) 2543 result["country_code"] = from_str(self.country_code) 2544 result["currency"] = from_str(self.currency) 2545 if self.end_date_time is not None: 2546 result["end_date_time"] = from_union([from_none, from_str], self.end_date_time) 2547 result["evse_uid"] = from_str(self.evse_uid) 2548 result["id"] = from_str(self.id) 2549 result["kwh"] = to_float(self.kwh) 2550 result["last_updated"] = from_str(self.last_updated) 2551 result["location_id"] = from_str(self.location_id) 2552 if self.meter_id is not None: 2553 result["meter_id"] = from_union([from_none, from_str], self.meter_id) 2554 result["party_id"] = from_str(self.party_id) 2555 result["start_date_time"] = from_str(self.start_date_time) 2556 result["status"] = to_enum(SessionStatus, self.status) 2557 if self.total_cost is not None: 2558 result["total_cost"] = from_union([from_none, lambda x: to_class(Price, x)], self.total_cost) 2559 return result
class
SetChargingProfile:
2562class SetChargingProfile: 2563 charging_profile: ChargingProfile 2564 response_url: str 2565 2566 def __init__(self, charging_profile: ChargingProfile, response_url: str) -> None: 2567 self.charging_profile = charging_profile 2568 self.response_url = response_url 2569 2570 @staticmethod 2571 def from_dict(obj: Any) -> 'SetChargingProfile': 2572 assert isinstance(obj, dict) 2573 charging_profile = ChargingProfile.from_dict(obj.get("charging_profile")) 2574 response_url = from_str(obj.get("response_url")) 2575 return SetChargingProfile(charging_profile, response_url) 2576 2577 def to_dict(self) -> dict: 2578 result: dict = {} 2579 result["charging_profile"] = to_class(ChargingProfile, self.charging_profile) 2580 result["response_url"] = from_str(self.response_url) 2581 return result
SetChargingProfile(charging_profile: ChargingProfile, response_url: str)
charging_profile: ChargingProfile
2570 @staticmethod 2571 def from_dict(obj: Any) -> 'SetChargingProfile': 2572 assert isinstance(obj, dict) 2573 charging_profile = ChargingProfile.from_dict(obj.get("charging_profile")) 2574 response_url = from_str(obj.get("response_url")) 2575 return SetChargingProfile(charging_profile, response_url)
class
StartSession:
2584class StartSession: 2585 authorization_reference: Optional[str] 2586 connector_id: Optional[str] 2587 evse_uid: Optional[str] 2588 location_id: str 2589 response_url: str 2590 token: Token 2591 2592 def __init__(self, authorization_reference: Optional[str], connector_id: Optional[str], evse_uid: Optional[str], location_id: str, response_url: str, token: Token) -> None: 2593 self.authorization_reference = authorization_reference 2594 self.connector_id = connector_id 2595 self.evse_uid = evse_uid 2596 self.location_id = location_id 2597 self.response_url = response_url 2598 self.token = token 2599 2600 @staticmethod 2601 def from_dict(obj: Any) -> 'StartSession': 2602 assert isinstance(obj, dict) 2603 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 2604 connector_id = from_union([from_none, from_str], obj.get("connector_id")) 2605 evse_uid = from_union([from_none, from_str], obj.get("evse_uid")) 2606 location_id = from_str(obj.get("location_id")) 2607 response_url = from_str(obj.get("response_url")) 2608 token = Token.from_dict(obj.get("token")) 2609 return StartSession(authorization_reference, connector_id, evse_uid, location_id, response_url, token) 2610 2611 def to_dict(self) -> dict: 2612 result: dict = {} 2613 if self.authorization_reference is not None: 2614 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 2615 if self.connector_id is not None: 2616 result["connector_id"] = from_union([from_none, from_str], self.connector_id) 2617 if self.evse_uid is not None: 2618 result["evse_uid"] = from_union([from_none, from_str], self.evse_uid) 2619 result["location_id"] = from_str(self.location_id) 2620 result["response_url"] = from_str(self.response_url) 2621 result["token"] = to_class(Token, self.token) 2622 return result
StartSession( authorization_reference: Optional[str], connector_id: Optional[str], evse_uid: Optional[str], location_id: str, response_url: str, token: Token)
2592 def __init__(self, authorization_reference: Optional[str], connector_id: Optional[str], evse_uid: Optional[str], location_id: str, response_url: str, token: Token) -> None: 2593 self.authorization_reference = authorization_reference 2594 self.connector_id = connector_id 2595 self.evse_uid = evse_uid 2596 self.location_id = location_id 2597 self.response_url = response_url 2598 self.token = token
token: Token
2600 @staticmethod 2601 def from_dict(obj: Any) -> 'StartSession': 2602 assert isinstance(obj, dict) 2603 authorization_reference = from_union([from_none, from_str], obj.get("authorization_reference")) 2604 connector_id = from_union([from_none, from_str], obj.get("connector_id")) 2605 evse_uid = from_union([from_none, from_str], obj.get("evse_uid")) 2606 location_id = from_str(obj.get("location_id")) 2607 response_url = from_str(obj.get("response_url")) 2608 token = Token.from_dict(obj.get("token")) 2609 return StartSession(authorization_reference, connector_id, evse_uid, location_id, response_url, token)
def
to_dict(self) -> dict:
2611 def to_dict(self) -> dict: 2612 result: dict = {} 2613 if self.authorization_reference is not None: 2614 result["authorization_reference"] = from_union([from_none, from_str], self.authorization_reference) 2615 if self.connector_id is not None: 2616 result["connector_id"] = from_union([from_none, from_str], self.connector_id) 2617 if self.evse_uid is not None: 2618 result["evse_uid"] = from_union([from_none, from_str], self.evse_uid) 2619 result["location_id"] = from_str(self.location_id) 2620 result["response_url"] = from_str(self.response_url) 2621 result["token"] = to_class(Token, self.token) 2622 return result
class
StopSession:
2625class StopSession: 2626 response_url: str 2627 session_id: str 2628 2629 def __init__(self, response_url: str, session_id: str) -> None: 2630 self.response_url = response_url 2631 self.session_id = session_id 2632 2633 @staticmethod 2634 def from_dict(obj: Any) -> 'StopSession': 2635 assert isinstance(obj, dict) 2636 response_url = from_str(obj.get("response_url")) 2637 session_id = from_str(obj.get("session_id")) 2638 return StopSession(response_url, session_id) 2639 2640 def to_dict(self) -> dict: 2641 result: dict = {} 2642 result["response_url"] = from_str(self.response_url) 2643 result["session_id"] = from_str(self.session_id) 2644 return result
class
UnlockConnector:
2647class UnlockConnector: 2648 connector_id: str 2649 evse_uid: str 2650 location_id: str 2651 response_url: str 2652 2653 def __init__(self, connector_id: str, evse_uid: str, location_id: str, response_url: str) -> None: 2654 self.connector_id = connector_id 2655 self.evse_uid = evse_uid 2656 self.location_id = location_id 2657 self.response_url = response_url 2658 2659 @staticmethod 2660 def from_dict(obj: Any) -> 'UnlockConnector': 2661 assert isinstance(obj, dict) 2662 connector_id = from_str(obj.get("connector_id")) 2663 evse_uid = from_str(obj.get("evse_uid")) 2664 location_id = from_str(obj.get("location_id")) 2665 response_url = from_str(obj.get("response_url")) 2666 return UnlockConnector(connector_id, evse_uid, location_id, response_url) 2667 2668 def to_dict(self) -> dict: 2669 result: dict = {} 2670 result["connector_id"] = from_str(self.connector_id) 2671 result["evse_uid"] = from_str(self.evse_uid) 2672 result["location_id"] = from_str(self.location_id) 2673 result["response_url"] = from_str(self.response_url) 2674 return result
2659 @staticmethod 2660 def from_dict(obj: Any) -> 'UnlockConnector': 2661 assert isinstance(obj, dict) 2662 connector_id = from_str(obj.get("connector_id")) 2663 evse_uid = from_str(obj.get("evse_uid")) 2664 location_id = from_str(obj.get("location_id")) 2665 response_url = from_str(obj.get("response_url")) 2666 return UnlockConnector(connector_id, evse_uid, location_id, response_url)
class
VersionNumber(enum.Enum):
2677class VersionNumber(Enum): 2678 THE_20 = "2.0" 2679 THE_21 = "2.1" 2680 THE_211 = "2.1.1" 2681 THE_22 = "2.2" 2682 THE_221 = "2.2.1" 2683 THE_230 = "2.3.0"
THE_20 =
<VersionNumber.THE_20: '2.0'>
THE_21 =
<VersionNumber.THE_21: '2.1'>
THE_211 =
<VersionNumber.THE_211: '2.1.1'>
THE_22 =
<VersionNumber.THE_22: '2.2'>
THE_221 =
<VersionNumber.THE_221: '2.2.1'>
THE_230 =
<VersionNumber.THE_230: '2.3.0'>
class
Version:
2686class Version: 2687 url: str 2688 version: VersionNumber 2689 2690 def __init__(self, url: str, version: VersionNumber) -> None: 2691 self.url = url 2692 self.version = version 2693 2694 @staticmethod 2695 def from_dict(obj: Any) -> 'Version': 2696 assert isinstance(obj, dict) 2697 url = from_str(obj.get("url")) 2698 version = VersionNumber(obj.get("version")) 2699 return Version(url, version) 2700 2701 def to_dict(self) -> dict: 2702 result: dict = {} 2703 result["url"] = from_str(self.url) 2704 result["version"] = to_enum(VersionNumber, self.version) 2705 return result
Version(url: str, version: VersionNumber)
version: VersionNumber
class
VersionDetails:
2708class VersionDetails: 2709 endpoints: List[Endpoint] 2710 version: VersionNumber 2711 2712 def __init__(self, endpoints: List[Endpoint], version: VersionNumber) -> None: 2713 self.endpoints = endpoints 2714 self.version = version 2715 2716 @staticmethod 2717 def from_dict(obj: Any) -> 'VersionDetails': 2718 assert isinstance(obj, dict) 2719 endpoints = from_list(Endpoint.from_dict, obj.get("endpoints")) 2720 version = VersionNumber(obj.get("version")) 2721 return VersionDetails(endpoints, version) 2722 2723 def to_dict(self) -> dict: 2724 result: dict = {} 2725 result["endpoints"] = from_list(lambda x: to_class(Endpoint, x), self.endpoints) 2726 result["version"] = to_enum(VersionNumber, self.version) 2727 return result
VersionDetails(endpoints: List[Endpoint], version: VersionNumber)
endpoints: List[Endpoint]
version: VersionNumber
class
V230:
2730class V230: 2731 active_charging_profile: Optional[ActiveChargingProfile] 2732 active_charging_profile_result: Optional[ActiveChargingProfileResult] 2733 authorization_info: Optional[AuthorizationInfo] 2734 cancel_reservation: Optional[CancelReservation] 2735 cdr: Optional[Cdr] 2736 charging_preferences: Optional[ChargingPreferences] 2737 charging_profile: Optional[ChargingProfile] 2738 charging_profile_response: Optional[ChargingProfileResponse] 2739 charging_profile_result: Optional[ChargingProfileResult] 2740 clear_profile_result: Optional[ClearProfileResult] 2741 command_response: Optional[CommandResponse] 2742 command_result: Optional[CommandResult] 2743 connector: Optional[Connector] 2744 credentials: Optional[Credentials] 2745 endpoint: Optional[Endpoint] 2746 evse: Optional[Evse] 2747 hub_client_info: Optional[HubClientInfo] 2748 location: Optional[Location] 2749 location_references: Optional[LocationReferences] 2750 reserve_now: Optional[ReserveNow] 2751 session: Optional[Session] 2752 set_charging_profile: Optional[SetChargingProfile] 2753 start_session: Optional[StartSession] 2754 stop_session: Optional[StopSession] 2755 tariff: Optional[Tariff] 2756 token: Optional[Token] 2757 unlock_connector: Optional[UnlockConnector] 2758 version: Optional[Version] 2759 version_details: Optional[VersionDetails] 2760 2761 def __init__(self, active_charging_profile: Optional[ActiveChargingProfile], active_charging_profile_result: Optional[ActiveChargingProfileResult], authorization_info: Optional[AuthorizationInfo], cancel_reservation: Optional[CancelReservation], cdr: Optional[Cdr], charging_preferences: Optional[ChargingPreferences], charging_profile: Optional[ChargingProfile], charging_profile_response: Optional[ChargingProfileResponse], charging_profile_result: Optional[ChargingProfileResult], clear_profile_result: Optional[ClearProfileResult], command_response: Optional[CommandResponse], command_result: Optional[CommandResult], connector: Optional[Connector], credentials: Optional[Credentials], endpoint: Optional[Endpoint], evse: Optional[Evse], hub_client_info: Optional[HubClientInfo], location: Optional[Location], location_references: Optional[LocationReferences], reserve_now: Optional[ReserveNow], session: Optional[Session], set_charging_profile: Optional[SetChargingProfile], start_session: Optional[StartSession], stop_session: Optional[StopSession], tariff: Optional[Tariff], token: Optional[Token], unlock_connector: Optional[UnlockConnector], version: Optional[Version], version_details: Optional[VersionDetails]) -> None: 2762 self.active_charging_profile = active_charging_profile 2763 self.active_charging_profile_result = active_charging_profile_result 2764 self.authorization_info = authorization_info 2765 self.cancel_reservation = cancel_reservation 2766 self.cdr = cdr 2767 self.charging_preferences = charging_preferences 2768 self.charging_profile = charging_profile 2769 self.charging_profile_response = charging_profile_response 2770 self.charging_profile_result = charging_profile_result 2771 self.clear_profile_result = clear_profile_result 2772 self.command_response = command_response 2773 self.command_result = command_result 2774 self.connector = connector 2775 self.credentials = credentials 2776 self.endpoint = endpoint 2777 self.evse = evse 2778 self.hub_client_info = hub_client_info 2779 self.location = location 2780 self.location_references = location_references 2781 self.reserve_now = reserve_now 2782 self.session = session 2783 self.set_charging_profile = set_charging_profile 2784 self.start_session = start_session 2785 self.stop_session = stop_session 2786 self.tariff = tariff 2787 self.token = token 2788 self.unlock_connector = unlock_connector 2789 self.version = version 2790 self.version_details = version_details 2791 2792 @staticmethod 2793 def from_dict(obj: Any) -> 'V230': 2794 assert isinstance(obj, dict) 2795 active_charging_profile = from_union([ActiveChargingProfile.from_dict, from_none], obj.get("active_charging_profile")) 2796 active_charging_profile_result = from_union([ActiveChargingProfileResult.from_dict, from_none], obj.get("active_charging_profile_result")) 2797 authorization_info = from_union([AuthorizationInfo.from_dict, from_none], obj.get("authorization_info")) 2798 cancel_reservation = from_union([CancelReservation.from_dict, from_none], obj.get("cancel_reservation")) 2799 cdr = from_union([Cdr.from_dict, from_none], obj.get("cdr")) 2800 charging_preferences = from_union([ChargingPreferences.from_dict, from_none], obj.get("charging_preferences")) 2801 charging_profile = from_union([ChargingProfile.from_dict, from_none], obj.get("charging_profile")) 2802 charging_profile_response = from_union([ChargingProfileResponse.from_dict, from_none], obj.get("charging_profile_response")) 2803 charging_profile_result = from_union([ChargingProfileResult.from_dict, from_none], obj.get("charging_profile_result")) 2804 clear_profile_result = from_union([ClearProfileResult.from_dict, from_none], obj.get("clear_profile_result")) 2805 command_response = from_union([CommandResponse.from_dict, from_none], obj.get("command_response")) 2806 command_result = from_union([CommandResult.from_dict, from_none], obj.get("command_result")) 2807 connector = from_union([Connector.from_dict, from_none], obj.get("connector")) 2808 credentials = from_union([Credentials.from_dict, from_none], obj.get("credentials")) 2809 endpoint = from_union([Endpoint.from_dict, from_none], obj.get("endpoint")) 2810 evse = from_union([Evse.from_dict, from_none], obj.get("evse")) 2811 hub_client_info = from_union([HubClientInfo.from_dict, from_none], obj.get("hub_client_info")) 2812 location = from_union([Location.from_dict, from_none], obj.get("location")) 2813 location_references = from_union([from_none, LocationReferences.from_dict], obj.get("location_references")) 2814 reserve_now = from_union([ReserveNow.from_dict, from_none], obj.get("reserve_now")) 2815 session = from_union([Session.from_dict, from_none], obj.get("session")) 2816 set_charging_profile = from_union([SetChargingProfile.from_dict, from_none], obj.get("set_charging_profile")) 2817 start_session = from_union([StartSession.from_dict, from_none], obj.get("start_session")) 2818 stop_session = from_union([StopSession.from_dict, from_none], obj.get("stop_session")) 2819 tariff = from_union([Tariff.from_dict, from_none], obj.get("tariff")) 2820 token = from_union([Token.from_dict, from_none], obj.get("token")) 2821 unlock_connector = from_union([UnlockConnector.from_dict, from_none], obj.get("unlock_connector")) 2822 version = from_union([Version.from_dict, from_none], obj.get("version")) 2823 version_details = from_union([VersionDetails.from_dict, from_none], obj.get("version_details")) 2824 return V230(active_charging_profile, active_charging_profile_result, authorization_info, cancel_reservation, cdr, charging_preferences, charging_profile, charging_profile_response, charging_profile_result, clear_profile_result, command_response, command_result, connector, credentials, endpoint, evse, hub_client_info, location, location_references, reserve_now, session, set_charging_profile, start_session, stop_session, tariff, token, unlock_connector, version, version_details) 2825 2826 def to_dict(self) -> dict: 2827 result: dict = {} 2828 if self.active_charging_profile is not None: 2829 result["active_charging_profile"] = from_union([lambda x: to_class(ActiveChargingProfile, x), from_none], self.active_charging_profile) 2830 if self.active_charging_profile_result is not None: 2831 result["active_charging_profile_result"] = from_union([lambda x: to_class(ActiveChargingProfileResult, x), from_none], self.active_charging_profile_result) 2832 if self.authorization_info is not None: 2833 result["authorization_info"] = from_union([lambda x: to_class(AuthorizationInfo, x), from_none], self.authorization_info) 2834 if self.cancel_reservation is not None: 2835 result["cancel_reservation"] = from_union([lambda x: to_class(CancelReservation, x), from_none], self.cancel_reservation) 2836 if self.cdr is not None: 2837 result["cdr"] = from_union([lambda x: to_class(Cdr, x), from_none], self.cdr) 2838 if self.charging_preferences is not None: 2839 result["charging_preferences"] = from_union([lambda x: to_class(ChargingPreferences, x), from_none], self.charging_preferences) 2840 if self.charging_profile is not None: 2841 result["charging_profile"] = from_union([lambda x: to_class(ChargingProfile, x), from_none], self.charging_profile) 2842 if self.charging_profile_response is not None: 2843 result["charging_profile_response"] = from_union([lambda x: to_class(ChargingProfileResponse, x), from_none], self.charging_profile_response) 2844 if self.charging_profile_result is not None: 2845 result["charging_profile_result"] = from_union([lambda x: to_class(ChargingProfileResult, x), from_none], self.charging_profile_result) 2846 if self.clear_profile_result is not None: 2847 result["clear_profile_result"] = from_union([lambda x: to_class(ClearProfileResult, x), from_none], self.clear_profile_result) 2848 if self.command_response is not None: 2849 result["command_response"] = from_union([lambda x: to_class(CommandResponse, x), from_none], self.command_response) 2850 if self.command_result is not None: 2851 result["command_result"] = from_union([lambda x: to_class(CommandResult, x), from_none], self.command_result) 2852 if self.connector is not None: 2853 result["connector"] = from_union([lambda x: to_class(Connector, x), from_none], self.connector) 2854 if self.credentials is not None: 2855 result["credentials"] = from_union([lambda x: to_class(Credentials, x), from_none], self.credentials) 2856 if self.endpoint is not None: 2857 result["endpoint"] = from_union([lambda x: to_class(Endpoint, x), from_none], self.endpoint) 2858 if self.evse is not None: 2859 result["evse"] = from_union([lambda x: to_class(Evse, x), from_none], self.evse) 2860 if self.hub_client_info is not None: 2861 result["hub_client_info"] = from_union([lambda x: to_class(HubClientInfo, x), from_none], self.hub_client_info) 2862 if self.location is not None: 2863 result["location"] = from_union([lambda x: to_class(Location, x), from_none], self.location) 2864 if self.location_references is not None: 2865 result["location_references"] = from_union([from_none, lambda x: to_class(LocationReferences, x)], self.location_references) 2866 if self.reserve_now is not None: 2867 result["reserve_now"] = from_union([lambda x: to_class(ReserveNow, x), from_none], self.reserve_now) 2868 if self.session is not None: 2869 result["session"] = from_union([lambda x: to_class(Session, x), from_none], self.session) 2870 if self.set_charging_profile is not None: 2871 result["set_charging_profile"] = from_union([lambda x: to_class(SetChargingProfile, x), from_none], self.set_charging_profile) 2872 if self.start_session is not None: 2873 result["start_session"] = from_union([lambda x: to_class(StartSession, x), from_none], self.start_session) 2874 if self.stop_session is not None: 2875 result["stop_session"] = from_union([lambda x: to_class(StopSession, x), from_none], self.stop_session) 2876 if self.tariff is not None: 2877 result["tariff"] = from_union([lambda x: to_class(Tariff, x), from_none], self.tariff) 2878 if self.token is not None: 2879 result["token"] = from_union([lambda x: to_class(Token, x), from_none], self.token) 2880 if self.unlock_connector is not None: 2881 result["unlock_connector"] = from_union([lambda x: to_class(UnlockConnector, x), from_none], self.unlock_connector) 2882 if self.version is not None: 2883 result["version"] = from_union([lambda x: to_class(Version, x), from_none], self.version) 2884 if self.version_details is not None: 2885 result["version_details"] = from_union([lambda x: to_class(VersionDetails, x), from_none], self.version_details) 2886 return result
V230( active_charging_profile: Optional[ActiveChargingProfile], active_charging_profile_result: Optional[ActiveChargingProfileResult], authorization_info: Optional[AuthorizationInfo], cancel_reservation: Optional[CancelReservation], cdr: Optional[Cdr], charging_preferences: Optional[ChargingPreferences], charging_profile: Optional[ChargingProfile], charging_profile_response: Optional[ChargingProfileResponse], charging_profile_result: Optional[ChargingProfileResult], clear_profile_result: Optional[ClearProfileResult], command_response: Optional[CommandResponse], command_result: Optional[CommandResult], connector: Optional[Connector], credentials: Optional[Credentials], endpoint: Optional[Endpoint], evse: Optional[Evse], hub_client_info: Optional[HubClientInfo], location: Optional[Location], location_references: Optional[LocationReferences], reserve_now: Optional[ReserveNow], session: Optional[Session], set_charging_profile: Optional[SetChargingProfile], start_session: Optional[StartSession], stop_session: Optional[StopSession], tariff: Optional[Tariff], token: Optional[Token], unlock_connector: Optional[UnlockConnector], version: Optional[Version], version_details: Optional[VersionDetails])
2761 def __init__(self, active_charging_profile: Optional[ActiveChargingProfile], active_charging_profile_result: Optional[ActiveChargingProfileResult], authorization_info: Optional[AuthorizationInfo], cancel_reservation: Optional[CancelReservation], cdr: Optional[Cdr], charging_preferences: Optional[ChargingPreferences], charging_profile: Optional[ChargingProfile], charging_profile_response: Optional[ChargingProfileResponse], charging_profile_result: Optional[ChargingProfileResult], clear_profile_result: Optional[ClearProfileResult], command_response: Optional[CommandResponse], command_result: Optional[CommandResult], connector: Optional[Connector], credentials: Optional[Credentials], endpoint: Optional[Endpoint], evse: Optional[Evse], hub_client_info: Optional[HubClientInfo], location: Optional[Location], location_references: Optional[LocationReferences], reserve_now: Optional[ReserveNow], session: Optional[Session], set_charging_profile: Optional[SetChargingProfile], start_session: Optional[StartSession], stop_session: Optional[StopSession], tariff: Optional[Tariff], token: Optional[Token], unlock_connector: Optional[UnlockConnector], version: Optional[Version], version_details: Optional[VersionDetails]) -> None: 2762 self.active_charging_profile = active_charging_profile 2763 self.active_charging_profile_result = active_charging_profile_result 2764 self.authorization_info = authorization_info 2765 self.cancel_reservation = cancel_reservation 2766 self.cdr = cdr 2767 self.charging_preferences = charging_preferences 2768 self.charging_profile = charging_profile 2769 self.charging_profile_response = charging_profile_response 2770 self.charging_profile_result = charging_profile_result 2771 self.clear_profile_result = clear_profile_result 2772 self.command_response = command_response 2773 self.command_result = command_result 2774 self.connector = connector 2775 self.credentials = credentials 2776 self.endpoint = endpoint 2777 self.evse = evse 2778 self.hub_client_info = hub_client_info 2779 self.location = location 2780 self.location_references = location_references 2781 self.reserve_now = reserve_now 2782 self.session = session 2783 self.set_charging_profile = set_charging_profile 2784 self.start_session = start_session 2785 self.stop_session = stop_session 2786 self.tariff = tariff 2787 self.token = token 2788 self.unlock_connector = unlock_connector 2789 self.version = version 2790 self.version_details = version_details
active_charging_profile: Optional[ActiveChargingProfile]
active_charging_profile_result: Optional[ActiveChargingProfileResult]
cancel_reservation: Optional[CancelReservation]
cdr: Optional[Cdr]
charging_preferences: Optional[ChargingPreferences]
charging_profile: Optional[ChargingProfile]
charging_profile_response: Optional[ChargingProfileResponse]
charging_profile_result: Optional[ChargingProfileResult]
clear_profile_result: Optional[ClearProfileResult]
command_response: Optional[CommandResponse]
command_result: Optional[CommandResult]
connector: Optional[Connector]
credentials: Optional[Credentials]
endpoint: Optional[Endpoint]
evse: Optional[Evse]
hub_client_info: Optional[HubClientInfo]
location: Optional[Location]
location_references: Optional[LocationReferences]
reserve_now: Optional[ReserveNow]
session: Optional[Session]
set_charging_profile: Optional[SetChargingProfile]
start_session: Optional[StartSession]
stop_session: Optional[StopSession]
tariff: Optional[Tariff]
token: Optional[Token]
unlock_connector: Optional[UnlockConnector]
version: Optional[Version]
version_details: Optional[VersionDetails]
2792 @staticmethod 2793 def from_dict(obj: Any) -> 'V230': 2794 assert isinstance(obj, dict) 2795 active_charging_profile = from_union([ActiveChargingProfile.from_dict, from_none], obj.get("active_charging_profile")) 2796 active_charging_profile_result = from_union([ActiveChargingProfileResult.from_dict, from_none], obj.get("active_charging_profile_result")) 2797 authorization_info = from_union([AuthorizationInfo.from_dict, from_none], obj.get("authorization_info")) 2798 cancel_reservation = from_union([CancelReservation.from_dict, from_none], obj.get("cancel_reservation")) 2799 cdr = from_union([Cdr.from_dict, from_none], obj.get("cdr")) 2800 charging_preferences = from_union([ChargingPreferences.from_dict, from_none], obj.get("charging_preferences")) 2801 charging_profile = from_union([ChargingProfile.from_dict, from_none], obj.get("charging_profile")) 2802 charging_profile_response = from_union([ChargingProfileResponse.from_dict, from_none], obj.get("charging_profile_response")) 2803 charging_profile_result = from_union([ChargingProfileResult.from_dict, from_none], obj.get("charging_profile_result")) 2804 clear_profile_result = from_union([ClearProfileResult.from_dict, from_none], obj.get("clear_profile_result")) 2805 command_response = from_union([CommandResponse.from_dict, from_none], obj.get("command_response")) 2806 command_result = from_union([CommandResult.from_dict, from_none], obj.get("command_result")) 2807 connector = from_union([Connector.from_dict, from_none], obj.get("connector")) 2808 credentials = from_union([Credentials.from_dict, from_none], obj.get("credentials")) 2809 endpoint = from_union([Endpoint.from_dict, from_none], obj.get("endpoint")) 2810 evse = from_union([Evse.from_dict, from_none], obj.get("evse")) 2811 hub_client_info = from_union([HubClientInfo.from_dict, from_none], obj.get("hub_client_info")) 2812 location = from_union([Location.from_dict, from_none], obj.get("location")) 2813 location_references = from_union([from_none, LocationReferences.from_dict], obj.get("location_references")) 2814 reserve_now = from_union([ReserveNow.from_dict, from_none], obj.get("reserve_now")) 2815 session = from_union([Session.from_dict, from_none], obj.get("session")) 2816 set_charging_profile = from_union([SetChargingProfile.from_dict, from_none], obj.get("set_charging_profile")) 2817 start_session = from_union([StartSession.from_dict, from_none], obj.get("start_session")) 2818 stop_session = from_union([StopSession.from_dict, from_none], obj.get("stop_session")) 2819 tariff = from_union([Tariff.from_dict, from_none], obj.get("tariff")) 2820 token = from_union([Token.from_dict, from_none], obj.get("token")) 2821 unlock_connector = from_union([UnlockConnector.from_dict, from_none], obj.get("unlock_connector")) 2822 version = from_union([Version.from_dict, from_none], obj.get("version")) 2823 version_details = from_union([VersionDetails.from_dict, from_none], obj.get("version_details")) 2824 return V230(active_charging_profile, active_charging_profile_result, authorization_info, cancel_reservation, cdr, charging_preferences, charging_profile, charging_profile_response, charging_profile_result, clear_profile_result, command_response, command_result, connector, credentials, endpoint, evse, hub_client_info, location, location_references, reserve_now, session, set_charging_profile, start_session, stop_session, tariff, token, unlock_connector, version, version_details)
def
to_dict(self) -> dict:
2826 def to_dict(self) -> dict: 2827 result: dict = {} 2828 if self.active_charging_profile is not None: 2829 result["active_charging_profile"] = from_union([lambda x: to_class(ActiveChargingProfile, x), from_none], self.active_charging_profile) 2830 if self.active_charging_profile_result is not None: 2831 result["active_charging_profile_result"] = from_union([lambda x: to_class(ActiveChargingProfileResult, x), from_none], self.active_charging_profile_result) 2832 if self.authorization_info is not None: 2833 result["authorization_info"] = from_union([lambda x: to_class(AuthorizationInfo, x), from_none], self.authorization_info) 2834 if self.cancel_reservation is not None: 2835 result["cancel_reservation"] = from_union([lambda x: to_class(CancelReservation, x), from_none], self.cancel_reservation) 2836 if self.cdr is not None: 2837 result["cdr"] = from_union([lambda x: to_class(Cdr, x), from_none], self.cdr) 2838 if self.charging_preferences is not None: 2839 result["charging_preferences"] = from_union([lambda x: to_class(ChargingPreferences, x), from_none], self.charging_preferences) 2840 if self.charging_profile is not None: 2841 result["charging_profile"] = from_union([lambda x: to_class(ChargingProfile, x), from_none], self.charging_profile) 2842 if self.charging_profile_response is not None: 2843 result["charging_profile_response"] = from_union([lambda x: to_class(ChargingProfileResponse, x), from_none], self.charging_profile_response) 2844 if self.charging_profile_result is not None: 2845 result["charging_profile_result"] = from_union([lambda x: to_class(ChargingProfileResult, x), from_none], self.charging_profile_result) 2846 if self.clear_profile_result is not None: 2847 result["clear_profile_result"] = from_union([lambda x: to_class(ClearProfileResult, x), from_none], self.clear_profile_result) 2848 if self.command_response is not None: 2849 result["command_response"] = from_union([lambda x: to_class(CommandResponse, x), from_none], self.command_response) 2850 if self.command_result is not None: 2851 result["command_result"] = from_union([lambda x: to_class(CommandResult, x), from_none], self.command_result) 2852 if self.connector is not None: 2853 result["connector"] = from_union([lambda x: to_class(Connector, x), from_none], self.connector) 2854 if self.credentials is not None: 2855 result["credentials"] = from_union([lambda x: to_class(Credentials, x), from_none], self.credentials) 2856 if self.endpoint is not None: 2857 result["endpoint"] = from_union([lambda x: to_class(Endpoint, x), from_none], self.endpoint) 2858 if self.evse is not None: 2859 result["evse"] = from_union([lambda x: to_class(Evse, x), from_none], self.evse) 2860 if self.hub_client_info is not None: 2861 result["hub_client_info"] = from_union([lambda x: to_class(HubClientInfo, x), from_none], self.hub_client_info) 2862 if self.location is not None: 2863 result["location"] = from_union([lambda x: to_class(Location, x), from_none], self.location) 2864 if self.location_references is not None: 2865 result["location_references"] = from_union([from_none, lambda x: to_class(LocationReferences, x)], self.location_references) 2866 if self.reserve_now is not None: 2867 result["reserve_now"] = from_union([lambda x: to_class(ReserveNow, x), from_none], self.reserve_now) 2868 if self.session is not None: 2869 result["session"] = from_union([lambda x: to_class(Session, x), from_none], self.session) 2870 if self.set_charging_profile is not None: 2871 result["set_charging_profile"] = from_union([lambda x: to_class(SetChargingProfile, x), from_none], self.set_charging_profile) 2872 if self.start_session is not None: 2873 result["start_session"] = from_union([lambda x: to_class(StartSession, x), from_none], self.start_session) 2874 if self.stop_session is not None: 2875 result["stop_session"] = from_union([lambda x: to_class(StopSession, x), from_none], self.stop_session) 2876 if self.tariff is not None: 2877 result["tariff"] = from_union([lambda x: to_class(Tariff, x), from_none], self.tariff) 2878 if self.token is not None: 2879 result["token"] = from_union([lambda x: to_class(Token, x), from_none], self.token) 2880 if self.unlock_connector is not None: 2881 result["unlock_connector"] = from_union([lambda x: to_class(UnlockConnector, x), from_none], self.unlock_connector) 2882 if self.version is not None: 2883 result["version"] = from_union([lambda x: to_class(Version, x), from_none], self.version) 2884 if self.version_details is not None: 2885 result["version_details"] = from_union([lambda x: to_class(VersionDetails, x), from_none], self.version_details) 2886 return result