# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: common/protocol/headers.proto, common/protocol/server_spec.proto, common/protocol/user.proto
# plugin: python-betterproto2
# This file has been @generated

__all__ = (
    "SecurityType",
    "SecurityConfig",
    "ServerEndpoint",
    "User",
)

from dataclasses import dataclass

import betterproto2

from ....message_pool import default_message_pool

betterproto2.check_compiler_version("0.5.1")


class SecurityType(betterproto2.Enum):
    UNKNOWN = 0

    AUTO = 2

    AES128_GCM = 3

    CHACHA20_POLY1305 = 4

    NONE = 5
    """
    [DEPRECATED 2023-06] 
    """

    ZERO = 6


@dataclass(eq=False, repr=False)
class SecurityConfig(betterproto2.Message):
    type: "SecurityType" = betterproto2.field(
        1, betterproto2.TYPE_ENUM, default_factory=lambda: SecurityType(0)
    )


default_message_pool.register_message(
    "xray.common.protocol", "SecurityConfig", SecurityConfig
)


@dataclass(eq=False, repr=False)
class ServerEndpoint(betterproto2.Message):
    address: "_net__.IpOrDomain | None" = betterproto2.field(
        1, betterproto2.TYPE_MESSAGE, optional=True
    )

    port: "int" = betterproto2.field(2, betterproto2.TYPE_UINT32)

    user: "list[User]" = betterproto2.field(3, betterproto2.TYPE_MESSAGE, repeated=True)


default_message_pool.register_message(
    "xray.common.protocol", "ServerEndpoint", ServerEndpoint
)


@dataclass(eq=False, repr=False)
class User(betterproto2.Message):
    """
    User is a generic user for all protocols.
    """

    level: "int" = betterproto2.field(1, betterproto2.TYPE_UINT32)

    email: "str" = betterproto2.field(2, betterproto2.TYPE_STRING)

    account: "_serial__.TypedMessage | None" = betterproto2.field(
        3, betterproto2.TYPE_MESSAGE, optional=True
    )
    """
    Protocol specific account information. Must be the account proto in one of
    the proxies.
    """


default_message_pool.register_message("xray.common.protocol", "User", User)


from .. import net as _net__
from .. import serial as _serial__
