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

This domain allows configuring virtual authenticators to test the WebAuthn
API.
https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn/

***************************************************
                    Events
***************************************************
"""
from __future__ import annotations

from cdpkit.protocol._types import (
    WebAuthn,
)
from cdpkit.protocol.base import CDPEvent


class CredentialAdded(CDPEvent):
    """ Triggered when a credential is added to an authenticator. """

    authenticatorId: WebAuthn.AuthenticatorId
    credential: WebAuthn.Credential


class CredentialDeleted(CDPEvent):
    """ Triggered when a credential is deleted, e.g. through
    PublicKeyCredential.signalUnknownCredential(). """

    authenticatorId: WebAuthn.AuthenticatorId
    credentialId: str


class CredentialUpdated(CDPEvent):
    """ Triggered when a credential is updated, e.g. through
    PublicKeyCredential.signalCurrentUserDetails(). """

    authenticatorId: WebAuthn.AuthenticatorId
    credential: WebAuthn.Credential


class CredentialAsserted(CDPEvent):
    """ Triggered when a credential is used in a webauthn assertion. """

    authenticatorId: WebAuthn.AuthenticatorId
    credential: WebAuthn.Credential
