# coding: utf-8

from __future__ import annotations
from datetime import date, datetime  # noqa: F401

import re  # noqa: F401
from typing import Any, Dict, List, Optional  # noqa: F401

from pydantic import AnyUrl, BaseModel, EmailStr, Field, validator  # noqa: F401


class Si7020(BaseModel):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.

    Si7020 - a model defined in OpenAPI

        temperature: The temperature of this Si7020 [Optional].
        humidity: The humidity of this Si7020 [Optional].
        serial: The serial of this Si7020 [Optional].
        firmware: The firmware of this Si7020 [Optional].
    """
    class Config:
        orm_mode = True

    temperature: Optional[float] = Field(alias="temperature", default=None)
    humidity: Optional[float] = Field(alias="humidity", default=None)
    serial: Optional[str] = Field(alias="serial", default=None)
    firmware: Optional[str] = Field(alias="firmware", default=None)

    @validator("temperature")
    def temperature_max(cls, value):
        assert value <= 125
        return value

    @validator("temperature")
    def temperature_min(cls, value):
        assert value >= -40
        return value

    @validator("humidity")
    def humidity_max(cls, value):
        assert value <= 100
        return value

    @validator("humidity")
    def humidity_min(cls, value):
        assert value >= 0
        return value

Si7020.update_forward_refs()
