package webauthn

// Code generated by cdproto-gen. DO NOT EDIT.

import (
	

	
	
	
)

// AuthenticatorID [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-AuthenticatorId
type AuthenticatorID string

// String returns the AuthenticatorID as string value.
func ( AuthenticatorID) () string {
	return string()
}

// AuthenticatorProtocol [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-AuthenticatorProtocol
type AuthenticatorProtocol string

// String returns the AuthenticatorProtocol as string value.
func ( AuthenticatorProtocol) () string {
	return string()
}

// AuthenticatorProtocol values.
const (
	AuthenticatorProtocolU2f   AuthenticatorProtocol = "u2f"
	AuthenticatorProtocolCtap2 AuthenticatorProtocol = "ctap2"
)

// MarshalEasyJSON satisfies easyjson.Marshaler.
func ( AuthenticatorProtocol) ( *jwriter.Writer) {
	.String(string())
}

// MarshalJSON satisfies json.Marshaler.
func ( AuthenticatorProtocol) () ([]byte, error) {
	return easyjson.Marshal()
}

// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func ( *AuthenticatorProtocol) ( *jlexer.Lexer) {
	 := .String()
	switch AuthenticatorProtocol() {
	case AuthenticatorProtocolU2f:
		* = AuthenticatorProtocolU2f
	case AuthenticatorProtocolCtap2:
		* = AuthenticatorProtocolCtap2

	default:
		.AddError(fmt.Errorf("unknown AuthenticatorProtocol value: %v", ))
	}
}

// UnmarshalJSON satisfies json.Unmarshaler.
func ( *AuthenticatorProtocol) ( []byte) error {
	return easyjson.Unmarshal(, )
}

// Ctap2version [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-Ctap2Version
type Ctap2version string

// String returns the Ctap2version as string value.
func ( Ctap2version) () string {
	return string()
}

// Ctap2version values.
const (
	Ctap2versionCtap20 Ctap2version = "ctap2_0"
	Ctap2versionCtap21 Ctap2version = "ctap2_1"
)

// MarshalEasyJSON satisfies easyjson.Marshaler.
func ( Ctap2version) ( *jwriter.Writer) {
	.String(string())
}

// MarshalJSON satisfies json.Marshaler.
func ( Ctap2version) () ([]byte, error) {
	return easyjson.Marshal()
}

// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func ( *Ctap2version) ( *jlexer.Lexer) {
	 := .String()
	switch Ctap2version() {
	case Ctap2versionCtap20:
		* = Ctap2versionCtap20
	case Ctap2versionCtap21:
		* = Ctap2versionCtap21

	default:
		.AddError(fmt.Errorf("unknown Ctap2version value: %v", ))
	}
}

// UnmarshalJSON satisfies json.Unmarshaler.
func ( *Ctap2version) ( []byte) error {
	return easyjson.Unmarshal(, )
}

// AuthenticatorTransport [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-AuthenticatorTransport
type AuthenticatorTransport string

// String returns the AuthenticatorTransport as string value.
func ( AuthenticatorTransport) () string {
	return string()
}

// AuthenticatorTransport values.
const (
	AuthenticatorTransportUsb      AuthenticatorTransport = "usb"
	AuthenticatorTransportNfc      AuthenticatorTransport = "nfc"
	AuthenticatorTransportBle      AuthenticatorTransport = "ble"
	AuthenticatorTransportCable    AuthenticatorTransport = "cable"
	AuthenticatorTransportInternal AuthenticatorTransport = "internal"
)

// MarshalEasyJSON satisfies easyjson.Marshaler.
func ( AuthenticatorTransport) ( *jwriter.Writer) {
	.String(string())
}

// MarshalJSON satisfies json.Marshaler.
func ( AuthenticatorTransport) () ([]byte, error) {
	return easyjson.Marshal()
}

// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func ( *AuthenticatorTransport) ( *jlexer.Lexer) {
	 := .String()
	switch AuthenticatorTransport() {
	case AuthenticatorTransportUsb:
		* = AuthenticatorTransportUsb
	case AuthenticatorTransportNfc:
		* = AuthenticatorTransportNfc
	case AuthenticatorTransportBle:
		* = AuthenticatorTransportBle
	case AuthenticatorTransportCable:
		* = AuthenticatorTransportCable
	case AuthenticatorTransportInternal:
		* = AuthenticatorTransportInternal

	default:
		.AddError(fmt.Errorf("unknown AuthenticatorTransport value: %v", ))
	}
}

// UnmarshalJSON satisfies json.Unmarshaler.
func ( *AuthenticatorTransport) ( []byte) error {
	return easyjson.Unmarshal(, )
}

// VirtualAuthenticatorOptions [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-VirtualAuthenticatorOptions
type VirtualAuthenticatorOptions struct {
	Protocol                    AuthenticatorProtocol  `json:"protocol"`
	Ctap2version                Ctap2version           `json:"ctap2Version,omitempty"` // Defaults to ctap2_0. Ignored if |protocol| == u2f.
	Transport                   AuthenticatorTransport `json:"transport"`
	HasResidentKey              bool                   `json:"hasResidentKey,omitempty"`              // Defaults to false.
	HasUserVerification         bool                   `json:"hasUserVerification,omitempty"`         // Defaults to false.
	HasLargeBlob                bool                   `json:"hasLargeBlob,omitempty"`                // If set to true, the authenticator will support the largeBlob extension. https://w3c.github.io/webauthn#largeBlob Defaults to false.
	HasCredBlob                 bool                   `json:"hasCredBlob,omitempty"`                 // If set to true, the authenticator will support the credBlob extension. https://fidoalliance.org/specs/fido-v2.1-rd-20201208/fido-client-to-authenticator-protocol-v2.1-rd-20201208.html#sctn-credBlob-extension Defaults to false.
	HasMinPinLength             bool                   `json:"hasMinPinLength,omitempty"`             // If set to true, the authenticator will support the minPinLength extension. https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-minpinlength-extension Defaults to false.
	HasPrf                      bool                   `json:"hasPrf,omitempty"`                      // If set to true, the authenticator will support the prf extension. https://w3c.github.io/webauthn/#prf-extension Defaults to false.
	AutomaticPresenceSimulation bool                   `json:"automaticPresenceSimulation,omitempty"` // If set to true, tests of user presence will succeed immediately. Otherwise, they will not be resolved. Defaults to true.
	IsUserVerified              bool                   `json:"isUserVerified,omitempty"`              // Sets whether User Verification succeeds or fails for an authenticator. Defaults to false.
}

// Credential [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/WebAuthn#type-Credential
type Credential struct {
	CredentialID         string `json:"credentialId"`
	IsResidentCredential bool   `json:"isResidentCredential"`
	RpID                 string `json:"rpId,omitempty"`       // Relying Party ID the credential is scoped to. Must be set when adding a credential.
	PrivateKey           string `json:"privateKey"`           // The ECDSA P-256 private key in PKCS#8 format.
	UserHandle           string `json:"userHandle,omitempty"` // An opaque byte sequence with a maximum size of 64 bytes mapping the credential to a specific user.
	SignCount            int64  `json:"signCount"`            // Signature counter. This is incremented by one for each successful assertion. See https://w3c.github.io/webauthn/#signature-counter
	LargeBlob            string `json:"largeBlob,omitempty"`  // The large blob associated with the credential. See https://w3c.github.io/webauthn/#sctn-large-blob-extension
}