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

from __future__ import annotations
from .oauthrefreshtokencredentials import (
    OAuthRefreshTokenCredentials,
    OAuthRefreshTokenCredentialsTypedDict,
)
from .onedrivedata import OnedriveData, OnedriveDataTypedDict
import pydantic
from pydantic.functional_validators import AfterValidator
from ragie.types import BaseModel
from ragie.utils import validate_const
from typing import Literal
from typing_extensions import Annotated, TypedDict


class AuthenticatorOnedriveConnectionTypedDict(TypedDict):
    data: OnedriveDataTypedDict
    user_email: str
    r"""The email of the Onedrive account this is for"""
    credentials: OAuthRefreshTokenCredentialsTypedDict
    provider: Literal["onedrive"]


class AuthenticatorOnedriveConnection(BaseModel):
    data: OnedriveData

    user_email: str
    r"""The email of the Onedrive account this is for"""

    credentials: OAuthRefreshTokenCredentials

    PROVIDER: Annotated[
        Annotated[Literal["onedrive"], AfterValidator(validate_const("onedrive"))],
        pydantic.Field(alias="provider"),
    ] = "onedrive"
