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

This domain allows inspection of Web Audio API.
https://webaudio.github.io/web-audio-api/
https://chromedevtools.github.io/devtools-protocol/tot/WebAudio/

***************************************************
                    Methods
***************************************************
"""
from __future__ import annotations

from cdpkit.protocol._types import (
    WebAudio,
)
from cdpkit.protocol.base import CDPMethod, InputModel, OutputModel


class Enable(CDPMethod[None]):
    """ Enables the WebAudio domain and starts sending context lifetime events. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class Disable(CDPMethod[None]):
    """ Disables the WebAudio domain. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class GetRealtimeDataInput(InputModel):

    contextId: WebAudio.GraphObjectId


class GetRealtimeDataOutput(OutputModel):

    realtimeData: WebAudio.ContextRealtimeData


class GetRealtimeData(CDPMethod[GetRealtimeDataOutput]):
    """ Fetch the realtime data from the registered contexts. """

    INPUT_VALIDATOR = GetRealtimeDataInput
    OUTPUT_VALIDATOR = GetRealtimeDataOutput

    def __init__(
        self,
        *,
        context_id: WebAudio.GraphObjectId
    ):
        super().__init__(
            contextId=context_id
        )
