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

__all__ = (
    "Message",
    "NestedMessage",
    "Test",
)


from datetime import datetime, timedelta
from typing import (
    Optional,
)

from pydantic import model_validator
from pydantic.dataclasses import dataclass

import betterproto_fw


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

    value: int = betterproto_fw.int64_field(1)
    """
    
    """


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

    id: int = betterproto_fw.int64_field(1)
    """
    
    """

    wrapped_message_value: Optional["Message"] = betterproto_fw.message_field(
        2, optional=True, group="value_type"
    )
    """
    
    """

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


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

    bool_value: Optional[bool] = betterproto_fw.bool_field(
        1, optional=True, group="value_type"
    )
    """
    
    """

    int64_value: Optional[int] = betterproto_fw.int64_field(
        2, optional=True, group="value_type"
    )
    """
    
    """

    timestamp_value: Optional[datetime] = betterproto_fw.message_field(
        3, optional=True, group="value_type"
    )
    """
    
    """

    duration_value: Optional[timedelta] = betterproto_fw.message_field(
        4, optional=True, group="value_type"
    )
    """
    
    """

    wrapped_message_value: Optional["Message"] = betterproto_fw.message_field(
        5, optional=True, group="value_type"
    )
    """
    
    """

    wrapped_nested_message_value: Optional["NestedMessage"] = (
        betterproto_fw.message_field(6, optional=True, group="value_type")
    )
    """
    
    """

    wrapped_bool_value: Optional[Optional[bool]] = betterproto_fw.message_field(
        7, wraps=betterproto_fw.TYPE_BOOL, optional=True, group="value_type"
    )
    """
    
    """

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