# 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.1
    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 Block(
    schemas.AnyTypeSchema,
):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """


    class MetaOapg:
        required = {
            "gas_used",
            "sha3_uncles",
            "transaction_count",
            "receipts_root",
            "total_difficulty",
            "transactions",
            "nonce",
            "miner",
            "difficulty",
            "number",
            "logs_bloom",
            "gas_limit",
            "size",
            "extra_data",
            "transactions_root",
            "hash",
            "parent_hash",
            "state_root",
            "timestamp",
        }
        
        class properties:
            timestamp = schemas.StrSchema
            number = schemas.StrSchema
            hash = schemas.StrSchema
            parent_hash = schemas.StrSchema
            nonce = schemas.StrSchema
            sha3_uncles = schemas.StrSchema
            logs_bloom = schemas.StrSchema
            transactions_root = schemas.StrSchema
            state_root = schemas.StrSchema
            receipts_root = schemas.StrSchema
            miner = schemas.StrSchema
            difficulty = schemas.StrSchema
            total_difficulty = schemas.StrSchema
            size = schemas.StrSchema
            extra_data = schemas.StrSchema
            gas_limit = schemas.StrSchema
            gas_used = schemas.StrSchema
            transaction_count = schemas.StrSchema
            
            
            class transactions(
                schemas.ListSchema
            ):
            
            
                class MetaOapg:
                    
                    @staticmethod
                    def items() -> typing.Type['BlockTransaction']:
                        return BlockTransaction
            
                def __new__(
                    cls,
                    _arg: typing.Union[typing.Tuple['BlockTransaction'], typing.List['BlockTransaction']],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'transactions':
                    return super().__new__(
                        cls,
                        _arg,
                        _configuration=_configuration,
                    )
            
                def __getitem__(self, i: int) -> 'BlockTransaction':
                    return super().__getitem__(i)
            __annotations__ = {
                "timestamp": timestamp,
                "number": number,
                "hash": hash,
                "parent_hash": parent_hash,
                "nonce": nonce,
                "sha3_uncles": sha3_uncles,
                "logs_bloom": logs_bloom,
                "transactions_root": transactions_root,
                "state_root": state_root,
                "receipts_root": receipts_root,
                "miner": miner,
                "difficulty": difficulty,
                "total_difficulty": total_difficulty,
                "size": size,
                "extra_data": extra_data,
                "gas_limit": gas_limit,
                "gas_used": gas_used,
                "transaction_count": transaction_count,
                "transactions": transactions,
            }

    
    gas_used: MetaOapg.properties.gas_used
    sha3_uncles: MetaOapg.properties.sha3_uncles
    transaction_count: MetaOapg.properties.transaction_count
    receipts_root: MetaOapg.properties.receipts_root
    total_difficulty: MetaOapg.properties.total_difficulty
    transactions: MetaOapg.properties.transactions
    nonce: MetaOapg.properties.nonce
    miner: MetaOapg.properties.miner
    difficulty: MetaOapg.properties.difficulty
    number: MetaOapg.properties.number
    logs_bloom: MetaOapg.properties.logs_bloom
    gas_limit: MetaOapg.properties.gas_limit
    size: MetaOapg.properties.size
    extra_data: MetaOapg.properties.extra_data
    transactions_root: MetaOapg.properties.transactions_root
    hash: MetaOapg.properties.hash
    parent_hash: MetaOapg.properties.parent_hash
    state_root: MetaOapg.properties.state_root
    timestamp: MetaOapg.properties.timestamp
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["timestamp"]) -> MetaOapg.properties.timestamp: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["hash"]) -> MetaOapg.properties.hash: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["parent_hash"]) -> MetaOapg.properties.parent_hash: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["nonce"]) -> MetaOapg.properties.nonce: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["sha3_uncles"]) -> MetaOapg.properties.sha3_uncles: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["logs_bloom"]) -> MetaOapg.properties.logs_bloom: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["transactions_root"]) -> MetaOapg.properties.transactions_root: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["state_root"]) -> MetaOapg.properties.state_root: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["receipts_root"]) -> MetaOapg.properties.receipts_root: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["miner"]) -> MetaOapg.properties.miner: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["difficulty"]) -> MetaOapg.properties.difficulty: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["total_difficulty"]) -> MetaOapg.properties.total_difficulty: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["size"]) -> MetaOapg.properties.size: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["extra_data"]) -> MetaOapg.properties.extra_data: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["gas_limit"]) -> MetaOapg.properties.gas_limit: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["gas_used"]) -> MetaOapg.properties.gas_used: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["transaction_count"]) -> MetaOapg.properties.transaction_count: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["transactions"]) -> MetaOapg.properties.transactions: ...
    
    @typing.overload
    def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
    
    def __getitem__(self, name: typing.Union[typing_extensions.Literal["timestamp", "number", "hash", "parent_hash", "nonce", "sha3_uncles", "logs_bloom", "transactions_root", "state_root", "receipts_root", "miner", "difficulty", "total_difficulty", "size", "extra_data", "gas_limit", "gas_used", "transaction_count", "transactions", ], str]):
        # dict_instance[name] accessor
        return super().__getitem__(name)
    
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["timestamp"]) -> MetaOapg.properties.timestamp: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["number"]) -> MetaOapg.properties.number: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["hash"]) -> MetaOapg.properties.hash: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["parent_hash"]) -> MetaOapg.properties.parent_hash: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["nonce"]) -> MetaOapg.properties.nonce: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["sha3_uncles"]) -> MetaOapg.properties.sha3_uncles: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["logs_bloom"]) -> MetaOapg.properties.logs_bloom: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["transactions_root"]) -> MetaOapg.properties.transactions_root: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["state_root"]) -> MetaOapg.properties.state_root: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["receipts_root"]) -> MetaOapg.properties.receipts_root: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["miner"]) -> MetaOapg.properties.miner: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["difficulty"]) -> MetaOapg.properties.difficulty: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["total_difficulty"]) -> MetaOapg.properties.total_difficulty: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["size"]) -> MetaOapg.properties.size: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["extra_data"]) -> MetaOapg.properties.extra_data: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["gas_limit"]) -> MetaOapg.properties.gas_limit: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["gas_used"]) -> MetaOapg.properties.gas_used: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["transaction_count"]) -> MetaOapg.properties.transaction_count: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["transactions"]) -> MetaOapg.properties.transactions: ...
    
    @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["timestamp", "number", "hash", "parent_hash", "nonce", "sha3_uncles", "logs_bloom", "transactions_root", "state_root", "receipts_root", "miner", "difficulty", "total_difficulty", "size", "extra_data", "gas_limit", "gas_used", "transaction_count", "transactions", ], str]):
        return super().get_item_oapg(name)
    

    def __new__(
        cls,
        *_args: typing.Union[dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ],
        gas_used: typing.Union[MetaOapg.properties.gas_used, str, ],
        sha3_uncles: typing.Union[MetaOapg.properties.sha3_uncles, str, ],
        transaction_count: typing.Union[MetaOapg.properties.transaction_count, str, ],
        receipts_root: typing.Union[MetaOapg.properties.receipts_root, str, ],
        total_difficulty: typing.Union[MetaOapg.properties.total_difficulty, str, ],
        transactions: typing.Union[MetaOapg.properties.transactions, list, tuple, ],
        nonce: typing.Union[MetaOapg.properties.nonce, str, ],
        miner: typing.Union[MetaOapg.properties.miner, str, ],
        difficulty: typing.Union[MetaOapg.properties.difficulty, str, ],
        number: typing.Union[MetaOapg.properties.number, str, ],
        logs_bloom: typing.Union[MetaOapg.properties.logs_bloom, str, ],
        gas_limit: typing.Union[MetaOapg.properties.gas_limit, str, ],
        size: typing.Union[MetaOapg.properties.size, str, ],
        extra_data: typing.Union[MetaOapg.properties.extra_data, str, ],
        transactions_root: typing.Union[MetaOapg.properties.transactions_root, str, ],
        hash: typing.Union[MetaOapg.properties.hash, str, ],
        parent_hash: typing.Union[MetaOapg.properties.parent_hash, str, ],
        state_root: typing.Union[MetaOapg.properties.state_root, str, ],
        timestamp: typing.Union[MetaOapg.properties.timestamp, str, ],
        _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],
    ) -> 'Block':
        return super().__new__(
            cls,
            *_args,
            gas_used=gas_used,
            sha3_uncles=sha3_uncles,
            transaction_count=transaction_count,
            receipts_root=receipts_root,
            total_difficulty=total_difficulty,
            transactions=transactions,
            nonce=nonce,
            miner=miner,
            difficulty=difficulty,
            number=number,
            logs_bloom=logs_bloom,
            gas_limit=gas_limit,
            size=size,
            extra_data=extra_data,
            transactions_root=transactions_root,
            hash=hash,
            parent_hash=parent_hash,
            state_root=state_root,
            timestamp=timestamp,
            _configuration=_configuration,
            **kwargs,
        )

from openapi_evm_api.model.block_transaction import BlockTransaction
