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

Query and modify DOM storage.
https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage/

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

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


class ClearInput(InputModel):

    storageId: DOMStorage.StorageId


class Clear(CDPMethod[None]):

    INPUT_VALIDATOR = ClearInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        storage_id: DOMStorage.StorageId
    ):
        super().__init__(
            storageId=storage_id
        )


class Disable(CDPMethod[None]):
    """ Disables storage tracking, prevents storage events from being sent to the client. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class Enable(CDPMethod[None]):
    """ Enables storage tracking, storage events will now be delivered to the client. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class GetDOMStorageItemsInput(InputModel):

    storageId: DOMStorage.StorageId


class GetDOMStorageItemsOutput(OutputModel):

    entries: list[DOMStorage.Item]


class GetDOMStorageItems(CDPMethod[GetDOMStorageItemsOutput]):

    INPUT_VALIDATOR = GetDOMStorageItemsInput
    OUTPUT_VALIDATOR = GetDOMStorageItemsOutput

    def __init__(
        self,
        *,
        storage_id: DOMStorage.StorageId
    ):
        super().__init__(
            storageId=storage_id
        )


class RemoveDOMStorageItemInput(InputModel):

    storageId: DOMStorage.StorageId
    key: str


class RemoveDOMStorageItem(CDPMethod[None]):

    INPUT_VALIDATOR = RemoveDOMStorageItemInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        storage_id: DOMStorage.StorageId,
        key: str
    ):
        super().__init__(
            storageId=storage_id,
            key=key
        )


class SetDOMStorageItemInput(InputModel):

    storageId: DOMStorage.StorageId
    key: str
    value: str


class SetDOMStorageItem(CDPMethod[None]):

    INPUT_VALIDATOR = SetDOMStorageItemInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        storage_id: DOMStorage.StorageId,
        key: str,
        value: str
    ):
        super().__init__(
            storageId=storage_id,
            key=key,
            value=value
        )
