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


https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/

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

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


class DeliverPushMessageInput(InputModel):

    origin: str
    registrationId: ServiceWorker.RegistrationID
    data: str


class DeliverPushMessage(CDPMethod[None]):

    INPUT_VALIDATOR = DeliverPushMessageInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        origin: str,
        registration_id: ServiceWorker.RegistrationID,
        data: str
    ):
        super().__init__(
            origin=origin,
            registrationId=registration_id,
            data=data
        )


class Disable(CDPMethod[None]):

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class DispatchSyncEventInput(InputModel):

    origin: str
    registrationId: ServiceWorker.RegistrationID
    tag: str
    lastChance: bool


class DispatchSyncEvent(CDPMethod[None]):

    INPUT_VALIDATOR = DispatchSyncEventInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        origin: str,
        registration_id: ServiceWorker.RegistrationID,
        tag: str,
        last_chance: bool
    ):
        super().__init__(
            origin=origin,
            registrationId=registration_id,
            tag=tag,
            lastChance=last_chance
        )


class DispatchPeriodicSyncEventInput(InputModel):

    origin: str
    registrationId: ServiceWorker.RegistrationID
    tag: str


class DispatchPeriodicSyncEvent(CDPMethod[None]):

    INPUT_VALIDATOR = DispatchPeriodicSyncEventInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        origin: str,
        registration_id: ServiceWorker.RegistrationID,
        tag: str
    ):
        super().__init__(
            origin=origin,
            registrationId=registration_id,
            tag=tag
        )


class Enable(CDPMethod[None]):

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class SetForceUpdateOnPageLoadInput(InputModel):

    forceUpdateOnPageLoad: bool


class SetForceUpdateOnPageLoad(CDPMethod[None]):

    INPUT_VALIDATOR = SetForceUpdateOnPageLoadInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        force_update_on_page_load: bool
    ):
        super().__init__(
            forceUpdateOnPageLoad=force_update_on_page_load
        )


class SkipWaitingInput(InputModel):

    scopeURL: str


class SkipWaiting(CDPMethod[None]):

    INPUT_VALIDATOR = SkipWaitingInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        scope_url: str
    ):
        super().__init__(
            scopeURL=scope_url
        )


class StartWorkerInput(InputModel):

    scopeURL: str


class StartWorker(CDPMethod[None]):

    INPUT_VALIDATOR = StartWorkerInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        scope_url: str
    ):
        super().__init__(
            scopeURL=scope_url
        )


class StopAllWorkers(CDPMethod[None]):

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class StopWorkerInput(InputModel):

    versionId: str


class StopWorker(CDPMethod[None]):

    INPUT_VALIDATOR = StopWorkerInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        version_id: str
    ):
        super().__init__(
            versionId=version_id
        )


class UnregisterInput(InputModel):

    scopeURL: str


class Unregister(CDPMethod[None]):

    INPUT_VALIDATOR = UnregisterInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        scope_url: str
    ):
        super().__init__(
            scopeURL=scope_url
        )


class UpdateRegistrationInput(InputModel):

    scopeURL: str


class UpdateRegistration(CDPMethod[None]):

    INPUT_VALIDATOR = UpdateRegistrationInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        scope_url: str
    ):
        super().__init__(
            scopeURL=scope_url
        )
