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

Defines events for background web platform features.
https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService/

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

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


class StartObservingInput(InputModel):

    service: BackgroundService.ServiceName


class StartObserving(CDPMethod[None]):
    """ Enables event updates for the service. """

    INPUT_VALIDATOR = StartObservingInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        service: BackgroundService.ServiceName
    ):
        super().__init__(
            service=service
        )


class StopObservingInput(InputModel):

    service: BackgroundService.ServiceName


class StopObserving(CDPMethod[None]):
    """ Disables event updates for the service. """

    INPUT_VALIDATOR = StopObservingInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        service: BackgroundService.ServiceName
    ):
        super().__init__(
            service=service
        )


class SetRecordingInput(InputModel):

    shouldRecord: bool
    service: BackgroundService.ServiceName


class SetRecording(CDPMethod[None]):
    """ Set the recording state for the service. """

    INPUT_VALIDATOR = SetRecordingInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        should_record: bool,
        service: BackgroundService.ServiceName
    ):
        super().__init__(
            shouldRecord=should_record,
            service=service
        )


class ClearEventsInput(InputModel):

    service: BackgroundService.ServiceName


class ClearEvents(CDPMethod[None]):
    """ Clears all stored data for the service. """

    INPUT_VALIDATOR = ClearEventsInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        service: BackgroundService.ServiceName
    ):
        super().__init__(
            service=service
        )
