# 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 msgspec import UNSET, Struct, UnsetType


class Event(Struct, tag_field='type', tag='message.created'):
    id: str


class Event1(Struct, tag_field='type', tag='message.failed'):
    reason: str


class StatusCode(Struct, tag_field='code', tag=7):
    value: int


class StatusCode1(Struct, tag_field='code', tag=8):
    message: str


class Flagged(Struct):
    flag: bool
    name: str


class Flagged1(Struct):
    flag: bool
    count: int


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


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


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


class OptionalTagged1(Struct):
    count: int
    mode: Literal['beta'] | UnsetType = UNSET


class RefCreated(Struct, tag_field='kind', tag='ref.created'):
    id: str


class RefFailed(Struct, tag_field='kind', tag='ref.failed'):
    reason: str


class Payload(Struct):
    schemaVersion: Literal['1.0.0']
    event: Event | Event1
    statusCode: StatusCode | StatusCode1
    flagged: Flagged | Flagged1
    partialTagged: PartialTagged | PartialTagged1 | dict[str, Any]
    optionalTagged: OptionalTagged | OptionalTagged1
    refEvent: RefCreated | RefFailed
    negated: bool | UnsetType = UNSET
