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

This domain allows interacting with the FedCM dialog.
https://chromedevtools.github.io/devtools-protocol/tot/FedCm/

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

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


class EnableInput(InputModel):

    disableRejectionDelay: bool | None = None


class Enable(CDPMethod[None]):

    INPUT_VALIDATOR = EnableInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        disable_rejection_delay: bool | None = None
    ):
        super().__init__(
            disableRejectionDelay=disable_rejection_delay
        )


class Disable(CDPMethod[None]):

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class SelectAccountInput(InputModel):

    dialogId: str
    accountIndex: int


class SelectAccount(CDPMethod[None]):

    INPUT_VALIDATOR = SelectAccountInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        dialog_id: str,
        account_index: int
    ):
        super().__init__(
            dialogId=dialog_id,
            accountIndex=account_index
        )


class ClickDialogButtonInput(InputModel):

    dialogId: str
    dialogButton: FedCm.DialogButton


class ClickDialogButton(CDPMethod[None]):

    INPUT_VALIDATOR = ClickDialogButtonInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        dialog_id: str,
        dialog_button: FedCm.DialogButton
    ):
        super().__init__(
            dialogId=dialog_id,
            dialogButton=dialog_button
        )


class OpenUrlInput(InputModel):

    dialogId: str
    accountIndex: int
    accountUrlType: FedCm.AccountUrlType


class OpenUrl(CDPMethod[None]):

    INPUT_VALIDATOR = OpenUrlInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        dialog_id: str,
        account_index: int,
        account_url_type: FedCm.AccountUrlType
    ):
        super().__init__(
            dialogId=dialog_id,
            accountIndex=account_index,
            accountUrlType=account_url_type
        )


class DismissDialogInput(InputModel):

    dialogId: str
    triggerCooldown: bool | None = None


class DismissDialog(CDPMethod[None]):

    INPUT_VALIDATOR = DismissDialogInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        dialog_id: str,
        trigger_cooldown: bool | None = None
    ):
        super().__init__(
            dialogId=dialog_id,
            triggerCooldown=trigger_cooldown
        )


class ResetCooldown(CDPMethod[None]):
    """ Resets the cooldown time, if any, to allow the next FedCM call to show
    a dialog even if one was recently dismissed by the user. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None
