Skip to content

Commit

Permalink
feat: Add schemas and enums for hubclientinfo v_2_2_1 module.
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-bozbei-ew committed Nov 9, 2023
1 parent e1b75a9 commit 9aeed04
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Empty file.
12 changes: 12 additions & 0 deletions py_ocpi/modules/hubclientinfo/v_2_2_1/enums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from enum import Enum


class ConnectionStatus(str, Enum):
"""
https://github.com/ocpi/ocpi/blob/release-2.2.1-bugfixes/mod_hub_client_info.asciidoc#151-connectionstatus-enum
"""

connected = "CONNECTED"
offline = "OFFLINE"
planned = "PLANNED"
suspended = "SUSPENDED"
17 changes: 17 additions & 0 deletions py_ocpi/modules/hubclientinfo/v_2_2_1/schemas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from pydantic import BaseModel

from py_ocpi.core.data_types import CiString, DateTime
from py_ocpi.core.enums import RoleEnum
from py_ocpi.modules.hubclientinfo.v_2_2_1.enums import ConnectionStatus


class ClientInfo(BaseModel):
"""
https://github.com/ocpi/ocpi/blob/release-2.2.1-bugfixes/mod_hub_client_info.asciidoc#141-clientinfo-object
"""

party_id: CiString(3) # type: ignore
country_code: CiString(2) # type: ignore
role: RoleEnum
status: ConnectionStatus
last_updated: DateTime

0 comments on commit 9aeed04

Please sign in to comment.