"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
Copyright 2025 LiveKit, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import builtins
import collections.abc
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
from . import handle_pb2
import sys
from . import track_pb2
import typing

if sys.version_info >= (3, 10):
    import typing as typing_extensions
else:
    import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

class _ParticipantState:
    ValueType = typing.NewType("ValueType", builtins.int)
    V: typing_extensions.TypeAlias = ValueType

class _ParticipantStateEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ParticipantState.ValueType], builtins.type):
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
    PARTICIPANT_STATE_JOINING: _ParticipantState.ValueType  # 0
    PARTICIPANT_STATE_JOINED: _ParticipantState.ValueType  # 1
    PARTICIPANT_STATE_ACTIVE: _ParticipantState.ValueType  # 2
    PARTICIPANT_STATE_DISCONNECTED: _ParticipantState.ValueType  # 3

class ParticipantState(_ParticipantState, metaclass=_ParticipantStateEnumTypeWrapper): ...

PARTICIPANT_STATE_JOINING: ParticipantState.ValueType  # 0
PARTICIPANT_STATE_JOINED: ParticipantState.ValueType  # 1
PARTICIPANT_STATE_ACTIVE: ParticipantState.ValueType  # 2
PARTICIPANT_STATE_DISCONNECTED: ParticipantState.ValueType  # 3
global___ParticipantState = ParticipantState

class _ParticipantKind:
    ValueType = typing.NewType("ValueType", builtins.int)
    V: typing_extensions.TypeAlias = ValueType

class _ParticipantKindEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ParticipantKind.ValueType], builtins.type):
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
    PARTICIPANT_KIND_STANDARD: _ParticipantKind.ValueType  # 0
    PARTICIPANT_KIND_INGRESS: _ParticipantKind.ValueType  # 1
    PARTICIPANT_KIND_EGRESS: _ParticipantKind.ValueType  # 2
    PARTICIPANT_KIND_SIP: _ParticipantKind.ValueType  # 3
    PARTICIPANT_KIND_AGENT: _ParticipantKind.ValueType  # 4
    PARTICIPANT_KIND_CONNECTOR: _ParticipantKind.ValueType  # 5
    PARTICIPANT_KIND_BRIDGE: _ParticipantKind.ValueType  # 6

class ParticipantKind(_ParticipantKind, metaclass=_ParticipantKindEnumTypeWrapper): ...

PARTICIPANT_KIND_STANDARD: ParticipantKind.ValueType  # 0
PARTICIPANT_KIND_INGRESS: ParticipantKind.ValueType  # 1
PARTICIPANT_KIND_EGRESS: ParticipantKind.ValueType  # 2
PARTICIPANT_KIND_SIP: ParticipantKind.ValueType  # 3
PARTICIPANT_KIND_AGENT: ParticipantKind.ValueType  # 4
PARTICIPANT_KIND_CONNECTOR: ParticipantKind.ValueType  # 5
PARTICIPANT_KIND_BRIDGE: ParticipantKind.ValueType  # 6
global___ParticipantKind = ParticipantKind

class _ParticipantKindDetail:
    ValueType = typing.NewType("ValueType", builtins.int)
    V: typing_extensions.TypeAlias = ValueType

class _ParticipantKindDetailEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ParticipantKindDetail.ValueType], builtins.type):
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
    PARTICIPANT_KIND_DETAIL_CLOUD_AGENT: _ParticipantKindDetail.ValueType  # 0
    PARTICIPANT_KIND_DETAIL_FORWARDED: _ParticipantKindDetail.ValueType  # 1
    PARTICIPANT_KIND_DETAIL_CONNECTOR_WHATSAPP: _ParticipantKindDetail.ValueType  # 2
    PARTICIPANT_KIND_DETAIL_CONNECTOR_TWILIO: _ParticipantKindDetail.ValueType  # 3
    PARTICIPANT_KIND_DETAIL_BRIDGE_RTSP: _ParticipantKindDetail.ValueType  # 4

class ParticipantKindDetail(_ParticipantKindDetail, metaclass=_ParticipantKindDetailEnumTypeWrapper): ...

PARTICIPANT_KIND_DETAIL_CLOUD_AGENT: ParticipantKindDetail.ValueType  # 0
PARTICIPANT_KIND_DETAIL_FORWARDED: ParticipantKindDetail.ValueType  # 1
PARTICIPANT_KIND_DETAIL_CONNECTOR_WHATSAPP: ParticipantKindDetail.ValueType  # 2
PARTICIPANT_KIND_DETAIL_CONNECTOR_TWILIO: ParticipantKindDetail.ValueType  # 3
PARTICIPANT_KIND_DETAIL_BRIDGE_RTSP: ParticipantKindDetail.ValueType  # 4
global___ParticipantKindDetail = ParticipantKindDetail

class _DisconnectReason:
    ValueType = typing.NewType("ValueType", builtins.int)
    V: typing_extensions.TypeAlias = ValueType

class _DisconnectReasonEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DisconnectReason.ValueType], builtins.type):
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
    UNKNOWN_REASON: _DisconnectReason.ValueType  # 0
    CLIENT_INITIATED: _DisconnectReason.ValueType  # 1
    """the client initiated the disconnect"""
    DUPLICATE_IDENTITY: _DisconnectReason.ValueType  # 2
    """another participant with the same identity has joined the room"""
    SERVER_SHUTDOWN: _DisconnectReason.ValueType  # 3
    """the server instance is shutting down"""
    PARTICIPANT_REMOVED: _DisconnectReason.ValueType  # 4
    """RoomService.RemoveParticipant was called"""
    ROOM_DELETED: _DisconnectReason.ValueType  # 5
    """RoomService.DeleteRoom was called"""
    STATE_MISMATCH: _DisconnectReason.ValueType  # 6
    """the client is attempting to resume a session, but server is not aware of it"""
    JOIN_FAILURE: _DisconnectReason.ValueType  # 7
    """client was unable to connect fully"""
    MIGRATION: _DisconnectReason.ValueType  # 8
    """Cloud-only, the server requested Participant to migrate the connection elsewhere"""
    SIGNAL_CLOSE: _DisconnectReason.ValueType  # 9
    """the signal websocket was closed unexpectedly"""
    ROOM_CLOSED: _DisconnectReason.ValueType  # 10
    """the room was closed, due to all Standard and Ingress participants having left"""
    USER_UNAVAILABLE: _DisconnectReason.ValueType  # 11
    """SIP callee did not respond in time"""
    USER_REJECTED: _DisconnectReason.ValueType  # 12
    """SIP callee rejected the call (busy)"""
    SIP_TRUNK_FAILURE: _DisconnectReason.ValueType  # 13
    """SIP protocol failure or unexpected response"""
    CONNECTION_TIMEOUT: _DisconnectReason.ValueType  # 14
    MEDIA_FAILURE: _DisconnectReason.ValueType  # 15
    AGENT_ERROR: _DisconnectReason.ValueType  # 16

class DisconnectReason(_DisconnectReason, metaclass=_DisconnectReasonEnumTypeWrapper): ...

UNKNOWN_REASON: DisconnectReason.ValueType  # 0
CLIENT_INITIATED: DisconnectReason.ValueType  # 1
"""the client initiated the disconnect"""
DUPLICATE_IDENTITY: DisconnectReason.ValueType  # 2
"""another participant with the same identity has joined the room"""
SERVER_SHUTDOWN: DisconnectReason.ValueType  # 3
"""the server instance is shutting down"""
PARTICIPANT_REMOVED: DisconnectReason.ValueType  # 4
"""RoomService.RemoveParticipant was called"""
ROOM_DELETED: DisconnectReason.ValueType  # 5
"""RoomService.DeleteRoom was called"""
STATE_MISMATCH: DisconnectReason.ValueType  # 6
"""the client is attempting to resume a session, but server is not aware of it"""
JOIN_FAILURE: DisconnectReason.ValueType  # 7
"""client was unable to connect fully"""
MIGRATION: DisconnectReason.ValueType  # 8
"""Cloud-only, the server requested Participant to migrate the connection elsewhere"""
SIGNAL_CLOSE: DisconnectReason.ValueType  # 9
"""the signal websocket was closed unexpectedly"""
ROOM_CLOSED: DisconnectReason.ValueType  # 10
"""the room was closed, due to all Standard and Ingress participants having left"""
USER_UNAVAILABLE: DisconnectReason.ValueType  # 11
"""SIP callee did not respond in time"""
USER_REJECTED: DisconnectReason.ValueType  # 12
"""SIP callee rejected the call (busy)"""
SIP_TRUNK_FAILURE: DisconnectReason.ValueType  # 13
"""SIP protocol failure or unexpected response"""
CONNECTION_TIMEOUT: DisconnectReason.ValueType  # 14
MEDIA_FAILURE: DisconnectReason.ValueType  # 15
AGENT_ERROR: DisconnectReason.ValueType  # 16
global___DisconnectReason = DisconnectReason

@typing.final
class ParticipantInfo(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    @typing.final
    class AttributesEntry(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        KEY_FIELD_NUMBER: builtins.int
        VALUE_FIELD_NUMBER: builtins.int
        key: builtins.str
        value: builtins.str
        def __init__(
            self,
            *,
            key: builtins.str | None = ...,
            value: builtins.str | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ...

    SID_FIELD_NUMBER: builtins.int
    NAME_FIELD_NUMBER: builtins.int
    IDENTITY_FIELD_NUMBER: builtins.int
    STATE_FIELD_NUMBER: builtins.int
    METADATA_FIELD_NUMBER: builtins.int
    ATTRIBUTES_FIELD_NUMBER: builtins.int
    KIND_FIELD_NUMBER: builtins.int
    DISCONNECT_REASON_FIELD_NUMBER: builtins.int
    JOINED_AT_FIELD_NUMBER: builtins.int
    KIND_DETAILS_FIELD_NUMBER: builtins.int
    PERMISSION_FIELD_NUMBER: builtins.int
    sid: builtins.str
    name: builtins.str
    identity: builtins.str
    state: global___ParticipantState.ValueType
    metadata: builtins.str
    kind: global___ParticipantKind.ValueType
    disconnect_reason: global___DisconnectReason.ValueType
    joined_at: builtins.int
    """ms timestamp of when the participant joined the room, maps to joined_at_ms in livekit_models"""
    @property
    def attributes(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]: ...
    @property
    def kind_details(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[global___ParticipantKindDetail.ValueType]: ...
    @property
    def permission(self) -> global___ParticipantPermission: ...
    def __init__(
        self,
        *,
        sid: builtins.str | None = ...,
        name: builtins.str | None = ...,
        identity: builtins.str | None = ...,
        state: global___ParticipantState.ValueType | None = ...,
        metadata: builtins.str | None = ...,
        attributes: collections.abc.Mapping[builtins.str, builtins.str] | None = ...,
        kind: global___ParticipantKind.ValueType | None = ...,
        disconnect_reason: global___DisconnectReason.ValueType | None = ...,
        joined_at: builtins.int | None = ...,
        kind_details: collections.abc.Iterable[global___ParticipantKindDetail.ValueType] | None = ...,
        permission: global___ParticipantPermission | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["disconnect_reason", b"disconnect_reason", "identity", b"identity", "joined_at", b"joined_at", "kind", b"kind", "metadata", b"metadata", "name", b"name", "permission", b"permission", "sid", b"sid", "state", b"state"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["attributes", b"attributes", "disconnect_reason", b"disconnect_reason", "identity", b"identity", "joined_at", b"joined_at", "kind", b"kind", "kind_details", b"kind_details", "metadata", b"metadata", "name", b"name", "permission", b"permission", "sid", b"sid", "state", b"state"]) -> None: ...

global___ParticipantInfo = ParticipantInfo

@typing.final
class OwnedParticipant(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    HANDLE_FIELD_NUMBER: builtins.int
    INFO_FIELD_NUMBER: builtins.int
    @property
    def handle(self) -> handle_pb2.FfiOwnedHandle: ...
    @property
    def info(self) -> global___ParticipantInfo: ...
    def __init__(
        self,
        *,
        handle: handle_pb2.FfiOwnedHandle | None = ...,
        info: global___ParticipantInfo | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["handle", b"handle", "info", b"info"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["handle", b"handle", "info", b"info"]) -> None: ...

global___OwnedParticipant = OwnedParticipant

@typing.final
class ParticipantPermission(google.protobuf.message.Message):
    """copied from livekit-protocol/protocol/protobufs/livekit_models.proto and removed deprecated fields"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    CAN_SUBSCRIBE_FIELD_NUMBER: builtins.int
    CAN_PUBLISH_FIELD_NUMBER: builtins.int
    CAN_PUBLISH_DATA_FIELD_NUMBER: builtins.int
    CAN_PUBLISH_SOURCES_FIELD_NUMBER: builtins.int
    HIDDEN_FIELD_NUMBER: builtins.int
    CAN_UPDATE_METADATA_FIELD_NUMBER: builtins.int
    CAN_SUBSCRIBE_METRICS_FIELD_NUMBER: builtins.int
    CAN_MANAGE_AGENT_SESSION_FIELD_NUMBER: builtins.int
    can_subscribe: builtins.bool
    """allow participant to subscribe to other tracks in the room"""
    can_publish: builtins.bool
    """allow participant to publish new tracks to room"""
    can_publish_data: builtins.bool
    """allow participant to publish data"""
    hidden: builtins.bool
    """indicates that it's hidden to others"""
    can_update_metadata: builtins.bool
    """indicates that participant can update own metadata and attributes"""
    can_subscribe_metrics: builtins.bool
    """if a participant can subscribe to metrics"""
    can_manage_agent_session: builtins.bool
    """if a participant can manage an agent session via RemoteSession (control and access state)"""
    @property
    def can_publish_sources(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[track_pb2.TrackSource.ValueType]:
        """sources that are allowed to be published"""

    def __init__(
        self,
        *,
        can_subscribe: builtins.bool | None = ...,
        can_publish: builtins.bool | None = ...,
        can_publish_data: builtins.bool | None = ...,
        can_publish_sources: collections.abc.Iterable[track_pb2.TrackSource.ValueType] | None = ...,
        hidden: builtins.bool | None = ...,
        can_update_metadata: builtins.bool | None = ...,
        can_subscribe_metrics: builtins.bool | None = ...,
        can_manage_agent_session: builtins.bool | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["can_manage_agent_session", b"can_manage_agent_session", "can_publish", b"can_publish", "can_publish_data", b"can_publish_data", "can_subscribe", b"can_subscribe", "can_subscribe_metrics", b"can_subscribe_metrics", "can_update_metadata", b"can_update_metadata", "hidden", b"hidden"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["can_manage_agent_session", b"can_manage_agent_session", "can_publish", b"can_publish", "can_publish_data", b"can_publish_data", "can_publish_sources", b"can_publish_sources", "can_subscribe", b"can_subscribe", "can_subscribe_metrics", b"can_subscribe_metrics", "can_update_metadata", b"can_update_metadata", "hidden", b"hidden"]) -> None: ...

global___ParticipantPermission = ParticipantPermission
