ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PublicKeyCredentialCreationOptionsJSON.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.PublicKeyCredentialCreationOptionsJSON
(js_newPublicKeyCredentialCreationOptionsJSON, 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, newPublicKeyCredentialCreationOptionsJSON, 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, PublicKeyCredentialCreationOptionsJSON(..), gTypePublicKeyCredentialCreationOptionsJSON)
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_newPublicKeyCredentialCreationOptionsJSON :: PublicKeyCredentialRpEntity -> PublicKeyCredentialUserEntityJSON -> JSString -> JSVal -> IO PublicKeyCredentialCreationOptionsJSON
-- | <https://w3c.github.io/webauthn/#dictdef-publickeycredentialcreationoptionsjson PublicKeyCredentialCreationOptionsJSON specification>
newPublicKeyCredentialCreationOptionsJSON :: (MonadDOM m, ToJSString challenge) => PublicKeyCredentialRpEntity -> PublicKeyCredentialUserEntityJSON -> challenge -> [PublicKeyCredentialParameters] -> m PublicKeyCredentialCreationOptionsJSON
newPublicKeyCredentialCreationOptionsJSON rp user challenge pubKeyCredParams = liftDOM (((toJSVal pubKeyCredParams) >>= \a4' -> js_newPublicKeyCredentialCreationOptionsJSON (rp) (user) (toJSString challenge) a4'))
foreign import javascript safe "(($1, $2) => { $1[\"rp\"] = $2; })"
js_setRp :: PublicKeyCredentialCreationOptionsJSON -> PublicKeyCredentialRpEntity -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-rp PublicKeyCredentialCreationOptionsJSON.rp specification>
setRp :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> PublicKeyCredentialRpEntity -> m ()
setRp self val = liftDOM (void ((js_setRp (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"rp\"]; })"
js_getRp :: PublicKeyCredentialCreationOptionsJSON -> IO PublicKeyCredentialRpEntity
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-rp PublicKeyCredentialCreationOptionsJSON.rp specification>
getRp :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> m PublicKeyCredentialRpEntity
getRp self = liftDOM ((js_getRp (self)))
foreign import javascript safe "(($1, $2) => { $1[\"user\"] = $2; })"
js_setUser :: PublicKeyCredentialCreationOptionsJSON -> PublicKeyCredentialUserEntityJSON -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-user PublicKeyCredentialCreationOptionsJSON.user specification>
setUser :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> PublicKeyCredentialUserEntityJSON -> m ()
setUser self val = liftDOM (void ((js_setUser (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"user\"]; })"
js_getUser :: PublicKeyCredentialCreationOptionsJSON -> IO PublicKeyCredentialUserEntityJSON
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-user PublicKeyCredentialCreationOptionsJSON.user specification>
getUser :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> m PublicKeyCredentialUserEntityJSON
getUser self = liftDOM ((js_getUser (self)))
foreign import javascript safe "(($1, $2) => { $1[\"challenge\"] = $2; })"
js_setChallenge :: PublicKeyCredentialCreationOptionsJSON -> JSString -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-challenge PublicKeyCredentialCreationOptionsJSON.challenge specification>
setChallenge :: (MonadDOM m, ToJSString val) => PublicKeyCredentialCreationOptionsJSON -> val -> m ()
setChallenge self val = liftDOM (void ((js_setChallenge (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"challenge\"]; })"
js_getChallenge :: PublicKeyCredentialCreationOptionsJSON -> IO JSString
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-challenge PublicKeyCredentialCreationOptionsJSON.challenge specification>
getChallenge :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptionsJSON -> m result
getChallenge self = liftDOM ((fromJSString <$> (js_getChallenge (self))))
foreign import javascript safe "(($1, $2) => { $1[\"pubKeyCredParams\"] = $2; })"
js_setPubKeyCredParams :: PublicKeyCredentialCreationOptionsJSON -> JSVal -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-pubkeycredparams PublicKeyCredentialCreationOptionsJSON.pubKeyCredParams specification>
setPubKeyCredParams :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> [PublicKeyCredentialParameters] -> m ()
setPubKeyCredParams self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setPubKeyCredParams (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"pubKeyCredParams\"]; })"
js_getPubKeyCredParams :: PublicKeyCredentialCreationOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-pubkeycredparams PublicKeyCredentialCreationOptionsJSON.pubKeyCredParams specification>
getPubKeyCredParams :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> m [PublicKeyCredentialParameters]
getPubKeyCredParams self = liftDOM (((js_getPubKeyCredParams (self)) >>= fromJSValUnchecked))
foreign import javascript safe "(($1, $2) => { $1[\"timeout\"] = $2; })"
js_setTimeout :: PublicKeyCredentialCreationOptionsJSON -> Word -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-timeout PublicKeyCredentialCreationOptionsJSON.timeout specification>
setTimeout :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> Word -> m ()
setTimeout self val = liftDOM (void ((js_setTimeout (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"timeout\"]; })"
js_getTimeout :: PublicKeyCredentialCreationOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-timeout PublicKeyCredentialCreationOptionsJSON.timeout specification>
getTimeout :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> m (Maybe Word)
getTimeout self = liftDOM (((js_getTimeout (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-timeout PublicKeyCredentialCreationOptionsJSON.timeout specification>
getTimeoutUnsafe :: (MonadDOM m, HasCallStack) => PublicKeyCredentialCreationOptionsJSON -> m Word
getTimeoutUnsafe self = liftDOM ((((js_getTimeout (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-timeout PublicKeyCredentialCreationOptionsJSON.timeout specification>
getTimeoutUnchecked :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> m Word
getTimeoutUnchecked self = liftDOM ((pFromJSVal <$> (js_getTimeout (self))))
foreign import javascript safe "(($1, $2) => { $1[\"excludeCredentials\"] = $2; })"
js_setExcludeCredentials :: PublicKeyCredentialCreationOptionsJSON -> JSVal -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-excludecredentials PublicKeyCredentialCreationOptionsJSON.excludeCredentials specification>
setExcludeCredentials :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> [PublicKeyCredentialDescriptorJSON] -> m ()
setExcludeCredentials self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setExcludeCredentials (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"excludeCredentials\"]; })"
js_getExcludeCredentials :: PublicKeyCredentialCreationOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-excludecredentials PublicKeyCredentialCreationOptionsJSON.excludeCredentials specification>
getExcludeCredentials :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> m (Maybe [PublicKeyCredentialDescriptorJSON])
getExcludeCredentials self = liftDOM (((js_getExcludeCredentials (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-excludecredentials PublicKeyCredentialCreationOptionsJSON.excludeCredentials specification>
getExcludeCredentialsUnsafe :: (MonadDOM m, HasCallStack) => PublicKeyCredentialCreationOptionsJSON -> m [PublicKeyCredentialDescriptorJSON]
getExcludeCredentialsUnsafe self = liftDOM ((((js_getExcludeCredentials (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-excludecredentials PublicKeyCredentialCreationOptionsJSON.excludeCredentials specification>
getExcludeCredentialsUnchecked :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> m [PublicKeyCredentialDescriptorJSON]
getExcludeCredentialsUnchecked self = liftDOM (((js_getExcludeCredentials (self)) >>= fromJSValUnchecked))
foreign import javascript safe "(($1, $2) => { $1[\"authenticatorSelection\"] = $2; })"
js_setAuthenticatorSelection :: PublicKeyCredentialCreationOptionsJSON -> AuthenticatorSelectionCriteria -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-authenticatorselection PublicKeyCredentialCreationOptionsJSON.authenticatorSelection specification>
setAuthenticatorSelection :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> AuthenticatorSelectionCriteria -> m ()
setAuthenticatorSelection self val = liftDOM (void ((js_setAuthenticatorSelection (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"authenticatorSelection\"]; })"
js_getAuthenticatorSelection :: PublicKeyCredentialCreationOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-authenticatorselection PublicKeyCredentialCreationOptionsJSON.authenticatorSelection specification>
getAuthenticatorSelection :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> m (Maybe AuthenticatorSelectionCriteria)
getAuthenticatorSelection self = liftDOM (((js_getAuthenticatorSelection (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-authenticatorselection PublicKeyCredentialCreationOptionsJSON.authenticatorSelection specification>
getAuthenticatorSelectionUnsafe :: (MonadDOM m, HasCallStack) => PublicKeyCredentialCreationOptionsJSON -> m AuthenticatorSelectionCriteria
getAuthenticatorSelectionUnsafe self = liftDOM ((((js_getAuthenticatorSelection (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-authenticatorselection PublicKeyCredentialCreationOptionsJSON.authenticatorSelection specification>
getAuthenticatorSelectionUnchecked :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> m AuthenticatorSelectionCriteria
getAuthenticatorSelectionUnchecked self = liftDOM ((pFromJSVal <$> (js_getAuthenticatorSelection (self))))
foreign import javascript safe "(($1, $2) => { $1[\"hints\"] = $2; })"
js_setHints :: PublicKeyCredentialCreationOptionsJSON -> JSVal -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-hints PublicKeyCredentialCreationOptionsJSON.hints specification>
setHints :: (MonadDOM m, ToJSString val) => PublicKeyCredentialCreationOptionsJSON -> [val] -> m ()
setHints self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setHints (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"hints\"]; })"
js_getHints :: PublicKeyCredentialCreationOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-hints PublicKeyCredentialCreationOptionsJSON.hints specification>
getHints :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptionsJSON -> m (Maybe [result])
getHints self = liftDOM (((js_getHints (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-hints PublicKeyCredentialCreationOptionsJSON.hints specification>
getHintsUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PublicKeyCredentialCreationOptionsJSON -> m [result]
getHintsUnsafe self = liftDOM ((((js_getHints (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-hints PublicKeyCredentialCreationOptionsJSON.hints specification>
getHintsUnchecked :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptionsJSON -> m [result]
getHintsUnchecked self = liftDOM (((js_getHints (self)) >>= fromJSValUnchecked))
foreign import javascript safe "(($1, $2) => { $1[\"attestation\"] = $2; })"
js_setAttestation :: PublicKeyCredentialCreationOptionsJSON -> JSString -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-attestation PublicKeyCredentialCreationOptionsJSON.attestation specification>
setAttestation :: (MonadDOM m, ToJSString val) => PublicKeyCredentialCreationOptionsJSON -> val -> m ()
setAttestation self val = liftDOM (void ((js_setAttestation (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"attestation\"]; })"
js_getAttestation :: PublicKeyCredentialCreationOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-attestation PublicKeyCredentialCreationOptionsJSON.attestation specification>
getAttestation :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptionsJSON -> m (Maybe result)
getAttestation self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getAttestation (self))))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-attestation PublicKeyCredentialCreationOptionsJSON.attestation specification>
getAttestationUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PublicKeyCredentialCreationOptionsJSON -> 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-publickeycredentialcreationoptionsjson-attestation PublicKeyCredentialCreationOptionsJSON.attestation specification>
getAttestationUnchecked :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptionsJSON -> m result
getAttestationUnchecked self = liftDOM ((pFromJSVal <$> (js_getAttestation (self))))
foreign import javascript safe "(($1, $2) => { $1[\"attestationFormats\"] = $2; })"
js_setAttestationFormats :: PublicKeyCredentialCreationOptionsJSON -> JSVal -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-attestationformats PublicKeyCredentialCreationOptionsJSON.attestationFormats specification>
setAttestationFormats :: (MonadDOM m, ToJSString val) => PublicKeyCredentialCreationOptionsJSON -> [val] -> m ()
setAttestationFormats self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setAttestationFormats (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"attestationFormats\"]; })"
js_getAttestationFormats :: PublicKeyCredentialCreationOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-attestationformats PublicKeyCredentialCreationOptionsJSON.attestationFormats specification>
getAttestationFormats :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptionsJSON -> m (Maybe [result])
getAttestationFormats self = liftDOM (((js_getAttestationFormats (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-attestationformats PublicKeyCredentialCreationOptionsJSON.attestationFormats specification>
getAttestationFormatsUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PublicKeyCredentialCreationOptionsJSON -> m [result]
getAttestationFormatsUnsafe self = liftDOM ((((js_getAttestationFormats (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-attestationformats PublicKeyCredentialCreationOptionsJSON.attestationFormats specification>
getAttestationFormatsUnchecked :: (MonadDOM m, FromJSString result) => PublicKeyCredentialCreationOptionsJSON -> m [result]
getAttestationFormatsUnchecked self = liftDOM (((js_getAttestationFormats (self)) >>= fromJSValUnchecked))
foreign import javascript safe "(($1, $2) => { $1[\"extensions\"] = $2; })"
js_setExtensions :: PublicKeyCredentialCreationOptionsJSON -> AuthenticationExtensionsClientInputsJSON -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-extensions PublicKeyCredentialCreationOptionsJSON.extensions specification>
setExtensions :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> AuthenticationExtensionsClientInputsJSON -> m ()
setExtensions self val = liftDOM (void ((js_setExtensions (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"extensions\"]; })"
js_getExtensions :: PublicKeyCredentialCreationOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-extensions PublicKeyCredentialCreationOptionsJSON.extensions specification>
getExtensions :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> m (Maybe AuthenticationExtensionsClientInputsJSON)
getExtensions self = liftDOM (((js_getExtensions (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-extensions PublicKeyCredentialCreationOptionsJSON.extensions specification>
getExtensionsUnsafe :: (MonadDOM m, HasCallStack) => PublicKeyCredentialCreationOptionsJSON -> m AuthenticationExtensionsClientInputsJSON
getExtensionsUnsafe self = liftDOM ((((js_getExtensions (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptionsjson-extensions PublicKeyCredentialCreationOptionsJSON.extensions specification>
getExtensionsUnchecked :: (MonadDOM m) => PublicKeyCredentialCreationOptionsJSON -> m AuthenticationExtensionsClientInputsJSON
getExtensionsUnchecked self = liftDOM ((pFromJSVal <$> (js_getExtensions (self))))