# 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 EncodeSubmissionRequest(
    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 = {
            "sequence_number",
            "secondary_signers",
            "payload",
            "sender",
            "gas_unit_price",
            "max_gas_amount",
            "expiration_timestamp_secs",
        }
        
        class properties:
            sender = schemas.StrSchema
            sequence_number = schemas.StrSchema
            max_gas_amount = schemas.StrSchema
            gas_unit_price = schemas.StrSchema
            expiration_timestamp_secs = schemas.StrSchema
            
            
            class payload(
                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 [
                            EntryFunctionPayloadRequest,
                            ScriptPayloadRequest,
                            ModuleBundlePayloadRequest,
                        ]
            
            
                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],
                ) -> 'payload':
                    return super().__new__(
                        cls,
                        *args,
                        _configuration=_configuration,
                        **kwargs,
                    )
            
            
            class secondary_signers(
                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,
                ) -> 'secondary_signers':
                    return super().__new__(
                        cls,
                        arg,
                        _configuration=_configuration,
                    )
            
                def __getitem__(self, i: int) -> MetaOapg.items:
                    return super().__getitem__(i)
            __annotations__ = {
                "sender": sender,
                "sequence_number": sequence_number,
                "max_gas_amount": max_gas_amount,
                "gas_unit_price": gas_unit_price,
                "expiration_timestamp_secs": expiration_timestamp_secs,
                "payload": payload,
                "secondary_signers": secondary_signers,
            }
    
    sequence_number: MetaOapg.properties.sequence_number
    secondary_signers: MetaOapg.properties.secondary_signers
    payload: MetaOapg.properties.payload
    sender: MetaOapg.properties.sender
    gas_unit_price: MetaOapg.properties.gas_unit_price
    max_gas_amount: MetaOapg.properties.max_gas_amount
    expiration_timestamp_secs: MetaOapg.properties.expiration_timestamp_secs
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["sender"]) -> MetaOapg.properties.sender: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["sequence_number"]) -> MetaOapg.properties.sequence_number: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["max_gas_amount"]) -> MetaOapg.properties.max_gas_amount: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["gas_unit_price"]) -> MetaOapg.properties.gas_unit_price: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["expiration_timestamp_secs"]) -> MetaOapg.properties.expiration_timestamp_secs: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["payload"]) -> MetaOapg.properties.payload: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["secondary_signers"]) -> MetaOapg.properties.secondary_signers: ...
    
    @typing.overload
    def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
    
    def __getitem__(self, name: typing.Union[typing_extensions.Literal["sender", "sequence_number", "max_gas_amount", "gas_unit_price", "expiration_timestamp_secs", "payload", "secondary_signers", ], str]):
        # dict_instance[name] accessor
        return super().__getitem__(name)
    
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["sender"]) -> MetaOapg.properties.sender: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["sequence_number"]) -> MetaOapg.properties.sequence_number: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["max_gas_amount"]) -> MetaOapg.properties.max_gas_amount: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["gas_unit_price"]) -> MetaOapg.properties.gas_unit_price: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["expiration_timestamp_secs"]) -> MetaOapg.properties.expiration_timestamp_secs: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["payload"]) -> MetaOapg.properties.payload: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["secondary_signers"]) -> MetaOapg.properties.secondary_signers: ...
    
    @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["sender", "sequence_number", "max_gas_amount", "gas_unit_price", "expiration_timestamp_secs", "payload", "secondary_signers", ], str]):
        return super().get_item_oapg(name)
    

    def __new__(
        cls,
        *args: typing.Union[dict, frozendict.frozendict, ],
        sequence_number: typing.Union[MetaOapg.properties.sequence_number, str, ],
        secondary_signers: typing.Union[MetaOapg.properties.secondary_signers, list, tuple, ],
        payload: typing.Union[MetaOapg.properties.payload, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ],
        sender: typing.Union[MetaOapg.properties.sender, str, ],
        gas_unit_price: typing.Union[MetaOapg.properties.gas_unit_price, str, ],
        max_gas_amount: typing.Union[MetaOapg.properties.max_gas_amount, str, ],
        expiration_timestamp_secs: typing.Union[MetaOapg.properties.expiration_timestamp_secs, 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],
    ) -> 'EncodeSubmissionRequest':
        return super().__new__(
            cls,
            *args,
            sequence_number=sequence_number,
            secondary_signers=secondary_signers,
            payload=payload,
            sender=sender,
            gas_unit_price=gas_unit_price,
            max_gas_amount=max_gas_amount,
            expiration_timestamp_secs=expiration_timestamp_secs,
            _configuration=_configuration,
            **kwargs,
        )

from openapi_aptos_api.model.entry_function_payload_request import EntryFunctionPayloadRequest
from openapi_aptos_api.model.module_bundle_payload_request import ModuleBundlePayloadRequest
from openapi_aptos_api.model.script_payload_request import ScriptPayloadRequest
