# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: proto3_field_presence.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.dataclasses import rebuild_dataclass


class TestEnum(betterproto.Enum):
    A = 0
    B = 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)
class InnerTest(betterproto.Message):
    test: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class Test(betterproto.Message):
    test1: Optional[int] = betterproto.uint32_field(1, optional=True)
    test2: Optional[bool] = betterproto.bool_field(2, optional=True)
    test3: Optional[str] = betterproto.string_field(3, optional=True)
    test4: Optional[bytes] = betterproto.bytes_field(4, optional=True)
    test5: Optional["InnerTest"] = betterproto.message_field(5, optional=True)
    test6: Optional["TestEnum"] = betterproto.enum_field(6, optional=True)
    test7: Optional[int] = betterproto.uint64_field(7, optional=True)
    test8: Optional[float] = betterproto.float_field(8, optional=True)
    test9: Optional[datetime] = betterproto.message_field(9, optional=True)


rebuild_dataclass(Test)  # type: ignore
