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

from __future__ import annotations
import pydantic
from pydantic.functional_validators import AfterValidator
from r9s.types import BaseModel
from r9s.utils import validate_const
from typing import Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class AnthropicContentBlockStopContentBlockTypedDict(TypedDict):
    r"""Optional content block metadata"""


class AnthropicContentBlockStopContentBlock(BaseModel):
    r"""Optional content block metadata"""


class AnthropicContentBlockStopTypedDict(TypedDict):
    index: int
    type: Literal["content_block_stop"]
    content_block: NotRequired[AnthropicContentBlockStopContentBlockTypedDict]
    r"""Optional content block metadata"""


class AnthropicContentBlockStop(BaseModel):
    index: int

    TYPE: Annotated[
        Annotated[
            Literal["content_block_stop"],
            AfterValidator(validate_const("content_block_stop")),
        ],
        pydantic.Field(alias="type"),
    ] = "content_block_stop"

    content_block: Optional[AnthropicContentBlockStopContentBlock] = None
    r"""Optional content block metadata"""
