# coding: utf-8

"""
    EVM API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 2.2
    Generated by: https://openapi-generator.tech
"""

from datetime import date, datetime  # noqa: F401
import decimal  # noqa: F401
import functools  # noqa: F401
import io  # noqa: F401
import re  # noqa: F401
import typing  # noqa: F401
import typing_extensions  # noqa: F401
import uuid  # noqa: F401

import frozendict  # noqa: F401

from openapi_evm_api import schemas  # noqa: F401


class CommonContractData(
    schemas.DictSchema
):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """


    class MetaOapg:
        required = {
            "spender",
            "value",
            "token",
        }
        
        class properties:
            value = schemas.StrSchema
        
            @staticmethod
            def token() -> typing.Type['ContractTokenDetails']:
                return ContractTokenDetails
        
            @staticmethod
            def spender() -> typing.Type['ContractSpenderDetails']:
                return ContractSpenderDetails
            
            
            class value_formatted(
                schemas.StrBase,
                schemas.NoneBase,
                schemas.Schema,
                schemas.NoneStrMixin
            ):
            
            
                def __new__(
                    cls,
                    *args: typing.Union[None, str, ],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'value_formatted':
                    return super().__new__(
                        cls,
                        *args,
                        _configuration=_configuration,
                    )
            __annotations__ = {
                "value": value,
                "token": token,
                "spender": spender,
                "value_formatted": value_formatted,
            }
    
    spender: 'ContractSpenderDetails'
    value: MetaOapg.properties.value
    token: 'ContractTokenDetails'
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["value"]) -> MetaOapg.properties.value: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["token"]) -> 'ContractTokenDetails': ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["spender"]) -> 'ContractSpenderDetails': ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["value_formatted"]) -> MetaOapg.properties.value_formatted: ...
    
    @typing.overload
    def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
    
    def __getitem__(self, name: typing.Union[typing_extensions.Literal["value", "token", "spender", "value_formatted", ], str]):
        # dict_instance[name] accessor
        return super().__getitem__(name)
    
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["value"]) -> MetaOapg.properties.value: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["token"]) -> 'ContractTokenDetails': ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["spender"]) -> 'ContractSpenderDetails': ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["value_formatted"]) -> typing.Union[MetaOapg.properties.value_formatted, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
    
    def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["value", "token", "spender", "value_formatted", ], str]):
        return super().get_item_oapg(name)
    

    def __new__(
        cls,
        *args: typing.Union[dict, frozendict.frozendict, ],
        spender: 'ContractSpenderDetails',
        value: typing.Union[MetaOapg.properties.value, str, ],
        token: 'ContractTokenDetails',
        value_formatted: typing.Union[MetaOapg.properties.value_formatted, None, str, schemas.Unset] = schemas.unset,
        _configuration: typing.Optional[schemas.Configuration] = None,
        **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes],
    ) -> 'CommonContractData':
        return super().__new__(
            cls,
            *args,
            spender=spender,
            value=value,
            token=token,
            value_formatted=value_formatted,
            _configuration=_configuration,
            **kwargs,
        )

from openapi_evm_api.model.contract_spender_details import ContractSpenderDetails
from openapi_evm_api.model.contract_token_details import ContractTokenDetails
