# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: proxy/shadowsocks_2022/config.proto
# plugin: python-betterproto2
# This file has been @generated

__all__ = (
    "Account",
    "ClientConfig",
    "MultiUserServerConfig",
    "RelayDestination",
    "RelayServerConfig",
    "ServerConfig",
)

from dataclasses import dataclass

import betterproto2

from ....message_pool import default_message_pool

betterproto2.check_compiler_version("0.5.1")


@dataclass(eq=False, repr=False)
class Account(betterproto2.Message):
    key: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)


default_message_pool.register_message("xray.proxy.shadowsocks_2022", "Account", Account)


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

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

    method: "str" = betterproto2.field(3, betterproto2.TYPE_STRING)

    key: "str" = betterproto2.field(4, betterproto2.TYPE_STRING)

    udp_over_tcp: "bool" = betterproto2.field(5, betterproto2.TYPE_BOOL)

    udp_over_tcp_version: "int" = betterproto2.field(6, betterproto2.TYPE_UINT32)


default_message_pool.register_message(
    "xray.proxy.shadowsocks_2022", "ClientConfig", ClientConfig
)


@dataclass(eq=False, repr=False)
class MultiUserServerConfig(betterproto2.Message):
    method: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)

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

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

    network: "list[__common__net__.Network]" = betterproto2.field(
        4, betterproto2.TYPE_ENUM, repeated=True
    )


default_message_pool.register_message(
    "xray.proxy.shadowsocks_2022", "MultiUserServerConfig", MultiUserServerConfig
)


@dataclass(eq=False, repr=False)
class RelayDestination(betterproto2.Message):
    key: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)

    address: "__common__net__.IpOrDomain | None" = betterproto2.field(
        2, betterproto2.TYPE_MESSAGE, optional=True
    )

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

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

    level: "int" = betterproto2.field(5, betterproto2.TYPE_INT32)


default_message_pool.register_message(
    "xray.proxy.shadowsocks_2022", "RelayDestination", RelayDestination
)


@dataclass(eq=False, repr=False)
class RelayServerConfig(betterproto2.Message):
    method: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)

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

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

    network: "list[__common__net__.Network]" = betterproto2.field(
        4, betterproto2.TYPE_ENUM, repeated=True
    )


default_message_pool.register_message(
    "xray.proxy.shadowsocks_2022", "RelayServerConfig", RelayServerConfig
)


@dataclass(eq=False, repr=False)
class ServerConfig(betterproto2.Message):
    method: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)

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

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

    level: "int" = betterproto2.field(4, betterproto2.TYPE_INT32)

    network: "list[__common__net__.Network]" = betterproto2.field(
        5, betterproto2.TYPE_ENUM, repeated=True
    )


default_message_pool.register_message(
    "xray.proxy.shadowsocks_2022", "ServerConfig", ServerConfig
)


from ...common import net as __common__net__
from ...common import protocol as __common__protocol__
