# 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.log
from cdp.log import (
    EntryAdded,
    LogEntry,
    ViolationSetting
)


async def clear() -> None:
    '''
    Clears the log.
    '''
    session = get_session_context('log.clear')
    return await session.execute(cdp.log.clear())


async def disable() -> None:
    '''
    Disables log domain, prevents further log entries from being reported to the client.
    '''
    session = get_session_context('log.disable')
    return await session.execute(cdp.log.disable())


async def enable() -> None:
    '''
    Enables log domain, sends the entries collected so far to the client by means of the
    ``entryAdded`` notification.
    '''
    session = get_session_context('log.enable')
    return await session.execute(cdp.log.enable())


async def start_violations_report(
        config: typing.List[ViolationSetting]
    ) -> None:
    '''
    start violation reporting.

    :param config: Configuration for violations.
    '''
    session = get_session_context('log.start_violations_report')
    return await session.execute(cdp.log.start_violations_report(config))


async def stop_violations_report() -> None:
    '''
    Stop violation reporting.
    '''
    session = get_session_context('log.stop_violations_report')
    return await session.execute(cdp.log.stop_violations_report())
