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

__all__ = (
    "Config",
    "Header",
    "Method",
    "RequestConfig",
    "ResponseConfig",
    "Status",
    "Version",
)

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 Config(betterproto2.Message):
    request: "RequestConfig | None" = betterproto2.field(
        1, betterproto2.TYPE_MESSAGE, optional=True
    )
    """
    Settings for authenticating requests. If not set, client side will not send
    authentication header, and server side will bypass authentication.
    """

    response: "ResponseConfig | None" = betterproto2.field(
        2, betterproto2.TYPE_MESSAGE, optional=True
    )
    """
    Settings for authenticating responses. If not set, client side will bypass
    authentication, and server side will not send authentication header.
    """


default_message_pool.register_message(
    "xray.transport.internet.headers.http", "Config", Config
)


@dataclass(eq=False, repr=False)
class Header(betterproto2.Message):
    name: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)
    """
    "Accept", "Cookie", etc
    """

    value: "list[str]" = betterproto2.field(2, betterproto2.TYPE_STRING, repeated=True)
    """
    Each entry must be valid in one piece. Random entry will be chosen if
    multiple entries present.
    """


default_message_pool.register_message(
    "xray.transport.internet.headers.http", "Header", Header
)


@dataclass(eq=False, repr=False)
class Method(betterproto2.Message):
    """
    HTTP method. Default value "GET".
    """

    value: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)


default_message_pool.register_message(
    "xray.transport.internet.headers.http", "Method", Method
)


@dataclass(eq=False, repr=False)
class RequestConfig(betterproto2.Message):
    version: "Version | None" = betterproto2.field(
        1, betterproto2.TYPE_MESSAGE, optional=True
    )
    """
    Full HTTP version like "1.1".
    """

    method: "Method | None" = betterproto2.field(
        2, betterproto2.TYPE_MESSAGE, optional=True
    )
    """
    GET, POST, CONNECT etc
    """

    uri: "list[str]" = betterproto2.field(3, betterproto2.TYPE_STRING, repeated=True)
    """
    URI like "/login.php"
    """

    header: "list[Header]" = betterproto2.field(
        4, betterproto2.TYPE_MESSAGE, repeated=True
    )


default_message_pool.register_message(
    "xray.transport.internet.headers.http", "RequestConfig", RequestConfig
)


@dataclass(eq=False, repr=False)
class ResponseConfig(betterproto2.Message):
    version: "Version | None" = betterproto2.field(
        1, betterproto2.TYPE_MESSAGE, optional=True
    )

    status: "Status | None" = betterproto2.field(
        2, betterproto2.TYPE_MESSAGE, optional=True
    )

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


default_message_pool.register_message(
    "xray.transport.internet.headers.http", "ResponseConfig", ResponseConfig
)


@dataclass(eq=False, repr=False)
class Status(betterproto2.Message):
    code: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)
    """
    Status code. Default "200".
    """

    reason: "str" = betterproto2.field(2, betterproto2.TYPE_STRING)
    """
    Statue reason. Default "OK".
    """


default_message_pool.register_message(
    "xray.transport.internet.headers.http", "Status", Status
)


@dataclass(eq=False, repr=False)
class Version(betterproto2.Message):
    """
    HTTP version. Default value "1.1".
    """

    value: "str" = betterproto2.field(1, betterproto2.TYPE_STRING)


default_message_pool.register_message(
    "xray.transport.internet.headers.http", "Version", Version
)
