# DO NOT EDIT THIS FILE!
#
# This code is generated off of PyCDP modules. If you need to make
# changes, edit the generator and regenerate all of the modules.

from __future__ import annotations
import typing

from ..context import get_connection_context, get_session_context

import cdp.background_service
from cdp.background_service import (
    BackgroundServiceEvent,
    BackgroundServiceEventReceived,
    EventMetadata,
    RecordingStateChanged,
    ServiceName
)


async def clear_events(
        service: ServiceName
    ) -> None:
    '''
    Clears all stored data for the service.

    :param service:
    '''
    session = get_session_context('background_service.clear_events')
    return await session.execute(cdp.background_service.clear_events(service))


async def set_recording(
        should_record: bool,
        service: ServiceName
    ) -> None:
    '''
    Set the recording state for the service.

    :param should_record:
    :param service:
    '''
    session = get_session_context('background_service.set_recording')
    return await session.execute(cdp.background_service.set_recording(should_record, service))


async def start_observing(
        service: ServiceName
    ) -> None:
    '''
    Enables event updates for the service.

    :param service:
    '''
    session = get_session_context('background_service.start_observing')
    return await session.execute(cdp.background_service.start_observing(service))


async def stop_observing(
        service: ServiceName
    ) -> None:
    '''
    Disables event updates for the service.

    :param service:
    '''
    session = get_session_context('background_service.stop_observing')
    return await session.execute(cdp.background_service.stop_observing(service))
