"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from polar_sdk.types import BaseModel
from polar_sdk.utils import FieldMetadata, validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import Literal
from typing_extensions import Annotated, TypedDict


class RefreshTokenRequestTypedDict(TypedDict):
    client_id: str
    client_secret: str
    refresh_token: str
    grant_type: Literal["refresh_token"]


class RefreshTokenRequest(BaseModel):
    client_id: Annotated[str, FieldMetadata(form=True)]

    client_secret: Annotated[str, FieldMetadata(form=True)]

    refresh_token: Annotated[str, FieldMetadata(form=True)]

    GRANT_TYPE: Annotated[
        Annotated[
            Literal["refresh_token"], AfterValidator(validate_const("refresh_token"))
        ],
        pydantic.Field(alias="grant_type"),
        FieldMetadata(form=True),
    ] = "refresh_token"
