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

from __future__ import annotations
from .oauthrefreshtokencredentials import (
    OAuthRefreshTokenCredentials,
    OAuthRefreshTokenCredentialsTypedDict,
)
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 AuthenticatorSalesforceConnectionTypedDict(TypedDict):
    user_email: str
    r"""The email of the Salesforce account this is for"""
    url: str
    r"""The url of your Salesforce instance, where you go to login."""
    credentials: OAuthRefreshTokenCredentialsTypedDict
    provider: Literal["salesforce"]


class AuthenticatorSalesforceConnection(BaseModel):
    user_email: str
    r"""The email of the Salesforce account this is for"""

    url: str
    r"""The url of your Salesforce instance, where you go to login."""

    credentials: OAuthRefreshTokenCredentials

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