# coding: utf-8

"""
    Peblar local REST API

    # General This document contains the specification of the WLAC local REST API. This API for local networks is supported by Peblar products from firmware versions 1.6 and onwards. Before the API can be accessed, it is required to be enabled in the advanced settings page of the chargers web interface. The endpoints described below can be reached via http://\\<local_ip\\>/api/wlac/v1/\\<endpoint_name\\> for example http://10.11.12.13/api/wlac/v1/evinterface. <br><br> <img src=\"./images/api_enable.png\"/> <br> 

    The version of the OpenAPI document: 1.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json


from typing import Optional
from pydantic import BaseModel, Field, StrictInt

class MeterGet200Response(BaseModel):
    """
    MeterGet200Response
    """
    current_phase1: Optional[StrictInt] = Field(default=None, alias="CurrentPhase1", description="The instantaneous current on phase 1 in milliAmperes.")
    current_phase2: Optional[StrictInt] = Field(default=None, alias="CurrentPhase2", description="The instantaneous current on phase 2 in milliAmperes.")
    current_phase3: Optional[StrictInt] = Field(default=None, alias="CurrentPhase3", description="The instantaneous current on phase 3 in milliAmperes.")
    voltage_phase1: Optional[StrictInt] = Field(default=None, alias="VoltagePhase1", description="The instantaneous voltage on phase 1 in Volts.")
    voltage_phase2: Optional[StrictInt] = Field(default=None, alias="VoltagePhase2", description="The instantaneous voltage on phase 2 in Volts. If no valid measurement can be made, null is returned.")
    voltage_phase3: Optional[StrictInt] = Field(default=None, alias="VoltagePhase3", description="The instantaneous voltage on phase 3 in Volts. If no valid measurement can be made, null is returned.")
    power_phase1: Optional[StrictInt] = Field(default=None, alias="PowerPhase1", description="The instantaneous active power on phase 1 in Watts.")
    power_phase2: Optional[StrictInt] = Field(default=None, alias="PowerPhase2", description="The instantaneous active power on phase 2 in Watts.")
    power_phase3: Optional[StrictInt] = Field(default=None, alias="PowerPhase3", description="The instantaneous active power on phase 3 in Watts.")
    power_total: Optional[StrictInt] = Field(default=None, alias="PowerTotal", description="The combined instantaneous active power on phases 1, 2 and 3.")
    energy_total: Optional[StrictInt] = Field(default=None, alias="EnergyTotal", description="The lifetime energy supplied by the charger in Wh.")
    energy_session: Optional[StrictInt] = Field(default=None, alias="EnergySession", description="The energy supplied by the charger from the last or pending charging session in Wh.")
    __properties = ["CurrentPhase1", "CurrentPhase2", "CurrentPhase3", "VoltagePhase1", "VoltagePhase2", "VoltagePhase3", "PowerPhase1", "PowerPhase2", "PowerPhase3", "PowerTotal", "EnergyTotal", "EnergySession"]

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_name = True
        validate_assignment = True

    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.dict(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> MeterGet200Response:
        """Create an instance of MeterGet200Response from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> MeterGet200Response:
        """Create an instance of MeterGet200Response from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return MeterGet200Response.parse_obj(obj)

        _obj = MeterGet200Response.parse_obj({
            "current_phase1": obj.get("CurrentPhase1"),
            "current_phase2": obj.get("CurrentPhase2"),
            "current_phase3": obj.get("CurrentPhase3"),
            "voltage_phase1": obj.get("VoltagePhase1"),
            "voltage_phase2": obj.get("VoltagePhase2"),
            "voltage_phase3": obj.get("VoltagePhase3"),
            "power_phase1": obj.get("PowerPhase1"),
            "power_phase2": obj.get("PowerPhase2"),
            "power_phase3": obj.get("PowerPhase3"),
            "power_total": obj.get("PowerTotal"),
            "energy_total": obj.get("EnergyTotal"),
            "energy_session": obj.get("EnergySession")
        })
        return _obj


