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

from __future__ import annotations
from outpost_sdk.types import BaseModel, UNSET_SENTINEL
from outpost_sdk.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
from pydantic import model_serializer
from typing import List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


GetTenantDestinationAttemptIncludeTypedDict = TypeAliasType(
    "GetTenantDestinationAttemptIncludeTypedDict", Union[str, List[str]]
)
r"""Fields to include in the response. Use bracket notation for multiple values (e.g., `include[0]=event&include[1]=response_data`).
- `event`: Include event summary
- `event.data`: Include full event with payload data
- `response_data`: Include response body and headers
- `destination`: Include the full destination object

"""


GetTenantDestinationAttemptInclude = TypeAliasType(
    "GetTenantDestinationAttemptInclude", Union[str, List[str]]
)
r"""Fields to include in the response. Use bracket notation for multiple values (e.g., `include[0]=event&include[1]=response_data`).
- `event`: Include event summary
- `event.data`: Include full event with payload data
- `response_data`: Include response body and headers
- `destination`: Include the full destination object

"""


class GetTenantDestinationAttemptRequestTypedDict(TypedDict):
    tenant_id: str
    r"""The ID of the tenant. Required when using AdminApiKey authentication."""
    destination_id: str
    r"""The ID of the destination."""
    attempt_id: str
    r"""The ID of the attempt."""
    include: NotRequired[GetTenantDestinationAttemptIncludeTypedDict]
    r"""Fields to include in the response. Use bracket notation for multiple values (e.g., `include[0]=event&include[1]=response_data`).
    - `event`: Include event summary
    - `event.data`: Include full event with payload data
    - `response_data`: Include response body and headers
    - `destination`: Include the full destination object

    """


class GetTenantDestinationAttemptRequest(BaseModel):
    tenant_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The ID of the tenant. Required when using AdminApiKey authentication."""

    destination_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The ID of the destination."""

    attempt_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The ID of the attempt."""

    include: Annotated[
        Optional[GetTenantDestinationAttemptInclude],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""Fields to include in the response. Use bracket notation for multiple values (e.g., `include[0]=event&include[1]=response_data`).
    - `event`: Include event summary
    - `event.data`: Include full event with payload data
    - `response_data`: Include response body and headers
    - `destination`: Include the full destination object

    """

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["include"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m
