packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PublicKeyCredentialCreationOptions.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webauthn-4 (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.PublicKeyCredentialCreationOptions
       (js_newPublicKeyCredentialCreationOptions, js_setRp, js_getRp, js_setUser, js_getUser, js_setChallenge, js_getChallenge, js_setPubKeyCredParams, js_getPubKeyCredParams, js_setTimeout, js_getTimeout, js_setExcludeCredentials, js_getExcludeCredentials, js_setAuthenticatorSelection, js_getAuthenticatorSelection, js_setHints, js_getHints, js_setAttestation, js_getAttestation, js_setAttestationFormats, js_getAttestationFormats, js_setExtensions, js_getExtensions, newPublicKeyCredentialCreationOptions, setRp, getRp, setUser, getUser, setChallenge, getChallenge, setPubKeyCredParams, getPubKeyCredParams, setTimeout, getTimeout, getTimeoutUnsafe, getTimeoutUnchecked, setExcludeCredentials, getExcludeCredentials, getExcludeCredentialsUnsafe, getExcludeCredentialsUnchecked, setAuthenticatorSelection, getAuthenticatorSelection, getAuthenticatorSelectionUnsafe, getAuthenticatorSelectionUnchecked, setHints, getHints, getHintsUnsafe, getHintsUnchecked, setAttestation, getAttestation, getAttestationUnsafe, getAttestationUnchecked, setAttestationFormats, getAttestationFormats, getAttestationFormatsUnsafe, getAttestationFormatsUnchecked, setExtensions, getExtensions, getExtensionsUnsafe, getExtensionsUnchecked, PublicKeyCredentialCreationOptions(..), gTypePublicKeyCredentialCreationOptions)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(($1, $2, $3, $4) => { return ({\"rp\": $1, \"user\": $2, \"challenge\": $3, \"pubKeyCredParams\": $4}); })"
        js_newPublicKeyCredentialCreationOptions :: PublicKeyCredentialRpEntity -> PublicKeyCredentialUserEntity -> BufferSource -> JSVal -> IO PublicKeyCredentialCreationOptions
-- | <https://w3c.github.io/webauthn/#dictdef-publickeycredentialcreationoptions PublicKeyCredentialCreationOptions specification>
newPublicKeyCredentialCreationOptions :: (MonadDOM m, IsBufferSource challenge) => PublicKeyCredentialRpEntity -> PublicKeyCredentialUserEntity -> challenge -> [PublicKeyCredentialParameters] -> m PublicKeyCredentialCreationOptions
newPublicKeyCredentialCreationOptions rp user challenge pubKeyCredParams = liftDOM (((toJSVal pubKeyCredParams) >>= \a4' -> js_newPublicKeyCredentialCreationOptions (rp) (user) (Types.toBufferSource challenge) a4'))

foreign import javascript safe "(($1, $2) => { $1[\"rp\"] = $2; })"
        js_setRp :: PublicKeyCredentialCreationOptions -> PublicKeyCredentialRpEntity -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-rp PublicKeyCredentialCreationOptions.rp specification>
setRp :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> PublicKeyCredentialRpEntity -> m ()
setRp self val = liftDOM (void ((js_setRp (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"rp\"]; })"
        js_getRp :: PublicKeyCredentialCreationOptions -> IO PublicKeyCredentialRpEntity
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-rp PublicKeyCredentialCreationOptions.rp specification>
getRp :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> m PublicKeyCredentialRpEntity
getRp self = liftDOM ((js_getRp (self)))

foreign import javascript safe "(($1, $2) => { $1[\"user\"] = $2; })"
        js_setUser :: PublicKeyCredentialCreationOptions -> PublicKeyCredentialUserEntity -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-user PublicKeyCredentialCreationOptions.user specification>
setUser :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> PublicKeyCredentialUserEntity -> m ()
setUser self val = liftDOM (void ((js_setUser (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"user\"]; })"
        js_getUser :: PublicKeyCredentialCreationOptions -> IO PublicKeyCredentialUserEntity
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-user PublicKeyCredentialCreationOptions.user specification>
getUser :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> m PublicKeyCredentialUserEntity
getUser self = liftDOM ((js_getUser (self)))

foreign import javascript safe "(($1, $2) => { $1[\"challenge\"] = $2; })"
        js_setChallenge :: PublicKeyCredentialCreationOptions -> BufferSource -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-challenge PublicKeyCredentialCreationOptions.challenge specification>
setChallenge :: (MonadDOM m, IsBufferSource val) => PublicKeyCredentialCreationOptions -> val -> m ()
setChallenge self val = liftDOM (void ((js_setChallenge (self) (Types.toBufferSource val))))

foreign import javascript unsafe "(($1) => { return $1[\"challenge\"]; })"
        js_getChallenge :: PublicKeyCredentialCreationOptions -> IO BufferSource
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-challenge PublicKeyCredentialCreationOptions.challenge specification>
getChallenge :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> m BufferSource
getChallenge self = liftDOM ((js_getChallenge (self)))

foreign import javascript safe "(($1, $2) => { $1[\"pubKeyCredParams\"] = $2; })"
        js_setPubKeyCredParams :: PublicKeyCredentialCreationOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-pubkeycredparams PublicKeyCredentialCreationOptions.pubKeyCredParams specification>
setPubKeyCredParams :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> [PublicKeyCredentialParameters] -> m ()
setPubKeyCredParams self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setPubKeyCredParams (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"pubKeyCredParams\"]; })"
        js_getPubKeyCredParams :: PublicKeyCredentialCreationOptions -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-pubkeycredparams PublicKeyCredentialCreationOptions.pubKeyCredParams specification>
getPubKeyCredParams :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> m [PublicKeyCredentialParameters]
getPubKeyCredParams self = liftDOM (((js_getPubKeyCredParams (self)) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"timeout\"] = $2; })"
        js_setTimeout :: PublicKeyCredentialCreationOptions -> Word -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-timeout PublicKeyCredentialCreationOptions.timeout specification>
setTimeout :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> Word -> m ()
setTimeout self val = liftDOM (void ((js_setTimeout (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"timeout\"]; })"
        js_getTimeout :: PublicKeyCredentialCreationOptions -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-timeout PublicKeyCredentialCreationOptions.timeout specification>
getTimeout :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> m (Maybe Word)
getTimeout self = liftDOM (((js_getTimeout (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-timeout PublicKeyCredentialCreationOptions.timeout specification>
getTimeoutUnsafe :: (MonadDOM m, HasCallStack) => PublicKeyCredentialCreationOptions -> m Word
getTimeoutUnsafe self = liftDOM ((((js_getTimeout (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-timeout PublicKeyCredentialCreationOptions.timeout specification>
getTimeoutUnchecked :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> m Word
getTimeoutUnchecked self = liftDOM ((pFromJSVal <$> (js_getTimeout (self))))

foreign import javascript safe "(($1, $2) => { $1[\"excludeCredentials\"] = $2; })"
        js_setExcludeCredentials :: PublicKeyCredentialCreationOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-excludecredentials PublicKeyCredentialCreationOptions.excludeCredentials specification>
setExcludeCredentials :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> [PublicKeyCredentialDescriptor] -> m ()
setExcludeCredentials self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setExcludeCredentials (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"excludeCredentials\"]; })"
        js_getExcludeCredentials :: PublicKeyCredentialCreationOptions -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-excludecredentials PublicKeyCredentialCreationOptions.excludeCredentials specification>
getExcludeCredentials :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> m (Maybe [PublicKeyCredentialDescriptor])
getExcludeCredentials self = liftDOM (((js_getExcludeCredentials (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-excludecredentials PublicKeyCredentialCreationOptions.excludeCredentials specification>
getExcludeCredentialsUnsafe :: (MonadDOM m, HasCallStack) => PublicKeyCredentialCreationOptions -> m [PublicKeyCredentialDescriptor]
getExcludeCredentialsUnsafe self = liftDOM ((((js_getExcludeCredentials (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-excludecredentials PublicKeyCredentialCreationOptions.excludeCredentials specification>
getExcludeCredentialsUnchecked :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> m [PublicKeyCredentialDescriptor]
getExcludeCredentialsUnchecked self = liftDOM (((js_getExcludeCredentials (self)) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"authenticatorSelection\"] = $2; })"
        js_setAuthenticatorSelection :: PublicKeyCredentialCreationOptions -> AuthenticatorSelectionCriteria -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-authenticatorselection PublicKeyCredentialCreationOptions.authenticatorSelection specification>
setAuthenticatorSelection :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> AuthenticatorSelectionCriteria -> m ()
setAuthenticatorSelection self val = liftDOM (void ((js_setAuthenticatorSelection (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"authenticatorSelection\"]; })"
        js_getAuthenticatorSelection :: PublicKeyCredentialCreationOptions -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-authenticatorselection PublicKeyCredentialCreationOptions.authenticatorSelection specification>
getAuthenticatorSelection :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> m (Maybe AuthenticatorSelectionCriteria)
getAuthenticatorSelection self = liftDOM (((js_getAuthenticatorSelection (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-authenticatorselection PublicKeyCredentialCreationOptions.authenticatorSelection specification>
getAuthenticatorSelectionUnsafe :: (MonadDOM m, HasCallStack) => PublicKeyCredentialCreationOptions -> m AuthenticatorSelectionCriteria
getAuthenticatorSelectionUnsafe self = liftDOM ((((js_getAuthenticatorSelection (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-authenticatorselection PublicKeyCredentialCreationOptions.authenticatorSelection specification>
getAuthenticatorSelectionUnchecked :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> m AuthenticatorSelectionCriteria
getAuthenticatorSelectionUnchecked self = liftDOM ((pFromJSVal <$> (js_getAuthenticatorSelection (self))))

foreign import javascript safe "(($1, $2) => { $1[\"hints\"] = $2; })"
        js_setHints :: PublicKeyCredentialCreationOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-hints PublicKeyCredentialCreationOptions.hints specification>
setHints :: (MonadDOM m, ToJSString val) => PublicKeyCredentialCreationOptions -> [val] -> m ()
setHints self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setHints (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"hints\"]; })"
        js_getHints :: PublicKeyCredentialCreationOptions -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-hints PublicKeyCredentialCreationOptions.hints specification>
getHints :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptions -> m (Maybe [result])
getHints self = liftDOM (((js_getHints (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-hints PublicKeyCredentialCreationOptions.hints specification>
getHintsUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PublicKeyCredentialCreationOptions -> m [result]
getHintsUnsafe self = liftDOM ((((js_getHints (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-hints PublicKeyCredentialCreationOptions.hints specification>
getHintsUnchecked :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptions -> m [result]
getHintsUnchecked self = liftDOM (((js_getHints (self)) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"attestation\"] = $2; })"
        js_setAttestation :: PublicKeyCredentialCreationOptions -> JSString -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-attestation PublicKeyCredentialCreationOptions.attestation specification>
setAttestation :: (MonadDOM m, ToJSString val) => PublicKeyCredentialCreationOptions -> val -> m ()
setAttestation self val = liftDOM (void ((js_setAttestation (self) (toJSString val))))

foreign import javascript unsafe "(($1) => { return $1[\"attestation\"]; })"
        js_getAttestation :: PublicKeyCredentialCreationOptions -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-attestation PublicKeyCredentialCreationOptions.attestation specification>
getAttestation :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptions -> m (Maybe result)
getAttestation self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getAttestation (self))))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-attestation PublicKeyCredentialCreationOptions.attestation specification>
getAttestationUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PublicKeyCredentialCreationOptions -> m result
getAttestationUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getAttestation (self))) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-attestation PublicKeyCredentialCreationOptions.attestation specification>
getAttestationUnchecked :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptions -> m result
getAttestationUnchecked self = liftDOM ((pFromJSVal <$> (js_getAttestation (self))))

foreign import javascript safe "(($1, $2) => { $1[\"attestationFormats\"] = $2; })"
        js_setAttestationFormats :: PublicKeyCredentialCreationOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-attestationformats PublicKeyCredentialCreationOptions.attestationFormats specification>
setAttestationFormats :: (MonadDOM m, ToJSString val) => PublicKeyCredentialCreationOptions -> [val] -> m ()
setAttestationFormats self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setAttestationFormats (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"attestationFormats\"]; })"
        js_getAttestationFormats :: PublicKeyCredentialCreationOptions -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-attestationformats PublicKeyCredentialCreationOptions.attestationFormats specification>
getAttestationFormats :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptions -> m (Maybe [result])
getAttestationFormats self = liftDOM (((js_getAttestationFormats (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-attestationformats PublicKeyCredentialCreationOptions.attestationFormats specification>
getAttestationFormatsUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PublicKeyCredentialCreationOptions -> m [result]
getAttestationFormatsUnsafe self = liftDOM ((((js_getAttestationFormats (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-attestationformats PublicKeyCredentialCreationOptions.attestationFormats specification>
getAttestationFormatsUnchecked :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptions -> m [result]
getAttestationFormatsUnchecked self = liftDOM (((js_getAttestationFormats (self)) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"extensions\"] = $2; })"
        js_setExtensions :: PublicKeyCredentialCreationOptions -> AuthenticationExtensionsClientInputs -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-extensions PublicKeyCredentialCreationOptions.extensions specification>
setExtensions :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> AuthenticationExtensionsClientInputs -> m ()
setExtensions self val = liftDOM (void ((js_setExtensions (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"extensions\"]; })"
        js_getExtensions :: PublicKeyCredentialCreationOptions -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-extensions PublicKeyCredentialCreationOptions.extensions specification>
getExtensions :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> m (Maybe AuthenticationExtensionsClientInputs)
getExtensions self = liftDOM (((js_getExtensions (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-extensions PublicKeyCredentialCreationOptions.extensions specification>
getExtensionsUnsafe :: (MonadDOM m, HasCallStack) => PublicKeyCredentialCreationOptions -> m AuthenticationExtensionsClientInputs
getExtensionsUnsafe self = liftDOM ((((js_getExtensions (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-extensions PublicKeyCredentialCreationOptions.extensions specification>
getExtensionsUnchecked :: (MonadDOM m) => PublicKeyCredentialCreationOptions -> m AuthenticationExtensionsClientInputs
getExtensionsUnchecked self = liftDOM ((pFromJSVal <$> (js_getExtensions (self))))