# generated by datamodel-codegen:
#   filename:  auth/emailVerificationToken.json
#   timestamp: 2022-10-03T15:16:21+00:00

from __future__ import annotations

from enum import Enum
from typing import Optional

from pydantic import BaseModel, Extra, Field

from ..type import basic


class TokenStatus(Enum):
    STATUS_PENDING = 'STATUS_PENDING'
    STATUS_CONFIRMED = 'STATUS_CONFIRMED'


class TokenType(Enum):
    REFRESH_TOKEN = 'REFRESH_TOKEN'
    EMAIL_VERIFICATION = 'EMAIL_VERIFICATION'
    PASSWORD_RESET = 'PASSWORD_RESET'


class EmailVerificationToken(BaseModel):
    class Config:
        extra = Extra.forbid

    token: basic.Uuid = Field(..., description='Unique Refresh Token for user')
    userId: Optional[basic.Uuid] = Field(
        None, description=' User this email Verification token is given to'
    )
    tokenType: TokenType = Field(..., description='Token Type')
    tokenStatus: TokenStatus = Field(..., description='Refresh Count')
    expiryDate: basic.Timestamp = Field(
        ..., description='Expiry Date-Time of the token'
    )
