# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: google_impl_behavior_equivalence.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 datetime import datetime
from typing import Optional

import betterproto
from pydantic import model_validator
from pydantic.dataclasses import rebuild_dataclass


@dataclass(eq=False, repr=False)
class Foo(betterproto.Message):
    bar: int = betterproto.int64_field(1)


@dataclass(eq=False, repr=False)
class Test(betterproto.Message):
    string: Optional[str] = betterproto.string_field(1, optional=True, group="group")
    integer: Optional[int] = betterproto.int64_field(2, optional=True, group="group")
    foo: Optional["Foo"] = betterproto.message_field(3, optional=True, group="group")

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


@dataclass(eq=False, repr=False)
class Spam(betterproto.Message):
    ts: datetime = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class Request(betterproto.Message):
    foo: "Empty" = betterproto.message_field(1)


@dataclass(eq=False, repr=False)
class Empty(betterproto.Message):
    pass


rebuild_dataclass(Test)  # type: ignore
rebuild_dataclass(Spam)  # type: ignore
rebuild_dataclass(Request)  # type: ignore
