# coding: utf-8
"""
    InductivaWebAPI

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

    The version of the OpenAPI document: 0.1.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 inductiva.client import schemas  # noqa: F401


class TaskSubmittedInfo(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 = {
            "id",
            "is_terminated",
            "status",
        }

        class properties:
            id = schemas.StrSchema

            @staticmethod
            def status() -> typing.Type['TaskStatusCode']:
                return TaskStatusCode

            is_terminated = schemas.BoolSchema

            class position_in_queue(
                    schemas.ComposedSchema,):

                class MetaOapg:
                    any_of_1 = schemas.NoneSchema

                    @classmethod
                    @functools.lru_cache()
                    def any_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 [
                            TaskPositionInQueue,
                            cls.any_of_1,
                        ]

                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],
                ) -> 'position_in_queue':
                    return super().__new__(
                        cls,
                        *_args,
                        _configuration=_configuration,
                        **kwargs,
                    )

            class time_to_live_seconds(
                    schemas.ComposedSchema,):

                class MetaOapg:
                    any_of_0 = schemas.NumberSchema
                    any_of_1 = schemas.NoneSchema

                    @classmethod
                    @functools.lru_cache()
                    def any_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 [
                            cls.any_of_0,
                            cls.any_of_1,
                        ]

                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],
                ) -> 'time_to_live_seconds':
                    return super().__new__(
                        cls,
                        *_args,
                        _configuration=_configuration,
                        **kwargs,
                    )

            __annotations__ = {
                "id": id,
                "status": status,
                "is_terminated": is_terminated,
                "position_in_queue": position_in_queue,
                "time_to_live_seconds": time_to_live_seconds,
            }

    id: MetaOapg.properties.id
    is_terminated: MetaOapg.properties.is_terminated
    status: 'TaskStatusCode'

    @typing.overload
    def __getitem__(
            self,
            name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id:
        ...

    @typing.overload
    def __getitem__(
            self,
            name: typing_extensions.Literal["status"]) -> 'TaskStatusCode':
        ...

    @typing.overload
    def __getitem__(
        self, name: typing_extensions.Literal["is_terminated"]
    ) -> MetaOapg.properties.is_terminated:
        ...

    @typing.overload
    def __getitem__(
        self, name: typing_extensions.Literal["position_in_queue"]
    ) -> MetaOapg.properties.position_in_queue:
        ...

    @typing.overload
    def __getitem__(
        self, name: typing_extensions.Literal["time_to_live_seconds"]
    ) -> MetaOapg.properties.time_to_live_seconds:
        ...

    @typing.overload
    def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema:
        ...

    def __getitem__(self, name: typing.Union[typing_extensions.Literal[
        "id",
        "status",
        "is_terminated",
        "position_in_queue",
        "time_to_live_seconds",
    ], str]):
        # dict_instance[name] accessor
        return super().__getitem__(name)

    @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["status"]) -> 'TaskStatusCode':
        ...

    @typing.overload
    def get_item_oapg(
        self, name: typing_extensions.Literal["is_terminated"]
    ) -> MetaOapg.properties.is_terminated:
        ...

    @typing.overload
    def get_item_oapg(
        self, name: typing_extensions.Literal["position_in_queue"]
    ) -> typing.Union[MetaOapg.properties.position_in_queue, schemas.Unset]:
        ...

    @typing.overload
    def get_item_oapg(
        self, name: typing_extensions.Literal["time_to_live_seconds"]
    ) -> typing.Union[MetaOapg.properties.time_to_live_seconds, 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[
        "id",
        "status",
        "is_terminated",
        "position_in_queue",
        "time_to_live_seconds",
    ], str]):
        return super().get_item_oapg(name)

    def __new__(
        cls,
        *_args: typing.Union[
            dict,
            frozendict.frozendict,
        ],
        id: typing.Union[
            MetaOapg.properties.id,
            str,
        ],
        is_terminated: typing.Union[
            MetaOapg.properties.is_terminated,
            bool,
        ],
        status: 'TaskStatusCode',
        position_in_queue: typing.Union[MetaOapg.properties.position_in_queue,
                                        dict, frozendict.frozendict, str, date,
                                        datetime, uuid.UUID, int, float,
                                        decimal.Decimal, bool, None, list,
                                        tuple, bytes, io.FileIO,
                                        io.BufferedReader,
                                        schemas.Unset] = schemas.unset,
        time_to_live_seconds: typing.Union[
            MetaOapg.properties.time_to_live_seconds, dict,
            frozendict.frozendict, str, date, datetime, uuid.UUID, int, float,
            decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO,
            io.BufferedReader, 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],
    ) -> 'TaskSubmittedInfo':
        return super().__new__(
            cls,
            *_args,
            id=id,
            is_terminated=is_terminated,
            status=status,
            position_in_queue=position_in_queue,
            time_to_live_seconds=time_to_live_seconds,
            _configuration=_configuration,
            **kwargs,
        )


from inductiva.client.model.task_position_in_queue import TaskPositionInQueue
from inductiva.client.model.task_status_code import TaskStatusCode
