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

__all__ = (
    "Signal",
    "Test",
    "Move",
)


from typing import (
    Optional,
)

from pydantic import model_validator
from pydantic.dataclasses import dataclass

import betterproto_fw


class Signal(betterproto_fw.Enum):
    """ """

    PASS = 0
    """
    
    """

    RESIGN = 1
    """
    
    """

    @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, config={"extra": "forbid"})
class Test(betterproto_fw.Message):
    """ """

    signal: Optional["Signal"] = betterproto_fw.enum_field(
        1, optional=True, group="action"
    )
    """
    
    """

    move: Optional["Move"] = betterproto_fw.message_field(
        2, optional=True, group="action"
    )
    """
    
    """

    @model_validator(mode="after")
    def check_oneof(cls, values):
        return cls._validate_field_groups(values)


@dataclass(eq=False, repr=False, config={"extra": "forbid"})
class Move(betterproto_fw.Message):
    """ """

    x: int = betterproto_fw.int32_field(1)
    """
    
    """

    y: int = betterproto_fw.int32_field(2)
    """
    
    """
