# coding: utf-8

"""
Binance Wallet REST API

OpenAPI Specification for the Binance Wallet REST API
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
"""


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

from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Set
from typing_extensions import Self


class AllCoinsInformationResponseInnerNetworkListInner(BaseModel):
    """
    AllCoinsInformationResponseInnerNetworkListInner
    """  # noqa: E501

    network: Optional[StrictStr] = None
    coin: Optional[StrictStr] = None
    withdraw_integer_multiple: Optional[StrictStr] = Field(
        default=None, alias="withdrawIntegerMultiple"
    )
    is_default: Optional[StrictBool] = Field(default=None, alias="isDefault")
    deposit_enable: Optional[StrictBool] = Field(default=None, alias="depositEnable")
    withdraw_enable: Optional[StrictBool] = Field(default=None, alias="withdrawEnable")
    deposit_desc: Optional[StrictStr] = Field(default=None, alias="depositDesc")
    withdraw_desc: Optional[StrictStr] = Field(default=None, alias="withdrawDesc")
    special_tips: Optional[StrictStr] = Field(default=None, alias="specialTips")
    special_withdraw_tips: Optional[StrictStr] = Field(
        default=None, alias="specialWithdrawTips"
    )
    name: Optional[StrictStr] = None
    reset_address_status: Optional[StrictBool] = Field(
        default=None, alias="resetAddressStatus"
    )
    address_regex: Optional[StrictStr] = Field(default=None, alias="addressRegex")
    memo_regex: Optional[StrictStr] = Field(default=None, alias="memoRegex")
    withdraw_fee: Optional[StrictStr] = Field(default=None, alias="withdrawFee")
    withdraw_min: Optional[StrictStr] = Field(default=None, alias="withdrawMin")
    withdraw_max: Optional[StrictStr] = Field(default=None, alias="withdrawMax")
    withdraw_internal_min: Optional[StrictStr] = Field(
        default=None, alias="withdrawInternalMin"
    )
    deposit_dust: Optional[StrictStr] = Field(default=None, alias="depositDust")
    min_confirm: Optional[StrictInt] = Field(default=None, alias="minConfirm")
    un_lock_confirm: Optional[StrictInt] = Field(default=None, alias="unLockConfirm")
    same_address: Optional[StrictBool] = Field(default=None, alias="sameAddress")
    withdraw_tag: Optional[StrictBool] = Field(default=None, alias="withdrawTag")
    estimated_arrival_time: Optional[StrictInt] = Field(
        default=None, alias="estimatedArrivalTime"
    )
    busy: Optional[StrictBool] = None
    contract_address_url: Optional[StrictStr] = Field(
        default=None, alias="contractAddressUrl"
    )
    contract_address: Optional[StrictStr] = Field(default=None, alias="contractAddress")
    denomination: Optional[StrictInt] = None
    additional_properties: Dict[str, Any] = {}
    __properties: ClassVar[List[str]] = [
        "network",
        "coin",
        "withdrawIntegerMultiple",
        "isDefault",
        "depositEnable",
        "withdrawEnable",
        "depositDesc",
        "withdrawDesc",
        "specialTips",
        "specialWithdrawTips",
        "name",
        "resetAddressStatus",
        "addressRegex",
        "memoRegex",
        "withdrawFee",
        "withdrawMin",
        "withdrawMax",
        "withdrawInternalMin",
        "depositDust",
        "minConfirm",
        "unLockConfirm",
        "sameAddress",
        "withdrawTag",
        "estimatedArrivalTime",
        "busy",
        "contractAddressUrl",
        "contractAddress",
        "denomination",
    ]

    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 is_array(cls) -> bool:
        return False

    @classmethod
    def from_json(cls, json_str: str) -> Optional[Self]:
        """Create an instance of AllCoinsInformationResponseInnerNetworkListInner 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.
        * Fields in `self.additional_properties` are added to the output dict.
        """
        excluded_fields: Set[str] = set(
            [
                "additional_properties",
            ]
        )

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        # puts key-value pairs in additional_properties in the top level
        if self.additional_properties is not None:
            for _key, _value in self.additional_properties.items():
                _dict[_key] = _value

        return _dict

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

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

        _obj = cls.model_validate(
            {
                "network": obj.get("network"),
                "coin": obj.get("coin"),
                "withdrawIntegerMultiple": obj.get("withdrawIntegerMultiple"),
                "isDefault": obj.get("isDefault"),
                "depositEnable": obj.get("depositEnable"),
                "withdrawEnable": obj.get("withdrawEnable"),
                "depositDesc": obj.get("depositDesc"),
                "withdrawDesc": obj.get("withdrawDesc"),
                "specialTips": obj.get("specialTips"),
                "specialWithdrawTips": obj.get("specialWithdrawTips"),
                "name": obj.get("name"),
                "resetAddressStatus": obj.get("resetAddressStatus"),
                "addressRegex": obj.get("addressRegex"),
                "memoRegex": obj.get("memoRegex"),
                "withdrawFee": obj.get("withdrawFee"),
                "withdrawMin": obj.get("withdrawMin"),
                "withdrawMax": obj.get("withdrawMax"),
                "withdrawInternalMin": obj.get("withdrawInternalMin"),
                "depositDust": obj.get("depositDust"),
                "minConfirm": obj.get("minConfirm"),
                "unLockConfirm": obj.get("unLockConfirm"),
                "sameAddress": obj.get("sameAddress"),
                "withdrawTag": obj.get("withdrawTag"),
                "estimatedArrivalTime": obj.get("estimatedArrivalTime"),
                "busy": obj.get("busy"),
                "contractAddressUrl": obj.get("contractAddressUrl"),
                "contractAddress": obj.get("contractAddress"),
                "denomination": obj.get("denomination"),
            }
        )
        # store additional fields in additional_properties
        for _key in obj.keys():
            if _key not in cls.__properties:
                _obj.additional_properties[_key] = obj.get(_key)

        return _obj
