"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""
import builtins
import google.protobuf.descriptor
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import typing
import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...

# To simplify identifying the origin of a packet, client-to-server packets
# use even numbers and server-to-client packets use odd numbers.
class PacketType(_PacketType, metaclass=_PacketTypeEnumTypeWrapper):
    pass
class _PacketType:
    V = typing.NewType('V', builtins.int)
class _PacketTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_PacketType.V], builtins.type):
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ...
    # Client-to-server packets

    # The client invokes an RPC. Always the first packet.
    REQUEST = PacketType.V(0)
    # A message in a client stream. Always sent after a REQUEST and before a
    # CLIENT_STREAM_END.
    CLIENT_STREAM = PacketType.V(2)
    # The client received a packet for an RPC it did not request.
    CLIENT_ERROR = PacketType.V(4)
    # Deprecated, do not use. Send a CLIENT_ERROR with status CANCELLED instead.
    # TODO(pwbug/512): Remove this packet type.
    DEPRECATED_CANCEL = PacketType.V(6)
    # A client stream has completed.
    CLIENT_STREAM_END = PacketType.V(8)
    # Server-to-client packets

    # The RPC has finished.
    RESPONSE = PacketType.V(1)
    # Deprecated, do not use. Formerly was used as the last packet in a server
    # stream.
    # TODO(pwbug/512): Remove this packet type.
    DEPRECATED_SERVER_STREAM_END = PacketType.V(3)
    # The server was unable to process a request.
    SERVER_ERROR = PacketType.V(5)
    # A message in a server stream.
    SERVER_STREAM = PacketType.V(7)

# Client-to-server packets

# The client invokes an RPC. Always the first packet.
REQUEST = PacketType.V(0)
# A message in a client stream. Always sent after a REQUEST and before a
# CLIENT_STREAM_END.
CLIENT_STREAM = PacketType.V(2)
# The client received a packet for an RPC it did not request.
CLIENT_ERROR = PacketType.V(4)
# Deprecated, do not use. Send a CLIENT_ERROR with status CANCELLED instead.
# TODO(pwbug/512): Remove this packet type.
DEPRECATED_CANCEL = PacketType.V(6)
# A client stream has completed.
CLIENT_STREAM_END = PacketType.V(8)
# Server-to-client packets

# The RPC has finished.
RESPONSE = PacketType.V(1)
# Deprecated, do not use. Formerly was used as the last packet in a server
# stream.
# TODO(pwbug/512): Remove this packet type.
DEPRECATED_SERVER_STREAM_END = PacketType.V(3)
# The server was unable to process a request.
SERVER_ERROR = PacketType.V(5)
# A message in a server stream.
SERVER_STREAM = PacketType.V(7)
global___PacketType = PacketType


class RpcPacket(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    TYPE_FIELD_NUMBER: builtins.int
    CHANNEL_ID_FIELD_NUMBER: builtins.int
    SERVICE_ID_FIELD_NUMBER: builtins.int
    METHOD_ID_FIELD_NUMBER: builtins.int
    PAYLOAD_FIELD_NUMBER: builtins.int
    STATUS_FIELD_NUMBER: builtins.int
    CALL_ID_FIELD_NUMBER: builtins.int
    # The type of packet. Determines which other fields are used.
    type: global___PacketType.V = ...
    # Channel through which the packet is sent.
    channel_id: builtins.int = ...
    # Hash of the fully-qualified name of the service with which this packet is
    # associated. For RPC packets, this is the service that processes the packet.
    service_id: builtins.int = ...
    # Hash of the name of the method which should process this packet.
    method_id: builtins.int = ...
    # The packet's payload, which is an encoded protobuf.
    payload: builtins.bytes = ...
    # Status code for the RPC response or error.
    status: builtins.int = ...
    # Unique identifier for the call that initiated this RPC. Optionally set by
    # the client in the initial request and sent in all subsequent client
    # packets; echoed by the server.
    call_id: builtins.int = ...
    def __init__(self,
        *,
        type : global___PacketType.V = ...,
        channel_id : builtins.int = ...,
        service_id : builtins.int = ...,
        method_id : builtins.int = ...,
        payload : builtins.bytes = ...,
        status : builtins.int = ...,
        call_id : builtins.int = ...,
        ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal[u"call_id",b"call_id",u"channel_id",b"channel_id",u"method_id",b"method_id",u"payload",b"payload",u"service_id",b"service_id",u"status",b"status",u"type",b"type"]) -> None: ...
global___RpcPacket = RpcPacket
