# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: xcapi/xray/app/router/command/command.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
from xcapi.xray.common.net.network_pb import Network
from xcapi.xray.common.serial.typed_message_pb import TypedMessage
from xcapi.model import ClassMeta
from typing import Optional, List, Dict
from dataclasses import dataclass


@dataclass
class RoutingContext(ClassMeta):
    """
    RoutingContext is the context with information relative to routing process.
    It conforms to the structure of xray.features.routing.Context and xray.features.routing.Route.
    """
    InboundTag: Optional[str] = None
    Network: Optional[Network] = None
    SourceIPs: Optional[List[bytes]] = None
    TargetIPs: Optional[List[bytes]] = None
    SourcePort: Optional[int] = None
    TargetPort: Optional[int] = None
    TargetDomain: Optional[str] = None
    Protocol: Optional[str] = None
    User: Optional[str] = None
    Attributes: Optional[Dict[str, str]] = None
    OutboundGroupTags: Optional[List[str]] = None
    OutboundTag: Optional[str] = None


@dataclass
class SubscribeRoutingStatsRequest(ClassMeta):
    """
    SubscribeRoutingStatsRequest subscribes to routing statistics channel if opened by xray-core.

    * FieldSelectors selects a subset of fields in routing statistics to return.

    Valid selectors:
        - inbound: Selects connection's inbound tag.
        - network: Selects connection's network.
        - ip: Equivalent as "ip_source" and "ip_target", selects both source and target IP.
        - port: Equivalent as "port_source" and "port_target", selects both source and target port.
        - domain: Selects target domain.
        - protocol: Select connection's protocol.
        - user: Select connection's inbound user email.
        - attributes: Select connection's additional attributes.
        - outbound: Equivalent as "outbound" and "outbound_group", select both outbound tag and outbound group tags.
    * If FieldSelectors is left empty, all fields will be returned.
    """
    FieldSelectors: Optional[List[str]] = None


@dataclass
class TestRouteRequest(ClassMeta):
    """
    TestRouteRequest manually tests a routing result according to the routing context message.
        * RoutingContext is the routing message without outbound information.
        * FieldSelectors selects the fields to return in the routing result. All fields are returned if left empty.
        * PublishResult broadcasts the routing result to routing statistics channel if set true.
    """
    RoutingContext: Optional[RoutingContext] = None
    FieldSelectors: Optional[List[str]] = None
    PublishResult: Optional[bool] = None


@dataclass
class PrincipleTargetInfo(ClassMeta):
    tag: Optional[List[str]] = None


@dataclass
class OverrideInfo(ClassMeta):
    target: Optional[str] = None


@dataclass
class BalancerMsg(ClassMeta):
    override: Optional[OverrideInfo] = None
    principle_target: Optional[PrincipleTargetInfo] = None


@dataclass
class GetBalancerInfoRequest(ClassMeta):
    tag: Optional[str] = None


@dataclass
class GetBalancerInfoResponse(ClassMeta):
    balancer: Optional[BalancerMsg] = None


@dataclass
class OverrideBalancerTargetRequest(ClassMeta):
    balancerTag: Optional[str] = None
    target: Optional[str] = None


@dataclass
class OverrideBalancerTargetResponse(ClassMeta):
    pass


@dataclass
class AddRuleRequest(ClassMeta):
    config: Optional[TypedMessage] = None
    shouldAppend: Optional[bool] = None


@dataclass
class AddRuleResponse(ClassMeta):
    pass


@dataclass
class RemoveRuleRequest(ClassMeta):
    ruleTag: Optional[str] = None


@dataclass
class RemoveRuleResponse(ClassMeta):
    pass


@dataclass
class Config(ClassMeta):
    pass


_sym_db = _symbol_database.Default()

DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
    b'\n+xcapi/xray/app/router/command/command.proto\x12\x17xray.app.router.command\x1a#xcapi/xray/common/net/network.proto\x1a,xcapi/xray/common/serial/typed_message.proto\"\x83\x03\n\x0eRoutingContext\x12\x12\n\nInboundTag\x18\x01 \x01(\t\x12)\n\x07Network\x18\x02 \x01(\x0e\x32\x18.xray.common.net.Network\x12\x11\n\tSourceIPs\x18\x03 \x03(\x0c\x12\x11\n\tTargetIPs\x18\x04 \x03(\x0c\x12\x12\n\nSourcePort\x18\x05 \x01(\r\x12\x12\n\nTargetPort\x18\x06 \x01(\r\x12\x14\n\x0cTargetDomain\x18\x07 \x01(\t\x12\x10\n\x08Protocol\x18\x08 \x01(\t\x12\x0c\n\x04User\x18\t \x01(\t\x12K\n\nAttributes\x18\n \x03(\x0b\x32\x37.xray.app.router.command.RoutingContext.AttributesEntry\x12\x19\n\x11OutboundGroupTags\x18\x0b \x03(\t\x12\x13\n\x0bOutboundTag\x18\x0c \x01(\t\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"6\n\x1cSubscribeRoutingStatsRequest\x12\x16\n\x0e\x46ieldSelectors\x18\x01 \x03(\t\"\x82\x01\n\x10TestRouteRequest\x12?\n\x0eRoutingContext\x18\x01 \x01(\x0b\x32\'.xray.app.router.command.RoutingContext\x12\x16\n\x0e\x46ieldSelectors\x18\x02 \x03(\t\x12\x15\n\rPublishResult\x18\x03 \x01(\x08\"\"\n\x13PrincipleTargetInfo\x12\x0b\n\x03tag\x18\x01 \x03(\t\"\x1e\n\x0cOverrideInfo\x12\x0e\n\x06target\x18\x02 \x01(\t\"\x8e\x01\n\x0b\x42\x61lancerMsg\x12\x37\n\x08override\x18\x05 \x01(\x0b\x32%.xray.app.router.command.OverrideInfo\x12\x46\n\x10principle_target\x18\x06 \x01(\x0b\x32,.xray.app.router.command.PrincipleTargetInfo\"%\n\x16GetBalancerInfoRequest\x12\x0b\n\x03tag\x18\x01 \x01(\t\"Q\n\x17GetBalancerInfoResponse\x12\x36\n\x08\x62\x61lancer\x18\x01 \x01(\x0b\x32$.xray.app.router.command.BalancerMsg\"D\n\x1dOverrideBalancerTargetRequest\x12\x13\n\x0b\x62\x61lancerTag\x18\x01 \x01(\t\x12\x0e\n\x06target\x18\x02 \x01(\t\" \n\x1eOverrideBalancerTargetResponse\"X\n\x0e\x41\x64\x64RuleRequest\x12\x30\n\x06\x63onfig\x18\x01 \x01(\x0b\x32 .xray.common.serial.TypedMessage\x12\x14\n\x0cshouldAppend\x18\x02 \x01(\x08\"\x11\n\x0f\x41\x64\x64RuleResponse\"$\n\x11RemoveRuleRequest\x12\x0f\n\x07ruleTag\x18\x01 \x01(\t\"\x14\n\x12RemoveRuleResponse\"\x08\n\x06\x43onfig2\xbf\x05\n\x0eRoutingService\x12{\n\x15SubscribeRoutingStats\x12\x35.xray.app.router.command.SubscribeRoutingStatsRequest\x1a\'.xray.app.router.command.RoutingContext\"\x00\x30\x01\x12\x61\n\tTestRoute\x12).xray.app.router.command.TestRouteRequest\x1a\'.xray.app.router.command.RoutingContext\"\x00\x12v\n\x0fGetBalancerInfo\x12/.xray.app.router.command.GetBalancerInfoRequest\x1a\x30.xray.app.router.command.GetBalancerInfoResponse\"\x00\x12\x8b\x01\n\x16OverrideBalancerTarget\x12\x36.xray.app.router.command.OverrideBalancerTargetRequest\x1a\x37.xray.app.router.command.OverrideBalancerTargetResponse\"\x00\x12^\n\x07\x41\x64\x64Rule\x12\'.xray.app.router.command.AddRuleRequest\x1a(.xray.app.router.command.AddRuleResponse\"\x00\x12g\n\nRemoveRule\x12*.xray.app.router.command.RemoveRuleRequest\x1a+.xray.app.router.command.RemoveRuleResponse\"\x00\x62\x06proto3')

_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xcapi.xray.app.router.command.command_pb', _globals)
if not _descriptor._USE_C_DESCRIPTORS:
    DESCRIPTOR._loaded_options = None
    _globals['_ROUTINGCONTEXT_ATTRIBUTESENTRY']._loaded_options = None
    _globals['_ROUTINGCONTEXT_ATTRIBUTESENTRY']._serialized_options = b'8\001'
    _globals['_ROUTINGCONTEXT']._serialized_start = 156
    _globals['_ROUTINGCONTEXT']._serialized_end = 543
    _globals['_ROUTINGCONTEXT_ATTRIBUTESENTRY']._serialized_start = 494
    _globals['_ROUTINGCONTEXT_ATTRIBUTESENTRY']._serialized_end = 543
    _globals['_SUBSCRIBEROUTINGSTATSREQUEST']._serialized_start = 545
    _globals['_SUBSCRIBEROUTINGSTATSREQUEST']._serialized_end = 599
    _globals['_TESTROUTEREQUEST']._serialized_start = 602
    _globals['_TESTROUTEREQUEST']._serialized_end = 732
    _globals['_PRINCIPLETARGETINFO']._serialized_start = 734
    _globals['_PRINCIPLETARGETINFO']._serialized_end = 768
    _globals['_OVERRIDEINFO']._serialized_start = 770
    _globals['_OVERRIDEINFO']._serialized_end = 800
    _globals['_BALANCERMSG']._serialized_start = 803
    _globals['_BALANCERMSG']._serialized_end = 945
    _globals['_GETBALANCERINFOREQUEST']._serialized_start = 947
    _globals['_GETBALANCERINFOREQUEST']._serialized_end = 984
    _globals['_GETBALANCERINFORESPONSE']._serialized_start = 986
    _globals['_GETBALANCERINFORESPONSE']._serialized_end = 1067
    _globals['_OVERRIDEBALANCERTARGETREQUEST']._serialized_start = 1069
    _globals['_OVERRIDEBALANCERTARGETREQUEST']._serialized_end = 1137
    _globals['_OVERRIDEBALANCERTARGETRESPONSE']._serialized_start = 1139
    _globals['_OVERRIDEBALANCERTARGETRESPONSE']._serialized_end = 1171
    _globals['_ADDRULEREQUEST']._serialized_start = 1173
    _globals['_ADDRULEREQUEST']._serialized_end = 1261
    _globals['_ADDRULERESPONSE']._serialized_start = 1263
    _globals['_ADDRULERESPONSE']._serialized_end = 1280
    _globals['_REMOVERULEREQUEST']._serialized_start = 1282
    _globals['_REMOVERULEREQUEST']._serialized_end = 1318
    _globals['_REMOVERULERESPONSE']._serialized_start = 1320
    _globals['_REMOVERULERESPONSE']._serialized_end = 1340
    _globals['_CONFIG']._serialized_start = 1342
    _globals['_CONFIG']._serialized_end = 1350
    _globals['_ROUTINGSERVICE']._serialized_start = 1353
    _globals['_ROUTINGSERVICE']._serialized_end = 2056
