# 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 BlockMetadataTransaction(
    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 = {
            "proposer",
            "event_root_hash",
            "gas_used",
            "changes",
            "previous_block_votes_bitvec",
            "state_checkpoint_hash",
            "epoch",
            "state_change_hash",
            "accumulator_root_hash",
            "type",
            "version",
            "failed_proposer_indices",
            "vm_status",
            "round",
            "success",
            "id",
            "events",
            "hash",
            "timestamp",
        }
        
        class properties:
            type = schemas.StrSchema
            version = schemas.StrSchema
            hash = schemas.StrSchema
            state_change_hash = schemas.StrSchema
            event_root_hash = schemas.StrSchema
            state_checkpoint_hash = schemas.StrSchema
            gas_used = schemas.StrSchema
            success = schemas.BoolSchema
            vm_status = schemas.StrSchema
            accumulator_root_hash = schemas.StrSchema
            
            
            class changes(
                schemas.ListSchema
            ):
            
            
                class MetaOapg:
                    items = schemas.StrSchema
            
                def __new__(
                    cls,
                    arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'changes':
                    return super().__new__(
                        cls,
                        arg,
                        _configuration=_configuration,
                    )
            
                def __getitem__(self, i: int) -> MetaOapg.items:
                    return super().__getitem__(i)
            id = schemas.StrSchema
            epoch = schemas.StrSchema
            round = schemas.StrSchema
            
            
            class events(
                schemas.ListSchema
            ):
            
            
                class MetaOapg:
                    
                    @staticmethod
                    def items() -> typing.Type['TransactionEvent']:
                        return TransactionEvent
            
                def __new__(
                    cls,
                    arg: typing.Union[typing.Tuple['TransactionEvent'], typing.List['TransactionEvent']],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'events':
                    return super().__new__(
                        cls,
                        arg,
                        _configuration=_configuration,
                    )
            
                def __getitem__(self, i: int) -> 'TransactionEvent':
                    return super().__getitem__(i)
            
            
            class previous_block_votes_bitvec(
                schemas.ListSchema
            ):
            
            
                class MetaOapg:
                    items = schemas.StrSchema
            
                def __new__(
                    cls,
                    arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'previous_block_votes_bitvec':
                    return super().__new__(
                        cls,
                        arg,
                        _configuration=_configuration,
                    )
            
                def __getitem__(self, i: int) -> MetaOapg.items:
                    return super().__getitem__(i)
            proposer = schemas.StrSchema
            
            
            class failed_proposer_indices(
                schemas.ListSchema
            ):
            
            
                class MetaOapg:
                    items = schemas.StrSchema
            
                def __new__(
                    cls,
                    arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]],
                    _configuration: typing.Optional[schemas.Configuration] = None,
                ) -> 'failed_proposer_indices':
                    return super().__new__(
                        cls,
                        arg,
                        _configuration=_configuration,
                    )
            
                def __getitem__(self, i: int) -> MetaOapg.items:
                    return super().__getitem__(i)
            timestamp = schemas.StrSchema
            __annotations__ = {
                "type": type,
                "version": version,
                "hash": hash,
                "state_change_hash": state_change_hash,
                "event_root_hash": event_root_hash,
                "state_checkpoint_hash": state_checkpoint_hash,
                "gas_used": gas_used,
                "success": success,
                "vm_status": vm_status,
                "accumulator_root_hash": accumulator_root_hash,
                "changes": changes,
                "id": id,
                "epoch": epoch,
                "round": round,
                "events": events,
                "previous_block_votes_bitvec": previous_block_votes_bitvec,
                "proposer": proposer,
                "failed_proposer_indices": failed_proposer_indices,
                "timestamp": timestamp,
            }
    
    proposer: MetaOapg.properties.proposer
    event_root_hash: MetaOapg.properties.event_root_hash
    gas_used: MetaOapg.properties.gas_used
    changes: MetaOapg.properties.changes
    previous_block_votes_bitvec: MetaOapg.properties.previous_block_votes_bitvec
    state_checkpoint_hash: MetaOapg.properties.state_checkpoint_hash
    epoch: MetaOapg.properties.epoch
    state_change_hash: MetaOapg.properties.state_change_hash
    accumulator_root_hash: MetaOapg.properties.accumulator_root_hash
    type: MetaOapg.properties.type
    version: MetaOapg.properties.version
    failed_proposer_indices: MetaOapg.properties.failed_proposer_indices
    vm_status: MetaOapg.properties.vm_status
    round: MetaOapg.properties.round
    success: MetaOapg.properties.success
    id: MetaOapg.properties.id
    events: MetaOapg.properties.events
    hash: MetaOapg.properties.hash
    timestamp: MetaOapg.properties.timestamp
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["type"]) -> MetaOapg.properties.type: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["version"]) -> MetaOapg.properties.version: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["hash"]) -> MetaOapg.properties.hash: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["state_change_hash"]) -> MetaOapg.properties.state_change_hash: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["event_root_hash"]) -> MetaOapg.properties.event_root_hash: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["state_checkpoint_hash"]) -> MetaOapg.properties.state_checkpoint_hash: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["gas_used"]) -> MetaOapg.properties.gas_used: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["success"]) -> MetaOapg.properties.success: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["vm_status"]) -> MetaOapg.properties.vm_status: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["accumulator_root_hash"]) -> MetaOapg.properties.accumulator_root_hash: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["changes"]) -> MetaOapg.properties.changes: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["epoch"]) -> MetaOapg.properties.epoch: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["round"]) -> MetaOapg.properties.round: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["events"]) -> MetaOapg.properties.events: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["previous_block_votes_bitvec"]) -> MetaOapg.properties.previous_block_votes_bitvec: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["proposer"]) -> MetaOapg.properties.proposer: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["failed_proposer_indices"]) -> MetaOapg.properties.failed_proposer_indices: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["timestamp"]) -> MetaOapg.properties.timestamp: ...
    
    @typing.overload
    def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
    
    def __getitem__(self, name: typing.Union[typing_extensions.Literal["type", "version", "hash", "state_change_hash", "event_root_hash", "state_checkpoint_hash", "gas_used", "success", "vm_status", "accumulator_root_hash", "changes", "id", "epoch", "round", "events", "previous_block_votes_bitvec", "proposer", "failed_proposer_indices", "timestamp", ], str]):
        # dict_instance[name] accessor
        return super().__getitem__(name)
    
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["type"]) -> MetaOapg.properties.type: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["version"]) -> MetaOapg.properties.version: ...
    
    @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["state_change_hash"]) -> MetaOapg.properties.state_change_hash: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["event_root_hash"]) -> MetaOapg.properties.event_root_hash: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["state_checkpoint_hash"]) -> MetaOapg.properties.state_checkpoint_hash: ...
    
    @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["success"]) -> MetaOapg.properties.success: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["vm_status"]) -> MetaOapg.properties.vm_status: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["accumulator_root_hash"]) -> MetaOapg.properties.accumulator_root_hash: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["changes"]) -> MetaOapg.properties.changes: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["epoch"]) -> MetaOapg.properties.epoch: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["round"]) -> MetaOapg.properties.round: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["events"]) -> MetaOapg.properties.events: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["previous_block_votes_bitvec"]) -> MetaOapg.properties.previous_block_votes_bitvec: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["proposer"]) -> MetaOapg.properties.proposer: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["failed_proposer_indices"]) -> MetaOapg.properties.failed_proposer_indices: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["timestamp"]) -> MetaOapg.properties.timestamp: ...
    
    @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["type", "version", "hash", "state_change_hash", "event_root_hash", "state_checkpoint_hash", "gas_used", "success", "vm_status", "accumulator_root_hash", "changes", "id", "epoch", "round", "events", "previous_block_votes_bitvec", "proposer", "failed_proposer_indices", "timestamp", ], str]):
        return super().get_item_oapg(name)
    

    def __new__(
        cls,
        *args: typing.Union[dict, frozendict.frozendict, ],
        proposer: typing.Union[MetaOapg.properties.proposer, str, ],
        event_root_hash: typing.Union[MetaOapg.properties.event_root_hash, str, ],
        gas_used: typing.Union[MetaOapg.properties.gas_used, str, ],
        changes: typing.Union[MetaOapg.properties.changes, list, tuple, ],
        previous_block_votes_bitvec: typing.Union[MetaOapg.properties.previous_block_votes_bitvec, list, tuple, ],
        state_checkpoint_hash: typing.Union[MetaOapg.properties.state_checkpoint_hash, str, ],
        epoch: typing.Union[MetaOapg.properties.epoch, str, ],
        state_change_hash: typing.Union[MetaOapg.properties.state_change_hash, str, ],
        accumulator_root_hash: typing.Union[MetaOapg.properties.accumulator_root_hash, str, ],
        type: typing.Union[MetaOapg.properties.type, str, ],
        version: typing.Union[MetaOapg.properties.version, str, ],
        failed_proposer_indices: typing.Union[MetaOapg.properties.failed_proposer_indices, list, tuple, ],
        vm_status: typing.Union[MetaOapg.properties.vm_status, str, ],
        round: typing.Union[MetaOapg.properties.round, str, ],
        success: typing.Union[MetaOapg.properties.success, bool, ],
        id: typing.Union[MetaOapg.properties.id, str, ],
        events: typing.Union[MetaOapg.properties.events, list, tuple, ],
        hash: typing.Union[MetaOapg.properties.hash, 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],
    ) -> 'BlockMetadataTransaction':
        return super().__new__(
            cls,
            *args,
            proposer=proposer,
            event_root_hash=event_root_hash,
            gas_used=gas_used,
            changes=changes,
            previous_block_votes_bitvec=previous_block_votes_bitvec,
            state_checkpoint_hash=state_checkpoint_hash,
            epoch=epoch,
            state_change_hash=state_change_hash,
            accumulator_root_hash=accumulator_root_hash,
            type=type,
            version=version,
            failed_proposer_indices=failed_proposer_indices,
            vm_status=vm_status,
            round=round,
            success=success,
            id=id,
            events=events,
            hash=hash,
            timestamp=timestamp,
            _configuration=_configuration,
            **kwargs,
        )

from openapi_aptos_api.model.transaction_event import TransactionEvent
