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


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

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

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


class Disable(CDPMethod[None]):
    """ Disables tracking security state changes. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class Enable(CDPMethod[None]):
    """ Enables tracking security state changes. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class SetIgnoreCertificateErrorsInput(InputModel):

    ignore: bool


class SetIgnoreCertificateErrors(CDPMethod[None]):
    """ Enable/disable whether all certificate errors should be ignored. """

    INPUT_VALIDATOR = SetIgnoreCertificateErrorsInput
    OUTPUT_VALIDATOR = None

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


class HandleCertificateErrorInput(InputModel):

    eventId: int
    action: Security.CertificateErrorAction


class HandleCertificateError(CDPMethod[None]):  # deprecated
    """ Handles a certificate error that fired a certificateError event. """

    INPUT_VALIDATOR = HandleCertificateErrorInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        event_id: int,
        action: Security.CertificateErrorAction
    ):
        super().__init__(
            eventId=event_id,
            action=action
        )


class SetOverrideCertificateErrorsInput(InputModel):

    override: bool


class SetOverrideCertificateErrors(CDPMethod[None]):  # deprecated
    """ Enable/disable overriding certificate errors. If enabled, all certificate error events need to
    be handled by the DevTools client and should be answered with `handleCertificateError` commands. """

    INPUT_VALIDATOR = SetOverrideCertificateErrorsInput
    OUTPUT_VALIDATOR = None

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