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

from __future__ import annotations
from .contact import Contact, ContactTypedDict
from .contactresponse import ContactResponse, ContactResponseTypedDict
from .errorresponse import ErrorResponse, ErrorResponseTypedDict
from postivo_client.types import BaseModel
from postivo_client.utils import FieldMetadata, PathParamMetadata, RequestMetadata
import pydantic
from typing import Dict, List, Union
from typing_extensions import Annotated, TypeAliasType, TypedDict


class UpdateContactByExternalIDRequestTypedDict(TypedDict):
    ext_id_param: str
    r"""External (custom) ID of the contact to update."""
    contact: ContactTypedDict
    r"""A `Contact` object with the updated fields."""


class UpdateContactByExternalIDRequest(BaseModel):
    ext_id_param: Annotated[
        str,
        pydantic.Field(alias="ext_id"),
        FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
    ]
    r"""External (custom) ID of the contact to update."""

    contact: Annotated[
        Contact, FieldMetadata(request=RequestMetadata(media_type="application/json"))
    ]
    r"""A `Contact` object with the updated fields."""


UpdateContactByExternalIDResponseResultTypedDict = TypeAliasType(
    "UpdateContactByExternalIDResponseResultTypedDict",
    Union[ErrorResponseTypedDict, ContactResponseTypedDict],
)


UpdateContactByExternalIDResponseResult = TypeAliasType(
    "UpdateContactByExternalIDResponseResult", Union[ErrorResponse, ContactResponse]
)


class UpdateContactByExternalIDResponseTypedDict(TypedDict):
    headers: Dict[str, List[str]]
    result: UpdateContactByExternalIDResponseResultTypedDict


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

    result: UpdateContactByExternalIDResponseResult
