# 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 User(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 = {
            "terms_and_conditions_decision",
            "campaigns",
            "tier",
            "total_available_credits",
            "email",
            "username",
        }

        class properties:
            username = schemas.StrSchema
            email = schemas.StrSchema

            @staticmethod
            def terms_and_conditions_decision(
            ) -> typing.Type['TermsAndConditions']:
                return TermsAndConditions

            total_available_credits = schemas.NumberSchema

            @staticmethod
            def tier() -> typing.Type['Tier']:
                return Tier

            class campaigns(schemas.ListSchema):

                class MetaOapg:

                    @staticmethod
                    def items() -> typing.Type['UserCampaign']:
                        return UserCampaign

                def __new__(
                    cls,
                    _arg: typing.Union[typing.Tuple['UserCampaign'],
                                       typing.List['UserCampaign']],
                    _configuration: typing.Optional[
                        schemas.Configuration] = None,
                ) -> 'campaigns':
                    return super().__new__(
                        cls,
                        _arg,
                        _configuration=_configuration,
                    )

                def __getitem__(self, i: int) -> 'UserCampaign':
                    return super().__getitem__(i)

            class name(
                    schemas.ComposedSchema,):

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

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

            credits_currency = schemas.StrSchema
            __annotations__ = {
                "username":
                    username,
                "email":
                    email,
                "terms_and_conditions_decision":
                    terms_and_conditions_decision,
                "total_available_credits":
                    total_available_credits,
                "tier":
                    tier,
                "campaigns":
                    campaigns,
                "name":
                    name,
                "terms_and_conditions_decision_ts":
                    terms_and_conditions_decision_ts,
                "credits_currency":
                    credits_currency,
            }

    terms_and_conditions_decision: 'TermsAndConditions'
    campaigns: MetaOapg.properties.campaigns
    tier: 'Tier'
    total_available_credits: MetaOapg.properties.total_available_credits
    email: MetaOapg.properties.email
    username: MetaOapg.properties.username

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

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

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

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

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

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

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

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

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

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

    def __getitem__(self, name: typing.Union[typing_extensions.Literal[
        "username",
        "email",
        "terms_and_conditions_decision",
        "total_available_credits",
        "tier",
        "campaigns",
        "name",
        "terms_and_conditions_decision_ts",
        "credits_currency",
    ], str]):
        # dict_instance[name] accessor
        return super().__getitem__(name)

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

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

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

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

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

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

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

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

    @typing.overload
    def get_item_oapg(
        self, name: typing_extensions.Literal["credits_currency"]
    ) -> typing.Union[MetaOapg.properties.credits_currency, 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[
        "username",
        "email",
        "terms_and_conditions_decision",
        "total_available_credits",
        "tier",
        "campaigns",
        "name",
        "terms_and_conditions_decision_ts",
        "credits_currency",
    ], str]):
        return super().get_item_oapg(name)

    def __new__(
        cls,
        *_args: typing.Union[
            dict,
            frozendict.frozendict,
        ],
        terms_and_conditions_decision: 'TermsAndConditions',
        campaigns: typing.Union[
            MetaOapg.properties.campaigns,
            list,
            tuple,
        ],
        tier: 'Tier',
        total_available_credits: typing.Union[
            MetaOapg.properties.total_available_credits,
            decimal.Decimal,
            int,
            float,
        ],
        email: typing.Union[
            MetaOapg.properties.email,
            str,
        ],
        username: typing.Union[
            MetaOapg.properties.username,
            str,
        ],
        name: typing.Union[MetaOapg.properties.name, 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,
        terms_and_conditions_decision_ts: typing.Union[
            MetaOapg.properties.terms_and_conditions_decision_ts, 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,
        credits_currency: typing.Union[MetaOapg.properties.credits_currency,
                                       str, 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],
    ) -> 'User':
        return super().__new__(
            cls,
            *_args,
            terms_and_conditions_decision=terms_and_conditions_decision,
            campaigns=campaigns,
            tier=tier,
            total_available_credits=total_available_credits,
            email=email,
            username=username,
            name=name,
            terms_and_conditions_decision_ts=terms_and_conditions_decision_ts,
            credits_currency=credits_currency,
            _configuration=_configuration,
            **kwargs,
        )


from inductiva.client.model.terms_and_conditions import TermsAndConditions
from inductiva.client.model.tier import Tier
from inductiva.client.model.user_campaign import UserCampaign
