# coding: utf-8

"""
    Graphiant APIs

    Graphiant API documentation.

    The version of the OpenAPI document: 1.0.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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self

class V2MonitoringCircuitsSummaryPost200ResponseCircuitSummariesInner(BaseModel):
    """
    V2MonitoringCircuitsSummaryPost200ResponseCircuitSummariesInner
    """ # noqa: E501
    average_delay: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="averageDelay")
    average_jitter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="averageJitter")
    average_link_down_speed_kbps: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="averageLinkDownSpeedKbps")
    average_link_up_speed_kbps: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="averageLinkUpSpeedKbps")
    average_loss: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="averageLoss")
    avg_mos: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="avgMos")
    circuit_name: Optional[StrictStr] = Field(default=None, alias="circuitName")
    config_link_down_speed_mbps: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, alias="configLinkDownSpeedMbps")
    config_link_up_speed_mbps: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, alias="configLinkUpSpeedMbps")
    connection_status: Optional[StrictStr] = Field(default=None, alias="connectionStatus")
    current_link_down_speed_kbps: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="currentLinkDownSpeedKbps")
    current_link_up_speed_kbps: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="currentLinkUpSpeedKbps")
    delay: Optional[Annotated[int, Field(strict=True, ge=0)]] = None
    jitter: Optional[Annotated[int, Field(strict=True, ge=0)]] = None
    last_resort: Optional[StrictBool] = Field(default=None, alias="lastResort")
    loss: Optional[Union[StrictFloat, StrictInt]] = None
    max_delay: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="maxDelay")
    max_jitter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="maxJitter")
    max_loss: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="maxLoss")
    max_mos: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="maxMos")
    min_delay: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="minDelay")
    min_jitter: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="minJitter")
    min_loss: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="minLoss")
    min_mos: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="minMos")
    mos: Optional[Union[StrictFloat, StrictInt]] = None
    __properties: ClassVar[List[str]] = ["averageDelay", "averageJitter", "averageLinkDownSpeedKbps", "averageLinkUpSpeedKbps", "averageLoss", "avgMos", "circuitName", "configLinkDownSpeedMbps", "configLinkUpSpeedMbps", "connectionStatus", "currentLinkDownSpeedKbps", "currentLinkUpSpeedKbps", "delay", "jitter", "lastResort", "loss", "maxDelay", "maxJitter", "maxLoss", "maxMos", "minDelay", "minJitter", "minLoss", "minMos", "mos"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


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

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

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

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of V2MonitoringCircuitsSummaryPost200ResponseCircuitSummariesInner from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "averageDelay": obj.get("averageDelay"),
            "averageJitter": obj.get("averageJitter"),
            "averageLinkDownSpeedKbps": obj.get("averageLinkDownSpeedKbps"),
            "averageLinkUpSpeedKbps": obj.get("averageLinkUpSpeedKbps"),
            "averageLoss": obj.get("averageLoss"),
            "avgMos": obj.get("avgMos"),
            "circuitName": obj.get("circuitName"),
            "configLinkDownSpeedMbps": obj.get("configLinkDownSpeedMbps"),
            "configLinkUpSpeedMbps": obj.get("configLinkUpSpeedMbps"),
            "connectionStatus": obj.get("connectionStatus"),
            "currentLinkDownSpeedKbps": obj.get("currentLinkDownSpeedKbps"),
            "currentLinkUpSpeedKbps": obj.get("currentLinkUpSpeedKbps"),
            "delay": obj.get("delay"),
            "jitter": obj.get("jitter"),
            "lastResort": obj.get("lastResort"),
            "loss": obj.get("loss"),
            "maxDelay": obj.get("maxDelay"),
            "maxJitter": obj.get("maxJitter"),
            "maxLoss": obj.get("maxLoss"),
            "maxMos": obj.get("maxMos"),
            "minDelay": obj.get("minDelay"),
            "minJitter": obj.get("minJitter"),
            "minLoss": obj.get("minLoss"),
            "minMos": obj.get("minMos"),
            "mos": obj.get("mos")
        })
        return _obj


