# coding: utf-8

"""
    aptos-api

    The aptos-api provider  # noqa: E501

    The version of the OpenAPI document: 1.0.0
    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_aptos_api import schemas  # noqa: F401


class Block(
    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 = {
            "last_version",
            "first_version",
            "block_timestamp",
            "block_hash",
            "block_height",
            "transactions",
        }
        
        class properties:
            block_height = schemas.StrSchema
            block_hash = schemas.StrSchema
            block_timestamp = schemas.StrSchema
            first_version = schemas.StrSchema
            last_version = schemas.StrSchema
            
            
            class transactions(
                schemas.ListSchema
            ):
            
            
                class MetaOapg:
                    
                    
                    class items(
                        schemas.ComposedSchema,
                    ):
                    
                    
                        class MetaOapg:
                            
                            @classmethod
                            @functools.lru_cache()
                            def one_of(cls):
                                # we need this here to make our import statements work
                                # we must store _composed_schemas in here so the code is only run
                                # when we invoke this method. If we kept this at the class
                                # level we would get an error because the class level
                                # code would be run when this module is imported, and these composed
                                # classes don't exist yet because their module has not finished
                                # loading
                                return [
                                    PendingTransaction,
                                    UserTransaction,
                                    GenesisTransaction,
                                    BlockMetadataTransaction,
                                    StateCheckpointTransaction,
                                ]
                    
                    
                        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, ],
                            _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],
                        ) -> 'items':
                            return super().__new__(
                                cls,
                                *args,
                                _configuration=_configuration,
                                **kwargs,
                            )
            
                def __new__(
                    cls,
                    arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ]]],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'transactions':
                    return super().__new__(
                        cls,
                        arg,
                        _configuration=_configuration,
                    )
            
                def __getitem__(self, i: int) -> MetaOapg.items:
                    return super().__getitem__(i)
            __annotations__ = {
                "block_height": block_height,
                "block_hash": block_hash,
                "block_timestamp": block_timestamp,
                "first_version": first_version,
                "last_version": last_version,
                "transactions": transactions,
            }
    
    last_version: MetaOapg.properties.last_version
    first_version: MetaOapg.properties.first_version
    block_timestamp: MetaOapg.properties.block_timestamp
    block_hash: MetaOapg.properties.block_hash
    block_height: MetaOapg.properties.block_height
    transactions: MetaOapg.properties.transactions
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["block_height"]) -> MetaOapg.properties.block_height: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["block_hash"]) -> MetaOapg.properties.block_hash: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["block_timestamp"]) -> MetaOapg.properties.block_timestamp: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["first_version"]) -> MetaOapg.properties.first_version: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["last_version"]) -> MetaOapg.properties.last_version: ...
    
    @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["block_height", "block_hash", "block_timestamp", "first_version", "last_version", "transactions", ], str]):
        # dict_instance[name] accessor
        return super().__getitem__(name)
    
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["block_height"]) -> MetaOapg.properties.block_height: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["block_hash"]) -> MetaOapg.properties.block_hash: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["block_timestamp"]) -> MetaOapg.properties.block_timestamp: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["first_version"]) -> MetaOapg.properties.first_version: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["last_version"]) -> MetaOapg.properties.last_version: ...
    
    @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["block_height", "block_hash", "block_timestamp", "first_version", "last_version", "transactions", ], str]):
        return super().get_item_oapg(name)
    

    def __new__(
        cls,
        *args: typing.Union[dict, frozendict.frozendict, ],
        last_version: typing.Union[MetaOapg.properties.last_version, str, ],
        first_version: typing.Union[MetaOapg.properties.first_version, str, ],
        block_timestamp: typing.Union[MetaOapg.properties.block_timestamp, str, ],
        block_hash: typing.Union[MetaOapg.properties.block_hash, str, ],
        block_height: typing.Union[MetaOapg.properties.block_height, str, ],
        transactions: typing.Union[MetaOapg.properties.transactions, list, tuple, ],
        _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,
            last_version=last_version,
            first_version=first_version,
            block_timestamp=block_timestamp,
            block_hash=block_hash,
            block_height=block_height,
            transactions=transactions,
            _configuration=_configuration,
            **kwargs,
        )

from openapi_aptos_api.model.block_metadata_transaction import BlockMetadataTransaction
from openapi_aptos_api.model.genesis_transaction import GenesisTransaction
from openapi_aptos_api.model.pending_transaction import PendingTransaction
from openapi_aptos_api.model.state_checkpoint_transaction import StateCheckpointTransaction
from openapi_aptos_api.model.user_transaction import UserTransaction
