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

__all__ = (
    "ConfigDomainStrategy",
    "Config",
    "DestinationOverride",
    "Fragment",
    "Noise",
)

from dataclasses import dataclass

import betterproto2

from ....message_pool import default_message_pool

betterproto2.check_compiler_version("0.5.1")


class ConfigDomainStrategy(betterproto2.Enum):
    AS_IS = 0

    USE_IP = 1

    USE_IP4 = 2

    USE_IP6 = 3

    USE_IP46 = 4

    USE_IP64 = 5

    FORCE_IP = 6

    FORCE_IP4 = 7

    FORCE_IP6 = 8

    FORCE_IP46 = 9

    FORCE_IP64 = 10


@dataclass(eq=False, repr=False)
class Config(betterproto2.Message):
    domain_strategy: "ConfigDomainStrategy" = betterproto2.field(
        1, betterproto2.TYPE_ENUM, default_factory=lambda: ConfigDomainStrategy(0)
    )

    destination_override: "DestinationOverride | None" = betterproto2.field(
        3, betterproto2.TYPE_MESSAGE, optional=True
    )

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

    fragment: "Fragment | None" = betterproto2.field(
        5, betterproto2.TYPE_MESSAGE, optional=True
    )

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

    noises: "list[Noise]" = betterproto2.field(
        7, betterproto2.TYPE_MESSAGE, repeated=True
    )


default_message_pool.register_message("xray.proxy.freedom", "Config", Config)


@dataclass(eq=False, repr=False)
class DestinationOverride(betterproto2.Message):
    server: "__common__protocol__.ServerEndpoint | None" = betterproto2.field(
        1, betterproto2.TYPE_MESSAGE, optional=True
    )


default_message_pool.register_message(
    "xray.proxy.freedom", "DestinationOverride", DestinationOverride
)


@dataclass(eq=False, repr=False)
class Fragment(betterproto2.Message):
    packets_from: "int" = betterproto2.field(1, betterproto2.TYPE_UINT64)

    packets_to: "int" = betterproto2.field(2, betterproto2.TYPE_UINT64)

    length_min: "int" = betterproto2.field(3, betterproto2.TYPE_UINT64)

    length_max: "int" = betterproto2.field(4, betterproto2.TYPE_UINT64)

    interval_min: "int" = betterproto2.field(5, betterproto2.TYPE_UINT64)

    interval_max: "int" = betterproto2.field(6, betterproto2.TYPE_UINT64)


default_message_pool.register_message("xray.proxy.freedom", "Fragment", Fragment)


@dataclass(eq=False, repr=False)
class Noise(betterproto2.Message):
    length_min: "int" = betterproto2.field(1, betterproto2.TYPE_UINT64)

    length_max: "int" = betterproto2.field(2, betterproto2.TYPE_UINT64)

    delay_min: "int" = betterproto2.field(3, betterproto2.TYPE_UINT64)

    delay_max: "int" = betterproto2.field(4, betterproto2.TYPE_UINT64)

    packet: "bytes" = betterproto2.field(5, betterproto2.TYPE_BYTES)


default_message_pool.register_message("xray.proxy.freedom", "Noise", Noise)


from ...common import protocol as __common__protocol__
