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

from __future__ import annotations
from novu_py.types import BaseModel
from novu_py.utils import (
    FieldMetadata,
    HeaderMetadata,
    PathParamMetadata,
    QueryParamMetadata,
)
import pydantic
from typing import Any, Dict, List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


class SubscribersV1ControllerChatOauthCallbackRequestTypedDict(TypedDict):
    subscriber_id: str
    provider_id: Any
    hmac_hash: str
    r"""HMAC hash for the request"""
    environment_id: str
    r"""The ID of the environment, must be a valid MongoDB ID"""
    code: str
    r"""Optional authorization code returned from the OAuth provider"""
    integration_identifier: NotRequired[str]
    r"""Optional integration identifier"""
    idempotency_key: NotRequired[str]
    r"""A header for idempotency purposes"""


class SubscribersV1ControllerChatOauthCallbackRequest(BaseModel):
    subscriber_id: Annotated[
        str,
        pydantic.Field(alias="subscriberId"),
        FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
    ]

    provider_id: Annotated[
        Any,
        pydantic.Field(alias="providerId"),
        FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
    ]

    hmac_hash: Annotated[
        str,
        pydantic.Field(alias="hmacHash"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ]
    r"""HMAC hash for the request"""

    environment_id: Annotated[
        str,
        pydantic.Field(alias="environmentId"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ]
    r"""The ID of the environment, must be a valid MongoDB ID"""

    code: Annotated[
        str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
    ]
    r"""Optional authorization code returned from the OAuth provider"""

    integration_identifier: Annotated[
        Optional[str],
        pydantic.Field(alias="integrationIdentifier"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Optional integration identifier"""

    idempotency_key: Annotated[
        Optional[str],
        pydantic.Field(alias="idempotency-key"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""A header for idempotency purposes"""


SubscribersV1ControllerChatOauthCallbackResponseResultTypedDict = TypeAliasType(
    "SubscribersV1ControllerChatOauthCallbackResponseResultTypedDict", Union[str, str]
)


SubscribersV1ControllerChatOauthCallbackResponseResult = TypeAliasType(
    "SubscribersV1ControllerChatOauthCallbackResponseResult", Union[str, str]
)


class SubscribersV1ControllerChatOauthCallbackResponseTypedDict(TypedDict):
    headers: Dict[str, List[str]]
    result: SubscribersV1ControllerChatOauthCallbackResponseResultTypedDict


class SubscribersV1ControllerChatOauthCallbackResponse(BaseModel):
    headers: Dict[str, List[str]]

    result: SubscribersV1ControllerChatOauthCallbackResponseResult
