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

This domain allows detailed inspection of media elements.
https://chromedevtools.github.io/devtools-protocol/tot/Media/

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

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


class PlayerPropertiesChanged(CDPEvent):
    """ This can be called multiple times, and can be used to set / override /
    remove player properties. A null propValue indicates removal. """

    playerId: Media.PlayerId
    properties: list[Media.PlayerProperty]


class PlayerEventsAdded(CDPEvent):
    """ Send events as a list, allowing them to be batched on the browser for less
    congestion. If batched, events must ALWAYS be in chronological order. """

    playerId: Media.PlayerId
    events: list[Media.PlayerEvent]


class PlayerMessagesLogged(CDPEvent):
    """ Send a list of any messages that need to be delivered. """

    playerId: Media.PlayerId
    messages: list[Media.PlayerMessage]


class PlayerErrorsRaised(CDPEvent):
    """ Send a list of any errors that need to be delivered. """

    playerId: Media.PlayerId
    errors: list[Media.PlayerError]


class PlayerCreated(CDPEvent):
    """ Called whenever a player is created, or when a new agent joins and receives
    a list of active players. If an agent is restored, it will receive one
    event for each active player. """

    player: Media.Player
