# 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.dom_storage
from cdp.dom_storage import (
    DomStorageItemAdded,
    DomStorageItemRemoved,
    DomStorageItemUpdated,
    DomStorageItemsCleared,
    Item,
    StorageId
)


async def clear(
        storage_id: StorageId
    ) -> None:
    '''
    :param storage_id:
    '''
    session = get_session_context('dom_storage.clear')
    return await session.execute(cdp.dom_storage.clear(storage_id))


async def disable() -> None:
    '''
    Disables storage tracking, prevents storage events from being sent to the client.
    '''
    session = get_session_context('dom_storage.disable')
    return await session.execute(cdp.dom_storage.disable())


async def enable() -> None:
    '''
    Enables storage tracking, storage events will now be delivered to the client.
    '''
    session = get_session_context('dom_storage.enable')
    return await session.execute(cdp.dom_storage.enable())


async def get_dom_storage_items(
        storage_id: StorageId
    ) -> typing.List[Item]:
    '''
    :param storage_id:
    :returns: 
    '''
    session = get_session_context('dom_storage.get_dom_storage_items')
    return await session.execute(cdp.dom_storage.get_dom_storage_items(storage_id))


async def remove_dom_storage_item(
        storage_id: StorageId,
        key: str
    ) -> None:
    '''
    :param storage_id:
    :param key:
    '''
    session = get_session_context('dom_storage.remove_dom_storage_item')
    return await session.execute(cdp.dom_storage.remove_dom_storage_item(storage_id, key))


async def set_dom_storage_item(
        storage_id: StorageId,
        key: str,
        value: str
    ) -> None:
    '''
    :param storage_id:
    :param key:
    :param value:
    '''
    session = get_session_context('dom_storage.set_dom_storage_item')
    return await session.execute(cdp.dom_storage.set_dom_storage_item(storage_id, key, value))
