# generated by datamodel-codegen:
#   filename:  auth/refreshToken.json
#   timestamp: 2022-10-04T14:49:18+00:00

from __future__ import annotations

from typing import Optional

from pydantic import BaseModel, Extra, Field

from ..type import basic
from . import emailVerificationToken


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

    token: basic.Uuid = Field(..., description='Unique Refresh Token for user')
    userId: basic.Uuid = Field(
        ..., description='User Id of the User this refresh token is given to'
    )
    tokenType: Optional[emailVerificationToken.TokenType] = Field(
        TokenType.REFRESH_TOKEN, description='Token Type'
    )
    refreshCount: Optional[int] = Field(None, description='Refresh Count')
    maxRefreshCount: Optional[int] = Field(None, description='Refresh Count')
    expiryDate: basic.Timestamp = Field(
        ..., description='Expiry Date-Time of the token'
    )
