# 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 TaskWithUserInfo(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 = {
            "method_name",
            "task_id",
            "user",
            "status",
        }

        class properties:
            task_id = schemas.StrSchema

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

            method_name = schemas.StrSchema

            @staticmethod
            def user() -> typing.Type['Username']:
                return Username

            class create_time(
                    schemas.DateTimeBase,
                    schemas.ComposedSchema,
            ):

                class MetaOapg:
                    format = 'date-time'
                    any_of_0 = schemas.StrSchema
                    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],
                ) -> 'create_time':
                    return super().__new__(
                        cls,
                        *_args,
                        _configuration=_configuration,
                        **kwargs,
                    )

            class input_submit_time(
                    schemas.DateTimeBase,
                    schemas.ComposedSchema,
            ):

                class MetaOapg:
                    format = 'date-time'
                    any_of_0 = schemas.StrSchema
                    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],
                ) -> 'input_submit_time':
                    return super().__new__(
                        cls,
                        *_args,
                        _configuration=_configuration,
                        **kwargs,
                    )

            class start_time(
                    schemas.DateTimeBase,
                    schemas.ComposedSchema,
            ):

                class MetaOapg:
                    format = 'date-time'
                    any_of_0 = schemas.StrSchema
                    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],
                ) -> 'start_time':
                    return super().__new__(
                        cls,
                        *_args,
                        _configuration=_configuration,
                        **kwargs,
                    )

            class end_time(
                    schemas.DateTimeBase,
                    schemas.ComposedSchema,
            ):

                class MetaOapg:
                    format = 'date-time'
                    any_of_0 = schemas.StrSchema
                    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],
                ) -> 'end_time':
                    return super().__new__(
                        cls,
                        *_args,
                        _configuration=_configuration,
                        **kwargs,
                    )

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

            __annotations__ = {
                "task_id": task_id,
                "status": status,
                "method_name": method_name,
                "user": user,
                "create_time": create_time,
                "input_submit_time": input_submit_time,
                "start_time": start_time,
                "end_time": end_time,
                "executer": executer,
            }

    method_name: MetaOapg.properties.method_name
    task_id: MetaOapg.properties.task_id
    user: 'Username'
    status: 'TaskStatusCode'

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

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

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

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

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

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

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

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

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

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

    def __getitem__(self, name: typing.Union[typing_extensions.Literal[
        "task_id",
        "status",
        "method_name",
        "user",
        "create_time",
        "input_submit_time",
        "start_time",
        "end_time",
        "executer",
    ], str]):
        # dict_instance[name] accessor
        return super().__getitem__(name)

    @typing.overload
    def get_item_oapg(
        self, name: typing_extensions.Literal["task_id"]
    ) -> MetaOapg.properties.task_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["method_name"]
    ) -> MetaOapg.properties.method_name:
        ...

    @typing.overload
    def get_item_oapg(self,
                      name: typing_extensions.Literal["user"]) -> 'Username':
        ...

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

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

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

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

    @typing.overload
    def get_item_oapg(
        self, name: typing_extensions.Literal["executer"]
    ) -> typing.Union[MetaOapg.properties.executer, 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[
        "task_id",
        "status",
        "method_name",
        "user",
        "create_time",
        "input_submit_time",
        "start_time",
        "end_time",
        "executer",
    ], str]):
        return super().get_item_oapg(name)

    def __new__(
        cls,
        *_args: typing.Union[
            dict,
            frozendict.frozendict,
        ],
        method_name: typing.Union[
            MetaOapg.properties.method_name,
            str,
        ],
        task_id: typing.Union[
            MetaOapg.properties.task_id,
            str,
        ],
        user: 'Username',
        status: 'TaskStatusCode',
        create_time: typing.Union[MetaOapg.properties.create_time, 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,
        input_submit_time: typing.Union[MetaOapg.properties.input_submit_time,
                                        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,
        start_time: typing.Union[MetaOapg.properties.start_time, 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,
        end_time: typing.Union[MetaOapg.properties.end_time, 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,
        executer: typing.Union[MetaOapg.properties.executer, 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],
    ) -> 'TaskWithUserInfo':
        return super().__new__(
            cls,
            *_args,
            method_name=method_name,
            task_id=task_id,
            user=user,
            status=status,
            create_time=create_time,
            input_submit_time=input_submit_time,
            start_time=start_time,
            end_time=end_time,
            executer=executer,
            _configuration=_configuration,
            **kwargs,
        )


from inductiva.client.model.executer import Executer
from inductiva.client.model.task_status_code import TaskStatusCode
from inductiva.client.model.username import Username
