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

from __future__ import annotations
from enum import Enum
from polar_sdk.types import BaseModel
from polar_sdk.utils import FieldMetadata
import pydantic
from typing import Final, TypedDict
from typing_extensions import Annotated


class Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType(str, Enum):
    REFRESH_TOKEN = "refresh_token"


class Onev11oauth21tokenPostXComponentsRefreshTokenRequestTypedDict(TypedDict):
    client_id: str
    client_secret: str
    refresh_token: str
    grant_type: Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType


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

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

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

    # fmt: off
    GRANT_TYPE: Annotated[Final[Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType], pydantic.Field(alias="grant_type"), FieldMetadata(form=True)] = Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType.REFRESH_TOKEN # type: ignore
    # fmt: on
