# generated by datamodel-codegen:
#   filename:  msgspec_payload_runtime_compatibility.json
#   timestamp: 2019-07-26T00:00:00+00:00

from __future__ import annotations

from typing import Any, Literal

from pydantic import BaseModel, Field


class Event(BaseModel):
    type: Literal['message.created']
    id: str


class Event1(BaseModel):
    type: Literal['message.failed']
    reason: str


class StatusCode(BaseModel):
    code: Literal[7]
    value: int


class StatusCode1(BaseModel):
    code: Literal[8]
    message: str


class Flagged(BaseModel):
    flag: Literal[True]
    name: str


class Flagged1(BaseModel):
    flag: Literal[False]
    count: int


class PartialTagged(BaseModel):
    kind: Literal['alpha']
    value: str


class PartialTagged1(BaseModel):
    kind: Literal['beta']
    count: int


class OptionalTagged(BaseModel):
    mode: Literal['alpha']
    name: str


class OptionalTagged1(BaseModel):
    mode: Literal['beta'] | None = None
    count: int


class RefCreated(BaseModel):
    kind: Literal['ref.created']
    id: str


class RefFailed(BaseModel):
    kind: Literal['ref.failed']
    reason: str


class Payload(BaseModel):
    schemaVersion: Literal['1.0.0']
    negated: Literal[True] | None = None
    event: Event | Event1
    statusCode: StatusCode | StatusCode1
    flagged: Flagged | Flagged1
    partialTagged: PartialTagged | PartialTagged1 | dict[str, Any]
    optionalTagged: OptionalTagged | OptionalTagged1
    refEvent: RefCreated | RefFailed = Field(..., discriminator='kind')
