"""
This file is generated by generator/run.py based on the Chrome DevTools Protocol.

This domain allows configuring virtual Bluetooth devices to test
the web-bluetooth API.
https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/

***************************************************
                    Events
***************************************************
"""
from __future__ import annotations

from cdpkit.protocol._types import (
    BluetoothEmulation,
)
from cdpkit.protocol.base import CDPEvent


class GattOperationReceived(CDPEvent):
    """ Event for when a GATT operation of |type| to the peripheral with |address|
    happened. """

    address: str
    type: BluetoothEmulation.GATTOperationType


class CharacteristicOperationReceived(CDPEvent):
    """ Event for when a characteristic operation of |type| to the characteristic
    respresented by |characteristicId| happened. |data| and |writeType| is
    expected to exist when |type| is write. """

    characteristicId: str
    type: BluetoothEmulation.CharacteristicOperationType
    data: str | None = None
    writeType: BluetoothEmulation.CharacteristicWriteType | None = None


class DescriptorOperationReceived(CDPEvent):
    """ Event for when a descriptor operation of |type| to the descriptor
    respresented by |descriptorId| happened. |data| is expected to exist when
    |type| is write. """

    descriptorId: str
    type: BluetoothEmulation.DescriptorOperationType
    data: str | None = None
