v211
1from enum import Enum 2from typing import Any, List, Optional, TypeVar, Type, Callable, cast 3from datetime import datetime 4import dateutil.parser 5 6 7T = TypeVar("T") 8EnumT = TypeVar("EnumT", bound=Enum) 9 10 11def from_float(x: Any) -> float: 12 assert isinstance(x, (float, int)) and not isinstance(x, bool) 13 return float(x) 14 15 16def to_enum(c: Type[EnumT], x: Any) -> EnumT: 17 assert isinstance(x, c) 18 return x.value 19 20 21def to_float(x: Any) -> float: 22 assert isinstance(x, float) 23 return x 24 25 26def from_list(f: Callable[[Any], T], x: Any) -> List[T]: 27 assert isinstance(x, list) 28 return [f(y) for y in x] 29 30 31def from_str(x: Any) -> str: 32 assert isinstance(x, str) 33 return x 34 35 36def to_class(c: Type[T], x: Any) -> dict: 37 assert isinstance(x, c) 38 return cast(Any, x).to_dict() 39 40 41def from_none(x: Any) -> Any: 42 assert x is None 43 return x 44 45 46def from_union(fs, x): 47 for f in fs: 48 try: 49 return f(x) 50 except: 51 pass 52 assert False 53 54 55def from_bool(x: Any) -> bool: 56 assert isinstance(x, bool) 57 return x 58 59 60def from_int(x: Any) -> int: 61 assert isinstance(x, int) and not isinstance(x, bool) 62 return x 63 64 65def from_datetime(x: Any) -> datetime: 66 return dateutil.parser.parse(x) 67 68 69class AuthMethod(Enum): 70 AUTH_REQUEST = "AUTH_REQUEST" 71 WHITELIST = "WHITELIST" 72 73 74class DimensionType(Enum): 75 ENERGY = "ENERGY" 76 FLAT = "FLAT" 77 MAX_CURRENT = "MAX_CURRENT" 78 MIN_CURRENT = "MIN_CURRENT" 79 PARKING_TIME = "PARKING_TIME" 80 TIME = "TIME" 81 82 83class Dimension: 84 type: DimensionType 85 volume: float 86 87 def __init__(self, type: DimensionType, volume: float) -> None: 88 self.type = type 89 self.volume = volume 90 91 @staticmethod 92 def from_dict(obj: Any) -> 'Dimension': 93 assert isinstance(obj, dict) 94 type = DimensionType(obj.get("type")) 95 volume = from_float(obj.get("volume")) 96 return Dimension(type, volume) 97 98 def to_dict(self) -> dict: 99 result: dict = {} 100 result["type"] = to_enum(DimensionType, self.type) 101 result["volume"] = to_float(self.volume) 102 return result 103 104 105class ChargingPeriod: 106 dimensions: List[Dimension] 107 start_date_time: str 108 109 def __init__(self, dimensions: List[Dimension], start_date_time: str) -> None: 110 self.dimensions = dimensions 111 self.start_date_time = start_date_time 112 113 @staticmethod 114 def from_dict(obj: Any) -> 'ChargingPeriod': 115 assert isinstance(obj, dict) 116 dimensions = from_list(Dimension.from_dict, obj.get("dimensions")) 117 start_date_time = from_str(obj.get("start_date_time")) 118 return ChargingPeriod(dimensions, start_date_time) 119 120 def to_dict(self) -> dict: 121 result: dict = {} 122 result["dimensions"] = from_list(lambda x: to_class(Dimension, x), self.dimensions) 123 result["start_date_time"] = from_str(self.start_date_time) 124 return result 125 126 127class GeoLocation: 128 latitude: Optional[str] 129 longitude: Optional[str] 130 131 def __init__(self, latitude: Optional[str], longitude: Optional[str]) -> None: 132 self.latitude = latitude 133 self.longitude = longitude 134 135 @staticmethod 136 def from_dict(obj: Any) -> 'GeoLocation': 137 assert isinstance(obj, dict) 138 latitude = from_union([from_str, from_none], obj.get("latitude")) 139 longitude = from_union([from_str, from_none], obj.get("longitude")) 140 return GeoLocation(latitude, longitude) 141 142 def to_dict(self) -> dict: 143 result: dict = {} 144 if self.latitude is not None: 145 result["latitude"] = from_union([from_str, from_none], self.latitude) 146 if self.longitude is not None: 147 result["longitude"] = from_union([from_str, from_none], self.longitude) 148 return result 149 150 151class DisplayText: 152 language: str 153 text: str 154 155 def __init__(self, language: str, text: str) -> None: 156 self.language = language 157 self.text = text 158 159 @staticmethod 160 def from_dict(obj: Any) -> 'DisplayText': 161 assert isinstance(obj, dict) 162 language = from_str(obj.get("language")) 163 text = from_str(obj.get("text")) 164 return DisplayText(language, text) 165 166 def to_dict(self) -> dict: 167 result: dict = {} 168 result["language"] = from_str(self.language) 169 result["text"] = from_str(self.text) 170 return result 171 172 173class EnergySourceSource(Enum): 174 COAL = "COAL" 175 GAS = "GAS" 176 GENERAL_FOSSIL = "GENERAL_FOSSIL" 177 GENERAL_GREEN = "GENERAL_GREEN" 178 NUCLEAR = "NUCLEAR" 179 SOLAR = "SOLAR" 180 WATER = "WATER" 181 WIND = "WIND" 182 183 184class EnergySource: 185 percentage: float 186 source: EnergySourceSource 187 188 def __init__(self, percentage: float, source: EnergySourceSource) -> None: 189 self.percentage = percentage 190 self.source = source 191 192 @staticmethod 193 def from_dict(obj: Any) -> 'EnergySource': 194 assert isinstance(obj, dict) 195 percentage = from_float(obj.get("percentage")) 196 source = EnergySourceSource(obj.get("source")) 197 return EnergySource(percentage, source) 198 199 def to_dict(self) -> dict: 200 result: dict = {} 201 result["percentage"] = to_float(self.percentage) 202 result["source"] = to_enum(EnergySourceSource, self.source) 203 return result 204 205 206class EnvironImpactSource(Enum): 207 CARBON_DIOXIDE = "CARBON_DIOXIDE" 208 NUCLEAR_WASTE = "NUCLEAR_WASTE" 209 210 211class EnvironImpact: 212 amount: float 213 source: EnvironImpactSource 214 215 def __init__(self, amount: float, source: EnvironImpactSource) -> None: 216 self.amount = amount 217 self.source = source 218 219 @staticmethod 220 def from_dict(obj: Any) -> 'EnvironImpact': 221 assert isinstance(obj, dict) 222 amount = from_float(obj.get("amount")) 223 source = EnvironImpactSource(obj.get("source")) 224 return EnvironImpact(amount, source) 225 226 def to_dict(self) -> dict: 227 result: dict = {} 228 result["amount"] = to_float(self.amount) 229 result["source"] = to_enum(EnvironImpactSource, self.source) 230 return result 231 232 233class EnergyMix: 234 energy_product_name: Optional[str] 235 energy_sources: Optional[List[EnergySource]] 236 environ_impact: Optional[List[EnvironImpact]] 237 is_green_energy: bool 238 supplier_name: Optional[str] 239 240 def __init__(self, energy_product_name: Optional[str], energy_sources: Optional[List[EnergySource]], environ_impact: Optional[List[EnvironImpact]], is_green_energy: bool, supplier_name: Optional[str]) -> None: 241 self.energy_product_name = energy_product_name 242 self.energy_sources = energy_sources 243 self.environ_impact = environ_impact 244 self.is_green_energy = is_green_energy 245 self.supplier_name = supplier_name 246 247 @staticmethod 248 def from_dict(obj: Any) -> 'EnergyMix': 249 assert isinstance(obj, dict) 250 energy_product_name = from_union([from_none, from_str], obj.get("energy_product_name")) 251 energy_sources = from_union([from_none, lambda x: from_list(EnergySource.from_dict, x)], obj.get("energy_sources")) 252 environ_impact = from_union([from_none, lambda x: from_list(EnvironImpact.from_dict, x)], obj.get("environ_impact")) 253 is_green_energy = from_bool(obj.get("is_green_energy")) 254 supplier_name = from_union([from_none, from_str], obj.get("supplier_name")) 255 return EnergyMix(energy_product_name, energy_sources, environ_impact, is_green_energy, supplier_name) 256 257 def to_dict(self) -> dict: 258 result: dict = {} 259 if self.energy_product_name is not None: 260 result["energy_product_name"] = from_union([from_none, from_str], self.energy_product_name) 261 if self.energy_sources is not None: 262 result["energy_sources"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EnergySource, x), x)], self.energy_sources) 263 if self.environ_impact is not None: 264 result["environ_impact"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EnvironImpact, x), x)], self.environ_impact) 265 result["is_green_energy"] = from_bool(self.is_green_energy) 266 if self.supplier_name is not None: 267 result["supplier_name"] = from_union([from_none, from_str], self.supplier_name) 268 return result 269 270 271class Capability(Enum): 272 CHARGING_PROFILE_CAPABLE = "CHARGING_PROFILE_CAPABLE" 273 CREDIT_CARD_PAYABLE = "CREDIT_CARD_PAYABLE" 274 REMOTE_START_STOP_CAPABLE = "REMOTE_START_STOP_CAPABLE" 275 RESERVABLE = "RESERVABLE" 276 RFID_READER = "RFID_READER" 277 UNLOCK_CAPABLE = "UNLOCK_CAPABLE" 278 279 280class Format(Enum): 281 CABLE = "CABLE" 282 SOCKET = "SOCKET" 283 284 285class PowerType(Enum): 286 AC_1__PHASE = "AC_1_PHASE" 287 AC_3__PHASE = "AC_3_PHASE" 288 DC = "DC" 289 290 291class Standard(Enum): 292 CHADEMO = "CHADEMO" 293 DOMESTIC_A = "DOMESTIC_A" 294 DOMESTIC_B = "DOMESTIC_B" 295 DOMESTIC_C = "DOMESTIC_C" 296 DOMESTIC_D = "DOMESTIC_D" 297 DOMESTIC_E = "DOMESTIC_E" 298 DOMESTIC_F = "DOMESTIC_F" 299 DOMESTIC_G = "DOMESTIC_G" 300 DOMESTIC_H = "DOMESTIC_H" 301 DOMESTIC_I = "DOMESTIC_I" 302 DOMESTIC_J = "DOMESTIC_J" 303 DOMESTIC_K = "DOMESTIC_K" 304 DOMESTIC_L = "DOMESTIC_L" 305 IEC_60309_2__SINGLE_16 = "IEC_60309_2_single_16" 306 IEC_60309_2__THREE_16 = "IEC_60309_2_three_16" 307 IEC_60309_2__THREE_32 = "IEC_60309_2_three_32" 308 IEC_60309_2__THREE_64 = "IEC_60309_2_three_64" 309 IEC_62196__T1 = "IEC_62196_T1" 310 IEC_62196__T1_COMBO = "IEC_62196_T1_COMBO" 311 IEC_62196__T2 = "IEC_62196_T2" 312 IEC_62196__T2_COMBO = "IEC_62196_T2_COMBO" 313 IEC_62196__T3_A = "IEC_62196_T3A" 314 IEC_62196__T3_C = "IEC_62196_T3C" 315 TESLA_R = "TESLA_R" 316 TESLA_S = "TESLA_S" 317 318 319class Connector: 320 amperage: Optional[int] 321 format: Optional[Format] 322 id: Optional[str] 323 last_updated: Optional[str] 324 power_type: Optional[PowerType] 325 standard: Optional[Standard] 326 tariff_id: Optional[str] 327 terms_and_conditions: Optional[str] 328 voltage: Optional[int] 329 330 def __init__(self, amperage: Optional[int], format: Optional[Format], id: Optional[str], last_updated: Optional[str], power_type: Optional[PowerType], standard: Optional[Standard], tariff_id: Optional[str], terms_and_conditions: Optional[str], voltage: Optional[int]) -> None: 331 self.amperage = amperage 332 self.format = format 333 self.id = id 334 self.last_updated = last_updated 335 self.power_type = power_type 336 self.standard = standard 337 self.tariff_id = tariff_id 338 self.terms_and_conditions = terms_and_conditions 339 self.voltage = voltage 340 341 @staticmethod 342 def from_dict(obj: Any) -> 'Connector': 343 assert isinstance(obj, dict) 344 amperage = from_union([from_int, from_none], obj.get("amperage")) 345 format = from_union([Format, from_none], obj.get("format")) 346 id = from_union([from_str, from_none], obj.get("id")) 347 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 348 power_type = from_union([PowerType, from_none], obj.get("power_type")) 349 standard = from_union([Standard, from_none], obj.get("standard")) 350 tariff_id = from_union([from_none, from_str], obj.get("tariff_id")) 351 terms_and_conditions = from_union([from_none, from_str], obj.get("terms_and_conditions")) 352 voltage = from_union([from_int, from_none], obj.get("voltage")) 353 return Connector(amperage, format, id, last_updated, power_type, standard, tariff_id, terms_and_conditions, voltage) 354 355 def to_dict(self) -> dict: 356 result: dict = {} 357 if self.amperage is not None: 358 result["amperage"] = from_union([from_int, from_none], self.amperage) 359 if self.format is not None: 360 result["format"] = from_union([lambda x: to_enum(Format, x), from_none], self.format) 361 if self.id is not None: 362 result["id"] = from_union([from_str, from_none], self.id) 363 if self.last_updated is not None: 364 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 365 if self.power_type is not None: 366 result["power_type"] = from_union([lambda x: to_enum(PowerType, x), from_none], self.power_type) 367 if self.standard is not None: 368 result["standard"] = from_union([lambda x: to_enum(Standard, x), from_none], self.standard) 369 if self.tariff_id is not None: 370 result["tariff_id"] = from_union([from_none, from_str], self.tariff_id) 371 if self.terms_and_conditions is not None: 372 result["terms_and_conditions"] = from_union([from_none, from_str], self.terms_and_conditions) 373 if self.voltage is not None: 374 result["voltage"] = from_union([from_int, from_none], self.voltage) 375 return result 376 377 378class Category(Enum): 379 CHARGER = "CHARGER" 380 ENTRANCE = "ENTRANCE" 381 LOCATION = "LOCATION" 382 NETWORK = "NETWORK" 383 OPERATOR = "OPERATOR" 384 OTHER = "OTHER" 385 OWNER = "OWNER" 386 387 388class Image: 389 category: Category 390 height: Optional[int] 391 thumbnail: Optional[str] 392 type: str 393 url: str 394 width: Optional[int] 395 396 def __init__(self, category: Category, height: Optional[int], thumbnail: Optional[str], type: str, url: str, width: Optional[int]) -> None: 397 self.category = category 398 self.height = height 399 self.thumbnail = thumbnail 400 self.type = type 401 self.url = url 402 self.width = width 403 404 @staticmethod 405 def from_dict(obj: Any) -> 'Image': 406 assert isinstance(obj, dict) 407 category = Category(obj.get("category")) 408 height = from_union([from_int, from_none], obj.get("height")) 409 thumbnail = from_union([from_none, from_str], obj.get("thumbnail")) 410 type = from_str(obj.get("type")) 411 url = from_str(obj.get("url")) 412 width = from_union([from_int, from_none], obj.get("width")) 413 return Image(category, height, thumbnail, type, url, width) 414 415 def to_dict(self) -> dict: 416 result: dict = {} 417 result["category"] = to_enum(Category, self.category) 418 if self.height is not None: 419 result["height"] = from_union([from_int, from_none], self.height) 420 if self.thumbnail is not None: 421 result["thumbnail"] = from_union([from_none, from_str], self.thumbnail) 422 result["type"] = from_str(self.type) 423 result["url"] = from_str(self.url) 424 if self.width is not None: 425 result["width"] = from_union([from_int, from_none], self.width) 426 return result 427 428 429class ParkingRestriction(Enum): 430 CUSTOMERS = "CUSTOMERS" 431 DISABLED = "DISABLED" 432 EV_ONLY = "EV_ONLY" 433 MOTORCYCLES = "MOTORCYCLES" 434 PLUGGED = "PLUGGED" 435 436 437class EvseStatus(Enum): 438 AVAILABLE = "AVAILABLE" 439 BLOCKED = "BLOCKED" 440 CHARGING = "CHARGING" 441 INOPERATIVE = "INOPERATIVE" 442 OUTOFORDER = "OUTOFORDER" 443 PLANNED = "PLANNED" 444 REMOVED = "REMOVED" 445 RESERVED = "RESERVED" 446 UNKNOWN = "UNKNOWN" 447 448 449class StatusSchedule: 450 period_begin: str 451 period_end: Optional[str] 452 status: EvseStatus 453 454 def __init__(self, period_begin: str, period_end: Optional[str], status: EvseStatus) -> None: 455 self.period_begin = period_begin 456 self.period_end = period_end 457 self.status = status 458 459 @staticmethod 460 def from_dict(obj: Any) -> 'StatusSchedule': 461 assert isinstance(obj, dict) 462 period_begin = from_str(obj.get("period_begin")) 463 period_end = from_union([from_str, from_none], obj.get("period_end")) 464 status = EvseStatus(obj.get("status")) 465 return StatusSchedule(period_begin, period_end, status) 466 467 def to_dict(self) -> dict: 468 result: dict = {} 469 result["period_begin"] = from_str(self.period_begin) 470 if self.period_end is not None: 471 result["period_end"] = from_union([from_str, from_none], self.period_end) 472 result["status"] = to_enum(EvseStatus, self.status) 473 return result 474 475 476class Evse: 477 capabilities: Optional[List[Capability]] 478 connectors: Optional[List[Connector]] 479 coordinates: Optional[GeoLocation] 480 directions: Optional[List[DisplayText]] 481 evse_id: Optional[str] 482 floor_level: Optional[str] 483 images: Optional[List[Image]] 484 last_updated: Optional[str] 485 parking_restrictions: Optional[List[ParkingRestriction]] 486 physical_reference: Optional[str] 487 status: Optional[EvseStatus] 488 status_schedule: Optional[List[StatusSchedule]] 489 uid: Optional[str] 490 491 def __init__(self, capabilities: Optional[List[Capability]], connectors: Optional[List[Connector]], coordinates: Optional[GeoLocation], directions: Optional[List[DisplayText]], evse_id: Optional[str], floor_level: Optional[str], images: Optional[List[Image]], last_updated: Optional[str], parking_restrictions: Optional[List[ParkingRestriction]], physical_reference: Optional[str], status: Optional[EvseStatus], status_schedule: Optional[List[StatusSchedule]], uid: Optional[str]) -> None: 492 self.capabilities = capabilities 493 self.connectors = connectors 494 self.coordinates = coordinates 495 self.directions = directions 496 self.evse_id = evse_id 497 self.floor_level = floor_level 498 self.images = images 499 self.last_updated = last_updated 500 self.parking_restrictions = parking_restrictions 501 self.physical_reference = physical_reference 502 self.status = status 503 self.status_schedule = status_schedule 504 self.uid = uid 505 506 @staticmethod 507 def from_dict(obj: Any) -> 'Evse': 508 assert isinstance(obj, dict) 509 capabilities = from_union([from_none, lambda x: from_list(Capability, x)], obj.get("capabilities")) 510 connectors = from_union([lambda x: from_list(Connector.from_dict, x), from_none], obj.get("connectors")) 511 coordinates = from_union([from_none, GeoLocation.from_dict], obj.get("coordinates")) 512 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 513 evse_id = from_union([from_none, from_str], obj.get("evse_id")) 514 floor_level = from_union([from_none, from_str], obj.get("floor_level")) 515 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 516 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 517 parking_restrictions = from_union([from_none, lambda x: from_list(ParkingRestriction, x)], obj.get("parking_restrictions")) 518 physical_reference = from_union([from_none, from_str], obj.get("physical_reference")) 519 status = from_union([EvseStatus, from_none], obj.get("status")) 520 status_schedule = from_union([from_none, lambda x: from_list(StatusSchedule.from_dict, x)], obj.get("status_schedule")) 521 uid = from_union([from_str, from_none], obj.get("uid")) 522 return Evse(capabilities, connectors, coordinates, directions, evse_id, floor_level, images, last_updated, parking_restrictions, physical_reference, status, status_schedule, uid) 523 524 def to_dict(self) -> dict: 525 result: dict = {} 526 if self.capabilities is not None: 527 result["capabilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Capability, x), x)], self.capabilities) 528 if self.connectors is not None: 529 result["connectors"] = from_union([lambda x: from_list(lambda x: to_class(Connector, x), x), from_none], self.connectors) 530 if self.coordinates is not None: 531 result["coordinates"] = from_union([from_none, lambda x: to_class(GeoLocation, x)], self.coordinates) 532 if self.directions is not None: 533 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 534 if self.evse_id is not None: 535 result["evse_id"] = from_union([from_none, from_str], self.evse_id) 536 if self.floor_level is not None: 537 result["floor_level"] = from_union([from_none, from_str], self.floor_level) 538 if self.images is not None: 539 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 540 if self.last_updated is not None: 541 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 542 if self.parking_restrictions is not None: 543 result["parking_restrictions"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(ParkingRestriction, x), x)], self.parking_restrictions) 544 if self.physical_reference is not None: 545 result["physical_reference"] = from_union([from_none, from_str], self.physical_reference) 546 if self.status is not None: 547 result["status"] = from_union([lambda x: to_enum(EvseStatus, x), from_none], self.status) 548 if self.status_schedule is not None: 549 result["status_schedule"] = from_union([from_none, lambda x: from_list(lambda x: to_class(StatusSchedule, x), x)], self.status_schedule) 550 if self.uid is not None: 551 result["uid"] = from_union([from_str, from_none], self.uid) 552 return result 553 554 555class Facility(Enum): 556 AIRPORT = "AIRPORT" 557 BUS_STOP = "BUS_STOP" 558 CAFE = "CAFE" 559 CARPOOL_PARKING = "CARPOOL_PARKING" 560 FUEL_STATION = "FUEL_STATION" 561 HOTEL = "HOTEL" 562 MALL = "MALL" 563 MUSEUM = "MUSEUM" 564 NATURE = "NATURE" 565 RECREATION_AREA = "RECREATION_AREA" 566 RESTAURANT = "RESTAURANT" 567 SPORT = "SPORT" 568 SUPERMARKET = "SUPERMARKET" 569 TAXI_STAND = "TAXI_STAND" 570 TRAIN_STATION = "TRAIN_STATION" 571 WIFI = "WIFI" 572 573 574class ExceptionalPeriod: 575 period_begin: str 576 period_end: str 577 578 def __init__(self, period_begin: str, period_end: str) -> None: 579 self.period_begin = period_begin 580 self.period_end = period_end 581 582 @staticmethod 583 def from_dict(obj: Any) -> 'ExceptionalPeriod': 584 assert isinstance(obj, dict) 585 period_begin = from_str(obj.get("period_begin")) 586 period_end = from_str(obj.get("period_end")) 587 return ExceptionalPeriod(period_begin, period_end) 588 589 def to_dict(self) -> dict: 590 result: dict = {} 591 result["period_begin"] = from_str(self.period_begin) 592 result["period_end"] = from_str(self.period_end) 593 return result 594 595 596class RegularHours: 597 period_begin: Optional[str] 598 period_end: Optional[str] 599 weekday: Optional[int] 600 601 def __init__(self, period_begin: Optional[str], period_end: Optional[str], weekday: Optional[int]) -> None: 602 self.period_begin = period_begin 603 self.period_end = period_end 604 self.weekday = weekday 605 606 @staticmethod 607 def from_dict(obj: Any) -> 'RegularHours': 608 assert isinstance(obj, dict) 609 period_begin = from_union([from_str, from_none], obj.get("period_begin")) 610 period_end = from_union([from_str, from_none], obj.get("period_end")) 611 weekday = from_union([from_int, from_none], obj.get("weekday")) 612 return RegularHours(period_begin, period_end, weekday) 613 614 def to_dict(self) -> dict: 615 result: dict = {} 616 if self.period_begin is not None: 617 result["period_begin"] = from_union([from_str, from_none], self.period_begin) 618 if self.period_end is not None: 619 result["period_end"] = from_union([from_str, from_none], self.period_end) 620 if self.weekday is not None: 621 result["weekday"] = from_union([from_int, from_none], self.weekday) 622 return result 623 624 625class Hours: 626 exceptional_closings: Optional[List[ExceptionalPeriod]] 627 exceptional_openings: Optional[List[ExceptionalPeriod]] 628 regular_hours: Optional[List[RegularHours]] 629 twentyfourseven: Optional[bool] 630 631 def __init__(self, exceptional_closings: Optional[List[ExceptionalPeriod]], exceptional_openings: Optional[List[ExceptionalPeriod]], regular_hours: Optional[List[RegularHours]], twentyfourseven: Optional[bool]) -> None: 632 self.exceptional_closings = exceptional_closings 633 self.exceptional_openings = exceptional_openings 634 self.regular_hours = regular_hours 635 self.twentyfourseven = twentyfourseven 636 637 @staticmethod 638 def from_dict(obj: Any) -> 'Hours': 639 assert isinstance(obj, dict) 640 exceptional_closings = from_union([from_none, lambda x: from_list(ExceptionalPeriod.from_dict, x)], obj.get("exceptional_closings")) 641 exceptional_openings = from_union([from_none, lambda x: from_list(ExceptionalPeriod.from_dict, x)], obj.get("exceptional_openings")) 642 regular_hours = from_union([from_none, lambda x: from_list(RegularHours.from_dict, x)], obj.get("regular_hours")) 643 twentyfourseven = from_union([from_none, from_bool], obj.get("twentyfourseven")) 644 return Hours(exceptional_closings, exceptional_openings, regular_hours, twentyfourseven) 645 646 def to_dict(self) -> dict: 647 result: dict = {} 648 if self.exceptional_closings is not None: 649 result["exceptional_closings"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ExceptionalPeriod, x), x)], self.exceptional_closings) 650 if self.exceptional_openings is not None: 651 result["exceptional_openings"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ExceptionalPeriod, x), x)], self.exceptional_openings) 652 if self.regular_hours is not None: 653 result["regular_hours"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RegularHours, x), x)], self.regular_hours) 654 if self.twentyfourseven is not None: 655 result["twentyfourseven"] = from_union([from_none, from_bool], self.twentyfourseven) 656 return result 657 658 659class BusinessDetails: 660 logo: Optional[Image] 661 name: str 662 website: Optional[str] 663 664 def __init__(self, logo: Optional[Image], name: str, website: Optional[str]) -> None: 665 self.logo = logo 666 self.name = name 667 self.website = website 668 669 @staticmethod 670 def from_dict(obj: Any) -> 'BusinessDetails': 671 assert isinstance(obj, dict) 672 logo = from_union([from_none, Image.from_dict], obj.get("logo")) 673 name = from_str(obj.get("name")) 674 website = from_union([from_none, from_str], obj.get("website")) 675 return BusinessDetails(logo, name, website) 676 677 def to_dict(self) -> dict: 678 result: dict = {} 679 if self.logo is not None: 680 result["logo"] = from_union([from_none, lambda x: to_class(Image, x)], self.logo) 681 result["name"] = from_str(self.name) 682 if self.website is not None: 683 result["website"] = from_union([from_none, from_str], self.website) 684 return result 685 686 687class RelatedLocation: 688 latitude: Optional[str] 689 longitude: Optional[str] 690 name: Optional[DisplayText] 691 692 def __init__(self, latitude: Optional[str], longitude: Optional[str], name: Optional[DisplayText]) -> None: 693 self.latitude = latitude 694 self.longitude = longitude 695 self.name = name 696 697 @staticmethod 698 def from_dict(obj: Any) -> 'RelatedLocation': 699 assert isinstance(obj, dict) 700 latitude = from_union([from_str, from_none], obj.get("latitude")) 701 longitude = from_union([from_str, from_none], obj.get("longitude")) 702 name = from_union([DisplayText.from_dict, from_none], obj.get("name")) 703 return RelatedLocation(latitude, longitude, name) 704 705 def to_dict(self) -> dict: 706 result: dict = {} 707 if self.latitude is not None: 708 result["latitude"] = from_union([from_str, from_none], self.latitude) 709 if self.longitude is not None: 710 result["longitude"] = from_union([from_str, from_none], self.longitude) 711 if self.name is not None: 712 result["name"] = from_union([lambda x: to_class(DisplayText, x), from_none], self.name) 713 return result 714 715 716class LocationType(Enum): 717 ON_STREET = "ON_STREET" 718 OTHER = "OTHER" 719 PARKING_GARAGE = "PARKING_GARAGE" 720 PARKING_LOT = "PARKING_LOT" 721 UNDERGROUND_GARAGE = "UNDERGROUND_GARAGE" 722 UNKNOWN = "UNKNOWN" 723 724 725class CdrLocation: 726 id: str 727 type: LocationType 728 address: str 729 city: str 730 postal_code: str 731 country: str 732 coordinates: GeoLocation 733 last_updated: str 734 charging_when_closed: Optional[bool] 735 directions: Optional[List[DisplayText]] 736 energy_mix: Optional[EnergyMix] 737 evses: Optional[List[Evse]] 738 facilities: Optional[List[Facility]] 739 images: Optional[List[Image]] 740 name: Optional[str] 741 opening_times: Optional[Hours] 742 operator: Optional[BusinessDetails] 743 owner: Optional[BusinessDetails] 744 related_locations: Optional[List[RelatedLocation]] 745 suboperator: Optional[BusinessDetails] 746 time_zone: Optional[str] 747 748 def __init__(self, id: str, type: LocationType, address: str, city: str, postal_code: str, country: str, coordinates: GeoLocation, last_updated: str, charging_when_closed: Optional[bool], directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], images: Optional[List[Image]], name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], related_locations: Optional[List[RelatedLocation]], suboperator: Optional[BusinessDetails], time_zone: Optional[str]) -> None: 749 self.id = id 750 self.type = type 751 self.address = address 752 self.city = city 753 self.postal_code = postal_code 754 self.country = country 755 self.coordinates = coordinates 756 self.last_updated = last_updated 757 self.charging_when_closed = charging_when_closed 758 self.directions = directions 759 self.energy_mix = energy_mix 760 self.evses = evses 761 self.facilities = facilities 762 self.images = images 763 self.name = name 764 self.opening_times = opening_times 765 self.operator = operator 766 self.owner = owner 767 self.related_locations = related_locations 768 self.suboperator = suboperator 769 self.time_zone = time_zone 770 771 @staticmethod 772 def from_dict(obj: Any) -> 'CdrLocation': 773 assert isinstance(obj, dict) 774 id = from_str(obj.get("id")) 775 type = LocationType(obj.get("type")) 776 address = from_str(obj.get("address")) 777 city = from_str(obj.get("city")) 778 postal_code = from_str(obj.get("postal_code")) 779 country = from_str(obj.get("country")) 780 coordinates = GeoLocation.from_dict(obj.get("coordinates")) 781 last_updated = from_str(obj.get("last_updated")) 782 charging_when_closed = from_union([from_none, from_bool], obj.get("charging_when_closed")) 783 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 784 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 785 evses = from_union([from_none, lambda x: from_list(Evse.from_dict, x)], obj.get("evses")) 786 facilities = from_union([from_none, lambda x: from_list(Facility, x)], obj.get("facilities")) 787 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 788 name = from_union([from_none, from_str], obj.get("name")) 789 opening_times = from_union([from_none, Hours.from_dict], obj.get("opening_times")) 790 operator = from_union([from_none, BusinessDetails.from_dict], obj.get("operator")) 791 owner = from_union([from_none, BusinessDetails.from_dict], obj.get("owner")) 792 related_locations = from_union([from_none, lambda x: from_list(RelatedLocation.from_dict, x)], obj.get("related_locations")) 793 suboperator = from_union([from_none, BusinessDetails.from_dict], obj.get("suboperator")) 794 time_zone = from_union([from_none, from_str], obj.get("time_zone")) 795 return CdrLocation(id, type, address, city, postal_code, country, coordinates, last_updated, charging_when_closed, directions, energy_mix, evses, facilities, images, name, opening_times, operator, owner, related_locations, suboperator, time_zone) 796 797 def to_dict(self) -> dict: 798 result: dict = {} 799 result["id"] = from_str(self.id) 800 result["type"] = to_enum(LocationType, self.type) 801 result["address"] = from_str(self.address) 802 result["city"] = from_str(self.city) 803 result["postal_code"] = from_str(self.postal_code) 804 result["country"] = from_str(self.country) 805 result["coordinates"] = to_class(GeoLocation, self.coordinates) 806 result["last_updated"] = from_str(self.last_updated) 807 if self.charging_when_closed is not None: 808 result["charging_when_closed"] = from_union([from_none, from_bool], self.charging_when_closed) 809 if self.directions is not None: 810 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 811 if self.energy_mix is not None: 812 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 813 if self.evses is not None: 814 result["evses"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Evse, x), x)], self.evses) 815 if self.facilities is not None: 816 result["facilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Facility, x), x)], self.facilities) 817 if self.images is not None: 818 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 819 if self.name is not None: 820 result["name"] = from_union([from_none, from_str], self.name) 821 if self.opening_times is not None: 822 result["opening_times"] = from_union([from_none, lambda x: to_class(Hours, x)], self.opening_times) 823 if self.operator is not None: 824 result["operator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.operator) 825 if self.owner is not None: 826 result["owner"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.owner) 827 if self.related_locations is not None: 828 result["related_locations"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RelatedLocation, x), x)], self.related_locations) 829 if self.suboperator is not None: 830 result["suboperator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.suboperator) 831 if self.time_zone is not None: 832 result["time_zone"] = from_union([from_none, from_str], self.time_zone) 833 return result 834 835 836class PriceComponentType(Enum): 837 ENERGY = "ENERGY" 838 FLAT = "FLAT" 839 PARKING_TIME = "PARKING_TIME" 840 TIME = "TIME" 841 842 843class PriceComponent: 844 price: float 845 step_size: int 846 type: PriceComponentType 847 848 def __init__(self, price: float, step_size: int, type: PriceComponentType) -> None: 849 self.price = price 850 self.step_size = step_size 851 self.type = type 852 853 @staticmethod 854 def from_dict(obj: Any) -> 'PriceComponent': 855 assert isinstance(obj, dict) 856 price = from_float(obj.get("price")) 857 step_size = from_int(obj.get("step_size")) 858 type = PriceComponentType(obj.get("type")) 859 return PriceComponent(price, step_size, type) 860 861 def to_dict(self) -> dict: 862 result: dict = {} 863 result["price"] = to_float(self.price) 864 result["step_size"] = from_int(self.step_size) 865 result["type"] = to_enum(PriceComponentType, self.type) 866 return result 867 868 869class DayOfWeek(Enum): 870 FRIDAY = "FRIDAY" 871 MONDAY = "MONDAY" 872 SATURDAY = "SATURDAY" 873 SUNDAY = "SUNDAY" 874 THURSDAY = "THURSDAY" 875 TUESDAY = "TUESDAY" 876 WEDNESDAY = "WEDNESDAY" 877 878 879class Restrictions: 880 day_of_week: Optional[List[DayOfWeek]] 881 end_date: Optional[datetime] 882 end_time: Optional[str] 883 max_duration: Optional[int] 884 max_kwh: Optional[float] 885 max_power: Optional[float] 886 min_duration: Optional[int] 887 min_kwh: Optional[float] 888 min_power: Optional[float] 889 start_date: Optional[datetime] 890 start_time: Optional[str] 891 892 def __init__(self, day_of_week: Optional[List[DayOfWeek]], end_date: Optional[datetime], end_time: Optional[str], max_duration: Optional[int], max_kwh: Optional[float], max_power: Optional[float], min_duration: Optional[int], min_kwh: Optional[float], min_power: Optional[float], start_date: Optional[datetime], start_time: Optional[str]) -> None: 893 self.day_of_week = day_of_week 894 self.end_date = end_date 895 self.end_time = end_time 896 self.max_duration = max_duration 897 self.max_kwh = max_kwh 898 self.max_power = max_power 899 self.min_duration = min_duration 900 self.min_kwh = min_kwh 901 self.min_power = min_power 902 self.start_date = start_date 903 self.start_time = start_time 904 905 @staticmethod 906 def from_dict(obj: Any) -> 'Restrictions': 907 assert isinstance(obj, dict) 908 day_of_week = from_union([from_none, lambda x: from_list(DayOfWeek, x)], obj.get("day_of_week")) 909 end_date = from_union([from_none, from_datetime], obj.get("end_date")) 910 end_time = from_union([from_none, from_str], obj.get("end_time")) 911 max_duration = from_union([from_none, from_int], obj.get("max_duration")) 912 max_kwh = from_union([from_none, from_float], obj.get("max_kwh")) 913 max_power = from_union([from_none, from_float], obj.get("max_power")) 914 min_duration = from_union([from_none, from_int], obj.get("min_duration")) 915 min_kwh = from_union([from_none, from_float], obj.get("min_kwh")) 916 min_power = from_union([from_none, from_float], obj.get("min_power")) 917 start_date = from_union([from_none, from_datetime], obj.get("start_date")) 918 start_time = from_union([from_none, from_str], obj.get("start_time")) 919 return Restrictions(day_of_week, end_date, end_time, max_duration, max_kwh, max_power, min_duration, min_kwh, min_power, start_date, start_time) 920 921 def to_dict(self) -> dict: 922 result: dict = {} 923 if self.day_of_week is not None: 924 result["day_of_week"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(DayOfWeek, x), x)], self.day_of_week) 925 if self.end_date is not None: 926 result["end_date"] = from_union([from_none, lambda x: x.isoformat()], self.end_date) 927 if self.end_time is not None: 928 result["end_time"] = from_union([from_none, from_str], self.end_time) 929 if self.max_duration is not None: 930 result["max_duration"] = from_union([from_none, from_int], self.max_duration) 931 if self.max_kwh is not None: 932 result["max_kwh"] = from_union([from_none, to_float], self.max_kwh) 933 if self.max_power is not None: 934 result["max_power"] = from_union([from_none, to_float], self.max_power) 935 if self.min_duration is not None: 936 result["min_duration"] = from_union([from_none, from_int], self.min_duration) 937 if self.min_kwh is not None: 938 result["min_kwh"] = from_union([from_none, to_float], self.min_kwh) 939 if self.min_power is not None: 940 result["min_power"] = from_union([from_none, to_float], self.min_power) 941 if self.start_date is not None: 942 result["start_date"] = from_union([from_none, lambda x: x.isoformat()], self.start_date) 943 if self.start_time is not None: 944 result["start_time"] = from_union([from_none, from_str], self.start_time) 945 return result 946 947 948class TariffElement: 949 price_components: List[PriceComponent] 950 restrictions: Optional[Restrictions] 951 952 def __init__(self, price_components: List[PriceComponent], restrictions: Optional[Restrictions]) -> None: 953 self.price_components = price_components 954 self.restrictions = restrictions 955 956 @staticmethod 957 def from_dict(obj: Any) -> 'TariffElement': 958 assert isinstance(obj, dict) 959 price_components = from_list(PriceComponent.from_dict, obj.get("price_components")) 960 restrictions = from_union([from_none, Restrictions.from_dict], obj.get("restrictions")) 961 return TariffElement(price_components, restrictions) 962 963 def to_dict(self) -> dict: 964 result: dict = {} 965 result["price_components"] = from_list(lambda x: to_class(PriceComponent, x), self.price_components) 966 if self.restrictions is not None: 967 result["restrictions"] = from_union([from_none, lambda x: to_class(Restrictions, x)], self.restrictions) 968 return result 969 970 971class Tariff: 972 currency: str 973 elements: List[TariffElement] 974 energy_mix: Optional[EnergyMix] 975 id: str 976 last_updated: str 977 tariff_alt_text: Optional[List[DisplayText]] 978 tariff_alt_url: Optional[str] 979 980 def __init__(self, currency: str, elements: List[TariffElement], energy_mix: Optional[EnergyMix], id: str, last_updated: str, tariff_alt_text: Optional[List[DisplayText]], tariff_alt_url: Optional[str]) -> None: 981 self.currency = currency 982 self.elements = elements 983 self.energy_mix = energy_mix 984 self.id = id 985 self.last_updated = last_updated 986 self.tariff_alt_text = tariff_alt_text 987 self.tariff_alt_url = tariff_alt_url 988 989 @staticmethod 990 def from_dict(obj: Any) -> 'Tariff': 991 assert isinstance(obj, dict) 992 currency = from_str(obj.get("currency")) 993 elements = from_list(TariffElement.from_dict, obj.get("elements")) 994 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 995 id = from_str(obj.get("id")) 996 last_updated = from_str(obj.get("last_updated")) 997 tariff_alt_text = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("tariff_alt_text")) 998 tariff_alt_url = from_union([from_none, from_str], obj.get("tariff_alt_url")) 999 return Tariff(currency, elements, energy_mix, id, last_updated, tariff_alt_text, tariff_alt_url) 1000 1001 def to_dict(self) -> dict: 1002 result: dict = {} 1003 result["currency"] = from_str(self.currency) 1004 result["elements"] = from_list(lambda x: to_class(TariffElement, x), self.elements) 1005 if self.energy_mix is not None: 1006 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 1007 result["id"] = from_str(self.id) 1008 result["last_updated"] = from_str(self.last_updated) 1009 if self.tariff_alt_text is not None: 1010 result["tariff_alt_text"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.tariff_alt_text) 1011 if self.tariff_alt_url is not None: 1012 result["tariff_alt_url"] = from_union([from_none, from_str], self.tariff_alt_url) 1013 return result 1014 1015 1016class Cdr: 1017 auth_id: str 1018 auth_method: AuthMethod 1019 charging_periods: List[ChargingPeriod] 1020 currency: str 1021 id: str 1022 last_updated: str 1023 location: CdrLocation 1024 meter_id: Optional[str] 1025 remark: Optional[str] 1026 start_date_time: str 1027 stop_date_time: str 1028 tariffs: Optional[List[Tariff]] 1029 total_cost: float 1030 total_energy: float 1031 total_parking_time: Optional[float] 1032 total_time: float 1033 1034 def __init__(self, auth_id: str, auth_method: AuthMethod, charging_periods: List[ChargingPeriod], currency: str, id: str, last_updated: str, location: CdrLocation, meter_id: Optional[str], remark: Optional[str], start_date_time: str, stop_date_time: str, tariffs: Optional[List[Tariff]], total_cost: float, total_energy: float, total_parking_time: Optional[float], total_time: float) -> None: 1035 self.auth_id = auth_id 1036 self.auth_method = auth_method 1037 self.charging_periods = charging_periods 1038 self.currency = currency 1039 self.id = id 1040 self.last_updated = last_updated 1041 self.location = location 1042 self.meter_id = meter_id 1043 self.remark = remark 1044 self.start_date_time = start_date_time 1045 self.stop_date_time = stop_date_time 1046 self.tariffs = tariffs 1047 self.total_cost = total_cost 1048 self.total_energy = total_energy 1049 self.total_parking_time = total_parking_time 1050 self.total_time = total_time 1051 1052 @staticmethod 1053 def from_dict(obj: Any) -> 'Cdr': 1054 assert isinstance(obj, dict) 1055 auth_id = from_str(obj.get("auth_id")) 1056 auth_method = AuthMethod(obj.get("auth_method")) 1057 charging_periods = from_list(ChargingPeriod.from_dict, obj.get("charging_periods")) 1058 currency = from_str(obj.get("currency")) 1059 id = from_str(obj.get("id")) 1060 last_updated = from_str(obj.get("last_updated")) 1061 location = CdrLocation.from_dict(obj.get("location")) 1062 meter_id = from_union([from_none, from_str], obj.get("meter_id")) 1063 remark = from_union([from_none, from_str], obj.get("remark")) 1064 start_date_time = from_str(obj.get("start_date_time")) 1065 stop_date_time = from_str(obj.get("stop_date_time")) 1066 tariffs = from_union([from_none, lambda x: from_list(Tariff.from_dict, x)], obj.get("tariffs")) 1067 total_cost = from_float(obj.get("total_cost")) 1068 total_energy = from_float(obj.get("total_energy")) 1069 total_parking_time = from_union([from_none, from_float], obj.get("total_parking_time")) 1070 total_time = from_float(obj.get("total_time")) 1071 return Cdr(auth_id, auth_method, charging_periods, currency, id, last_updated, location, meter_id, remark, start_date_time, stop_date_time, tariffs, total_cost, total_energy, total_parking_time, total_time) 1072 1073 def to_dict(self) -> dict: 1074 result: dict = {} 1075 result["auth_id"] = from_str(self.auth_id) 1076 result["auth_method"] = to_enum(AuthMethod, self.auth_method) 1077 result["charging_periods"] = from_list(lambda x: to_class(ChargingPeriod, x), self.charging_periods) 1078 result["currency"] = from_str(self.currency) 1079 result["id"] = from_str(self.id) 1080 result["last_updated"] = from_str(self.last_updated) 1081 result["location"] = to_class(CdrLocation, self.location) 1082 if self.meter_id is not None: 1083 result["meter_id"] = from_union([from_none, from_str], self.meter_id) 1084 if self.remark is not None: 1085 result["remark"] = from_union([from_none, from_str], self.remark) 1086 result["start_date_time"] = from_str(self.start_date_time) 1087 result["stop_date_time"] = from_str(self.stop_date_time) 1088 if self.tariffs is not None: 1089 result["tariffs"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Tariff, x), x)], self.tariffs) 1090 result["total_cost"] = to_float(self.total_cost) 1091 result["total_energy"] = to_float(self.total_energy) 1092 if self.total_parking_time is not None: 1093 result["total_parking_time"] = from_union([from_none, to_float], self.total_parking_time) 1094 result["total_time"] = to_float(self.total_time) 1095 return result 1096 1097 1098class Credentials: 1099 business_details: Optional[BusinessDetails] 1100 country_code: Optional[str] 1101 party_id: Optional[str] 1102 token: Optional[str] 1103 url: Optional[str] 1104 1105 def __init__(self, business_details: Optional[BusinessDetails], country_code: Optional[str], party_id: Optional[str], token: Optional[str], url: Optional[str]) -> None: 1106 self.business_details = business_details 1107 self.country_code = country_code 1108 self.party_id = party_id 1109 self.token = token 1110 self.url = url 1111 1112 @staticmethod 1113 def from_dict(obj: Any) -> 'Credentials': 1114 assert isinstance(obj, dict) 1115 business_details = from_union([from_none, BusinessDetails.from_dict], obj.get("business_details")) 1116 country_code = from_union([from_str, from_none], obj.get("country_code")) 1117 party_id = from_union([from_str, from_none], obj.get("party_id")) 1118 token = from_union([from_str, from_none], obj.get("token")) 1119 url = from_union([from_str, from_none], obj.get("url")) 1120 return Credentials(business_details, country_code, party_id, token, url) 1121 1122 def to_dict(self) -> dict: 1123 result: dict = {} 1124 if self.business_details is not None: 1125 result["business_details"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.business_details) 1126 if self.country_code is not None: 1127 result["country_code"] = from_union([from_str, from_none], self.country_code) 1128 if self.party_id is not None: 1129 result["party_id"] = from_union([from_str, from_none], self.party_id) 1130 if self.token is not None: 1131 result["token"] = from_union([from_str, from_none], self.token) 1132 if self.url is not None: 1133 result["url"] = from_union([from_str, from_none], self.url) 1134 return result 1135 1136 1137class Location: 1138 address: Optional[str] 1139 charging_when_closed: Optional[bool] 1140 city: Optional[str] 1141 coordinates: Optional[GeoLocation] 1142 country: Optional[str] 1143 directions: Optional[List[DisplayText]] 1144 energy_mix: Optional[EnergyMix] 1145 evses: Optional[List[Evse]] 1146 facilities: Optional[List[Facility]] 1147 id: Optional[str] 1148 images: Optional[List[Image]] 1149 last_updated: Optional[str] 1150 name: Optional[str] 1151 opening_times: Optional[Hours] 1152 operator: Optional[BusinessDetails] 1153 owner: Optional[BusinessDetails] 1154 postal_code: Optional[str] 1155 related_locations: Optional[List[RelatedLocation]] 1156 suboperator: Optional[BusinessDetails] 1157 time_zone: Optional[str] 1158 type: Optional[LocationType] 1159 1160 def __init__(self, address: Optional[str], charging_when_closed: Optional[bool], city: Optional[str], coordinates: Optional[GeoLocation], country: Optional[str], directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], id: Optional[str], images: Optional[List[Image]], last_updated: Optional[str], name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], postal_code: Optional[str], related_locations: Optional[List[RelatedLocation]], suboperator: Optional[BusinessDetails], time_zone: Optional[str], type: Optional[LocationType]) -> None: 1161 self.address = address 1162 self.charging_when_closed = charging_when_closed 1163 self.city = city 1164 self.coordinates = coordinates 1165 self.country = country 1166 self.directions = directions 1167 self.energy_mix = energy_mix 1168 self.evses = evses 1169 self.facilities = facilities 1170 self.id = id 1171 self.images = images 1172 self.last_updated = last_updated 1173 self.name = name 1174 self.opening_times = opening_times 1175 self.operator = operator 1176 self.owner = owner 1177 self.postal_code = postal_code 1178 self.related_locations = related_locations 1179 self.suboperator = suboperator 1180 self.time_zone = time_zone 1181 self.type = type 1182 1183 @staticmethod 1184 def from_dict(obj: Any) -> 'Location': 1185 assert isinstance(obj, dict) 1186 address = from_union([from_str, from_none], obj.get("address")) 1187 charging_when_closed = from_union([from_none, from_bool], obj.get("charging_when_closed")) 1188 city = from_union([from_str, from_none], obj.get("city")) 1189 coordinates = from_union([from_none, GeoLocation.from_dict], obj.get("coordinates")) 1190 country = from_union([from_str, from_none], obj.get("country")) 1191 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 1192 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 1193 evses = from_union([from_none, lambda x: from_list(Evse.from_dict, x)], obj.get("evses")) 1194 facilities = from_union([from_none, lambda x: from_list(Facility, x)], obj.get("facilities")) 1195 id = from_union([from_str, from_none], obj.get("id")) 1196 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 1197 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 1198 name = from_union([from_none, from_str], obj.get("name")) 1199 opening_times = from_union([from_none, Hours.from_dict], obj.get("opening_times")) 1200 operator = from_union([from_none, BusinessDetails.from_dict], obj.get("operator")) 1201 owner = from_union([from_none, BusinessDetails.from_dict], obj.get("owner")) 1202 postal_code = from_union([from_str, from_none], obj.get("postal_code")) 1203 related_locations = from_union([from_none, lambda x: from_list(RelatedLocation.from_dict, x)], obj.get("related_locations")) 1204 suboperator = from_union([from_none, BusinessDetails.from_dict], obj.get("suboperator")) 1205 time_zone = from_union([from_none, from_str], obj.get("time_zone")) 1206 type = from_union([LocationType, from_none], obj.get("type")) 1207 return Location(address, charging_when_closed, city, coordinates, country, directions, energy_mix, evses, facilities, id, images, last_updated, name, opening_times, operator, owner, postal_code, related_locations, suboperator, time_zone, type) 1208 1209 def to_dict(self) -> dict: 1210 result: dict = {} 1211 if self.address is not None: 1212 result["address"] = from_union([from_str, from_none], self.address) 1213 if self.charging_when_closed is not None: 1214 result["charging_when_closed"] = from_union([from_none, from_bool], self.charging_when_closed) 1215 if self.city is not None: 1216 result["city"] = from_union([from_str, from_none], self.city) 1217 if self.coordinates is not None: 1218 result["coordinates"] = from_union([from_none, lambda x: to_class(GeoLocation, x)], self.coordinates) 1219 if self.country is not None: 1220 result["country"] = from_union([from_str, from_none], self.country) 1221 if self.directions is not None: 1222 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 1223 if self.energy_mix is not None: 1224 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 1225 if self.evses is not None: 1226 result["evses"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Evse, x), x)], self.evses) 1227 if self.facilities is not None: 1228 result["facilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Facility, x), x)], self.facilities) 1229 if self.id is not None: 1230 result["id"] = from_union([from_str, from_none], self.id) 1231 if self.images is not None: 1232 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 1233 if self.last_updated is not None: 1234 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 1235 if self.name is not None: 1236 result["name"] = from_union([from_none, from_str], self.name) 1237 if self.opening_times is not None: 1238 result["opening_times"] = from_union([from_none, lambda x: to_class(Hours, x)], self.opening_times) 1239 if self.operator is not None: 1240 result["operator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.operator) 1241 if self.owner is not None: 1242 result["owner"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.owner) 1243 if self.postal_code is not None: 1244 result["postal_code"] = from_union([from_str, from_none], self.postal_code) 1245 if self.related_locations is not None: 1246 result["related_locations"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RelatedLocation, x), x)], self.related_locations) 1247 if self.suboperator is not None: 1248 result["suboperator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.suboperator) 1249 if self.time_zone is not None: 1250 result["time_zone"] = from_union([from_none, from_str], self.time_zone) 1251 if self.type is not None: 1252 result["type"] = from_union([lambda x: to_enum(LocationType, x), from_none], self.type) 1253 return result 1254 1255 1256class SessionLocation: 1257 id: str 1258 type: LocationType 1259 address: str 1260 city: str 1261 postal_code: str 1262 country: str 1263 coordinates: GeoLocation 1264 last_updated: str 1265 charging_when_closed: Optional[bool] 1266 directions: Optional[List[DisplayText]] 1267 energy_mix: Optional[EnergyMix] 1268 evses: Optional[List[Evse]] 1269 facilities: Optional[List[Facility]] 1270 images: Optional[List[Image]] 1271 name: Optional[str] 1272 opening_times: Optional[Hours] 1273 operator: Optional[BusinessDetails] 1274 owner: Optional[BusinessDetails] 1275 related_locations: Optional[List[RelatedLocation]] 1276 suboperator: Optional[BusinessDetails] 1277 time_zone: Optional[str] 1278 1279 def __init__(self, id: str, type: LocationType, address: str, city: str, postal_code: str, country: str, coordinates: GeoLocation, last_updated: str, charging_when_closed: Optional[bool], directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], images: Optional[List[Image]], name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], related_locations: Optional[List[RelatedLocation]], suboperator: Optional[BusinessDetails], time_zone: Optional[str]) -> None: 1280 self.id = id 1281 self.type = type 1282 self.address = address 1283 self.city = city 1284 self.postal_code = postal_code 1285 self.country = country 1286 self.coordinates = coordinates 1287 self.last_updated = last_updated 1288 self.charging_when_closed = charging_when_closed 1289 self.directions = directions 1290 self.energy_mix = energy_mix 1291 self.evses = evses 1292 self.facilities = facilities 1293 self.images = images 1294 self.name = name 1295 self.opening_times = opening_times 1296 self.operator = operator 1297 self.owner = owner 1298 self.related_locations = related_locations 1299 self.suboperator = suboperator 1300 self.time_zone = time_zone 1301 1302 @staticmethod 1303 def from_dict(obj: Any) -> 'SessionLocation': 1304 assert isinstance(obj, dict) 1305 id = from_str(obj.get("id")) 1306 type = LocationType(obj.get("type")) 1307 address = from_str(obj.get("address")) 1308 city = from_str(obj.get("city")) 1309 postal_code = from_str(obj.get("postal_code")) 1310 country = from_str(obj.get("country")) 1311 coordinates = GeoLocation.from_dict(obj.get("coordinates")) 1312 last_updated = from_str(obj.get("last_updated")) 1313 charging_when_closed = from_union([from_none, from_bool], obj.get("charging_when_closed")) 1314 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 1315 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 1316 evses = from_union([from_none, lambda x: from_list(Evse.from_dict, x)], obj.get("evses")) 1317 facilities = from_union([from_none, lambda x: from_list(Facility, x)], obj.get("facilities")) 1318 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 1319 name = from_union([from_none, from_str], obj.get("name")) 1320 opening_times = from_union([from_none, Hours.from_dict], obj.get("opening_times")) 1321 operator = from_union([from_none, BusinessDetails.from_dict], obj.get("operator")) 1322 owner = from_union([from_none, BusinessDetails.from_dict], obj.get("owner")) 1323 related_locations = from_union([from_none, lambda x: from_list(RelatedLocation.from_dict, x)], obj.get("related_locations")) 1324 suboperator = from_union([from_none, BusinessDetails.from_dict], obj.get("suboperator")) 1325 time_zone = from_union([from_none, from_str], obj.get("time_zone")) 1326 return SessionLocation(id, type, address, city, postal_code, country, coordinates, last_updated, charging_when_closed, directions, energy_mix, evses, facilities, images, name, opening_times, operator, owner, related_locations, suboperator, time_zone) 1327 1328 def to_dict(self) -> dict: 1329 result: dict = {} 1330 result["id"] = from_str(self.id) 1331 result["type"] = to_enum(LocationType, self.type) 1332 result["address"] = from_str(self.address) 1333 result["city"] = from_str(self.city) 1334 result["postal_code"] = from_str(self.postal_code) 1335 result["country"] = from_str(self.country) 1336 result["coordinates"] = to_class(GeoLocation, self.coordinates) 1337 result["last_updated"] = from_str(self.last_updated) 1338 if self.charging_when_closed is not None: 1339 result["charging_when_closed"] = from_union([from_none, from_bool], self.charging_when_closed) 1340 if self.directions is not None: 1341 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 1342 if self.energy_mix is not None: 1343 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 1344 if self.evses is not None: 1345 result["evses"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Evse, x), x)], self.evses) 1346 if self.facilities is not None: 1347 result["facilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Facility, x), x)], self.facilities) 1348 if self.images is not None: 1349 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 1350 if self.name is not None: 1351 result["name"] = from_union([from_none, from_str], self.name) 1352 if self.opening_times is not None: 1353 result["opening_times"] = from_union([from_none, lambda x: to_class(Hours, x)], self.opening_times) 1354 if self.operator is not None: 1355 result["operator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.operator) 1356 if self.owner is not None: 1357 result["owner"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.owner) 1358 if self.related_locations is not None: 1359 result["related_locations"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RelatedLocation, x), x)], self.related_locations) 1360 if self.suboperator is not None: 1361 result["suboperator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.suboperator) 1362 if self.time_zone is not None: 1363 result["time_zone"] = from_union([from_none, from_str], self.time_zone) 1364 return result 1365 1366 1367class Status(Enum): 1368 ACTIVE = "ACTIVE" 1369 COMPLETED = "COMPLETED" 1370 INVALID = "INVALID" 1371 PENDING = "PENDING" 1372 1373 1374class Session: 1375 auth_id: Optional[str] 1376 auth_method: Optional[AuthMethod] 1377 charging_periods: Optional[List[ChargingPeriod]] 1378 currency: Optional[str] 1379 end_datetime: Optional[str] 1380 id: Optional[str] 1381 kwh: Optional[float] 1382 last_updated: Optional[str] 1383 location: Optional[SessionLocation] 1384 meter_id: Optional[str] 1385 start_datetime: Optional[str] 1386 status: Optional[Status] 1387 total_cost: Optional[float] 1388 1389 def __init__(self, auth_id: Optional[str], auth_method: Optional[AuthMethod], charging_periods: Optional[List[ChargingPeriod]], currency: Optional[str], end_datetime: Optional[str], id: Optional[str], kwh: Optional[float], last_updated: Optional[str], location: Optional[SessionLocation], meter_id: Optional[str], start_datetime: Optional[str], status: Optional[Status], total_cost: Optional[float]) -> None: 1390 self.auth_id = auth_id 1391 self.auth_method = auth_method 1392 self.charging_periods = charging_periods 1393 self.currency = currency 1394 self.end_datetime = end_datetime 1395 self.id = id 1396 self.kwh = kwh 1397 self.last_updated = last_updated 1398 self.location = location 1399 self.meter_id = meter_id 1400 self.start_datetime = start_datetime 1401 self.status = status 1402 self.total_cost = total_cost 1403 1404 @staticmethod 1405 def from_dict(obj: Any) -> 'Session': 1406 assert isinstance(obj, dict) 1407 auth_id = from_union([from_str, from_none], obj.get("auth_id")) 1408 auth_method = from_union([AuthMethod, from_none], obj.get("auth_method")) 1409 charging_periods = from_union([from_none, lambda x: from_list(ChargingPeriod.from_dict, x)], obj.get("charging_periods")) 1410 currency = from_union([from_str, from_none], obj.get("currency")) 1411 end_datetime = from_union([from_none, from_str], obj.get("end_datetime")) 1412 id = from_union([from_str, from_none], obj.get("id")) 1413 kwh = from_union([from_none, from_float], obj.get("kwh")) 1414 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 1415 location = from_union([SessionLocation.from_dict, from_none], obj.get("location")) 1416 meter_id = from_union([from_none, from_str], obj.get("meter_id")) 1417 start_datetime = from_union([from_str, from_none], obj.get("start_datetime")) 1418 status = from_union([Status, from_none], obj.get("status")) 1419 total_cost = from_union([from_none, from_float], obj.get("total_cost")) 1420 return Session(auth_id, auth_method, charging_periods, currency, end_datetime, id, kwh, last_updated, location, meter_id, start_datetime, status, total_cost) 1421 1422 def to_dict(self) -> dict: 1423 result: dict = {} 1424 if self.auth_id is not None: 1425 result["auth_id"] = from_union([from_str, from_none], self.auth_id) 1426 if self.auth_method is not None: 1427 result["auth_method"] = from_union([lambda x: to_enum(AuthMethod, x), from_none], self.auth_method) 1428 if self.charging_periods is not None: 1429 result["charging_periods"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ChargingPeriod, x), x)], self.charging_periods) 1430 if self.currency is not None: 1431 result["currency"] = from_union([from_str, from_none], self.currency) 1432 if self.end_datetime is not None: 1433 result["end_datetime"] = from_union([from_none, from_str], self.end_datetime) 1434 if self.id is not None: 1435 result["id"] = from_union([from_str, from_none], self.id) 1436 if self.kwh is not None: 1437 result["kwh"] = from_union([from_none, to_float], self.kwh) 1438 if self.last_updated is not None: 1439 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 1440 if self.location is not None: 1441 result["location"] = from_union([lambda x: to_class(SessionLocation, x), from_none], self.location) 1442 if self.meter_id is not None: 1443 result["meter_id"] = from_union([from_none, from_str], self.meter_id) 1444 if self.start_datetime is not None: 1445 result["start_datetime"] = from_union([from_str, from_none], self.start_datetime) 1446 if self.status is not None: 1447 result["status"] = from_union([lambda x: to_enum(Status, x), from_none], self.status) 1448 if self.total_cost is not None: 1449 result["total_cost"] = from_union([from_none, to_float], self.total_cost) 1450 return result 1451 1452 1453class TokenType(Enum): 1454 OTHER = "OTHER" 1455 RFID = "RFID" 1456 1457 1458class Whitelist(Enum): 1459 ALLOWED = "ALLOWED" 1460 ALLOWED_OFFLINE = "ALLOWED_OFFLINE" 1461 ALWAYS = "ALWAYS" 1462 NEVER = "NEVER" 1463 1464 1465class Token: 1466 auth_id: Optional[str] 1467 issuer: Optional[str] 1468 language: Optional[str] 1469 last_updated: Optional[str] 1470 type: Optional[TokenType] 1471 uid: Optional[str] 1472 valid: Optional[bool] 1473 visual_number: Optional[str] 1474 whitelist: Optional[Whitelist] 1475 1476 def __init__(self, auth_id: Optional[str], issuer: Optional[str], language: Optional[str], last_updated: Optional[str], type: Optional[TokenType], uid: Optional[str], valid: Optional[bool], visual_number: Optional[str], whitelist: Optional[Whitelist]) -> None: 1477 self.auth_id = auth_id 1478 self.issuer = issuer 1479 self.language = language 1480 self.last_updated = last_updated 1481 self.type = type 1482 self.uid = uid 1483 self.valid = valid 1484 self.visual_number = visual_number 1485 self.whitelist = whitelist 1486 1487 @staticmethod 1488 def from_dict(obj: Any) -> 'Token': 1489 assert isinstance(obj, dict) 1490 auth_id = from_union([from_str, from_none], obj.get("auth_id")) 1491 issuer = from_union([from_str, from_none], obj.get("issuer")) 1492 language = from_union([from_str, from_none], obj.get("language")) 1493 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 1494 type = from_union([TokenType, from_none], obj.get("type")) 1495 uid = from_union([from_str, from_none], obj.get("uid")) 1496 valid = from_union([from_none, from_bool], obj.get("valid")) 1497 visual_number = from_union([from_str, from_none], obj.get("visual_number")) 1498 whitelist = from_union([Whitelist, from_none], obj.get("whitelist")) 1499 return Token(auth_id, issuer, language, last_updated, type, uid, valid, visual_number, whitelist) 1500 1501 def to_dict(self) -> dict: 1502 result: dict = {} 1503 if self.auth_id is not None: 1504 result["auth_id"] = from_union([from_str, from_none], self.auth_id) 1505 if self.issuer is not None: 1506 result["issuer"] = from_union([from_str, from_none], self.issuer) 1507 if self.language is not None: 1508 result["language"] = from_union([from_str, from_none], self.language) 1509 if self.last_updated is not None: 1510 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 1511 if self.type is not None: 1512 result["type"] = from_union([lambda x: to_enum(TokenType, x), from_none], self.type) 1513 if self.uid is not None: 1514 result["uid"] = from_union([from_str, from_none], self.uid) 1515 if self.valid is not None: 1516 result["valid"] = from_union([from_none, from_bool], self.valid) 1517 if self.visual_number is not None: 1518 result["visual_number"] = from_union([from_str, from_none], self.visual_number) 1519 if self.whitelist is not None: 1520 result["whitelist"] = from_union([lambda x: to_enum(Whitelist, x), from_none], self.whitelist) 1521 return result 1522 1523 1524class V211: 1525 cdr: Optional[Cdr] 1526 connector: Optional[Connector] 1527 credentials: Optional[Credentials] 1528 evse: Optional[Evse] 1529 location: Optional[Location] 1530 session: Optional[Session] 1531 tariff: Optional[Tariff] 1532 token: Optional[Token] 1533 1534 def __init__(self, cdr: Optional[Cdr], connector: Optional[Connector], credentials: Optional[Credentials], evse: Optional[Evse], location: Optional[Location], session: Optional[Session], tariff: Optional[Tariff], token: Optional[Token]) -> None: 1535 self.cdr = cdr 1536 self.connector = connector 1537 self.credentials = credentials 1538 self.evse = evse 1539 self.location = location 1540 self.session = session 1541 self.tariff = tariff 1542 self.token = token 1543 1544 @staticmethod 1545 def from_dict(obj: Any) -> 'V211': 1546 assert isinstance(obj, dict) 1547 cdr = from_union([Cdr.from_dict, from_none], obj.get("cdr")) 1548 connector = from_union([Connector.from_dict, from_none], obj.get("connector")) 1549 credentials = from_union([Credentials.from_dict, from_none], obj.get("credentials")) 1550 evse = from_union([Evse.from_dict, from_none], obj.get("evse")) 1551 location = from_union([Location.from_dict, from_none], obj.get("location")) 1552 session = from_union([Session.from_dict, from_none], obj.get("session")) 1553 tariff = from_union([Tariff.from_dict, from_none], obj.get("tariff")) 1554 token = from_union([Token.from_dict, from_none], obj.get("token")) 1555 return V211(cdr, connector, credentials, evse, location, session, tariff, token) 1556 1557 def to_dict(self) -> dict: 1558 result: dict = {} 1559 if self.cdr is not None: 1560 result["cdr"] = from_union([lambda x: to_class(Cdr, x), from_none], self.cdr) 1561 if self.connector is not None: 1562 result["connector"] = from_union([lambda x: to_class(Connector, x), from_none], self.connector) 1563 if self.credentials is not None: 1564 result["credentials"] = from_union([lambda x: to_class(Credentials, x), from_none], self.credentials) 1565 if self.evse is not None: 1566 result["evse"] = from_union([lambda x: to_class(Evse, x), from_none], self.evse) 1567 if self.location is not None: 1568 result["location"] = from_union([lambda x: to_class(Location, x), from_none], self.location) 1569 if self.session is not None: 1570 result["session"] = from_union([lambda x: to_class(Session, x), from_none], self.session) 1571 if self.tariff is not None: 1572 result["tariff"] = from_union([lambda x: to_class(Tariff, x), from_none], self.tariff) 1573 if self.token is not None: 1574 result["token"] = from_union([lambda x: to_class(Token, x), from_none], self.token) 1575 return result 1576 1577 1578def v211_from_dict(s: Any) -> V211: 1579 return V211.from_dict(s) 1580 1581 1582def v211_to_dict(x: V211) -> Any: 1583 return to_class(V211, x)
def
from_float(x: Any) -> float:
def
to_enum(c: Type[~EnumT], x: Any) -> ~EnumT:
def
to_float(x: Any) -> float:
def
from_list(f: Callable[[Any], ~T], x: Any) -> List[~T]:
def
from_str(x: Any) -> str:
def
to_class(c: Type[~T], x: Any) -> dict:
def
from_none(x: Any) -> Any:
def
from_union(fs, x):
def
from_bool(x: Any) -> bool:
def
from_int(x: Any) -> int:
def
from_datetime(x: Any) -> datetime.datetime:
class
AuthMethod(enum.Enum):
AUTH_REQUEST =
<AuthMethod.AUTH_REQUEST: 'AUTH_REQUEST'>
WHITELIST =
<AuthMethod.WHITELIST: 'WHITELIST'>
class
DimensionType(enum.Enum):
75class DimensionType(Enum): 76 ENERGY = "ENERGY" 77 FLAT = "FLAT" 78 MAX_CURRENT = "MAX_CURRENT" 79 MIN_CURRENT = "MIN_CURRENT" 80 PARKING_TIME = "PARKING_TIME" 81 TIME = "TIME"
ENERGY =
<DimensionType.ENERGY: 'ENERGY'>
FLAT =
<DimensionType.FLAT: 'FLAT'>
MAX_CURRENT =
<DimensionType.MAX_CURRENT: 'MAX_CURRENT'>
MIN_CURRENT =
<DimensionType.MIN_CURRENT: 'MIN_CURRENT'>
PARKING_TIME =
<DimensionType.PARKING_TIME: 'PARKING_TIME'>
TIME =
<DimensionType.TIME: 'TIME'>
class
Dimension:
84class Dimension: 85 type: DimensionType 86 volume: float 87 88 def __init__(self, type: DimensionType, volume: float) -> None: 89 self.type = type 90 self.volume = volume 91 92 @staticmethod 93 def from_dict(obj: Any) -> 'Dimension': 94 assert isinstance(obj, dict) 95 type = DimensionType(obj.get("type")) 96 volume = from_float(obj.get("volume")) 97 return Dimension(type, volume) 98 99 def to_dict(self) -> dict: 100 result: dict = {} 101 result["type"] = to_enum(DimensionType, self.type) 102 result["volume"] = to_float(self.volume) 103 return result
Dimension(type: DimensionType, volume: float)
type: DimensionType
class
ChargingPeriod:
106class ChargingPeriod: 107 dimensions: List[Dimension] 108 start_date_time: str 109 110 def __init__(self, dimensions: List[Dimension], start_date_time: str) -> None: 111 self.dimensions = dimensions 112 self.start_date_time = start_date_time 113 114 @staticmethod 115 def from_dict(obj: Any) -> 'ChargingPeriod': 116 assert isinstance(obj, dict) 117 dimensions = from_list(Dimension.from_dict, obj.get("dimensions")) 118 start_date_time = from_str(obj.get("start_date_time")) 119 return ChargingPeriod(dimensions, start_date_time) 120 121 def to_dict(self) -> dict: 122 result: dict = {} 123 result["dimensions"] = from_list(lambda x: to_class(Dimension, x), self.dimensions) 124 result["start_date_time"] = from_str(self.start_date_time) 125 return result
ChargingPeriod(dimensions: List[Dimension], start_date_time: str)
dimensions: List[Dimension]
class
GeoLocation:
128class GeoLocation: 129 latitude: Optional[str] 130 longitude: Optional[str] 131 132 def __init__(self, latitude: Optional[str], longitude: Optional[str]) -> None: 133 self.latitude = latitude 134 self.longitude = longitude 135 136 @staticmethod 137 def from_dict(obj: Any) -> 'GeoLocation': 138 assert isinstance(obj, dict) 139 latitude = from_union([from_str, from_none], obj.get("latitude")) 140 longitude = from_union([from_str, from_none], obj.get("longitude")) 141 return GeoLocation(latitude, longitude) 142 143 def to_dict(self) -> dict: 144 result: dict = {} 145 if self.latitude is not None: 146 result["latitude"] = from_union([from_str, from_none], self.latitude) 147 if self.longitude is not None: 148 result["longitude"] = from_union([from_str, from_none], self.longitude) 149 return result
class
DisplayText:
152class DisplayText: 153 language: str 154 text: str 155 156 def __init__(self, language: str, text: str) -> None: 157 self.language = language 158 self.text = text 159 160 @staticmethod 161 def from_dict(obj: Any) -> 'DisplayText': 162 assert isinstance(obj, dict) 163 language = from_str(obj.get("language")) 164 text = from_str(obj.get("text")) 165 return DisplayText(language, text) 166 167 def to_dict(self) -> dict: 168 result: dict = {} 169 result["language"] = from_str(self.language) 170 result["text"] = from_str(self.text) 171 return result
class
EnergySourceSource(enum.Enum):
174class EnergySourceSource(Enum): 175 COAL = "COAL" 176 GAS = "GAS" 177 GENERAL_FOSSIL = "GENERAL_FOSSIL" 178 GENERAL_GREEN = "GENERAL_GREEN" 179 NUCLEAR = "NUCLEAR" 180 SOLAR = "SOLAR" 181 WATER = "WATER" 182 WIND = "WIND"
COAL =
<EnergySourceSource.COAL: 'COAL'>
GAS =
<EnergySourceSource.GAS: 'GAS'>
GENERAL_FOSSIL =
<EnergySourceSource.GENERAL_FOSSIL: 'GENERAL_FOSSIL'>
GENERAL_GREEN =
<EnergySourceSource.GENERAL_GREEN: 'GENERAL_GREEN'>
NUCLEAR =
<EnergySourceSource.NUCLEAR: 'NUCLEAR'>
SOLAR =
<EnergySourceSource.SOLAR: 'SOLAR'>
WATER =
<EnergySourceSource.WATER: 'WATER'>
WIND =
<EnergySourceSource.WIND: 'WIND'>
class
EnergySource:
185class EnergySource: 186 percentage: float 187 source: EnergySourceSource 188 189 def __init__(self, percentage: float, source: EnergySourceSource) -> None: 190 self.percentage = percentage 191 self.source = source 192 193 @staticmethod 194 def from_dict(obj: Any) -> 'EnergySource': 195 assert isinstance(obj, dict) 196 percentage = from_float(obj.get("percentage")) 197 source = EnergySourceSource(obj.get("source")) 198 return EnergySource(percentage, source) 199 200 def to_dict(self) -> dict: 201 result: dict = {} 202 result["percentage"] = to_float(self.percentage) 203 result["source"] = to_enum(EnergySourceSource, self.source) 204 return result
EnergySource(percentage: float, source: EnergySourceSource)
source: EnergySourceSource
class
EnvironImpactSource(enum.Enum):
207class EnvironImpactSource(Enum): 208 CARBON_DIOXIDE = "CARBON_DIOXIDE" 209 NUCLEAR_WASTE = "NUCLEAR_WASTE"
CARBON_DIOXIDE =
<EnvironImpactSource.CARBON_DIOXIDE: 'CARBON_DIOXIDE'>
NUCLEAR_WASTE =
<EnvironImpactSource.NUCLEAR_WASTE: 'NUCLEAR_WASTE'>
class
EnvironImpact:
212class EnvironImpact: 213 amount: float 214 source: EnvironImpactSource 215 216 def __init__(self, amount: float, source: EnvironImpactSource) -> None: 217 self.amount = amount 218 self.source = source 219 220 @staticmethod 221 def from_dict(obj: Any) -> 'EnvironImpact': 222 assert isinstance(obj, dict) 223 amount = from_float(obj.get("amount")) 224 source = EnvironImpactSource(obj.get("source")) 225 return EnvironImpact(amount, source) 226 227 def to_dict(self) -> dict: 228 result: dict = {} 229 result["amount"] = to_float(self.amount) 230 result["source"] = to_enum(EnvironImpactSource, self.source) 231 return result
EnvironImpact(amount: float, source: EnvironImpactSource)
source: EnvironImpactSource
class
EnergyMix:
234class EnergyMix: 235 energy_product_name: Optional[str] 236 energy_sources: Optional[List[EnergySource]] 237 environ_impact: Optional[List[EnvironImpact]] 238 is_green_energy: bool 239 supplier_name: Optional[str] 240 241 def __init__(self, energy_product_name: Optional[str], energy_sources: Optional[List[EnergySource]], environ_impact: Optional[List[EnvironImpact]], is_green_energy: bool, supplier_name: Optional[str]) -> None: 242 self.energy_product_name = energy_product_name 243 self.energy_sources = energy_sources 244 self.environ_impact = environ_impact 245 self.is_green_energy = is_green_energy 246 self.supplier_name = supplier_name 247 248 @staticmethod 249 def from_dict(obj: Any) -> 'EnergyMix': 250 assert isinstance(obj, dict) 251 energy_product_name = from_union([from_none, from_str], obj.get("energy_product_name")) 252 energy_sources = from_union([from_none, lambda x: from_list(EnergySource.from_dict, x)], obj.get("energy_sources")) 253 environ_impact = from_union([from_none, lambda x: from_list(EnvironImpact.from_dict, x)], obj.get("environ_impact")) 254 is_green_energy = from_bool(obj.get("is_green_energy")) 255 supplier_name = from_union([from_none, from_str], obj.get("supplier_name")) 256 return EnergyMix(energy_product_name, energy_sources, environ_impact, is_green_energy, supplier_name) 257 258 def to_dict(self) -> dict: 259 result: dict = {} 260 if self.energy_product_name is not None: 261 result["energy_product_name"] = from_union([from_none, from_str], self.energy_product_name) 262 if self.energy_sources is not None: 263 result["energy_sources"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EnergySource, x), x)], self.energy_sources) 264 if self.environ_impact is not None: 265 result["environ_impact"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EnvironImpact, x), x)], self.environ_impact) 266 result["is_green_energy"] = from_bool(self.is_green_energy) 267 if self.supplier_name is not None: 268 result["supplier_name"] = from_union([from_none, from_str], self.supplier_name) 269 return result
EnergyMix( energy_product_name: Optional[str], energy_sources: Optional[List[EnergySource]], environ_impact: Optional[List[EnvironImpact]], is_green_energy: bool, supplier_name: Optional[str])
241 def __init__(self, energy_product_name: Optional[str], energy_sources: Optional[List[EnergySource]], environ_impact: Optional[List[EnvironImpact]], is_green_energy: bool, supplier_name: Optional[str]) -> None: 242 self.energy_product_name = energy_product_name 243 self.energy_sources = energy_sources 244 self.environ_impact = environ_impact 245 self.is_green_energy = is_green_energy 246 self.supplier_name = supplier_name
energy_sources: Optional[List[EnergySource]]
environ_impact: Optional[List[EnvironImpact]]
248 @staticmethod 249 def from_dict(obj: Any) -> 'EnergyMix': 250 assert isinstance(obj, dict) 251 energy_product_name = from_union([from_none, from_str], obj.get("energy_product_name")) 252 energy_sources = from_union([from_none, lambda x: from_list(EnergySource.from_dict, x)], obj.get("energy_sources")) 253 environ_impact = from_union([from_none, lambda x: from_list(EnvironImpact.from_dict, x)], obj.get("environ_impact")) 254 is_green_energy = from_bool(obj.get("is_green_energy")) 255 supplier_name = from_union([from_none, from_str], obj.get("supplier_name")) 256 return EnergyMix(energy_product_name, energy_sources, environ_impact, is_green_energy, supplier_name)
def
to_dict(self) -> dict:
258 def to_dict(self) -> dict: 259 result: dict = {} 260 if self.energy_product_name is not None: 261 result["energy_product_name"] = from_union([from_none, from_str], self.energy_product_name) 262 if self.energy_sources is not None: 263 result["energy_sources"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EnergySource, x), x)], self.energy_sources) 264 if self.environ_impact is not None: 265 result["environ_impact"] = from_union([from_none, lambda x: from_list(lambda x: to_class(EnvironImpact, x), x)], self.environ_impact) 266 result["is_green_energy"] = from_bool(self.is_green_energy) 267 if self.supplier_name is not None: 268 result["supplier_name"] = from_union([from_none, from_str], self.supplier_name) 269 return result
class
Capability(enum.Enum):
272class Capability(Enum): 273 CHARGING_PROFILE_CAPABLE = "CHARGING_PROFILE_CAPABLE" 274 CREDIT_CARD_PAYABLE = "CREDIT_CARD_PAYABLE" 275 REMOTE_START_STOP_CAPABLE = "REMOTE_START_STOP_CAPABLE" 276 RESERVABLE = "RESERVABLE" 277 RFID_READER = "RFID_READER" 278 UNLOCK_CAPABLE = "UNLOCK_CAPABLE"
CHARGING_PROFILE_CAPABLE =
<Capability.CHARGING_PROFILE_CAPABLE: 'CHARGING_PROFILE_CAPABLE'>
CREDIT_CARD_PAYABLE =
<Capability.CREDIT_CARD_PAYABLE: 'CREDIT_CARD_PAYABLE'>
REMOTE_START_STOP_CAPABLE =
<Capability.REMOTE_START_STOP_CAPABLE: 'REMOTE_START_STOP_CAPABLE'>
RESERVABLE =
<Capability.RESERVABLE: 'RESERVABLE'>
RFID_READER =
<Capability.RFID_READER: 'RFID_READER'>
UNLOCK_CAPABLE =
<Capability.UNLOCK_CAPABLE: 'UNLOCK_CAPABLE'>
class
Format(enum.Enum):
CABLE =
<Format.CABLE: 'CABLE'>
SOCKET =
<Format.SOCKET: 'SOCKET'>
class
PowerType(enum.Enum):
286class PowerType(Enum): 287 AC_1__PHASE = "AC_1_PHASE" 288 AC_3__PHASE = "AC_3_PHASE" 289 DC = "DC"
AC_1__PHASE =
<PowerType.AC_1__PHASE: 'AC_1_PHASE'>
AC_3__PHASE =
<PowerType.AC_3__PHASE: 'AC_3_PHASE'>
DC =
<PowerType.DC: 'DC'>
class
Standard(enum.Enum):
292class Standard(Enum): 293 CHADEMO = "CHADEMO" 294 DOMESTIC_A = "DOMESTIC_A" 295 DOMESTIC_B = "DOMESTIC_B" 296 DOMESTIC_C = "DOMESTIC_C" 297 DOMESTIC_D = "DOMESTIC_D" 298 DOMESTIC_E = "DOMESTIC_E" 299 DOMESTIC_F = "DOMESTIC_F" 300 DOMESTIC_G = "DOMESTIC_G" 301 DOMESTIC_H = "DOMESTIC_H" 302 DOMESTIC_I = "DOMESTIC_I" 303 DOMESTIC_J = "DOMESTIC_J" 304 DOMESTIC_K = "DOMESTIC_K" 305 DOMESTIC_L = "DOMESTIC_L" 306 IEC_60309_2__SINGLE_16 = "IEC_60309_2_single_16" 307 IEC_60309_2__THREE_16 = "IEC_60309_2_three_16" 308 IEC_60309_2__THREE_32 = "IEC_60309_2_three_32" 309 IEC_60309_2__THREE_64 = "IEC_60309_2_three_64" 310 IEC_62196__T1 = "IEC_62196_T1" 311 IEC_62196__T1_COMBO = "IEC_62196_T1_COMBO" 312 IEC_62196__T2 = "IEC_62196_T2" 313 IEC_62196__T2_COMBO = "IEC_62196_T2_COMBO" 314 IEC_62196__T3_A = "IEC_62196_T3A" 315 IEC_62196__T3_C = "IEC_62196_T3C" 316 TESLA_R = "TESLA_R" 317 TESLA_S = "TESLA_S"
CHADEMO =
<Standard.CHADEMO: 'CHADEMO'>
DOMESTIC_A =
<Standard.DOMESTIC_A: 'DOMESTIC_A'>
DOMESTIC_B =
<Standard.DOMESTIC_B: 'DOMESTIC_B'>
DOMESTIC_C =
<Standard.DOMESTIC_C: 'DOMESTIC_C'>
DOMESTIC_D =
<Standard.DOMESTIC_D: 'DOMESTIC_D'>
DOMESTIC_E =
<Standard.DOMESTIC_E: 'DOMESTIC_E'>
DOMESTIC_F =
<Standard.DOMESTIC_F: 'DOMESTIC_F'>
DOMESTIC_G =
<Standard.DOMESTIC_G: 'DOMESTIC_G'>
DOMESTIC_H =
<Standard.DOMESTIC_H: 'DOMESTIC_H'>
DOMESTIC_I =
<Standard.DOMESTIC_I: 'DOMESTIC_I'>
DOMESTIC_J =
<Standard.DOMESTIC_J: 'DOMESTIC_J'>
DOMESTIC_K =
<Standard.DOMESTIC_K: 'DOMESTIC_K'>
DOMESTIC_L =
<Standard.DOMESTIC_L: 'DOMESTIC_L'>
IEC_60309_2__SINGLE_16 =
<Standard.IEC_60309_2__SINGLE_16: 'IEC_60309_2_single_16'>
IEC_60309_2__THREE_16 =
<Standard.IEC_60309_2__THREE_16: 'IEC_60309_2_three_16'>
IEC_60309_2__THREE_32 =
<Standard.IEC_60309_2__THREE_32: 'IEC_60309_2_three_32'>
IEC_60309_2__THREE_64 =
<Standard.IEC_60309_2__THREE_64: 'IEC_60309_2_three_64'>
IEC_62196__T1 =
<Standard.IEC_62196__T1: 'IEC_62196_T1'>
IEC_62196__T1_COMBO =
<Standard.IEC_62196__T1_COMBO: 'IEC_62196_T1_COMBO'>
IEC_62196__T2 =
<Standard.IEC_62196__T2: 'IEC_62196_T2'>
IEC_62196__T2_COMBO =
<Standard.IEC_62196__T2_COMBO: 'IEC_62196_T2_COMBO'>
IEC_62196__T3_A =
<Standard.IEC_62196__T3_A: 'IEC_62196_T3A'>
IEC_62196__T3_C =
<Standard.IEC_62196__T3_C: 'IEC_62196_T3C'>
TESLA_R =
<Standard.TESLA_R: 'TESLA_R'>
TESLA_S =
<Standard.TESLA_S: 'TESLA_S'>
class
Connector:
320class Connector: 321 amperage: Optional[int] 322 format: Optional[Format] 323 id: Optional[str] 324 last_updated: Optional[str] 325 power_type: Optional[PowerType] 326 standard: Optional[Standard] 327 tariff_id: Optional[str] 328 terms_and_conditions: Optional[str] 329 voltage: Optional[int] 330 331 def __init__(self, amperage: Optional[int], format: Optional[Format], id: Optional[str], last_updated: Optional[str], power_type: Optional[PowerType], standard: Optional[Standard], tariff_id: Optional[str], terms_and_conditions: Optional[str], voltage: Optional[int]) -> None: 332 self.amperage = amperage 333 self.format = format 334 self.id = id 335 self.last_updated = last_updated 336 self.power_type = power_type 337 self.standard = standard 338 self.tariff_id = tariff_id 339 self.terms_and_conditions = terms_and_conditions 340 self.voltage = voltage 341 342 @staticmethod 343 def from_dict(obj: Any) -> 'Connector': 344 assert isinstance(obj, dict) 345 amperage = from_union([from_int, from_none], obj.get("amperage")) 346 format = from_union([Format, from_none], obj.get("format")) 347 id = from_union([from_str, from_none], obj.get("id")) 348 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 349 power_type = from_union([PowerType, from_none], obj.get("power_type")) 350 standard = from_union([Standard, from_none], obj.get("standard")) 351 tariff_id = from_union([from_none, from_str], obj.get("tariff_id")) 352 terms_and_conditions = from_union([from_none, from_str], obj.get("terms_and_conditions")) 353 voltage = from_union([from_int, from_none], obj.get("voltage")) 354 return Connector(amperage, format, id, last_updated, power_type, standard, tariff_id, terms_and_conditions, voltage) 355 356 def to_dict(self) -> dict: 357 result: dict = {} 358 if self.amperage is not None: 359 result["amperage"] = from_union([from_int, from_none], self.amperage) 360 if self.format is not None: 361 result["format"] = from_union([lambda x: to_enum(Format, x), from_none], self.format) 362 if self.id is not None: 363 result["id"] = from_union([from_str, from_none], self.id) 364 if self.last_updated is not None: 365 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 366 if self.power_type is not None: 367 result["power_type"] = from_union([lambda x: to_enum(PowerType, x), from_none], self.power_type) 368 if self.standard is not None: 369 result["standard"] = from_union([lambda x: to_enum(Standard, x), from_none], self.standard) 370 if self.tariff_id is not None: 371 result["tariff_id"] = from_union([from_none, from_str], self.tariff_id) 372 if self.terms_and_conditions is not None: 373 result["terms_and_conditions"] = from_union([from_none, from_str], self.terms_and_conditions) 374 if self.voltage is not None: 375 result["voltage"] = from_union([from_int, from_none], self.voltage) 376 return result
Connector( amperage: Optional[int], format: Optional[Format], id: Optional[str], last_updated: Optional[str], power_type: Optional[PowerType], standard: Optional[Standard], tariff_id: Optional[str], terms_and_conditions: Optional[str], voltage: Optional[int])
331 def __init__(self, amperage: Optional[int], format: Optional[Format], id: Optional[str], last_updated: Optional[str], power_type: Optional[PowerType], standard: Optional[Standard], tariff_id: Optional[str], terms_and_conditions: Optional[str], voltage: Optional[int]) -> None: 332 self.amperage = amperage 333 self.format = format 334 self.id = id 335 self.last_updated = last_updated 336 self.power_type = power_type 337 self.standard = standard 338 self.tariff_id = tariff_id 339 self.terms_and_conditions = terms_and_conditions 340 self.voltage = voltage
format: Optional[Format]
power_type: Optional[PowerType]
standard: Optional[Standard]
342 @staticmethod 343 def from_dict(obj: Any) -> 'Connector': 344 assert isinstance(obj, dict) 345 amperage = from_union([from_int, from_none], obj.get("amperage")) 346 format = from_union([Format, from_none], obj.get("format")) 347 id = from_union([from_str, from_none], obj.get("id")) 348 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 349 power_type = from_union([PowerType, from_none], obj.get("power_type")) 350 standard = from_union([Standard, from_none], obj.get("standard")) 351 tariff_id = from_union([from_none, from_str], obj.get("tariff_id")) 352 terms_and_conditions = from_union([from_none, from_str], obj.get("terms_and_conditions")) 353 voltage = from_union([from_int, from_none], obj.get("voltage")) 354 return Connector(amperage, format, id, last_updated, power_type, standard, tariff_id, terms_and_conditions, voltage)
def
to_dict(self) -> dict:
356 def to_dict(self) -> dict: 357 result: dict = {} 358 if self.amperage is not None: 359 result["amperage"] = from_union([from_int, from_none], self.amperage) 360 if self.format is not None: 361 result["format"] = from_union([lambda x: to_enum(Format, x), from_none], self.format) 362 if self.id is not None: 363 result["id"] = from_union([from_str, from_none], self.id) 364 if self.last_updated is not None: 365 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 366 if self.power_type is not None: 367 result["power_type"] = from_union([lambda x: to_enum(PowerType, x), from_none], self.power_type) 368 if self.standard is not None: 369 result["standard"] = from_union([lambda x: to_enum(Standard, x), from_none], self.standard) 370 if self.tariff_id is not None: 371 result["tariff_id"] = from_union([from_none, from_str], self.tariff_id) 372 if self.terms_and_conditions is not None: 373 result["terms_and_conditions"] = from_union([from_none, from_str], self.terms_and_conditions) 374 if self.voltage is not None: 375 result["voltage"] = from_union([from_int, from_none], self.voltage) 376 return result
class
Category(enum.Enum):
379class Category(Enum): 380 CHARGER = "CHARGER" 381 ENTRANCE = "ENTRANCE" 382 LOCATION = "LOCATION" 383 NETWORK = "NETWORK" 384 OPERATOR = "OPERATOR" 385 OTHER = "OTHER" 386 OWNER = "OWNER"
CHARGER =
<Category.CHARGER: 'CHARGER'>
ENTRANCE =
<Category.ENTRANCE: 'ENTRANCE'>
LOCATION =
<Category.LOCATION: 'LOCATION'>
NETWORK =
<Category.NETWORK: 'NETWORK'>
OPERATOR =
<Category.OPERATOR: 'OPERATOR'>
OTHER =
<Category.OTHER: 'OTHER'>
OWNER =
<Category.OWNER: 'OWNER'>
class
Image:
389class Image: 390 category: Category 391 height: Optional[int] 392 thumbnail: Optional[str] 393 type: str 394 url: str 395 width: Optional[int] 396 397 def __init__(self, category: Category, height: Optional[int], thumbnail: Optional[str], type: str, url: str, width: Optional[int]) -> None: 398 self.category = category 399 self.height = height 400 self.thumbnail = thumbnail 401 self.type = type 402 self.url = url 403 self.width = width 404 405 @staticmethod 406 def from_dict(obj: Any) -> 'Image': 407 assert isinstance(obj, dict) 408 category = Category(obj.get("category")) 409 height = from_union([from_int, from_none], obj.get("height")) 410 thumbnail = from_union([from_none, from_str], obj.get("thumbnail")) 411 type = from_str(obj.get("type")) 412 url = from_str(obj.get("url")) 413 width = from_union([from_int, from_none], obj.get("width")) 414 return Image(category, height, thumbnail, type, url, width) 415 416 def to_dict(self) -> dict: 417 result: dict = {} 418 result["category"] = to_enum(Category, self.category) 419 if self.height is not None: 420 result["height"] = from_union([from_int, from_none], self.height) 421 if self.thumbnail is not None: 422 result["thumbnail"] = from_union([from_none, from_str], self.thumbnail) 423 result["type"] = from_str(self.type) 424 result["url"] = from_str(self.url) 425 if self.width is not None: 426 result["width"] = from_union([from_int, from_none], self.width) 427 return result
Image( category: Category, height: Optional[int], thumbnail: Optional[str], type: str, url: str, width: Optional[int])
category: Category
405 @staticmethod 406 def from_dict(obj: Any) -> 'Image': 407 assert isinstance(obj, dict) 408 category = Category(obj.get("category")) 409 height = from_union([from_int, from_none], obj.get("height")) 410 thumbnail = from_union([from_none, from_str], obj.get("thumbnail")) 411 type = from_str(obj.get("type")) 412 url = from_str(obj.get("url")) 413 width = from_union([from_int, from_none], obj.get("width")) 414 return Image(category, height, thumbnail, type, url, width)
def
to_dict(self) -> dict:
416 def to_dict(self) -> dict: 417 result: dict = {} 418 result["category"] = to_enum(Category, self.category) 419 if self.height is not None: 420 result["height"] = from_union([from_int, from_none], self.height) 421 if self.thumbnail is not None: 422 result["thumbnail"] = from_union([from_none, from_str], self.thumbnail) 423 result["type"] = from_str(self.type) 424 result["url"] = from_str(self.url) 425 if self.width is not None: 426 result["width"] = from_union([from_int, from_none], self.width) 427 return result
class
ParkingRestriction(enum.Enum):
430class ParkingRestriction(Enum): 431 CUSTOMERS = "CUSTOMERS" 432 DISABLED = "DISABLED" 433 EV_ONLY = "EV_ONLY" 434 MOTORCYCLES = "MOTORCYCLES" 435 PLUGGED = "PLUGGED"
CUSTOMERS =
<ParkingRestriction.CUSTOMERS: 'CUSTOMERS'>
DISABLED =
<ParkingRestriction.DISABLED: 'DISABLED'>
EV_ONLY =
<ParkingRestriction.EV_ONLY: 'EV_ONLY'>
MOTORCYCLES =
<ParkingRestriction.MOTORCYCLES: 'MOTORCYCLES'>
PLUGGED =
<ParkingRestriction.PLUGGED: 'PLUGGED'>
class
EvseStatus(enum.Enum):
438class EvseStatus(Enum): 439 AVAILABLE = "AVAILABLE" 440 BLOCKED = "BLOCKED" 441 CHARGING = "CHARGING" 442 INOPERATIVE = "INOPERATIVE" 443 OUTOFORDER = "OUTOFORDER" 444 PLANNED = "PLANNED" 445 REMOVED = "REMOVED" 446 RESERVED = "RESERVED" 447 UNKNOWN = "UNKNOWN"
AVAILABLE =
<EvseStatus.AVAILABLE: 'AVAILABLE'>
BLOCKED =
<EvseStatus.BLOCKED: 'BLOCKED'>
CHARGING =
<EvseStatus.CHARGING: 'CHARGING'>
INOPERATIVE =
<EvseStatus.INOPERATIVE: 'INOPERATIVE'>
OUTOFORDER =
<EvseStatus.OUTOFORDER: 'OUTOFORDER'>
PLANNED =
<EvseStatus.PLANNED: 'PLANNED'>
REMOVED =
<EvseStatus.REMOVED: 'REMOVED'>
RESERVED =
<EvseStatus.RESERVED: 'RESERVED'>
UNKNOWN =
<EvseStatus.UNKNOWN: 'UNKNOWN'>
class
StatusSchedule:
450class StatusSchedule: 451 period_begin: str 452 period_end: Optional[str] 453 status: EvseStatus 454 455 def __init__(self, period_begin: str, period_end: Optional[str], status: EvseStatus) -> None: 456 self.period_begin = period_begin 457 self.period_end = period_end 458 self.status = status 459 460 @staticmethod 461 def from_dict(obj: Any) -> 'StatusSchedule': 462 assert isinstance(obj, dict) 463 period_begin = from_str(obj.get("period_begin")) 464 period_end = from_union([from_str, from_none], obj.get("period_end")) 465 status = EvseStatus(obj.get("status")) 466 return StatusSchedule(period_begin, period_end, status) 467 468 def to_dict(self) -> dict: 469 result: dict = {} 470 result["period_begin"] = from_str(self.period_begin) 471 if self.period_end is not None: 472 result["period_end"] = from_union([from_str, from_none], self.period_end) 473 result["status"] = to_enum(EvseStatus, self.status) 474 return result
StatusSchedule( period_begin: str, period_end: Optional[str], status: EvseStatus)
status: EvseStatus
460 @staticmethod 461 def from_dict(obj: Any) -> 'StatusSchedule': 462 assert isinstance(obj, dict) 463 period_begin = from_str(obj.get("period_begin")) 464 period_end = from_union([from_str, from_none], obj.get("period_end")) 465 status = EvseStatus(obj.get("status")) 466 return StatusSchedule(period_begin, period_end, status)
class
Evse:
477class Evse: 478 capabilities: Optional[List[Capability]] 479 connectors: Optional[List[Connector]] 480 coordinates: Optional[GeoLocation] 481 directions: Optional[List[DisplayText]] 482 evse_id: Optional[str] 483 floor_level: Optional[str] 484 images: Optional[List[Image]] 485 last_updated: Optional[str] 486 parking_restrictions: Optional[List[ParkingRestriction]] 487 physical_reference: Optional[str] 488 status: Optional[EvseStatus] 489 status_schedule: Optional[List[StatusSchedule]] 490 uid: Optional[str] 491 492 def __init__(self, capabilities: Optional[List[Capability]], connectors: Optional[List[Connector]], coordinates: Optional[GeoLocation], directions: Optional[List[DisplayText]], evse_id: Optional[str], floor_level: Optional[str], images: Optional[List[Image]], last_updated: Optional[str], parking_restrictions: Optional[List[ParkingRestriction]], physical_reference: Optional[str], status: Optional[EvseStatus], status_schedule: Optional[List[StatusSchedule]], uid: Optional[str]) -> None: 493 self.capabilities = capabilities 494 self.connectors = connectors 495 self.coordinates = coordinates 496 self.directions = directions 497 self.evse_id = evse_id 498 self.floor_level = floor_level 499 self.images = images 500 self.last_updated = last_updated 501 self.parking_restrictions = parking_restrictions 502 self.physical_reference = physical_reference 503 self.status = status 504 self.status_schedule = status_schedule 505 self.uid = uid 506 507 @staticmethod 508 def from_dict(obj: Any) -> 'Evse': 509 assert isinstance(obj, dict) 510 capabilities = from_union([from_none, lambda x: from_list(Capability, x)], obj.get("capabilities")) 511 connectors = from_union([lambda x: from_list(Connector.from_dict, x), from_none], obj.get("connectors")) 512 coordinates = from_union([from_none, GeoLocation.from_dict], obj.get("coordinates")) 513 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 514 evse_id = from_union([from_none, from_str], obj.get("evse_id")) 515 floor_level = from_union([from_none, from_str], obj.get("floor_level")) 516 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 517 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 518 parking_restrictions = from_union([from_none, lambda x: from_list(ParkingRestriction, x)], obj.get("parking_restrictions")) 519 physical_reference = from_union([from_none, from_str], obj.get("physical_reference")) 520 status = from_union([EvseStatus, from_none], obj.get("status")) 521 status_schedule = from_union([from_none, lambda x: from_list(StatusSchedule.from_dict, x)], obj.get("status_schedule")) 522 uid = from_union([from_str, from_none], obj.get("uid")) 523 return Evse(capabilities, connectors, coordinates, directions, evse_id, floor_level, images, last_updated, parking_restrictions, physical_reference, status, status_schedule, uid) 524 525 def to_dict(self) -> dict: 526 result: dict = {} 527 if self.capabilities is not None: 528 result["capabilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Capability, x), x)], self.capabilities) 529 if self.connectors is not None: 530 result["connectors"] = from_union([lambda x: from_list(lambda x: to_class(Connector, x), x), from_none], self.connectors) 531 if self.coordinates is not None: 532 result["coordinates"] = from_union([from_none, lambda x: to_class(GeoLocation, x)], self.coordinates) 533 if self.directions is not None: 534 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 535 if self.evse_id is not None: 536 result["evse_id"] = from_union([from_none, from_str], self.evse_id) 537 if self.floor_level is not None: 538 result["floor_level"] = from_union([from_none, from_str], self.floor_level) 539 if self.images is not None: 540 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 541 if self.last_updated is not None: 542 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 543 if self.parking_restrictions is not None: 544 result["parking_restrictions"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(ParkingRestriction, x), x)], self.parking_restrictions) 545 if self.physical_reference is not None: 546 result["physical_reference"] = from_union([from_none, from_str], self.physical_reference) 547 if self.status is not None: 548 result["status"] = from_union([lambda x: to_enum(EvseStatus, x), from_none], self.status) 549 if self.status_schedule is not None: 550 result["status_schedule"] = from_union([from_none, lambda x: from_list(lambda x: to_class(StatusSchedule, x), x)], self.status_schedule) 551 if self.uid is not None: 552 result["uid"] = from_union([from_str, from_none], self.uid) 553 return result
Evse( capabilities: Optional[List[Capability]], connectors: Optional[List[Connector]], coordinates: Optional[GeoLocation], directions: Optional[List[DisplayText]], evse_id: Optional[str], floor_level: Optional[str], images: Optional[List[Image]], last_updated: Optional[str], parking_restrictions: Optional[List[ParkingRestriction]], physical_reference: Optional[str], status: Optional[EvseStatus], status_schedule: Optional[List[StatusSchedule]], uid: Optional[str])
492 def __init__(self, capabilities: Optional[List[Capability]], connectors: Optional[List[Connector]], coordinates: Optional[GeoLocation], directions: Optional[List[DisplayText]], evse_id: Optional[str], floor_level: Optional[str], images: Optional[List[Image]], last_updated: Optional[str], parking_restrictions: Optional[List[ParkingRestriction]], physical_reference: Optional[str], status: Optional[EvseStatus], status_schedule: Optional[List[StatusSchedule]], uid: Optional[str]) -> None: 493 self.capabilities = capabilities 494 self.connectors = connectors 495 self.coordinates = coordinates 496 self.directions = directions 497 self.evse_id = evse_id 498 self.floor_level = floor_level 499 self.images = images 500 self.last_updated = last_updated 501 self.parking_restrictions = parking_restrictions 502 self.physical_reference = physical_reference 503 self.status = status 504 self.status_schedule = status_schedule 505 self.uid = uid
capabilities: Optional[List[Capability]]
connectors: Optional[List[Connector]]
coordinates: Optional[GeoLocation]
directions: Optional[List[DisplayText]]
images: Optional[List[Image]]
parking_restrictions: Optional[List[ParkingRestriction]]
status: Optional[EvseStatus]
status_schedule: Optional[List[StatusSchedule]]
507 @staticmethod 508 def from_dict(obj: Any) -> 'Evse': 509 assert isinstance(obj, dict) 510 capabilities = from_union([from_none, lambda x: from_list(Capability, x)], obj.get("capabilities")) 511 connectors = from_union([lambda x: from_list(Connector.from_dict, x), from_none], obj.get("connectors")) 512 coordinates = from_union([from_none, GeoLocation.from_dict], obj.get("coordinates")) 513 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 514 evse_id = from_union([from_none, from_str], obj.get("evse_id")) 515 floor_level = from_union([from_none, from_str], obj.get("floor_level")) 516 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 517 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 518 parking_restrictions = from_union([from_none, lambda x: from_list(ParkingRestriction, x)], obj.get("parking_restrictions")) 519 physical_reference = from_union([from_none, from_str], obj.get("physical_reference")) 520 status = from_union([EvseStatus, from_none], obj.get("status")) 521 status_schedule = from_union([from_none, lambda x: from_list(StatusSchedule.from_dict, x)], obj.get("status_schedule")) 522 uid = from_union([from_str, from_none], obj.get("uid")) 523 return Evse(capabilities, connectors, coordinates, directions, evse_id, floor_level, images, last_updated, parking_restrictions, physical_reference, status, status_schedule, uid)
def
to_dict(self) -> dict:
525 def to_dict(self) -> dict: 526 result: dict = {} 527 if self.capabilities is not None: 528 result["capabilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Capability, x), x)], self.capabilities) 529 if self.connectors is not None: 530 result["connectors"] = from_union([lambda x: from_list(lambda x: to_class(Connector, x), x), from_none], self.connectors) 531 if self.coordinates is not None: 532 result["coordinates"] = from_union([from_none, lambda x: to_class(GeoLocation, x)], self.coordinates) 533 if self.directions is not None: 534 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 535 if self.evse_id is not None: 536 result["evse_id"] = from_union([from_none, from_str], self.evse_id) 537 if self.floor_level is not None: 538 result["floor_level"] = from_union([from_none, from_str], self.floor_level) 539 if self.images is not None: 540 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 541 if self.last_updated is not None: 542 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 543 if self.parking_restrictions is not None: 544 result["parking_restrictions"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(ParkingRestriction, x), x)], self.parking_restrictions) 545 if self.physical_reference is not None: 546 result["physical_reference"] = from_union([from_none, from_str], self.physical_reference) 547 if self.status is not None: 548 result["status"] = from_union([lambda x: to_enum(EvseStatus, x), from_none], self.status) 549 if self.status_schedule is not None: 550 result["status_schedule"] = from_union([from_none, lambda x: from_list(lambda x: to_class(StatusSchedule, x), x)], self.status_schedule) 551 if self.uid is not None: 552 result["uid"] = from_union([from_str, from_none], self.uid) 553 return result
class
Facility(enum.Enum):
556class Facility(Enum): 557 AIRPORT = "AIRPORT" 558 BUS_STOP = "BUS_STOP" 559 CAFE = "CAFE" 560 CARPOOL_PARKING = "CARPOOL_PARKING" 561 FUEL_STATION = "FUEL_STATION" 562 HOTEL = "HOTEL" 563 MALL = "MALL" 564 MUSEUM = "MUSEUM" 565 NATURE = "NATURE" 566 RECREATION_AREA = "RECREATION_AREA" 567 RESTAURANT = "RESTAURANT" 568 SPORT = "SPORT" 569 SUPERMARKET = "SUPERMARKET" 570 TAXI_STAND = "TAXI_STAND" 571 TRAIN_STATION = "TRAIN_STATION" 572 WIFI = "WIFI"
AIRPORT =
<Facility.AIRPORT: 'AIRPORT'>
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'>
MUSEUM =
<Facility.MUSEUM: 'MUSEUM'>
NATURE =
<Facility.NATURE: 'NATURE'>
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'>
WIFI =
<Facility.WIFI: 'WIFI'>
class
ExceptionalPeriod:
575class ExceptionalPeriod: 576 period_begin: str 577 period_end: str 578 579 def __init__(self, period_begin: str, period_end: str) -> None: 580 self.period_begin = period_begin 581 self.period_end = period_end 582 583 @staticmethod 584 def from_dict(obj: Any) -> 'ExceptionalPeriod': 585 assert isinstance(obj, dict) 586 period_begin = from_str(obj.get("period_begin")) 587 period_end = from_str(obj.get("period_end")) 588 return ExceptionalPeriod(period_begin, period_end) 589 590 def to_dict(self) -> dict: 591 result: dict = {} 592 result["period_begin"] = from_str(self.period_begin) 593 result["period_end"] = from_str(self.period_end) 594 return result
class
RegularHours:
597class RegularHours: 598 period_begin: Optional[str] 599 period_end: Optional[str] 600 weekday: Optional[int] 601 602 def __init__(self, period_begin: Optional[str], period_end: Optional[str], weekday: Optional[int]) -> None: 603 self.period_begin = period_begin 604 self.period_end = period_end 605 self.weekday = weekday 606 607 @staticmethod 608 def from_dict(obj: Any) -> 'RegularHours': 609 assert isinstance(obj, dict) 610 period_begin = from_union([from_str, from_none], obj.get("period_begin")) 611 period_end = from_union([from_str, from_none], obj.get("period_end")) 612 weekday = from_union([from_int, from_none], obj.get("weekday")) 613 return RegularHours(period_begin, period_end, weekday) 614 615 def to_dict(self) -> dict: 616 result: dict = {} 617 if self.period_begin is not None: 618 result["period_begin"] = from_union([from_str, from_none], self.period_begin) 619 if self.period_end is not None: 620 result["period_end"] = from_union([from_str, from_none], self.period_end) 621 if self.weekday is not None: 622 result["weekday"] = from_union([from_int, from_none], self.weekday) 623 return result
607 @staticmethod 608 def from_dict(obj: Any) -> 'RegularHours': 609 assert isinstance(obj, dict) 610 period_begin = from_union([from_str, from_none], obj.get("period_begin")) 611 period_end = from_union([from_str, from_none], obj.get("period_end")) 612 weekday = from_union([from_int, from_none], obj.get("weekday")) 613 return RegularHours(period_begin, period_end, weekday)
def
to_dict(self) -> dict:
615 def to_dict(self) -> dict: 616 result: dict = {} 617 if self.period_begin is not None: 618 result["period_begin"] = from_union([from_str, from_none], self.period_begin) 619 if self.period_end is not None: 620 result["period_end"] = from_union([from_str, from_none], self.period_end) 621 if self.weekday is not None: 622 result["weekday"] = from_union([from_int, from_none], self.weekday) 623 return result
class
Hours:
626class Hours: 627 exceptional_closings: Optional[List[ExceptionalPeriod]] 628 exceptional_openings: Optional[List[ExceptionalPeriod]] 629 regular_hours: Optional[List[RegularHours]] 630 twentyfourseven: Optional[bool] 631 632 def __init__(self, exceptional_closings: Optional[List[ExceptionalPeriod]], exceptional_openings: Optional[List[ExceptionalPeriod]], regular_hours: Optional[List[RegularHours]], twentyfourseven: Optional[bool]) -> None: 633 self.exceptional_closings = exceptional_closings 634 self.exceptional_openings = exceptional_openings 635 self.regular_hours = regular_hours 636 self.twentyfourseven = twentyfourseven 637 638 @staticmethod 639 def from_dict(obj: Any) -> 'Hours': 640 assert isinstance(obj, dict) 641 exceptional_closings = from_union([from_none, lambda x: from_list(ExceptionalPeriod.from_dict, x)], obj.get("exceptional_closings")) 642 exceptional_openings = from_union([from_none, lambda x: from_list(ExceptionalPeriod.from_dict, x)], obj.get("exceptional_openings")) 643 regular_hours = from_union([from_none, lambda x: from_list(RegularHours.from_dict, x)], obj.get("regular_hours")) 644 twentyfourseven = from_union([from_none, from_bool], obj.get("twentyfourseven")) 645 return Hours(exceptional_closings, exceptional_openings, regular_hours, twentyfourseven) 646 647 def to_dict(self) -> dict: 648 result: dict = {} 649 if self.exceptional_closings is not None: 650 result["exceptional_closings"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ExceptionalPeriod, x), x)], self.exceptional_closings) 651 if self.exceptional_openings is not None: 652 result["exceptional_openings"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ExceptionalPeriod, x), x)], self.exceptional_openings) 653 if self.regular_hours is not None: 654 result["regular_hours"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RegularHours, x), x)], self.regular_hours) 655 if self.twentyfourseven is not None: 656 result["twentyfourseven"] = from_union([from_none, from_bool], self.twentyfourseven) 657 return result
Hours( exceptional_closings: Optional[List[ExceptionalPeriod]], exceptional_openings: Optional[List[ExceptionalPeriod]], regular_hours: Optional[List[RegularHours]], twentyfourseven: Optional[bool])
632 def __init__(self, exceptional_closings: Optional[List[ExceptionalPeriod]], exceptional_openings: Optional[List[ExceptionalPeriod]], regular_hours: Optional[List[RegularHours]], twentyfourseven: Optional[bool]) -> None: 633 self.exceptional_closings = exceptional_closings 634 self.exceptional_openings = exceptional_openings 635 self.regular_hours = regular_hours 636 self.twentyfourseven = twentyfourseven
exceptional_closings: Optional[List[ExceptionalPeriod]]
exceptional_openings: Optional[List[ExceptionalPeriod]]
regular_hours: Optional[List[RegularHours]]
638 @staticmethod 639 def from_dict(obj: Any) -> 'Hours': 640 assert isinstance(obj, dict) 641 exceptional_closings = from_union([from_none, lambda x: from_list(ExceptionalPeriod.from_dict, x)], obj.get("exceptional_closings")) 642 exceptional_openings = from_union([from_none, lambda x: from_list(ExceptionalPeriod.from_dict, x)], obj.get("exceptional_openings")) 643 regular_hours = from_union([from_none, lambda x: from_list(RegularHours.from_dict, x)], obj.get("regular_hours")) 644 twentyfourseven = from_union([from_none, from_bool], obj.get("twentyfourseven")) 645 return Hours(exceptional_closings, exceptional_openings, regular_hours, twentyfourseven)
def
to_dict(self) -> dict:
647 def to_dict(self) -> dict: 648 result: dict = {} 649 if self.exceptional_closings is not None: 650 result["exceptional_closings"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ExceptionalPeriod, x), x)], self.exceptional_closings) 651 if self.exceptional_openings is not None: 652 result["exceptional_openings"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ExceptionalPeriod, x), x)], self.exceptional_openings) 653 if self.regular_hours is not None: 654 result["regular_hours"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RegularHours, x), x)], self.regular_hours) 655 if self.twentyfourseven is not None: 656 result["twentyfourseven"] = from_union([from_none, from_bool], self.twentyfourseven) 657 return result
class
BusinessDetails:
660class BusinessDetails: 661 logo: Optional[Image] 662 name: str 663 website: Optional[str] 664 665 def __init__(self, logo: Optional[Image], name: str, website: Optional[str]) -> None: 666 self.logo = logo 667 self.name = name 668 self.website = website 669 670 @staticmethod 671 def from_dict(obj: Any) -> 'BusinessDetails': 672 assert isinstance(obj, dict) 673 logo = from_union([from_none, Image.from_dict], obj.get("logo")) 674 name = from_str(obj.get("name")) 675 website = from_union([from_none, from_str], obj.get("website")) 676 return BusinessDetails(logo, name, website) 677 678 def to_dict(self) -> dict: 679 result: dict = {} 680 if self.logo is not None: 681 result["logo"] = from_union([from_none, lambda x: to_class(Image, x)], self.logo) 682 result["name"] = from_str(self.name) 683 if self.website is not None: 684 result["website"] = from_union([from_none, from_str], self.website) 685 return result
BusinessDetails(logo: Optional[Image], name: str, website: Optional[str])
logo: Optional[Image]
670 @staticmethod 671 def from_dict(obj: Any) -> 'BusinessDetails': 672 assert isinstance(obj, dict) 673 logo = from_union([from_none, Image.from_dict], obj.get("logo")) 674 name = from_str(obj.get("name")) 675 website = from_union([from_none, from_str], obj.get("website")) 676 return BusinessDetails(logo, name, website)
def
to_dict(self) -> dict:
678 def to_dict(self) -> dict: 679 result: dict = {} 680 if self.logo is not None: 681 result["logo"] = from_union([from_none, lambda x: to_class(Image, x)], self.logo) 682 result["name"] = from_str(self.name) 683 if self.website is not None: 684 result["website"] = from_union([from_none, from_str], self.website) 685 return result
class
RelatedLocation:
688class RelatedLocation: 689 latitude: Optional[str] 690 longitude: Optional[str] 691 name: Optional[DisplayText] 692 693 def __init__(self, latitude: Optional[str], longitude: Optional[str], name: Optional[DisplayText]) -> None: 694 self.latitude = latitude 695 self.longitude = longitude 696 self.name = name 697 698 @staticmethod 699 def from_dict(obj: Any) -> 'RelatedLocation': 700 assert isinstance(obj, dict) 701 latitude = from_union([from_str, from_none], obj.get("latitude")) 702 longitude = from_union([from_str, from_none], obj.get("longitude")) 703 name = from_union([DisplayText.from_dict, from_none], obj.get("name")) 704 return RelatedLocation(latitude, longitude, name) 705 706 def to_dict(self) -> dict: 707 result: dict = {} 708 if self.latitude is not None: 709 result["latitude"] = from_union([from_str, from_none], self.latitude) 710 if self.longitude is not None: 711 result["longitude"] = from_union([from_str, from_none], self.longitude) 712 if self.name is not None: 713 result["name"] = from_union([lambda x: to_class(DisplayText, x), from_none], self.name) 714 return result
RelatedLocation( latitude: Optional[str], longitude: Optional[str], name: Optional[DisplayText])
name: Optional[DisplayText]
698 @staticmethod 699 def from_dict(obj: Any) -> 'RelatedLocation': 700 assert isinstance(obj, dict) 701 latitude = from_union([from_str, from_none], obj.get("latitude")) 702 longitude = from_union([from_str, from_none], obj.get("longitude")) 703 name = from_union([DisplayText.from_dict, from_none], obj.get("name")) 704 return RelatedLocation(latitude, longitude, name)
def
to_dict(self) -> dict:
706 def to_dict(self) -> dict: 707 result: dict = {} 708 if self.latitude is not None: 709 result["latitude"] = from_union([from_str, from_none], self.latitude) 710 if self.longitude is not None: 711 result["longitude"] = from_union([from_str, from_none], self.longitude) 712 if self.name is not None: 713 result["name"] = from_union([lambda x: to_class(DisplayText, x), from_none], self.name) 714 return result
class
LocationType(enum.Enum):
717class LocationType(Enum): 718 ON_STREET = "ON_STREET" 719 OTHER = "OTHER" 720 PARKING_GARAGE = "PARKING_GARAGE" 721 PARKING_LOT = "PARKING_LOT" 722 UNDERGROUND_GARAGE = "UNDERGROUND_GARAGE" 723 UNKNOWN = "UNKNOWN"
ON_STREET =
<LocationType.ON_STREET: 'ON_STREET'>
OTHER =
<LocationType.OTHER: 'OTHER'>
PARKING_GARAGE =
<LocationType.PARKING_GARAGE: 'PARKING_GARAGE'>
PARKING_LOT =
<LocationType.PARKING_LOT: 'PARKING_LOT'>
UNDERGROUND_GARAGE =
<LocationType.UNDERGROUND_GARAGE: 'UNDERGROUND_GARAGE'>
UNKNOWN =
<LocationType.UNKNOWN: 'UNKNOWN'>
class
CdrLocation:
726class CdrLocation: 727 id: str 728 type: LocationType 729 address: str 730 city: str 731 postal_code: str 732 country: str 733 coordinates: GeoLocation 734 last_updated: str 735 charging_when_closed: Optional[bool] 736 directions: Optional[List[DisplayText]] 737 energy_mix: Optional[EnergyMix] 738 evses: Optional[List[Evse]] 739 facilities: Optional[List[Facility]] 740 images: Optional[List[Image]] 741 name: Optional[str] 742 opening_times: Optional[Hours] 743 operator: Optional[BusinessDetails] 744 owner: Optional[BusinessDetails] 745 related_locations: Optional[List[RelatedLocation]] 746 suboperator: Optional[BusinessDetails] 747 time_zone: Optional[str] 748 749 def __init__(self, id: str, type: LocationType, address: str, city: str, postal_code: str, country: str, coordinates: GeoLocation, last_updated: str, charging_when_closed: Optional[bool], directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], images: Optional[List[Image]], name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], related_locations: Optional[List[RelatedLocation]], suboperator: Optional[BusinessDetails], time_zone: Optional[str]) -> None: 750 self.id = id 751 self.type = type 752 self.address = address 753 self.city = city 754 self.postal_code = postal_code 755 self.country = country 756 self.coordinates = coordinates 757 self.last_updated = last_updated 758 self.charging_when_closed = charging_when_closed 759 self.directions = directions 760 self.energy_mix = energy_mix 761 self.evses = evses 762 self.facilities = facilities 763 self.images = images 764 self.name = name 765 self.opening_times = opening_times 766 self.operator = operator 767 self.owner = owner 768 self.related_locations = related_locations 769 self.suboperator = suboperator 770 self.time_zone = time_zone 771 772 @staticmethod 773 def from_dict(obj: Any) -> 'CdrLocation': 774 assert isinstance(obj, dict) 775 id = from_str(obj.get("id")) 776 type = LocationType(obj.get("type")) 777 address = from_str(obj.get("address")) 778 city = from_str(obj.get("city")) 779 postal_code = from_str(obj.get("postal_code")) 780 country = from_str(obj.get("country")) 781 coordinates = GeoLocation.from_dict(obj.get("coordinates")) 782 last_updated = from_str(obj.get("last_updated")) 783 charging_when_closed = from_union([from_none, from_bool], obj.get("charging_when_closed")) 784 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 785 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 786 evses = from_union([from_none, lambda x: from_list(Evse.from_dict, x)], obj.get("evses")) 787 facilities = from_union([from_none, lambda x: from_list(Facility, x)], obj.get("facilities")) 788 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 789 name = from_union([from_none, from_str], obj.get("name")) 790 opening_times = from_union([from_none, Hours.from_dict], obj.get("opening_times")) 791 operator = from_union([from_none, BusinessDetails.from_dict], obj.get("operator")) 792 owner = from_union([from_none, BusinessDetails.from_dict], obj.get("owner")) 793 related_locations = from_union([from_none, lambda x: from_list(RelatedLocation.from_dict, x)], obj.get("related_locations")) 794 suboperator = from_union([from_none, BusinessDetails.from_dict], obj.get("suboperator")) 795 time_zone = from_union([from_none, from_str], obj.get("time_zone")) 796 return CdrLocation(id, type, address, city, postal_code, country, coordinates, last_updated, charging_when_closed, directions, energy_mix, evses, facilities, images, name, opening_times, operator, owner, related_locations, suboperator, time_zone) 797 798 def to_dict(self) -> dict: 799 result: dict = {} 800 result["id"] = from_str(self.id) 801 result["type"] = to_enum(LocationType, self.type) 802 result["address"] = from_str(self.address) 803 result["city"] = from_str(self.city) 804 result["postal_code"] = from_str(self.postal_code) 805 result["country"] = from_str(self.country) 806 result["coordinates"] = to_class(GeoLocation, self.coordinates) 807 result["last_updated"] = from_str(self.last_updated) 808 if self.charging_when_closed is not None: 809 result["charging_when_closed"] = from_union([from_none, from_bool], self.charging_when_closed) 810 if self.directions is not None: 811 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 812 if self.energy_mix is not None: 813 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 814 if self.evses is not None: 815 result["evses"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Evse, x), x)], self.evses) 816 if self.facilities is not None: 817 result["facilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Facility, x), x)], self.facilities) 818 if self.images is not None: 819 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 820 if self.name is not None: 821 result["name"] = from_union([from_none, from_str], self.name) 822 if self.opening_times is not None: 823 result["opening_times"] = from_union([from_none, lambda x: to_class(Hours, x)], self.opening_times) 824 if self.operator is not None: 825 result["operator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.operator) 826 if self.owner is not None: 827 result["owner"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.owner) 828 if self.related_locations is not None: 829 result["related_locations"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RelatedLocation, x), x)], self.related_locations) 830 if self.suboperator is not None: 831 result["suboperator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.suboperator) 832 if self.time_zone is not None: 833 result["time_zone"] = from_union([from_none, from_str], self.time_zone) 834 return result
CdrLocation( id: str, type: LocationType, address: str, city: str, postal_code: str, country: str, coordinates: GeoLocation, last_updated: str, charging_when_closed: Optional[bool], directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], images: Optional[List[Image]], name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], related_locations: Optional[List[RelatedLocation]], suboperator: Optional[BusinessDetails], time_zone: Optional[str])
749 def __init__(self, id: str, type: LocationType, address: str, city: str, postal_code: str, country: str, coordinates: GeoLocation, last_updated: str, charging_when_closed: Optional[bool], directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], images: Optional[List[Image]], name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], related_locations: Optional[List[RelatedLocation]], suboperator: Optional[BusinessDetails], time_zone: Optional[str]) -> None: 750 self.id = id 751 self.type = type 752 self.address = address 753 self.city = city 754 self.postal_code = postal_code 755 self.country = country 756 self.coordinates = coordinates 757 self.last_updated = last_updated 758 self.charging_when_closed = charging_when_closed 759 self.directions = directions 760 self.energy_mix = energy_mix 761 self.evses = evses 762 self.facilities = facilities 763 self.images = images 764 self.name = name 765 self.opening_times = opening_times 766 self.operator = operator 767 self.owner = owner 768 self.related_locations = related_locations 769 self.suboperator = suboperator 770 self.time_zone = time_zone
type: LocationType
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]
suboperator: Optional[BusinessDetails]
772 @staticmethod 773 def from_dict(obj: Any) -> 'CdrLocation': 774 assert isinstance(obj, dict) 775 id = from_str(obj.get("id")) 776 type = LocationType(obj.get("type")) 777 address = from_str(obj.get("address")) 778 city = from_str(obj.get("city")) 779 postal_code = from_str(obj.get("postal_code")) 780 country = from_str(obj.get("country")) 781 coordinates = GeoLocation.from_dict(obj.get("coordinates")) 782 last_updated = from_str(obj.get("last_updated")) 783 charging_when_closed = from_union([from_none, from_bool], obj.get("charging_when_closed")) 784 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 785 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 786 evses = from_union([from_none, lambda x: from_list(Evse.from_dict, x)], obj.get("evses")) 787 facilities = from_union([from_none, lambda x: from_list(Facility, x)], obj.get("facilities")) 788 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 789 name = from_union([from_none, from_str], obj.get("name")) 790 opening_times = from_union([from_none, Hours.from_dict], obj.get("opening_times")) 791 operator = from_union([from_none, BusinessDetails.from_dict], obj.get("operator")) 792 owner = from_union([from_none, BusinessDetails.from_dict], obj.get("owner")) 793 related_locations = from_union([from_none, lambda x: from_list(RelatedLocation.from_dict, x)], obj.get("related_locations")) 794 suboperator = from_union([from_none, BusinessDetails.from_dict], obj.get("suboperator")) 795 time_zone = from_union([from_none, from_str], obj.get("time_zone")) 796 return CdrLocation(id, type, address, city, postal_code, country, coordinates, last_updated, charging_when_closed, directions, energy_mix, evses, facilities, images, name, opening_times, operator, owner, related_locations, suboperator, time_zone)
def
to_dict(self) -> dict:
798 def to_dict(self) -> dict: 799 result: dict = {} 800 result["id"] = from_str(self.id) 801 result["type"] = to_enum(LocationType, self.type) 802 result["address"] = from_str(self.address) 803 result["city"] = from_str(self.city) 804 result["postal_code"] = from_str(self.postal_code) 805 result["country"] = from_str(self.country) 806 result["coordinates"] = to_class(GeoLocation, self.coordinates) 807 result["last_updated"] = from_str(self.last_updated) 808 if self.charging_when_closed is not None: 809 result["charging_when_closed"] = from_union([from_none, from_bool], self.charging_when_closed) 810 if self.directions is not None: 811 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 812 if self.energy_mix is not None: 813 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 814 if self.evses is not None: 815 result["evses"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Evse, x), x)], self.evses) 816 if self.facilities is not None: 817 result["facilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Facility, x), x)], self.facilities) 818 if self.images is not None: 819 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 820 if self.name is not None: 821 result["name"] = from_union([from_none, from_str], self.name) 822 if self.opening_times is not None: 823 result["opening_times"] = from_union([from_none, lambda x: to_class(Hours, x)], self.opening_times) 824 if self.operator is not None: 825 result["operator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.operator) 826 if self.owner is not None: 827 result["owner"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.owner) 828 if self.related_locations is not None: 829 result["related_locations"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RelatedLocation, x), x)], self.related_locations) 830 if self.suboperator is not None: 831 result["suboperator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.suboperator) 832 if self.time_zone is not None: 833 result["time_zone"] = from_union([from_none, from_str], self.time_zone) 834 return result
class
PriceComponentType(enum.Enum):
837class PriceComponentType(Enum): 838 ENERGY = "ENERGY" 839 FLAT = "FLAT" 840 PARKING_TIME = "PARKING_TIME" 841 TIME = "TIME"
ENERGY =
<PriceComponentType.ENERGY: 'ENERGY'>
FLAT =
<PriceComponentType.FLAT: 'FLAT'>
PARKING_TIME =
<PriceComponentType.PARKING_TIME: 'PARKING_TIME'>
TIME =
<PriceComponentType.TIME: 'TIME'>
class
PriceComponent:
844class PriceComponent: 845 price: float 846 step_size: int 847 type: PriceComponentType 848 849 def __init__(self, price: float, step_size: int, type: PriceComponentType) -> None: 850 self.price = price 851 self.step_size = step_size 852 self.type = type 853 854 @staticmethod 855 def from_dict(obj: Any) -> 'PriceComponent': 856 assert isinstance(obj, dict) 857 price = from_float(obj.get("price")) 858 step_size = from_int(obj.get("step_size")) 859 type = PriceComponentType(obj.get("type")) 860 return PriceComponent(price, step_size, type) 861 862 def to_dict(self) -> dict: 863 result: dict = {} 864 result["price"] = to_float(self.price) 865 result["step_size"] = from_int(self.step_size) 866 result["type"] = to_enum(PriceComponentType, self.type) 867 return result
PriceComponent(price: float, step_size: int, type: PriceComponentType)
type: PriceComponentType
class
DayOfWeek(enum.Enum):
870class DayOfWeek(Enum): 871 FRIDAY = "FRIDAY" 872 MONDAY = "MONDAY" 873 SATURDAY = "SATURDAY" 874 SUNDAY = "SUNDAY" 875 THURSDAY = "THURSDAY" 876 TUESDAY = "TUESDAY" 877 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
Restrictions:
880class Restrictions: 881 day_of_week: Optional[List[DayOfWeek]] 882 end_date: Optional[datetime] 883 end_time: Optional[str] 884 max_duration: Optional[int] 885 max_kwh: Optional[float] 886 max_power: Optional[float] 887 min_duration: Optional[int] 888 min_kwh: Optional[float] 889 min_power: Optional[float] 890 start_date: Optional[datetime] 891 start_time: Optional[str] 892 893 def __init__(self, day_of_week: Optional[List[DayOfWeek]], end_date: Optional[datetime], end_time: Optional[str], max_duration: Optional[int], max_kwh: Optional[float], max_power: Optional[float], min_duration: Optional[int], min_kwh: Optional[float], min_power: Optional[float], start_date: Optional[datetime], start_time: Optional[str]) -> None: 894 self.day_of_week = day_of_week 895 self.end_date = end_date 896 self.end_time = end_time 897 self.max_duration = max_duration 898 self.max_kwh = max_kwh 899 self.max_power = max_power 900 self.min_duration = min_duration 901 self.min_kwh = min_kwh 902 self.min_power = min_power 903 self.start_date = start_date 904 self.start_time = start_time 905 906 @staticmethod 907 def from_dict(obj: Any) -> 'Restrictions': 908 assert isinstance(obj, dict) 909 day_of_week = from_union([from_none, lambda x: from_list(DayOfWeek, x)], obj.get("day_of_week")) 910 end_date = from_union([from_none, from_datetime], obj.get("end_date")) 911 end_time = from_union([from_none, from_str], obj.get("end_time")) 912 max_duration = from_union([from_none, from_int], obj.get("max_duration")) 913 max_kwh = from_union([from_none, from_float], obj.get("max_kwh")) 914 max_power = from_union([from_none, from_float], obj.get("max_power")) 915 min_duration = from_union([from_none, from_int], obj.get("min_duration")) 916 min_kwh = from_union([from_none, from_float], obj.get("min_kwh")) 917 min_power = from_union([from_none, from_float], obj.get("min_power")) 918 start_date = from_union([from_none, from_datetime], obj.get("start_date")) 919 start_time = from_union([from_none, from_str], obj.get("start_time")) 920 return Restrictions(day_of_week, end_date, end_time, max_duration, max_kwh, max_power, min_duration, min_kwh, min_power, start_date, start_time) 921 922 def to_dict(self) -> dict: 923 result: dict = {} 924 if self.day_of_week is not None: 925 result["day_of_week"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(DayOfWeek, x), x)], self.day_of_week) 926 if self.end_date is not None: 927 result["end_date"] = from_union([from_none, lambda x: x.isoformat()], self.end_date) 928 if self.end_time is not None: 929 result["end_time"] = from_union([from_none, from_str], self.end_time) 930 if self.max_duration is not None: 931 result["max_duration"] = from_union([from_none, from_int], self.max_duration) 932 if self.max_kwh is not None: 933 result["max_kwh"] = from_union([from_none, to_float], self.max_kwh) 934 if self.max_power is not None: 935 result["max_power"] = from_union([from_none, to_float], self.max_power) 936 if self.min_duration is not None: 937 result["min_duration"] = from_union([from_none, from_int], self.min_duration) 938 if self.min_kwh is not None: 939 result["min_kwh"] = from_union([from_none, to_float], self.min_kwh) 940 if self.min_power is not None: 941 result["min_power"] = from_union([from_none, to_float], self.min_power) 942 if self.start_date is not None: 943 result["start_date"] = from_union([from_none, lambda x: x.isoformat()], self.start_date) 944 if self.start_time is not None: 945 result["start_time"] = from_union([from_none, from_str], self.start_time) 946 return result
Restrictions( day_of_week: Optional[List[DayOfWeek]], end_date: Optional[datetime.datetime], end_time: Optional[str], max_duration: Optional[int], max_kwh: Optional[float], max_power: Optional[float], min_duration: Optional[int], min_kwh: Optional[float], min_power: Optional[float], start_date: Optional[datetime.datetime], start_time: Optional[str])
893 def __init__(self, day_of_week: Optional[List[DayOfWeek]], end_date: Optional[datetime], end_time: Optional[str], max_duration: Optional[int], max_kwh: Optional[float], max_power: Optional[float], min_duration: Optional[int], min_kwh: Optional[float], min_power: Optional[float], start_date: Optional[datetime], start_time: Optional[str]) -> None: 894 self.day_of_week = day_of_week 895 self.end_date = end_date 896 self.end_time = end_time 897 self.max_duration = max_duration 898 self.max_kwh = max_kwh 899 self.max_power = max_power 900 self.min_duration = min_duration 901 self.min_kwh = min_kwh 902 self.min_power = min_power 903 self.start_date = start_date 904 self.start_time = start_time
day_of_week: Optional[List[DayOfWeek]]
906 @staticmethod 907 def from_dict(obj: Any) -> 'Restrictions': 908 assert isinstance(obj, dict) 909 day_of_week = from_union([from_none, lambda x: from_list(DayOfWeek, x)], obj.get("day_of_week")) 910 end_date = from_union([from_none, from_datetime], obj.get("end_date")) 911 end_time = from_union([from_none, from_str], obj.get("end_time")) 912 max_duration = from_union([from_none, from_int], obj.get("max_duration")) 913 max_kwh = from_union([from_none, from_float], obj.get("max_kwh")) 914 max_power = from_union([from_none, from_float], obj.get("max_power")) 915 min_duration = from_union([from_none, from_int], obj.get("min_duration")) 916 min_kwh = from_union([from_none, from_float], obj.get("min_kwh")) 917 min_power = from_union([from_none, from_float], obj.get("min_power")) 918 start_date = from_union([from_none, from_datetime], obj.get("start_date")) 919 start_time = from_union([from_none, from_str], obj.get("start_time")) 920 return Restrictions(day_of_week, end_date, end_time, max_duration, max_kwh, max_power, min_duration, min_kwh, min_power, start_date, start_time)
def
to_dict(self) -> dict:
922 def to_dict(self) -> dict: 923 result: dict = {} 924 if self.day_of_week is not None: 925 result["day_of_week"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(DayOfWeek, x), x)], self.day_of_week) 926 if self.end_date is not None: 927 result["end_date"] = from_union([from_none, lambda x: x.isoformat()], self.end_date) 928 if self.end_time is not None: 929 result["end_time"] = from_union([from_none, from_str], self.end_time) 930 if self.max_duration is not None: 931 result["max_duration"] = from_union([from_none, from_int], self.max_duration) 932 if self.max_kwh is not None: 933 result["max_kwh"] = from_union([from_none, to_float], self.max_kwh) 934 if self.max_power is not None: 935 result["max_power"] = from_union([from_none, to_float], self.max_power) 936 if self.min_duration is not None: 937 result["min_duration"] = from_union([from_none, from_int], self.min_duration) 938 if self.min_kwh is not None: 939 result["min_kwh"] = from_union([from_none, to_float], self.min_kwh) 940 if self.min_power is not None: 941 result["min_power"] = from_union([from_none, to_float], self.min_power) 942 if self.start_date is not None: 943 result["start_date"] = from_union([from_none, lambda x: x.isoformat()], self.start_date) 944 if self.start_time is not None: 945 result["start_time"] = from_union([from_none, from_str], self.start_time) 946 return result
class
TariffElement:
949class TariffElement: 950 price_components: List[PriceComponent] 951 restrictions: Optional[Restrictions] 952 953 def __init__(self, price_components: List[PriceComponent], restrictions: Optional[Restrictions]) -> None: 954 self.price_components = price_components 955 self.restrictions = restrictions 956 957 @staticmethod 958 def from_dict(obj: Any) -> 'TariffElement': 959 assert isinstance(obj, dict) 960 price_components = from_list(PriceComponent.from_dict, obj.get("price_components")) 961 restrictions = from_union([from_none, Restrictions.from_dict], obj.get("restrictions")) 962 return TariffElement(price_components, restrictions) 963 964 def to_dict(self) -> dict: 965 result: dict = {} 966 result["price_components"] = from_list(lambda x: to_class(PriceComponent, x), self.price_components) 967 if self.restrictions is not None: 968 result["restrictions"] = from_union([from_none, lambda x: to_class(Restrictions, x)], self.restrictions) 969 return result
TariffElement( price_components: List[PriceComponent], restrictions: Optional[Restrictions])
price_components: List[PriceComponent]
restrictions: Optional[Restrictions]
957 @staticmethod 958 def from_dict(obj: Any) -> 'TariffElement': 959 assert isinstance(obj, dict) 960 price_components = from_list(PriceComponent.from_dict, obj.get("price_components")) 961 restrictions = from_union([from_none, Restrictions.from_dict], obj.get("restrictions")) 962 return TariffElement(price_components, restrictions)
def
to_dict(self) -> dict:
964 def to_dict(self) -> dict: 965 result: dict = {} 966 result["price_components"] = from_list(lambda x: to_class(PriceComponent, x), self.price_components) 967 if self.restrictions is not None: 968 result["restrictions"] = from_union([from_none, lambda x: to_class(Restrictions, x)], self.restrictions) 969 return result
class
Tariff:
972class Tariff: 973 currency: str 974 elements: List[TariffElement] 975 energy_mix: Optional[EnergyMix] 976 id: str 977 last_updated: str 978 tariff_alt_text: Optional[List[DisplayText]] 979 tariff_alt_url: Optional[str] 980 981 def __init__(self, currency: str, elements: List[TariffElement], energy_mix: Optional[EnergyMix], id: str, last_updated: str, tariff_alt_text: Optional[List[DisplayText]], tariff_alt_url: Optional[str]) -> None: 982 self.currency = currency 983 self.elements = elements 984 self.energy_mix = energy_mix 985 self.id = id 986 self.last_updated = last_updated 987 self.tariff_alt_text = tariff_alt_text 988 self.tariff_alt_url = tariff_alt_url 989 990 @staticmethod 991 def from_dict(obj: Any) -> 'Tariff': 992 assert isinstance(obj, dict) 993 currency = from_str(obj.get("currency")) 994 elements = from_list(TariffElement.from_dict, obj.get("elements")) 995 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 996 id = from_str(obj.get("id")) 997 last_updated = from_str(obj.get("last_updated")) 998 tariff_alt_text = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("tariff_alt_text")) 999 tariff_alt_url = from_union([from_none, from_str], obj.get("tariff_alt_url")) 1000 return Tariff(currency, elements, energy_mix, id, last_updated, tariff_alt_text, tariff_alt_url) 1001 1002 def to_dict(self) -> dict: 1003 result: dict = {} 1004 result["currency"] = from_str(self.currency) 1005 result["elements"] = from_list(lambda x: to_class(TariffElement, x), self.elements) 1006 if self.energy_mix is not None: 1007 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 1008 result["id"] = from_str(self.id) 1009 result["last_updated"] = from_str(self.last_updated) 1010 if self.tariff_alt_text is not None: 1011 result["tariff_alt_text"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.tariff_alt_text) 1012 if self.tariff_alt_url is not None: 1013 result["tariff_alt_url"] = from_union([from_none, from_str], self.tariff_alt_url) 1014 return result
Tariff( currency: str, elements: List[TariffElement], energy_mix: Optional[EnergyMix], id: str, last_updated: str, tariff_alt_text: Optional[List[DisplayText]], tariff_alt_url: Optional[str])
981 def __init__(self, currency: str, elements: List[TariffElement], energy_mix: Optional[EnergyMix], id: str, last_updated: str, tariff_alt_text: Optional[List[DisplayText]], tariff_alt_url: Optional[str]) -> None: 982 self.currency = currency 983 self.elements = elements 984 self.energy_mix = energy_mix 985 self.id = id 986 self.last_updated = last_updated 987 self.tariff_alt_text = tariff_alt_text 988 self.tariff_alt_url = tariff_alt_url
elements: List[TariffElement]
energy_mix: Optional[EnergyMix]
tariff_alt_text: Optional[List[DisplayText]]
990 @staticmethod 991 def from_dict(obj: Any) -> 'Tariff': 992 assert isinstance(obj, dict) 993 currency = from_str(obj.get("currency")) 994 elements = from_list(TariffElement.from_dict, obj.get("elements")) 995 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 996 id = from_str(obj.get("id")) 997 last_updated = from_str(obj.get("last_updated")) 998 tariff_alt_text = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("tariff_alt_text")) 999 tariff_alt_url = from_union([from_none, from_str], obj.get("tariff_alt_url")) 1000 return Tariff(currency, elements, energy_mix, id, last_updated, tariff_alt_text, tariff_alt_url)
def
to_dict(self) -> dict:
1002 def to_dict(self) -> dict: 1003 result: dict = {} 1004 result["currency"] = from_str(self.currency) 1005 result["elements"] = from_list(lambda x: to_class(TariffElement, x), self.elements) 1006 if self.energy_mix is not None: 1007 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 1008 result["id"] = from_str(self.id) 1009 result["last_updated"] = from_str(self.last_updated) 1010 if self.tariff_alt_text is not None: 1011 result["tariff_alt_text"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.tariff_alt_text) 1012 if self.tariff_alt_url is not None: 1013 result["tariff_alt_url"] = from_union([from_none, from_str], self.tariff_alt_url) 1014 return result
class
Cdr:
1017class Cdr: 1018 auth_id: str 1019 auth_method: AuthMethod 1020 charging_periods: List[ChargingPeriod] 1021 currency: str 1022 id: str 1023 last_updated: str 1024 location: CdrLocation 1025 meter_id: Optional[str] 1026 remark: Optional[str] 1027 start_date_time: str 1028 stop_date_time: str 1029 tariffs: Optional[List[Tariff]] 1030 total_cost: float 1031 total_energy: float 1032 total_parking_time: Optional[float] 1033 total_time: float 1034 1035 def __init__(self, auth_id: str, auth_method: AuthMethod, charging_periods: List[ChargingPeriod], currency: str, id: str, last_updated: str, location: CdrLocation, meter_id: Optional[str], remark: Optional[str], start_date_time: str, stop_date_time: str, tariffs: Optional[List[Tariff]], total_cost: float, total_energy: float, total_parking_time: Optional[float], total_time: float) -> None: 1036 self.auth_id = auth_id 1037 self.auth_method = auth_method 1038 self.charging_periods = charging_periods 1039 self.currency = currency 1040 self.id = id 1041 self.last_updated = last_updated 1042 self.location = location 1043 self.meter_id = meter_id 1044 self.remark = remark 1045 self.start_date_time = start_date_time 1046 self.stop_date_time = stop_date_time 1047 self.tariffs = tariffs 1048 self.total_cost = total_cost 1049 self.total_energy = total_energy 1050 self.total_parking_time = total_parking_time 1051 self.total_time = total_time 1052 1053 @staticmethod 1054 def from_dict(obj: Any) -> 'Cdr': 1055 assert isinstance(obj, dict) 1056 auth_id = from_str(obj.get("auth_id")) 1057 auth_method = AuthMethod(obj.get("auth_method")) 1058 charging_periods = from_list(ChargingPeriod.from_dict, obj.get("charging_periods")) 1059 currency = from_str(obj.get("currency")) 1060 id = from_str(obj.get("id")) 1061 last_updated = from_str(obj.get("last_updated")) 1062 location = CdrLocation.from_dict(obj.get("location")) 1063 meter_id = from_union([from_none, from_str], obj.get("meter_id")) 1064 remark = from_union([from_none, from_str], obj.get("remark")) 1065 start_date_time = from_str(obj.get("start_date_time")) 1066 stop_date_time = from_str(obj.get("stop_date_time")) 1067 tariffs = from_union([from_none, lambda x: from_list(Tariff.from_dict, x)], obj.get("tariffs")) 1068 total_cost = from_float(obj.get("total_cost")) 1069 total_energy = from_float(obj.get("total_energy")) 1070 total_parking_time = from_union([from_none, from_float], obj.get("total_parking_time")) 1071 total_time = from_float(obj.get("total_time")) 1072 return Cdr(auth_id, auth_method, charging_periods, currency, id, last_updated, location, meter_id, remark, start_date_time, stop_date_time, tariffs, total_cost, total_energy, total_parking_time, total_time) 1073 1074 def to_dict(self) -> dict: 1075 result: dict = {} 1076 result["auth_id"] = from_str(self.auth_id) 1077 result["auth_method"] = to_enum(AuthMethod, self.auth_method) 1078 result["charging_periods"] = from_list(lambda x: to_class(ChargingPeriod, x), self.charging_periods) 1079 result["currency"] = from_str(self.currency) 1080 result["id"] = from_str(self.id) 1081 result["last_updated"] = from_str(self.last_updated) 1082 result["location"] = to_class(CdrLocation, self.location) 1083 if self.meter_id is not None: 1084 result["meter_id"] = from_union([from_none, from_str], self.meter_id) 1085 if self.remark is not None: 1086 result["remark"] = from_union([from_none, from_str], self.remark) 1087 result["start_date_time"] = from_str(self.start_date_time) 1088 result["stop_date_time"] = from_str(self.stop_date_time) 1089 if self.tariffs is not None: 1090 result["tariffs"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Tariff, x), x)], self.tariffs) 1091 result["total_cost"] = to_float(self.total_cost) 1092 result["total_energy"] = to_float(self.total_energy) 1093 if self.total_parking_time is not None: 1094 result["total_parking_time"] = from_union([from_none, to_float], self.total_parking_time) 1095 result["total_time"] = to_float(self.total_time) 1096 return result
Cdr( auth_id: str, auth_method: AuthMethod, charging_periods: List[ChargingPeriod], currency: str, id: str, last_updated: str, location: CdrLocation, meter_id: Optional[str], remark: Optional[str], start_date_time: str, stop_date_time: str, tariffs: Optional[List[Tariff]], total_cost: float, total_energy: float, total_parking_time: Optional[float], total_time: float)
1035 def __init__(self, auth_id: str, auth_method: AuthMethod, charging_periods: List[ChargingPeriod], currency: str, id: str, last_updated: str, location: CdrLocation, meter_id: Optional[str], remark: Optional[str], start_date_time: str, stop_date_time: str, tariffs: Optional[List[Tariff]], total_cost: float, total_energy: float, total_parking_time: Optional[float], total_time: float) -> None: 1036 self.auth_id = auth_id 1037 self.auth_method = auth_method 1038 self.charging_periods = charging_periods 1039 self.currency = currency 1040 self.id = id 1041 self.last_updated = last_updated 1042 self.location = location 1043 self.meter_id = meter_id 1044 self.remark = remark 1045 self.start_date_time = start_date_time 1046 self.stop_date_time = stop_date_time 1047 self.tariffs = tariffs 1048 self.total_cost = total_cost 1049 self.total_energy = total_energy 1050 self.total_parking_time = total_parking_time 1051 self.total_time = total_time
auth_method: AuthMethod
charging_periods: List[ChargingPeriod]
location: CdrLocation
tariffs: Optional[List[Tariff]]
1053 @staticmethod 1054 def from_dict(obj: Any) -> 'Cdr': 1055 assert isinstance(obj, dict) 1056 auth_id = from_str(obj.get("auth_id")) 1057 auth_method = AuthMethod(obj.get("auth_method")) 1058 charging_periods = from_list(ChargingPeriod.from_dict, obj.get("charging_periods")) 1059 currency = from_str(obj.get("currency")) 1060 id = from_str(obj.get("id")) 1061 last_updated = from_str(obj.get("last_updated")) 1062 location = CdrLocation.from_dict(obj.get("location")) 1063 meter_id = from_union([from_none, from_str], obj.get("meter_id")) 1064 remark = from_union([from_none, from_str], obj.get("remark")) 1065 start_date_time = from_str(obj.get("start_date_time")) 1066 stop_date_time = from_str(obj.get("stop_date_time")) 1067 tariffs = from_union([from_none, lambda x: from_list(Tariff.from_dict, x)], obj.get("tariffs")) 1068 total_cost = from_float(obj.get("total_cost")) 1069 total_energy = from_float(obj.get("total_energy")) 1070 total_parking_time = from_union([from_none, from_float], obj.get("total_parking_time")) 1071 total_time = from_float(obj.get("total_time")) 1072 return Cdr(auth_id, auth_method, charging_periods, currency, id, last_updated, location, meter_id, remark, start_date_time, stop_date_time, tariffs, total_cost, total_energy, total_parking_time, total_time)
def
to_dict(self) -> dict:
1074 def to_dict(self) -> dict: 1075 result: dict = {} 1076 result["auth_id"] = from_str(self.auth_id) 1077 result["auth_method"] = to_enum(AuthMethod, self.auth_method) 1078 result["charging_periods"] = from_list(lambda x: to_class(ChargingPeriod, x), self.charging_periods) 1079 result["currency"] = from_str(self.currency) 1080 result["id"] = from_str(self.id) 1081 result["last_updated"] = from_str(self.last_updated) 1082 result["location"] = to_class(CdrLocation, self.location) 1083 if self.meter_id is not None: 1084 result["meter_id"] = from_union([from_none, from_str], self.meter_id) 1085 if self.remark is not None: 1086 result["remark"] = from_union([from_none, from_str], self.remark) 1087 result["start_date_time"] = from_str(self.start_date_time) 1088 result["stop_date_time"] = from_str(self.stop_date_time) 1089 if self.tariffs is not None: 1090 result["tariffs"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Tariff, x), x)], self.tariffs) 1091 result["total_cost"] = to_float(self.total_cost) 1092 result["total_energy"] = to_float(self.total_energy) 1093 if self.total_parking_time is not None: 1094 result["total_parking_time"] = from_union([from_none, to_float], self.total_parking_time) 1095 result["total_time"] = to_float(self.total_time) 1096 return result
class
Credentials:
1099class Credentials: 1100 business_details: Optional[BusinessDetails] 1101 country_code: Optional[str] 1102 party_id: Optional[str] 1103 token: Optional[str] 1104 url: Optional[str] 1105 1106 def __init__(self, business_details: Optional[BusinessDetails], country_code: Optional[str], party_id: Optional[str], token: Optional[str], url: Optional[str]) -> None: 1107 self.business_details = business_details 1108 self.country_code = country_code 1109 self.party_id = party_id 1110 self.token = token 1111 self.url = url 1112 1113 @staticmethod 1114 def from_dict(obj: Any) -> 'Credentials': 1115 assert isinstance(obj, dict) 1116 business_details = from_union([from_none, BusinessDetails.from_dict], obj.get("business_details")) 1117 country_code = from_union([from_str, from_none], obj.get("country_code")) 1118 party_id = from_union([from_str, from_none], obj.get("party_id")) 1119 token = from_union([from_str, from_none], obj.get("token")) 1120 url = from_union([from_str, from_none], obj.get("url")) 1121 return Credentials(business_details, country_code, party_id, token, url) 1122 1123 def to_dict(self) -> dict: 1124 result: dict = {} 1125 if self.business_details is not None: 1126 result["business_details"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.business_details) 1127 if self.country_code is not None: 1128 result["country_code"] = from_union([from_str, from_none], self.country_code) 1129 if self.party_id is not None: 1130 result["party_id"] = from_union([from_str, from_none], self.party_id) 1131 if self.token is not None: 1132 result["token"] = from_union([from_str, from_none], self.token) 1133 if self.url is not None: 1134 result["url"] = from_union([from_str, from_none], self.url) 1135 return result
Credentials( business_details: Optional[BusinessDetails], country_code: Optional[str], party_id: Optional[str], token: Optional[str], url: Optional[str])
1106 def __init__(self, business_details: Optional[BusinessDetails], country_code: Optional[str], party_id: Optional[str], token: Optional[str], url: Optional[str]) -> None: 1107 self.business_details = business_details 1108 self.country_code = country_code 1109 self.party_id = party_id 1110 self.token = token 1111 self.url = url
business_details: Optional[BusinessDetails]
1113 @staticmethod 1114 def from_dict(obj: Any) -> 'Credentials': 1115 assert isinstance(obj, dict) 1116 business_details = from_union([from_none, BusinessDetails.from_dict], obj.get("business_details")) 1117 country_code = from_union([from_str, from_none], obj.get("country_code")) 1118 party_id = from_union([from_str, from_none], obj.get("party_id")) 1119 token = from_union([from_str, from_none], obj.get("token")) 1120 url = from_union([from_str, from_none], obj.get("url")) 1121 return Credentials(business_details, country_code, party_id, token, url)
def
to_dict(self) -> dict:
1123 def to_dict(self) -> dict: 1124 result: dict = {} 1125 if self.business_details is not None: 1126 result["business_details"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.business_details) 1127 if self.country_code is not None: 1128 result["country_code"] = from_union([from_str, from_none], self.country_code) 1129 if self.party_id is not None: 1130 result["party_id"] = from_union([from_str, from_none], self.party_id) 1131 if self.token is not None: 1132 result["token"] = from_union([from_str, from_none], self.token) 1133 if self.url is not None: 1134 result["url"] = from_union([from_str, from_none], self.url) 1135 return result
class
Location:
1138class Location: 1139 address: Optional[str] 1140 charging_when_closed: Optional[bool] 1141 city: Optional[str] 1142 coordinates: Optional[GeoLocation] 1143 country: Optional[str] 1144 directions: Optional[List[DisplayText]] 1145 energy_mix: Optional[EnergyMix] 1146 evses: Optional[List[Evse]] 1147 facilities: Optional[List[Facility]] 1148 id: Optional[str] 1149 images: Optional[List[Image]] 1150 last_updated: Optional[str] 1151 name: Optional[str] 1152 opening_times: Optional[Hours] 1153 operator: Optional[BusinessDetails] 1154 owner: Optional[BusinessDetails] 1155 postal_code: Optional[str] 1156 related_locations: Optional[List[RelatedLocation]] 1157 suboperator: Optional[BusinessDetails] 1158 time_zone: Optional[str] 1159 type: Optional[LocationType] 1160 1161 def __init__(self, address: Optional[str], charging_when_closed: Optional[bool], city: Optional[str], coordinates: Optional[GeoLocation], country: Optional[str], directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], id: Optional[str], images: Optional[List[Image]], last_updated: Optional[str], name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], postal_code: Optional[str], related_locations: Optional[List[RelatedLocation]], suboperator: Optional[BusinessDetails], time_zone: Optional[str], type: Optional[LocationType]) -> None: 1162 self.address = address 1163 self.charging_when_closed = charging_when_closed 1164 self.city = city 1165 self.coordinates = coordinates 1166 self.country = country 1167 self.directions = directions 1168 self.energy_mix = energy_mix 1169 self.evses = evses 1170 self.facilities = facilities 1171 self.id = id 1172 self.images = images 1173 self.last_updated = last_updated 1174 self.name = name 1175 self.opening_times = opening_times 1176 self.operator = operator 1177 self.owner = owner 1178 self.postal_code = postal_code 1179 self.related_locations = related_locations 1180 self.suboperator = suboperator 1181 self.time_zone = time_zone 1182 self.type = type 1183 1184 @staticmethod 1185 def from_dict(obj: Any) -> 'Location': 1186 assert isinstance(obj, dict) 1187 address = from_union([from_str, from_none], obj.get("address")) 1188 charging_when_closed = from_union([from_none, from_bool], obj.get("charging_when_closed")) 1189 city = from_union([from_str, from_none], obj.get("city")) 1190 coordinates = from_union([from_none, GeoLocation.from_dict], obj.get("coordinates")) 1191 country = from_union([from_str, from_none], obj.get("country")) 1192 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 1193 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 1194 evses = from_union([from_none, lambda x: from_list(Evse.from_dict, x)], obj.get("evses")) 1195 facilities = from_union([from_none, lambda x: from_list(Facility, x)], obj.get("facilities")) 1196 id = from_union([from_str, from_none], obj.get("id")) 1197 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 1198 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 1199 name = from_union([from_none, from_str], obj.get("name")) 1200 opening_times = from_union([from_none, Hours.from_dict], obj.get("opening_times")) 1201 operator = from_union([from_none, BusinessDetails.from_dict], obj.get("operator")) 1202 owner = from_union([from_none, BusinessDetails.from_dict], obj.get("owner")) 1203 postal_code = from_union([from_str, from_none], obj.get("postal_code")) 1204 related_locations = from_union([from_none, lambda x: from_list(RelatedLocation.from_dict, x)], obj.get("related_locations")) 1205 suboperator = from_union([from_none, BusinessDetails.from_dict], obj.get("suboperator")) 1206 time_zone = from_union([from_none, from_str], obj.get("time_zone")) 1207 type = from_union([LocationType, from_none], obj.get("type")) 1208 return Location(address, charging_when_closed, city, coordinates, country, directions, energy_mix, evses, facilities, id, images, last_updated, name, opening_times, operator, owner, postal_code, related_locations, suboperator, time_zone, type) 1209 1210 def to_dict(self) -> dict: 1211 result: dict = {} 1212 if self.address is not None: 1213 result["address"] = from_union([from_str, from_none], self.address) 1214 if self.charging_when_closed is not None: 1215 result["charging_when_closed"] = from_union([from_none, from_bool], self.charging_when_closed) 1216 if self.city is not None: 1217 result["city"] = from_union([from_str, from_none], self.city) 1218 if self.coordinates is not None: 1219 result["coordinates"] = from_union([from_none, lambda x: to_class(GeoLocation, x)], self.coordinates) 1220 if self.country is not None: 1221 result["country"] = from_union([from_str, from_none], self.country) 1222 if self.directions is not None: 1223 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 1224 if self.energy_mix is not None: 1225 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 1226 if self.evses is not None: 1227 result["evses"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Evse, x), x)], self.evses) 1228 if self.facilities is not None: 1229 result["facilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Facility, x), x)], self.facilities) 1230 if self.id is not None: 1231 result["id"] = from_union([from_str, from_none], self.id) 1232 if self.images is not None: 1233 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 1234 if self.last_updated is not None: 1235 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 1236 if self.name is not None: 1237 result["name"] = from_union([from_none, from_str], self.name) 1238 if self.opening_times is not None: 1239 result["opening_times"] = from_union([from_none, lambda x: to_class(Hours, x)], self.opening_times) 1240 if self.operator is not None: 1241 result["operator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.operator) 1242 if self.owner is not None: 1243 result["owner"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.owner) 1244 if self.postal_code is not None: 1245 result["postal_code"] = from_union([from_str, from_none], self.postal_code) 1246 if self.related_locations is not None: 1247 result["related_locations"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RelatedLocation, x), x)], self.related_locations) 1248 if self.suboperator is not None: 1249 result["suboperator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.suboperator) 1250 if self.time_zone is not None: 1251 result["time_zone"] = from_union([from_none, from_str], self.time_zone) 1252 if self.type is not None: 1253 result["type"] = from_union([lambda x: to_enum(LocationType, x), from_none], self.type) 1254 return result
Location( address: Optional[str], charging_when_closed: Optional[bool], city: Optional[str], coordinates: Optional[GeoLocation], country: Optional[str], directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], id: Optional[str], images: Optional[List[Image]], last_updated: Optional[str], name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], postal_code: Optional[str], related_locations: Optional[List[RelatedLocation]], suboperator: Optional[BusinessDetails], time_zone: Optional[str], type: Optional[LocationType])
1161 def __init__(self, address: Optional[str], charging_when_closed: Optional[bool], city: Optional[str], coordinates: Optional[GeoLocation], country: Optional[str], directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], id: Optional[str], images: Optional[List[Image]], last_updated: Optional[str], name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], postal_code: Optional[str], related_locations: Optional[List[RelatedLocation]], suboperator: Optional[BusinessDetails], time_zone: Optional[str], type: Optional[LocationType]) -> None: 1162 self.address = address 1163 self.charging_when_closed = charging_when_closed 1164 self.city = city 1165 self.coordinates = coordinates 1166 self.country = country 1167 self.directions = directions 1168 self.energy_mix = energy_mix 1169 self.evses = evses 1170 self.facilities = facilities 1171 self.id = id 1172 self.images = images 1173 self.last_updated = last_updated 1174 self.name = name 1175 self.opening_times = opening_times 1176 self.operator = operator 1177 self.owner = owner 1178 self.postal_code = postal_code 1179 self.related_locations = related_locations 1180 self.suboperator = suboperator 1181 self.time_zone = time_zone 1182 self.type = type
coordinates: Optional[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]
suboperator: Optional[BusinessDetails]
type: Optional[LocationType]
1184 @staticmethod 1185 def from_dict(obj: Any) -> 'Location': 1186 assert isinstance(obj, dict) 1187 address = from_union([from_str, from_none], obj.get("address")) 1188 charging_when_closed = from_union([from_none, from_bool], obj.get("charging_when_closed")) 1189 city = from_union([from_str, from_none], obj.get("city")) 1190 coordinates = from_union([from_none, GeoLocation.from_dict], obj.get("coordinates")) 1191 country = from_union([from_str, from_none], obj.get("country")) 1192 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 1193 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 1194 evses = from_union([from_none, lambda x: from_list(Evse.from_dict, x)], obj.get("evses")) 1195 facilities = from_union([from_none, lambda x: from_list(Facility, x)], obj.get("facilities")) 1196 id = from_union([from_str, from_none], obj.get("id")) 1197 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 1198 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 1199 name = from_union([from_none, from_str], obj.get("name")) 1200 opening_times = from_union([from_none, Hours.from_dict], obj.get("opening_times")) 1201 operator = from_union([from_none, BusinessDetails.from_dict], obj.get("operator")) 1202 owner = from_union([from_none, BusinessDetails.from_dict], obj.get("owner")) 1203 postal_code = from_union([from_str, from_none], obj.get("postal_code")) 1204 related_locations = from_union([from_none, lambda x: from_list(RelatedLocation.from_dict, x)], obj.get("related_locations")) 1205 suboperator = from_union([from_none, BusinessDetails.from_dict], obj.get("suboperator")) 1206 time_zone = from_union([from_none, from_str], obj.get("time_zone")) 1207 type = from_union([LocationType, from_none], obj.get("type")) 1208 return Location(address, charging_when_closed, city, coordinates, country, directions, energy_mix, evses, facilities, id, images, last_updated, name, opening_times, operator, owner, postal_code, related_locations, suboperator, time_zone, type)
def
to_dict(self) -> dict:
1210 def to_dict(self) -> dict: 1211 result: dict = {} 1212 if self.address is not None: 1213 result["address"] = from_union([from_str, from_none], self.address) 1214 if self.charging_when_closed is not None: 1215 result["charging_when_closed"] = from_union([from_none, from_bool], self.charging_when_closed) 1216 if self.city is not None: 1217 result["city"] = from_union([from_str, from_none], self.city) 1218 if self.coordinates is not None: 1219 result["coordinates"] = from_union([from_none, lambda x: to_class(GeoLocation, x)], self.coordinates) 1220 if self.country is not None: 1221 result["country"] = from_union([from_str, from_none], self.country) 1222 if self.directions is not None: 1223 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 1224 if self.energy_mix is not None: 1225 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 1226 if self.evses is not None: 1227 result["evses"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Evse, x), x)], self.evses) 1228 if self.facilities is not None: 1229 result["facilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Facility, x), x)], self.facilities) 1230 if self.id is not None: 1231 result["id"] = from_union([from_str, from_none], self.id) 1232 if self.images is not None: 1233 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 1234 if self.last_updated is not None: 1235 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 1236 if self.name is not None: 1237 result["name"] = from_union([from_none, from_str], self.name) 1238 if self.opening_times is not None: 1239 result["opening_times"] = from_union([from_none, lambda x: to_class(Hours, x)], self.opening_times) 1240 if self.operator is not None: 1241 result["operator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.operator) 1242 if self.owner is not None: 1243 result["owner"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.owner) 1244 if self.postal_code is not None: 1245 result["postal_code"] = from_union([from_str, from_none], self.postal_code) 1246 if self.related_locations is not None: 1247 result["related_locations"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RelatedLocation, x), x)], self.related_locations) 1248 if self.suboperator is not None: 1249 result["suboperator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.suboperator) 1250 if self.time_zone is not None: 1251 result["time_zone"] = from_union([from_none, from_str], self.time_zone) 1252 if self.type is not None: 1253 result["type"] = from_union([lambda x: to_enum(LocationType, x), from_none], self.type) 1254 return result
class
SessionLocation:
1257class SessionLocation: 1258 id: str 1259 type: LocationType 1260 address: str 1261 city: str 1262 postal_code: str 1263 country: str 1264 coordinates: GeoLocation 1265 last_updated: str 1266 charging_when_closed: Optional[bool] 1267 directions: Optional[List[DisplayText]] 1268 energy_mix: Optional[EnergyMix] 1269 evses: Optional[List[Evse]] 1270 facilities: Optional[List[Facility]] 1271 images: Optional[List[Image]] 1272 name: Optional[str] 1273 opening_times: Optional[Hours] 1274 operator: Optional[BusinessDetails] 1275 owner: Optional[BusinessDetails] 1276 related_locations: Optional[List[RelatedLocation]] 1277 suboperator: Optional[BusinessDetails] 1278 time_zone: Optional[str] 1279 1280 def __init__(self, id: str, type: LocationType, address: str, city: str, postal_code: str, country: str, coordinates: GeoLocation, last_updated: str, charging_when_closed: Optional[bool], directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], images: Optional[List[Image]], name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], related_locations: Optional[List[RelatedLocation]], suboperator: Optional[BusinessDetails], time_zone: Optional[str]) -> None: 1281 self.id = id 1282 self.type = type 1283 self.address = address 1284 self.city = city 1285 self.postal_code = postal_code 1286 self.country = country 1287 self.coordinates = coordinates 1288 self.last_updated = last_updated 1289 self.charging_when_closed = charging_when_closed 1290 self.directions = directions 1291 self.energy_mix = energy_mix 1292 self.evses = evses 1293 self.facilities = facilities 1294 self.images = images 1295 self.name = name 1296 self.opening_times = opening_times 1297 self.operator = operator 1298 self.owner = owner 1299 self.related_locations = related_locations 1300 self.suboperator = suboperator 1301 self.time_zone = time_zone 1302 1303 @staticmethod 1304 def from_dict(obj: Any) -> 'SessionLocation': 1305 assert isinstance(obj, dict) 1306 id = from_str(obj.get("id")) 1307 type = LocationType(obj.get("type")) 1308 address = from_str(obj.get("address")) 1309 city = from_str(obj.get("city")) 1310 postal_code = from_str(obj.get("postal_code")) 1311 country = from_str(obj.get("country")) 1312 coordinates = GeoLocation.from_dict(obj.get("coordinates")) 1313 last_updated = from_str(obj.get("last_updated")) 1314 charging_when_closed = from_union([from_none, from_bool], obj.get("charging_when_closed")) 1315 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 1316 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 1317 evses = from_union([from_none, lambda x: from_list(Evse.from_dict, x)], obj.get("evses")) 1318 facilities = from_union([from_none, lambda x: from_list(Facility, x)], obj.get("facilities")) 1319 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 1320 name = from_union([from_none, from_str], obj.get("name")) 1321 opening_times = from_union([from_none, Hours.from_dict], obj.get("opening_times")) 1322 operator = from_union([from_none, BusinessDetails.from_dict], obj.get("operator")) 1323 owner = from_union([from_none, BusinessDetails.from_dict], obj.get("owner")) 1324 related_locations = from_union([from_none, lambda x: from_list(RelatedLocation.from_dict, x)], obj.get("related_locations")) 1325 suboperator = from_union([from_none, BusinessDetails.from_dict], obj.get("suboperator")) 1326 time_zone = from_union([from_none, from_str], obj.get("time_zone")) 1327 return SessionLocation(id, type, address, city, postal_code, country, coordinates, last_updated, charging_when_closed, directions, energy_mix, evses, facilities, images, name, opening_times, operator, owner, related_locations, suboperator, time_zone) 1328 1329 def to_dict(self) -> dict: 1330 result: dict = {} 1331 result["id"] = from_str(self.id) 1332 result["type"] = to_enum(LocationType, self.type) 1333 result["address"] = from_str(self.address) 1334 result["city"] = from_str(self.city) 1335 result["postal_code"] = from_str(self.postal_code) 1336 result["country"] = from_str(self.country) 1337 result["coordinates"] = to_class(GeoLocation, self.coordinates) 1338 result["last_updated"] = from_str(self.last_updated) 1339 if self.charging_when_closed is not None: 1340 result["charging_when_closed"] = from_union([from_none, from_bool], self.charging_when_closed) 1341 if self.directions is not None: 1342 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 1343 if self.energy_mix is not None: 1344 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 1345 if self.evses is not None: 1346 result["evses"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Evse, x), x)], self.evses) 1347 if self.facilities is not None: 1348 result["facilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Facility, x), x)], self.facilities) 1349 if self.images is not None: 1350 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 1351 if self.name is not None: 1352 result["name"] = from_union([from_none, from_str], self.name) 1353 if self.opening_times is not None: 1354 result["opening_times"] = from_union([from_none, lambda x: to_class(Hours, x)], self.opening_times) 1355 if self.operator is not None: 1356 result["operator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.operator) 1357 if self.owner is not None: 1358 result["owner"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.owner) 1359 if self.related_locations is not None: 1360 result["related_locations"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RelatedLocation, x), x)], self.related_locations) 1361 if self.suboperator is not None: 1362 result["suboperator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.suboperator) 1363 if self.time_zone is not None: 1364 result["time_zone"] = from_union([from_none, from_str], self.time_zone) 1365 return result
SessionLocation( id: str, type: LocationType, address: str, city: str, postal_code: str, country: str, coordinates: GeoLocation, last_updated: str, charging_when_closed: Optional[bool], directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], images: Optional[List[Image]], name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], related_locations: Optional[List[RelatedLocation]], suboperator: Optional[BusinessDetails], time_zone: Optional[str])
1280 def __init__(self, id: str, type: LocationType, address: str, city: str, postal_code: str, country: str, coordinates: GeoLocation, last_updated: str, charging_when_closed: Optional[bool], directions: Optional[List[DisplayText]], energy_mix: Optional[EnergyMix], evses: Optional[List[Evse]], facilities: Optional[List[Facility]], images: Optional[List[Image]], name: Optional[str], opening_times: Optional[Hours], operator: Optional[BusinessDetails], owner: Optional[BusinessDetails], related_locations: Optional[List[RelatedLocation]], suboperator: Optional[BusinessDetails], time_zone: Optional[str]) -> None: 1281 self.id = id 1282 self.type = type 1283 self.address = address 1284 self.city = city 1285 self.postal_code = postal_code 1286 self.country = country 1287 self.coordinates = coordinates 1288 self.last_updated = last_updated 1289 self.charging_when_closed = charging_when_closed 1290 self.directions = directions 1291 self.energy_mix = energy_mix 1292 self.evses = evses 1293 self.facilities = facilities 1294 self.images = images 1295 self.name = name 1296 self.opening_times = opening_times 1297 self.operator = operator 1298 self.owner = owner 1299 self.related_locations = related_locations 1300 self.suboperator = suboperator 1301 self.time_zone = time_zone
type: LocationType
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]
suboperator: Optional[BusinessDetails]
1303 @staticmethod 1304 def from_dict(obj: Any) -> 'SessionLocation': 1305 assert isinstance(obj, dict) 1306 id = from_str(obj.get("id")) 1307 type = LocationType(obj.get("type")) 1308 address = from_str(obj.get("address")) 1309 city = from_str(obj.get("city")) 1310 postal_code = from_str(obj.get("postal_code")) 1311 country = from_str(obj.get("country")) 1312 coordinates = GeoLocation.from_dict(obj.get("coordinates")) 1313 last_updated = from_str(obj.get("last_updated")) 1314 charging_when_closed = from_union([from_none, from_bool], obj.get("charging_when_closed")) 1315 directions = from_union([from_none, lambda x: from_list(DisplayText.from_dict, x)], obj.get("directions")) 1316 energy_mix = from_union([from_none, EnergyMix.from_dict], obj.get("energy_mix")) 1317 evses = from_union([from_none, lambda x: from_list(Evse.from_dict, x)], obj.get("evses")) 1318 facilities = from_union([from_none, lambda x: from_list(Facility, x)], obj.get("facilities")) 1319 images = from_union([from_none, lambda x: from_list(Image.from_dict, x)], obj.get("images")) 1320 name = from_union([from_none, from_str], obj.get("name")) 1321 opening_times = from_union([from_none, Hours.from_dict], obj.get("opening_times")) 1322 operator = from_union([from_none, BusinessDetails.from_dict], obj.get("operator")) 1323 owner = from_union([from_none, BusinessDetails.from_dict], obj.get("owner")) 1324 related_locations = from_union([from_none, lambda x: from_list(RelatedLocation.from_dict, x)], obj.get("related_locations")) 1325 suboperator = from_union([from_none, BusinessDetails.from_dict], obj.get("suboperator")) 1326 time_zone = from_union([from_none, from_str], obj.get("time_zone")) 1327 return SessionLocation(id, type, address, city, postal_code, country, coordinates, last_updated, charging_when_closed, directions, energy_mix, evses, facilities, images, name, opening_times, operator, owner, related_locations, suboperator, time_zone)
def
to_dict(self) -> dict:
1329 def to_dict(self) -> dict: 1330 result: dict = {} 1331 result["id"] = from_str(self.id) 1332 result["type"] = to_enum(LocationType, self.type) 1333 result["address"] = from_str(self.address) 1334 result["city"] = from_str(self.city) 1335 result["postal_code"] = from_str(self.postal_code) 1336 result["country"] = from_str(self.country) 1337 result["coordinates"] = to_class(GeoLocation, self.coordinates) 1338 result["last_updated"] = from_str(self.last_updated) 1339 if self.charging_when_closed is not None: 1340 result["charging_when_closed"] = from_union([from_none, from_bool], self.charging_when_closed) 1341 if self.directions is not None: 1342 result["directions"] = from_union([from_none, lambda x: from_list(lambda x: to_class(DisplayText, x), x)], self.directions) 1343 if self.energy_mix is not None: 1344 result["energy_mix"] = from_union([from_none, lambda x: to_class(EnergyMix, x)], self.energy_mix) 1345 if self.evses is not None: 1346 result["evses"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Evse, x), x)], self.evses) 1347 if self.facilities is not None: 1348 result["facilities"] = from_union([from_none, lambda x: from_list(lambda x: to_enum(Facility, x), x)], self.facilities) 1349 if self.images is not None: 1350 result["images"] = from_union([from_none, lambda x: from_list(lambda x: to_class(Image, x), x)], self.images) 1351 if self.name is not None: 1352 result["name"] = from_union([from_none, from_str], self.name) 1353 if self.opening_times is not None: 1354 result["opening_times"] = from_union([from_none, lambda x: to_class(Hours, x)], self.opening_times) 1355 if self.operator is not None: 1356 result["operator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.operator) 1357 if self.owner is not None: 1358 result["owner"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.owner) 1359 if self.related_locations is not None: 1360 result["related_locations"] = from_union([from_none, lambda x: from_list(lambda x: to_class(RelatedLocation, x), x)], self.related_locations) 1361 if self.suboperator is not None: 1362 result["suboperator"] = from_union([from_none, lambda x: to_class(BusinessDetails, x)], self.suboperator) 1363 if self.time_zone is not None: 1364 result["time_zone"] = from_union([from_none, from_str], self.time_zone) 1365 return result
class
Status(enum.Enum):
1368class Status(Enum): 1369 ACTIVE = "ACTIVE" 1370 COMPLETED = "COMPLETED" 1371 INVALID = "INVALID" 1372 PENDING = "PENDING"
ACTIVE =
<Status.ACTIVE: 'ACTIVE'>
COMPLETED =
<Status.COMPLETED: 'COMPLETED'>
INVALID =
<Status.INVALID: 'INVALID'>
PENDING =
<Status.PENDING: 'PENDING'>
class
Session:
1375class Session: 1376 auth_id: Optional[str] 1377 auth_method: Optional[AuthMethod] 1378 charging_periods: Optional[List[ChargingPeriod]] 1379 currency: Optional[str] 1380 end_datetime: Optional[str] 1381 id: Optional[str] 1382 kwh: Optional[float] 1383 last_updated: Optional[str] 1384 location: Optional[SessionLocation] 1385 meter_id: Optional[str] 1386 start_datetime: Optional[str] 1387 status: Optional[Status] 1388 total_cost: Optional[float] 1389 1390 def __init__(self, auth_id: Optional[str], auth_method: Optional[AuthMethod], charging_periods: Optional[List[ChargingPeriod]], currency: Optional[str], end_datetime: Optional[str], id: Optional[str], kwh: Optional[float], last_updated: Optional[str], location: Optional[SessionLocation], meter_id: Optional[str], start_datetime: Optional[str], status: Optional[Status], total_cost: Optional[float]) -> None: 1391 self.auth_id = auth_id 1392 self.auth_method = auth_method 1393 self.charging_periods = charging_periods 1394 self.currency = currency 1395 self.end_datetime = end_datetime 1396 self.id = id 1397 self.kwh = kwh 1398 self.last_updated = last_updated 1399 self.location = location 1400 self.meter_id = meter_id 1401 self.start_datetime = start_datetime 1402 self.status = status 1403 self.total_cost = total_cost 1404 1405 @staticmethod 1406 def from_dict(obj: Any) -> 'Session': 1407 assert isinstance(obj, dict) 1408 auth_id = from_union([from_str, from_none], obj.get("auth_id")) 1409 auth_method = from_union([AuthMethod, from_none], obj.get("auth_method")) 1410 charging_periods = from_union([from_none, lambda x: from_list(ChargingPeriod.from_dict, x)], obj.get("charging_periods")) 1411 currency = from_union([from_str, from_none], obj.get("currency")) 1412 end_datetime = from_union([from_none, from_str], obj.get("end_datetime")) 1413 id = from_union([from_str, from_none], obj.get("id")) 1414 kwh = from_union([from_none, from_float], obj.get("kwh")) 1415 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 1416 location = from_union([SessionLocation.from_dict, from_none], obj.get("location")) 1417 meter_id = from_union([from_none, from_str], obj.get("meter_id")) 1418 start_datetime = from_union([from_str, from_none], obj.get("start_datetime")) 1419 status = from_union([Status, from_none], obj.get("status")) 1420 total_cost = from_union([from_none, from_float], obj.get("total_cost")) 1421 return Session(auth_id, auth_method, charging_periods, currency, end_datetime, id, kwh, last_updated, location, meter_id, start_datetime, status, total_cost) 1422 1423 def to_dict(self) -> dict: 1424 result: dict = {} 1425 if self.auth_id is not None: 1426 result["auth_id"] = from_union([from_str, from_none], self.auth_id) 1427 if self.auth_method is not None: 1428 result["auth_method"] = from_union([lambda x: to_enum(AuthMethod, x), from_none], self.auth_method) 1429 if self.charging_periods is not None: 1430 result["charging_periods"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ChargingPeriod, x), x)], self.charging_periods) 1431 if self.currency is not None: 1432 result["currency"] = from_union([from_str, from_none], self.currency) 1433 if self.end_datetime is not None: 1434 result["end_datetime"] = from_union([from_none, from_str], self.end_datetime) 1435 if self.id is not None: 1436 result["id"] = from_union([from_str, from_none], self.id) 1437 if self.kwh is not None: 1438 result["kwh"] = from_union([from_none, to_float], self.kwh) 1439 if self.last_updated is not None: 1440 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 1441 if self.location is not None: 1442 result["location"] = from_union([lambda x: to_class(SessionLocation, x), from_none], self.location) 1443 if self.meter_id is not None: 1444 result["meter_id"] = from_union([from_none, from_str], self.meter_id) 1445 if self.start_datetime is not None: 1446 result["start_datetime"] = from_union([from_str, from_none], self.start_datetime) 1447 if self.status is not None: 1448 result["status"] = from_union([lambda x: to_enum(Status, x), from_none], self.status) 1449 if self.total_cost is not None: 1450 result["total_cost"] = from_union([from_none, to_float], self.total_cost) 1451 return result
Session( auth_id: Optional[str], auth_method: Optional[AuthMethod], charging_periods: Optional[List[ChargingPeriod]], currency: Optional[str], end_datetime: Optional[str], id: Optional[str], kwh: Optional[float], last_updated: Optional[str], location: Optional[SessionLocation], meter_id: Optional[str], start_datetime: Optional[str], status: Optional[Status], total_cost: Optional[float])
1390 def __init__(self, auth_id: Optional[str], auth_method: Optional[AuthMethod], charging_periods: Optional[List[ChargingPeriod]], currency: Optional[str], end_datetime: Optional[str], id: Optional[str], kwh: Optional[float], last_updated: Optional[str], location: Optional[SessionLocation], meter_id: Optional[str], start_datetime: Optional[str], status: Optional[Status], total_cost: Optional[float]) -> None: 1391 self.auth_id = auth_id 1392 self.auth_method = auth_method 1393 self.charging_periods = charging_periods 1394 self.currency = currency 1395 self.end_datetime = end_datetime 1396 self.id = id 1397 self.kwh = kwh 1398 self.last_updated = last_updated 1399 self.location = location 1400 self.meter_id = meter_id 1401 self.start_datetime = start_datetime 1402 self.status = status 1403 self.total_cost = total_cost
auth_method: Optional[AuthMethod]
charging_periods: Optional[List[ChargingPeriod]]
location: Optional[SessionLocation]
status: Optional[Status]
1405 @staticmethod 1406 def from_dict(obj: Any) -> 'Session': 1407 assert isinstance(obj, dict) 1408 auth_id = from_union([from_str, from_none], obj.get("auth_id")) 1409 auth_method = from_union([AuthMethod, from_none], obj.get("auth_method")) 1410 charging_periods = from_union([from_none, lambda x: from_list(ChargingPeriod.from_dict, x)], obj.get("charging_periods")) 1411 currency = from_union([from_str, from_none], obj.get("currency")) 1412 end_datetime = from_union([from_none, from_str], obj.get("end_datetime")) 1413 id = from_union([from_str, from_none], obj.get("id")) 1414 kwh = from_union([from_none, from_float], obj.get("kwh")) 1415 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 1416 location = from_union([SessionLocation.from_dict, from_none], obj.get("location")) 1417 meter_id = from_union([from_none, from_str], obj.get("meter_id")) 1418 start_datetime = from_union([from_str, from_none], obj.get("start_datetime")) 1419 status = from_union([Status, from_none], obj.get("status")) 1420 total_cost = from_union([from_none, from_float], obj.get("total_cost")) 1421 return Session(auth_id, auth_method, charging_periods, currency, end_datetime, id, kwh, last_updated, location, meter_id, start_datetime, status, total_cost)
def
to_dict(self) -> dict:
1423 def to_dict(self) -> dict: 1424 result: dict = {} 1425 if self.auth_id is not None: 1426 result["auth_id"] = from_union([from_str, from_none], self.auth_id) 1427 if self.auth_method is not None: 1428 result["auth_method"] = from_union([lambda x: to_enum(AuthMethod, x), from_none], self.auth_method) 1429 if self.charging_periods is not None: 1430 result["charging_periods"] = from_union([from_none, lambda x: from_list(lambda x: to_class(ChargingPeriod, x), x)], self.charging_periods) 1431 if self.currency is not None: 1432 result["currency"] = from_union([from_str, from_none], self.currency) 1433 if self.end_datetime is not None: 1434 result["end_datetime"] = from_union([from_none, from_str], self.end_datetime) 1435 if self.id is not None: 1436 result["id"] = from_union([from_str, from_none], self.id) 1437 if self.kwh is not None: 1438 result["kwh"] = from_union([from_none, to_float], self.kwh) 1439 if self.last_updated is not None: 1440 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 1441 if self.location is not None: 1442 result["location"] = from_union([lambda x: to_class(SessionLocation, x), from_none], self.location) 1443 if self.meter_id is not None: 1444 result["meter_id"] = from_union([from_none, from_str], self.meter_id) 1445 if self.start_datetime is not None: 1446 result["start_datetime"] = from_union([from_str, from_none], self.start_datetime) 1447 if self.status is not None: 1448 result["status"] = from_union([lambda x: to_enum(Status, x), from_none], self.status) 1449 if self.total_cost is not None: 1450 result["total_cost"] = from_union([from_none, to_float], self.total_cost) 1451 return result
class
TokenType(enum.Enum):
OTHER =
<TokenType.OTHER: 'OTHER'>
RFID =
<TokenType.RFID: 'RFID'>
class
Whitelist(enum.Enum):
1459class Whitelist(Enum): 1460 ALLOWED = "ALLOWED" 1461 ALLOWED_OFFLINE = "ALLOWED_OFFLINE" 1462 ALWAYS = "ALWAYS" 1463 NEVER = "NEVER"
ALLOWED =
<Whitelist.ALLOWED: 'ALLOWED'>
ALLOWED_OFFLINE =
<Whitelist.ALLOWED_OFFLINE: 'ALLOWED_OFFLINE'>
ALWAYS =
<Whitelist.ALWAYS: 'ALWAYS'>
NEVER =
<Whitelist.NEVER: 'NEVER'>
class
Token:
1466class Token: 1467 auth_id: Optional[str] 1468 issuer: Optional[str] 1469 language: Optional[str] 1470 last_updated: Optional[str] 1471 type: Optional[TokenType] 1472 uid: Optional[str] 1473 valid: Optional[bool] 1474 visual_number: Optional[str] 1475 whitelist: Optional[Whitelist] 1476 1477 def __init__(self, auth_id: Optional[str], issuer: Optional[str], language: Optional[str], last_updated: Optional[str], type: Optional[TokenType], uid: Optional[str], valid: Optional[bool], visual_number: Optional[str], whitelist: Optional[Whitelist]) -> None: 1478 self.auth_id = auth_id 1479 self.issuer = issuer 1480 self.language = language 1481 self.last_updated = last_updated 1482 self.type = type 1483 self.uid = uid 1484 self.valid = valid 1485 self.visual_number = visual_number 1486 self.whitelist = whitelist 1487 1488 @staticmethod 1489 def from_dict(obj: Any) -> 'Token': 1490 assert isinstance(obj, dict) 1491 auth_id = from_union([from_str, from_none], obj.get("auth_id")) 1492 issuer = from_union([from_str, from_none], obj.get("issuer")) 1493 language = from_union([from_str, from_none], obj.get("language")) 1494 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 1495 type = from_union([TokenType, from_none], obj.get("type")) 1496 uid = from_union([from_str, from_none], obj.get("uid")) 1497 valid = from_union([from_none, from_bool], obj.get("valid")) 1498 visual_number = from_union([from_str, from_none], obj.get("visual_number")) 1499 whitelist = from_union([Whitelist, from_none], obj.get("whitelist")) 1500 return Token(auth_id, issuer, language, last_updated, type, uid, valid, visual_number, whitelist) 1501 1502 def to_dict(self) -> dict: 1503 result: dict = {} 1504 if self.auth_id is not None: 1505 result["auth_id"] = from_union([from_str, from_none], self.auth_id) 1506 if self.issuer is not None: 1507 result["issuer"] = from_union([from_str, from_none], self.issuer) 1508 if self.language is not None: 1509 result["language"] = from_union([from_str, from_none], self.language) 1510 if self.last_updated is not None: 1511 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 1512 if self.type is not None: 1513 result["type"] = from_union([lambda x: to_enum(TokenType, x), from_none], self.type) 1514 if self.uid is not None: 1515 result["uid"] = from_union([from_str, from_none], self.uid) 1516 if self.valid is not None: 1517 result["valid"] = from_union([from_none, from_bool], self.valid) 1518 if self.visual_number is not None: 1519 result["visual_number"] = from_union([from_str, from_none], self.visual_number) 1520 if self.whitelist is not None: 1521 result["whitelist"] = from_union([lambda x: to_enum(Whitelist, x), from_none], self.whitelist) 1522 return result
Token( auth_id: Optional[str], issuer: Optional[str], language: Optional[str], last_updated: Optional[str], type: Optional[TokenType], uid: Optional[str], valid: Optional[bool], visual_number: Optional[str], whitelist: Optional[Whitelist])
1477 def __init__(self, auth_id: Optional[str], issuer: Optional[str], language: Optional[str], last_updated: Optional[str], type: Optional[TokenType], uid: Optional[str], valid: Optional[bool], visual_number: Optional[str], whitelist: Optional[Whitelist]) -> None: 1478 self.auth_id = auth_id 1479 self.issuer = issuer 1480 self.language = language 1481 self.last_updated = last_updated 1482 self.type = type 1483 self.uid = uid 1484 self.valid = valid 1485 self.visual_number = visual_number 1486 self.whitelist = whitelist
type: Optional[TokenType]
whitelist: Optional[Whitelist]
1488 @staticmethod 1489 def from_dict(obj: Any) -> 'Token': 1490 assert isinstance(obj, dict) 1491 auth_id = from_union([from_str, from_none], obj.get("auth_id")) 1492 issuer = from_union([from_str, from_none], obj.get("issuer")) 1493 language = from_union([from_str, from_none], obj.get("language")) 1494 last_updated = from_union([from_str, from_none], obj.get("last_updated")) 1495 type = from_union([TokenType, from_none], obj.get("type")) 1496 uid = from_union([from_str, from_none], obj.get("uid")) 1497 valid = from_union([from_none, from_bool], obj.get("valid")) 1498 visual_number = from_union([from_str, from_none], obj.get("visual_number")) 1499 whitelist = from_union([Whitelist, from_none], obj.get("whitelist")) 1500 return Token(auth_id, issuer, language, last_updated, type, uid, valid, visual_number, whitelist)
def
to_dict(self) -> dict:
1502 def to_dict(self) -> dict: 1503 result: dict = {} 1504 if self.auth_id is not None: 1505 result["auth_id"] = from_union([from_str, from_none], self.auth_id) 1506 if self.issuer is not None: 1507 result["issuer"] = from_union([from_str, from_none], self.issuer) 1508 if self.language is not None: 1509 result["language"] = from_union([from_str, from_none], self.language) 1510 if self.last_updated is not None: 1511 result["last_updated"] = from_union([from_str, from_none], self.last_updated) 1512 if self.type is not None: 1513 result["type"] = from_union([lambda x: to_enum(TokenType, x), from_none], self.type) 1514 if self.uid is not None: 1515 result["uid"] = from_union([from_str, from_none], self.uid) 1516 if self.valid is not None: 1517 result["valid"] = from_union([from_none, from_bool], self.valid) 1518 if self.visual_number is not None: 1519 result["visual_number"] = from_union([from_str, from_none], self.visual_number) 1520 if self.whitelist is not None: 1521 result["whitelist"] = from_union([lambda x: to_enum(Whitelist, x), from_none], self.whitelist) 1522 return result
class
V211:
1525class V211: 1526 cdr: Optional[Cdr] 1527 connector: Optional[Connector] 1528 credentials: Optional[Credentials] 1529 evse: Optional[Evse] 1530 location: Optional[Location] 1531 session: Optional[Session] 1532 tariff: Optional[Tariff] 1533 token: Optional[Token] 1534 1535 def __init__(self, cdr: Optional[Cdr], connector: Optional[Connector], credentials: Optional[Credentials], evse: Optional[Evse], location: Optional[Location], session: Optional[Session], tariff: Optional[Tariff], token: Optional[Token]) -> None: 1536 self.cdr = cdr 1537 self.connector = connector 1538 self.credentials = credentials 1539 self.evse = evse 1540 self.location = location 1541 self.session = session 1542 self.tariff = tariff 1543 self.token = token 1544 1545 @staticmethod 1546 def from_dict(obj: Any) -> 'V211': 1547 assert isinstance(obj, dict) 1548 cdr = from_union([Cdr.from_dict, from_none], obj.get("cdr")) 1549 connector = from_union([Connector.from_dict, from_none], obj.get("connector")) 1550 credentials = from_union([Credentials.from_dict, from_none], obj.get("credentials")) 1551 evse = from_union([Evse.from_dict, from_none], obj.get("evse")) 1552 location = from_union([Location.from_dict, from_none], obj.get("location")) 1553 session = from_union([Session.from_dict, from_none], obj.get("session")) 1554 tariff = from_union([Tariff.from_dict, from_none], obj.get("tariff")) 1555 token = from_union([Token.from_dict, from_none], obj.get("token")) 1556 return V211(cdr, connector, credentials, evse, location, session, tariff, token) 1557 1558 def to_dict(self) -> dict: 1559 result: dict = {} 1560 if self.cdr is not None: 1561 result["cdr"] = from_union([lambda x: to_class(Cdr, x), from_none], self.cdr) 1562 if self.connector is not None: 1563 result["connector"] = from_union([lambda x: to_class(Connector, x), from_none], self.connector) 1564 if self.credentials is not None: 1565 result["credentials"] = from_union([lambda x: to_class(Credentials, x), from_none], self.credentials) 1566 if self.evse is not None: 1567 result["evse"] = from_union([lambda x: to_class(Evse, x), from_none], self.evse) 1568 if self.location is not None: 1569 result["location"] = from_union([lambda x: to_class(Location, x), from_none], self.location) 1570 if self.session is not None: 1571 result["session"] = from_union([lambda x: to_class(Session, x), from_none], self.session) 1572 if self.tariff is not None: 1573 result["tariff"] = from_union([lambda x: to_class(Tariff, x), from_none], self.tariff) 1574 if self.token is not None: 1575 result["token"] = from_union([lambda x: to_class(Token, x), from_none], self.token) 1576 return result
V211( cdr: Optional[Cdr], connector: Optional[Connector], credentials: Optional[Credentials], evse: Optional[Evse], location: Optional[Location], session: Optional[Session], tariff: Optional[Tariff], token: Optional[Token])
1535 def __init__(self, cdr: Optional[Cdr], connector: Optional[Connector], credentials: Optional[Credentials], evse: Optional[Evse], location: Optional[Location], session: Optional[Session], tariff: Optional[Tariff], token: Optional[Token]) -> None: 1536 self.cdr = cdr 1537 self.connector = connector 1538 self.credentials = credentials 1539 self.evse = evse 1540 self.location = location 1541 self.session = session 1542 self.tariff = tariff 1543 self.token = token
cdr: Optional[Cdr]
connector: Optional[Connector]
credentials: Optional[Credentials]
evse: Optional[Evse]
location: Optional[Location]
session: Optional[Session]
tariff: Optional[Tariff]
token: Optional[Token]
1545 @staticmethod 1546 def from_dict(obj: Any) -> 'V211': 1547 assert isinstance(obj, dict) 1548 cdr = from_union([Cdr.from_dict, from_none], obj.get("cdr")) 1549 connector = from_union([Connector.from_dict, from_none], obj.get("connector")) 1550 credentials = from_union([Credentials.from_dict, from_none], obj.get("credentials")) 1551 evse = from_union([Evse.from_dict, from_none], obj.get("evse")) 1552 location = from_union([Location.from_dict, from_none], obj.get("location")) 1553 session = from_union([Session.from_dict, from_none], obj.get("session")) 1554 tariff = from_union([Tariff.from_dict, from_none], obj.get("tariff")) 1555 token = from_union([Token.from_dict, from_none], obj.get("token")) 1556 return V211(cdr, connector, credentials, evse, location, session, tariff, token)
def
to_dict(self) -> dict:
1558 def to_dict(self) -> dict: 1559 result: dict = {} 1560 if self.cdr is not None: 1561 result["cdr"] = from_union([lambda x: to_class(Cdr, x), from_none], self.cdr) 1562 if self.connector is not None: 1563 result["connector"] = from_union([lambda x: to_class(Connector, x), from_none], self.connector) 1564 if self.credentials is not None: 1565 result["credentials"] = from_union([lambda x: to_class(Credentials, x), from_none], self.credentials) 1566 if self.evse is not None: 1567 result["evse"] = from_union([lambda x: to_class(Evse, x), from_none], self.evse) 1568 if self.location is not None: 1569 result["location"] = from_union([lambda x: to_class(Location, x), from_none], self.location) 1570 if self.session is not None: 1571 result["session"] = from_union([lambda x: to_class(Session, x), from_none], self.session) 1572 if self.tariff is not None: 1573 result["tariff"] = from_union([lambda x: to_class(Tariff, x), from_none], self.tariff) 1574 if self.token is not None: 1575 result["token"] = from_union([lambda x: to_class(Token, x), from_none], self.token) 1576 return result