func (c *WebAuthn) SetAutomaticPresenceSimulationWithParams(ctx context.Context, v *WebAuthnSetAutomaticPresenceSimulationParams) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "WebAuthn.setAutomaticPresenceSimulation", Params: v})
}
SetAutomaticPresenceSimulationWithParams - Sets whether tests of user presence will succeed immediately (if true) or fail to resolve (if false) for an authenticator. The default is true.
package gcdapi
import (
	"context"
	"github.com/wirepair/gcd/v2/gcdmessage"
)
type WebAuthnVirtualAuthenticatorOptions struct {
	Protocol                    string `json:"protocol"`                               
	Ctap2Version                string `json:"ctap2Version,omitempty"`                 
	Transport                   string `json:"transport"`                              
	HasResidentKey              bool   `json:"hasResidentKey,omitempty"`               
	HasUserVerification         bool   `json:"hasUserVerification,omitempty"`          
	HasLargeBlob                bool   `json:"hasLargeBlob,omitempty"`                 
	HasCredBlob                 bool   `json:"hasCredBlob,omitempty"`                  
	AutomaticPresenceSimulation bool   `json:"automaticPresenceSimulation,omitempty"`  
	IsUserVerified              bool   `json:"isUserVerified,omitempty"`               
}
type WebAuthnCredential struct {
	CredentialId         string `json:"credentialId"`          
	IsResidentCredential bool   `json:"isResidentCredential"`  
	RpId                 string `json:"rpId,omitempty"`        
	PrivateKey           string `json:"privateKey"`            
	UserHandle           string `json:"userHandle,omitempty"`  
	SignCount            int    `json:"signCount"`             
	LargeBlob            string `json:"largeBlob,omitempty"`   
}
type WebAuthn struct {
	target gcdmessage.ChromeTargeter
}
func NewWebAuthn(target gcdmessage.ChromeTargeter) *WebAuthn {
	c := &WebAuthn{target: target}
	return c
}
func (c *WebAuthn) Enable(ctx context.Context) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "WebAuthn.enable"})
}
func (c *WebAuthn) Disable(ctx context.Context) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "WebAuthn.disable"})
}
type WebAuthnAddVirtualAuthenticatorParams struct {
	Options *WebAuthnVirtualAuthenticatorOptions `json:"options"`
}
func (c *WebAuthn) AddVirtualAuthenticatorWithParams(ctx context.Context, v *WebAuthnAddVirtualAuthenticatorParams) (string, error) {
	resp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "WebAuthn.addVirtualAuthenticator", Params: v})
	if err != nil {
		return "", err
	}
	var chromeData struct {
		Result struct {
			AuthenticatorId string
		}
	}
	if resp == nil {
		return "", &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return "", &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return "", err
	}
	return chromeData.Result.AuthenticatorId, nil
}
func (c *WebAuthn) AddVirtualAuthenticator(ctx context.Context, options *WebAuthnVirtualAuthenticatorOptions) (string, error) {
	var v WebAuthnAddVirtualAuthenticatorParams
	v.Options = options
	return c.AddVirtualAuthenticatorWithParams(ctx, &v)
}
type WebAuthnRemoveVirtualAuthenticatorParams struct {
	AuthenticatorId string `json:"authenticatorId"`
}
func (c *WebAuthn) RemoveVirtualAuthenticatorWithParams(ctx context.Context, v *WebAuthnRemoveVirtualAuthenticatorParams) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "WebAuthn.removeVirtualAuthenticator", Params: v})
}
func (c *WebAuthn) RemoveVirtualAuthenticator(ctx context.Context, authenticatorId string) (*gcdmessage.ChromeResponse, error) {
	var v WebAuthnRemoveVirtualAuthenticatorParams
	v.AuthenticatorId = authenticatorId
	return c.RemoveVirtualAuthenticatorWithParams(ctx, &v)
}
type WebAuthnAddCredentialParams struct {
	AuthenticatorId string `json:"authenticatorId"`
	Credential *WebAuthnCredential `json:"credential"`
}
func (c *WebAuthn) AddCredentialWithParams(ctx context.Context, v *WebAuthnAddCredentialParams) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "WebAuthn.addCredential", Params: v})
}
func (c *WebAuthn) AddCredential(ctx context.Context, authenticatorId string, credential *WebAuthnCredential) (*gcdmessage.ChromeResponse, error) {
	var v WebAuthnAddCredentialParams
	v.AuthenticatorId = authenticatorId
	v.Credential = credential
	return c.AddCredentialWithParams(ctx, &v)
}
type WebAuthnGetCredentialParams struct {
	AuthenticatorId string `json:"authenticatorId"`
	CredentialId string `json:"credentialId"`
}
func (c *WebAuthn) GetCredentialWithParams(ctx context.Context, v *WebAuthnGetCredentialParams) (*WebAuthnCredential, error) {
	resp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "WebAuthn.getCredential", Params: v})
	if err != nil {
		return nil, err
	}
	var chromeData struct {
		Result struct {
			Credential *WebAuthnCredential
		}
	}
	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}
	return chromeData.Result.Credential, nil
}
func (c *WebAuthn) GetCredential(ctx context.Context, authenticatorId string, credentialId string) (*WebAuthnCredential, error) {
	var v WebAuthnGetCredentialParams
	v.AuthenticatorId = authenticatorId
	v.CredentialId = credentialId
	return c.GetCredentialWithParams(ctx, &v)
}
type WebAuthnGetCredentialsParams struct {
	AuthenticatorId string `json:"authenticatorId"`
}
func (c *WebAuthn) GetCredentialsWithParams(ctx context.Context, v *WebAuthnGetCredentialsParams) ([]*WebAuthnCredential, error) {
	resp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "WebAuthn.getCredentials", Params: v})
	if err != nil {
		return nil, err
	}
	var chromeData struct {
		Result struct {
			Credentials []*WebAuthnCredential
		}
	}
	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}
	return chromeData.Result.Credentials, nil
}
func (c *WebAuthn) GetCredentials(ctx context.Context, authenticatorId string) ([]*WebAuthnCredential, error) {
	var v WebAuthnGetCredentialsParams
	v.AuthenticatorId = authenticatorId
	return c.GetCredentialsWithParams(ctx, &v)
}
type WebAuthnRemoveCredentialParams struct {
	AuthenticatorId string `json:"authenticatorId"`
	CredentialId string `json:"credentialId"`
}
func (c *WebAuthn) RemoveCredentialWithParams(ctx context.Context, v *WebAuthnRemoveCredentialParams) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "WebAuthn.removeCredential", Params: v})
}
func (c *WebAuthn) RemoveCredential(ctx context.Context, authenticatorId string, credentialId string) (*gcdmessage.ChromeResponse, error) {
	var v WebAuthnRemoveCredentialParams
	v.AuthenticatorId = authenticatorId
	v.CredentialId = credentialId
	return c.RemoveCredentialWithParams(ctx, &v)
}
type WebAuthnClearCredentialsParams struct {
	AuthenticatorId string `json:"authenticatorId"`
}
func (c *WebAuthn) ClearCredentialsWithParams(ctx context.Context, v *WebAuthnClearCredentialsParams) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "WebAuthn.clearCredentials", Params: v})
}
func (c *WebAuthn) ClearCredentials(ctx context.Context, authenticatorId string) (*gcdmessage.ChromeResponse, error) {
	var v WebAuthnClearCredentialsParams
	v.AuthenticatorId = authenticatorId
	return c.ClearCredentialsWithParams(ctx, &v)
}
type WebAuthnSetUserVerifiedParams struct {
	AuthenticatorId string `json:"authenticatorId"`
	IsUserVerified bool `json:"isUserVerified"`
}
func (c *WebAuthn) SetUserVerifiedWithParams(ctx context.Context, v *WebAuthnSetUserVerifiedParams) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "WebAuthn.setUserVerified", Params: v})
}
func (c *WebAuthn) SetUserVerified(ctx context.Context, authenticatorId string, isUserVerified bool) (*gcdmessage.ChromeResponse, error) {
	var v WebAuthnSetUserVerifiedParams
	v.AuthenticatorId = authenticatorId
	v.IsUserVerified = isUserVerified
	return c.SetUserVerifiedWithParams(ctx, &v)
}
type WebAuthnSetAutomaticPresenceSimulationParams struct {
	AuthenticatorId string `json:"authenticatorId"`
	Enabled bool `json:"enabled"`
}