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

from __future__ import annotations

from enum import Enum

from pydantic import BaseModel, ConfigDict, Field, conint


class ExampleSpecProto2Proto2State(Enum):
    PROTO2_UNKNOWN = 'PROTO2_UNKNOWN'
    PROTO2_ACTIVE = 'PROTO2_ACTIVE'
    PROTO2_ENABLED = 'PROTO2_ENABLED'
    PROTO2_NEGATIVE = 'PROTO2_NEGATIVE'


class ExampleSpecProto2SpecProto2LegacyGroup(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    name: str | None = None


class ExampleSpecProto2SpecProto2Proto2Child(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    value: str | None = None


class ExampleSpecProto2SpecProto2(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    id: str
    decimal_default: int | None = -42
    hex_default: int | None = 42
    octal_default: conint(ge=0, le=4294967295) | None = 42
    pos_inf: float | None = float('inf')
    neg_inf: float | None = float('-inf')
    not_a_number: float | None = float('nan')
    enabled: bool | None = False
    single_quoted: str | None = 'single'
    escaped_bytes: bytes | None = b'\x01\x02'
    state: ExampleSpecProto2Proto2State | None = 'PROTO2_ACTIVE'
    tags: list[str] | None = []
    packed_numbers: list[int] | None = []
    children: dict[str, ExampleSpecProto2SpecProto2Proto2Child] | None = Field(
        {}, validate_default=True
    )
    text: str | None = Field(None, description='oneof: payload')
    child: ExampleSpecProto2SpecProto2Proto2Child | None = Field(
        None, description='oneof: payload'
    )
    legacygroup: ExampleSpecProto2SpecProto2LegacyGroup | None = None


class ExampleSpecProto2ExternalGroup(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    value: str | None = None


class ExampleSpecProto2Proto2Request(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    id: str


class ExampleSpecProto2Proto2Response(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    item: ExampleSpecProto2SpecProto2 | None = None
