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

__all__ = (
    "DeviceConfigDomainStrategy",
    "DeviceConfig",
    "PeerConfig",
)

from dataclasses import dataclass

import betterproto2

from ....message_pool import default_message_pool

betterproto2.check_compiler_version("0.5.1")


class DeviceConfigDomainStrategy(betterproto2.Enum):
    FORCE_IP = 0

    FORCE_IP4 = 1

    FORCE_IP6 = 2

    FORCE_IP46 = 3

    FORCE_IP64 = 4


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

    endpoint: "list[str]" = betterproto2.field(
        2, betterproto2.TYPE_STRING, repeated=True
    )

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

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

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

    reserved: "bytes" = betterproto2.field(6, betterproto2.TYPE_BYTES)

    domain_strategy: "DeviceConfigDomainStrategy" = betterproto2.field(
        7, betterproto2.TYPE_ENUM, default_factory=lambda: DeviceConfigDomainStrategy(0)
    )

    is_client: "bool" = betterproto2.field(8, betterproto2.TYPE_BOOL)

    no_kernel_tun: "bool" = betterproto2.field(9, betterproto2.TYPE_BOOL)


default_message_pool.register_message(
    "xray.proxy.wireguard", "DeviceConfig", DeviceConfig
)


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

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

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

    keep_alive: "int" = betterproto2.field(4, betterproto2.TYPE_UINT32)

    allowed_ips: "list[str]" = betterproto2.field(
        5, betterproto2.TYPE_STRING, repeated=True
    )


default_message_pool.register_message("xray.proxy.wireguard", "PeerConfig", PeerConfig)
