# Generated by smithplates HTTP codegen. Do not edit.

from __future__ import annotations

from datetime import datetime

from generated.example.image_asset import ImageAsset
from pydantic import BaseModel, TypeAdapter


class MediaAttachmentCaption(BaseModel):
    caption: str


class MediaAttachmentImage(BaseModel):
    image: ImageAsset


class MediaAttachmentArchivedAt(BaseModel):
    archivedAt: datetime


MediaAttachment = MediaAttachmentCaption | MediaAttachmentImage | MediaAttachmentArchivedAt


_MediaAttachment_ADAPTER = TypeAdapter(MediaAttachment)


def validate_media_attachment(value: object) -> MediaAttachment:
    return _MediaAttachment_ADAPTER.validate_python(value)
