# coding: utf-8

"""
    Lethean Blockchain API

    OpenAPI for Lethean Blockchain

    The version of the OpenAPI document: 6.0.1
    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, StrictInt
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class TxPoolPerformanceModel(BaseModel):
    """
    TxPoolPerformanceModel
    """ # noqa: E501
    tx_processing_time: Optional[StrictInt] = None
    check_inputs_types_supported_time: Optional[StrictInt] = None
    expiration_validate_time: Optional[StrictInt] = None
    validate_amount_time: Optional[StrictInt] = None
    validate_alias_time: Optional[StrictInt] = None
    check_keyimages_ws_ms_time: Optional[StrictInt] = None
    check_inputs_time: Optional[StrictInt] = None
    begin_tx_time: Optional[StrictInt] = None
    update_db_time: Optional[StrictInt] = None
    db_commit_time: Optional[StrictInt] = None
    check_post_hf4_balance: Optional[StrictInt] = None
    __properties: ClassVar[List[str]] = ["tx_processing_time", "check_inputs_types_supported_time", "expiration_validate_time", "validate_amount_time", "validate_alias_time", "check_keyimages_ws_ms_time", "check_inputs_time", "begin_tx_time", "update_db_time", "db_commit_time", "check_post_hf4_balance"]

    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 TxPoolPerformanceModel 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 TxPoolPerformanceModel from a dict"""
        if obj is None:
            return None

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

        _obj = cls.model_validate({
            "tx_processing_time": obj.get("tx_processing_time"),
            "check_inputs_types_supported_time": obj.get("check_inputs_types_supported_time"),
            "expiration_validate_time": obj.get("expiration_validate_time"),
            "validate_amount_time": obj.get("validate_amount_time"),
            "validate_alias_time": obj.get("validate_alias_time"),
            "check_keyimages_ws_ms_time": obj.get("check_keyimages_ws_ms_time"),
            "check_inputs_time": obj.get("check_inputs_time"),
            "begin_tx_time": obj.get("begin_tx_time"),
            "update_db_time": obj.get("update_db_time"),
            "db_commit_time": obj.get("db_commit_time"),
            "check_post_hf4_balance": obj.get("check_post_hf4_balance")
        })
        return _obj


