# coding: utf-8

"""
    OneLogin API

    OpenAPI Specification for OneLogin  # noqa: E501

    The version of the OpenAPI document: 3.1.1
    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 onelogin import schemas  # noqa: F401


class MessageTemplate(
    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 = {
            "template",
            "locale",
            "type",
        }
        
        class properties:
            
            
            class type(
                schemas.EnumBase,
                schemas.StrSchema
            ):
            
            
                class MetaOapg:
                    enum_value_to_name = {
                        "email_forgot_password": "EMAIL_FORGOT_PASSWORD",
                        "email_code_registration": "EMAIL_CODE_REGISTRATION",
                        "email_code_login_verification": "EMAIL_CODE_LOGIN_VERIFICATION",
                        "email_code_app_verification": "EMAIL_CODE_APP_VERIFICATION",
                        "email_code_pw_reset_verification": "EMAIL_CODE_PW_RESET_VERIFICATION",
                        "email_magiclink_registration": "EMAIL_MAGICLINK_REGISTRATION",
                        "email_magiclink_login_verification": "EMAIL_MAGICLINK_LOGIN_VERIFICATION",
                        "email_magiclink_app_verification": "EMAIL_MAGICLINK_APP_VERIFICATION",
                        "email_magiclink_pw_reset_verification": "EMAIL_MAGICLINK_PW_RESET_VERIFICATION",
                        "sms_registration": "SMS_REGISTRATION",
                        "sms_login_verification": "SMS_LOGIN_VERIFICATION",
                        "sms_app_verification": "SMS_APP_VERIFICATION",
                        "sms_pw_reset_verification": "SMS_PW_RESET_VERIFICATION",
                    }
                
                @schemas.classproperty
                def EMAIL_FORGOT_PASSWORD(cls):
                    return cls("email_forgot_password")
                
                @schemas.classproperty
                def EMAIL_CODE_REGISTRATION(cls):
                    return cls("email_code_registration")
                
                @schemas.classproperty
                def EMAIL_CODE_LOGIN_VERIFICATION(cls):
                    return cls("email_code_login_verification")
                
                @schemas.classproperty
                def EMAIL_CODE_APP_VERIFICATION(cls):
                    return cls("email_code_app_verification")
                
                @schemas.classproperty
                def EMAIL_CODE_PW_RESET_VERIFICATION(cls):
                    return cls("email_code_pw_reset_verification")
                
                @schemas.classproperty
                def EMAIL_MAGICLINK_REGISTRATION(cls):
                    return cls("email_magiclink_registration")
                
                @schemas.classproperty
                def EMAIL_MAGICLINK_LOGIN_VERIFICATION(cls):
                    return cls("email_magiclink_login_verification")
                
                @schemas.classproperty
                def EMAIL_MAGICLINK_APP_VERIFICATION(cls):
                    return cls("email_magiclink_app_verification")
                
                @schemas.classproperty
                def EMAIL_MAGICLINK_PW_RESET_VERIFICATION(cls):
                    return cls("email_magiclink_pw_reset_verification")
                
                @schemas.classproperty
                def SMS_REGISTRATION(cls):
                    return cls("sms_registration")
                
                @schemas.classproperty
                def SMS_LOGIN_VERIFICATION(cls):
                    return cls("sms_login_verification")
                
                @schemas.classproperty
                def SMS_APP_VERIFICATION(cls):
                    return cls("sms_app_verification")
                
                @schemas.classproperty
                def SMS_PW_RESET_VERIFICATION(cls):
                    return cls("sms_pw_reset_verification")
            
            
            class locale(
                schemas.StrSchema
            ):
            
            
                class MetaOapg:
                    regex=[{
                        'pattern': r'^[a-z]{2}$',  # noqa: E501
                    }]
            
            
            class template(
                schemas.ComposedSchema,
            ):
            
            
                class MetaOapg:
                    
                    
                    class one_of_0(
                        schemas.DictSchema
                    ):
                    
                    
                        class MetaOapg:
                            required = {
                                "plain",
                                "subject",
                                "html",
                            }
                            
                            class properties:
                                subject = schemas.StrSchema
                                html = schemas.StrSchema
                                plain = schemas.StrSchema
                                __annotations__ = {
                                    "subject": subject,
                                    "html": html,
                                    "plain": plain,
                                }
                        
                        plain: MetaOapg.properties.plain
                        subject: MetaOapg.properties.subject
                        html: MetaOapg.properties.html
                        
                        @typing.overload
                        def __getitem__(self, name: typing_extensions.Literal["subject"]) -> MetaOapg.properties.subject: ...
                        
                        @typing.overload
                        def __getitem__(self, name: typing_extensions.Literal["html"]) -> MetaOapg.properties.html: ...
                        
                        @typing.overload
                        def __getitem__(self, name: typing_extensions.Literal["plain"]) -> MetaOapg.properties.plain: ...
                        
                        @typing.overload
                        def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
                        
                        def __getitem__(self, name: typing.Union[typing_extensions.Literal["subject", "html", "plain", ], str]):
                            # dict_instance[name] accessor
                            return super().__getitem__(name)
                        
                        
                        @typing.overload
                        def get_item_oapg(self, name: typing_extensions.Literal["subject"]) -> MetaOapg.properties.subject: ...
                        
                        @typing.overload
                        def get_item_oapg(self, name: typing_extensions.Literal["html"]) -> MetaOapg.properties.html: ...
                        
                        @typing.overload
                        def get_item_oapg(self, name: typing_extensions.Literal["plain"]) -> MetaOapg.properties.plain: ...
                        
                        @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["subject", "html", "plain", ], str]):
                            return super().get_item_oapg(name)
                        
                    
                        def __new__(
                            cls,
                            *_args: typing.Union[dict, frozendict.frozendict, ],
                            plain: typing.Union[MetaOapg.properties.plain, str, ],
                            subject: typing.Union[MetaOapg.properties.subject, str, ],
                            html: typing.Union[MetaOapg.properties.html, 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],
                        ) -> 'one_of_0':
                            return super().__new__(
                                cls,
                                *_args,
                                plain=plain,
                                subject=subject,
                                html=html,
                                _configuration=_configuration,
                                **kwargs,
                            )
                    
                    
                    class one_of_1(
                        schemas.DictSchema
                    ):
                    
                    
                        class MetaOapg:
                            required = {
                                "message",
                            }
                            
                            class properties:
                                
                                
                                class message(
                                    schemas.StrSchema
                                ):
                                
                                
                                    class MetaOapg:
                                        max_length = 160
                                __annotations__ = {
                                    "message": message,
                                }
                        
                        message: MetaOapg.properties.message
                        
                        @typing.overload
                        def __getitem__(self, name: typing_extensions.Literal["message"]) -> MetaOapg.properties.message: ...
                        
                        @typing.overload
                        def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
                        
                        def __getitem__(self, name: typing.Union[typing_extensions.Literal["message", ], str]):
                            # dict_instance[name] accessor
                            return super().__getitem__(name)
                        
                        
                        @typing.overload
                        def get_item_oapg(self, name: typing_extensions.Literal["message"]) -> MetaOapg.properties.message: ...
                        
                        @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["message", ], str]):
                            return super().get_item_oapg(name)
                        
                    
                        def __new__(
                            cls,
                            *_args: typing.Union[dict, frozendict.frozendict, ],
                            message: typing.Union[MetaOapg.properties.message, 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],
                        ) -> 'one_of_1':
                            return super().__new__(
                                cls,
                                *_args,
                                message=message,
                                _configuration=_configuration,
                                **kwargs,
                            )
                    
                    @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 [
                            cls.one_of_0,
                            cls.one_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],
                ) -> 'template':
                    return super().__new__(
                        cls,
                        *_args,
                        _configuration=_configuration,
                        **kwargs,
                    )
            id = schemas.IntSchema
            account_id = schemas.IntSchema
            template_class = schemas.StrSchema
            updated_at = schemas.StrSchema
            brand_id = schemas.IntSchema
            __annotations__ = {
                "type": type,
                "locale": locale,
                "template": template,
                "id": id,
                "account_id": account_id,
                "template_class": template_class,
                "updated_at": updated_at,
                "brand_id": brand_id,
            }
    
    template: MetaOapg.properties.template
    locale: MetaOapg.properties.locale
    type: MetaOapg.properties.type
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["type"]) -> MetaOapg.properties.type: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["locale"]) -> MetaOapg.properties.locale: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["template"]) -> MetaOapg.properties.template: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["account_id"]) -> MetaOapg.properties.account_id: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["template_class"]) -> MetaOapg.properties.template_class: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["updated_at"]) -> MetaOapg.properties.updated_at: ...
    
    @typing.overload
    def __getitem__(self, name: typing_extensions.Literal["brand_id"]) -> MetaOapg.properties.brand_id: ...
    
    @typing.overload
    def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
    
    def __getitem__(self, name: typing.Union[typing_extensions.Literal["type", "locale", "template", "id", "account_id", "template_class", "updated_at", "brand_id", ], 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["locale"]) -> MetaOapg.properties.locale: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["template"]) -> MetaOapg.properties.template: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["account_id"]) -> typing.Union[MetaOapg.properties.account_id, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["template_class"]) -> typing.Union[MetaOapg.properties.template_class, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["updated_at"]) -> typing.Union[MetaOapg.properties.updated_at, schemas.Unset]: ...
    
    @typing.overload
    def get_item_oapg(self, name: typing_extensions.Literal["brand_id"]) -> typing.Union[MetaOapg.properties.brand_id, 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["type", "locale", "template", "id", "account_id", "template_class", "updated_at", "brand_id", ], str]):
        return super().get_item_oapg(name)
    

    def __new__(
        cls,
        *_args: typing.Union[dict, frozendict.frozendict, ],
        template: typing.Union[MetaOapg.properties.template, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, ],
        locale: typing.Union[MetaOapg.properties.locale, str, ],
        type: typing.Union[MetaOapg.properties.type, str, ],
        id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset,
        account_id: typing.Union[MetaOapg.properties.account_id, decimal.Decimal, int, schemas.Unset] = schemas.unset,
        template_class: typing.Union[MetaOapg.properties.template_class, str, schemas.Unset] = schemas.unset,
        updated_at: typing.Union[MetaOapg.properties.updated_at, str, schemas.Unset] = schemas.unset,
        brand_id: typing.Union[MetaOapg.properties.brand_id, decimal.Decimal, int, 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],
    ) -> 'MessageTemplate':
        return super().__new__(
            cls,
            *_args,
            template=template,
            locale=locale,
            type=type,
            id=id,
            account_id=account_id,
            template_class=template_class,
            updated_at=updated_at,
            brand_id=brand_id,
            _configuration=_configuration,
            **kwargs,
        )
