# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: enum.proto
# plugin: python-betterproto
# This file has been @generated

from typing import TYPE_CHECKING


if TYPE_CHECKING:
    from dataclasses import dataclass
else:
    from pydantic.dataclasses import dataclass

from typing import List

import betterproto
from pydantic.dataclasses import rebuild_dataclass


class Choice(betterproto.Enum):
    ZERO = 0
    ONE = 1
    FOUR = 4
    """TWO = 2;"""

    THREE = 3

    @classmethod
    def __get_pydantic_core_schema__(cls, _source_type, _handler):
        from pydantic_core import core_schema

        return core_schema.int_schema(ge=0)


class ArithmeticOperator(betterproto.Enum):
    """
    A "C" like enum with the enum name prefixed onto members, these should be stripped
    """

    NONE = 0
    PLUS = 1
    MINUS = 2
    _0_PREFIXED = 3

    @classmethod
    def __get_pydantic_core_schema__(cls, _source_type, _handler):
        from pydantic_core import core_schema

        return core_schema.int_schema(ge=0)


@dataclass(eq=False, repr=False)
class Test(betterproto.Message):
    """
    Tests that enums are correctly serialized and that it correctly handles skipped and out-of-order enum values
    """

    choice: "Choice" = betterproto.enum_field(1)
    choices: List["Choice"] = betterproto.enum_field(2)


rebuild_dataclass(Test)  # type: ignore
