ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PublicKeyCredentialRequestOptionsJSON.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.PublicKeyCredentialRequestOptionsJSON
(js_newPublicKeyCredentialRequestOptionsJSON, js_setChallenge, js_getChallenge, js_setTimeout, js_getTimeout, js_setRpId, js_getRpId, js_setAllowCredentials, js_getAllowCredentials, js_setUserVerification, js_getUserVerification, js_setHints, js_getHints, js_setExtensions, js_getExtensions, newPublicKeyCredentialRequestOptionsJSON, setChallenge, getChallenge, setTimeout, getTimeout, getTimeoutUnsafe, getTimeoutUnchecked, setRpId, getRpId, getRpIdUnsafe, getRpIdUnchecked, setAllowCredentials, getAllowCredentials, getAllowCredentialsUnsafe, getAllowCredentialsUnchecked, setUserVerification, getUserVerification, getUserVerificationUnsafe, getUserVerificationUnchecked, setHints, getHints, getHintsUnsafe, getHintsUnchecked, setExtensions, getExtensions, getExtensionsUnsafe, getExtensionsUnchecked, PublicKeyCredentialRequestOptionsJSON(..), gTypePublicKeyCredentialRequestOptionsJSON)
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) => { return ({\"challenge\": $1}); })"
js_newPublicKeyCredentialRequestOptionsJSON :: JSString -> IO PublicKeyCredentialRequestOptionsJSON
-- | <https://w3c.github.io/webauthn/#dictdef-publickeycredentialrequestoptionsjson PublicKeyCredentialRequestOptionsJSON specification>
newPublicKeyCredentialRequestOptionsJSON :: (MonadDOM m, ToJSString challenge) => challenge -> m PublicKeyCredentialRequestOptionsJSON
newPublicKeyCredentialRequestOptionsJSON challenge = liftDOM ((js_newPublicKeyCredentialRequestOptionsJSON (toJSString challenge)))
foreign import javascript safe "(($1, $2) => { $1[\"challenge\"] = $2; })"
js_setChallenge :: PublicKeyCredentialRequestOptionsJSON -> JSString -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-challenge PublicKeyCredentialRequestOptionsJSON.challenge specification>
setChallenge :: (MonadDOM m, ToJSString val) => PublicKeyCredentialRequestOptionsJSON -> val -> m ()
setChallenge self val = liftDOM (void ((js_setChallenge (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"challenge\"]; })"
js_getChallenge :: PublicKeyCredentialRequestOptionsJSON -> IO JSString
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-challenge PublicKeyCredentialRequestOptionsJSON.challenge specification>
getChallenge :: (MonadDOM m, FromJSString result) => PublicKeyCredentialRequestOptionsJSON -> m result
getChallenge self = liftDOM ((fromJSString <$> (js_getChallenge (self))))
foreign import javascript safe "(($1, $2) => { $1[\"timeout\"] = $2; })"
js_setTimeout :: PublicKeyCredentialRequestOptionsJSON -> Word -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-timeout PublicKeyCredentialRequestOptionsJSON.timeout specification>
setTimeout :: (MonadDOM m) => PublicKeyCredentialRequestOptionsJSON -> Word -> m ()
setTimeout self val = liftDOM (void ((js_setTimeout (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"timeout\"]; })"
js_getTimeout :: PublicKeyCredentialRequestOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-timeout PublicKeyCredentialRequestOptionsJSON.timeout specification>
getTimeout :: (MonadDOM m) => PublicKeyCredentialRequestOptionsJSON -> m (Maybe Word)
getTimeout self = liftDOM (((js_getTimeout (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-timeout PublicKeyCredentialRequestOptionsJSON.timeout specification>
getTimeoutUnsafe :: (MonadDOM m, HasCallStack) => PublicKeyCredentialRequestOptionsJSON -> m Word
getTimeoutUnsafe self = liftDOM ((((js_getTimeout (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-timeout PublicKeyCredentialRequestOptionsJSON.timeout specification>
getTimeoutUnchecked :: (MonadDOM m) => PublicKeyCredentialRequestOptionsJSON -> m Word
getTimeoutUnchecked self = liftDOM ((pFromJSVal <$> (js_getTimeout (self))))
foreign import javascript safe "(($1, $2) => { $1[\"rpId\"] = $2; })"
js_setRpId :: PublicKeyCredentialRequestOptionsJSON -> JSString -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-rpid PublicKeyCredentialRequestOptionsJSON.rpId specification>
setRpId :: (MonadDOM m, ToJSString val) => PublicKeyCredentialRequestOptionsJSON -> val -> m ()
setRpId self val = liftDOM (void ((js_setRpId (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"rpId\"]; })"
js_getRpId :: PublicKeyCredentialRequestOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-rpid PublicKeyCredentialRequestOptionsJSON.rpId specification>
getRpId :: (MonadDOM m, FromJSString result) => PublicKeyCredentialRequestOptionsJSON -> m (Maybe result)
getRpId self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getRpId (self))))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-rpid PublicKeyCredentialRequestOptionsJSON.rpId specification>
getRpIdUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PublicKeyCredentialRequestOptionsJSON -> m result
getRpIdUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getRpId (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-rpid PublicKeyCredentialRequestOptionsJSON.rpId specification>
getRpIdUnchecked :: (MonadDOM m, FromJSString result) => PublicKeyCredentialRequestOptionsJSON -> m result
getRpIdUnchecked self = liftDOM ((pFromJSVal <$> (js_getRpId (self))))
foreign import javascript safe "(($1, $2) => { $1[\"allowCredentials\"] = $2; })"
js_setAllowCredentials :: PublicKeyCredentialRequestOptionsJSON -> JSVal -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-allowcredentials PublicKeyCredentialRequestOptionsJSON.allowCredentials specification>
setAllowCredentials :: (MonadDOM m) => PublicKeyCredentialRequestOptionsJSON -> [PublicKeyCredentialDescriptorJSON] -> m ()
setAllowCredentials self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setAllowCredentials (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"allowCredentials\"]; })"
js_getAllowCredentials :: PublicKeyCredentialRequestOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-allowcredentials PublicKeyCredentialRequestOptionsJSON.allowCredentials specification>
getAllowCredentials :: (MonadDOM m) => PublicKeyCredentialRequestOptionsJSON -> m (Maybe [PublicKeyCredentialDescriptorJSON])
getAllowCredentials self = liftDOM (((js_getAllowCredentials (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-allowcredentials PublicKeyCredentialRequestOptionsJSON.allowCredentials specification>
getAllowCredentialsUnsafe :: (MonadDOM m, HasCallStack) => PublicKeyCredentialRequestOptionsJSON -> m [PublicKeyCredentialDescriptorJSON]
getAllowCredentialsUnsafe self = liftDOM ((((js_getAllowCredentials (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-allowcredentials PublicKeyCredentialRequestOptionsJSON.allowCredentials specification>
getAllowCredentialsUnchecked :: (MonadDOM m) => PublicKeyCredentialRequestOptionsJSON -> m [PublicKeyCredentialDescriptorJSON]
getAllowCredentialsUnchecked self = liftDOM (((js_getAllowCredentials (self)) >>= fromJSValUnchecked))
foreign import javascript safe "(($1, $2) => { $1[\"userVerification\"] = $2; })"
js_setUserVerification :: PublicKeyCredentialRequestOptionsJSON -> JSString -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-userverification PublicKeyCredentialRequestOptionsJSON.userVerification specification>
setUserVerification :: (MonadDOM m, ToJSString val) => PublicKeyCredentialRequestOptionsJSON -> val -> m ()
setUserVerification self val = liftDOM (void ((js_setUserVerification (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"userVerification\"]; })"
js_getUserVerification :: PublicKeyCredentialRequestOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-userverification PublicKeyCredentialRequestOptionsJSON.userVerification specification>
getUserVerification :: (MonadDOM m, FromJSString result) => PublicKeyCredentialRequestOptionsJSON -> m (Maybe result)
getUserVerification self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getUserVerification (self))))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-userverification PublicKeyCredentialRequestOptionsJSON.userVerification specification>
getUserVerificationUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PublicKeyCredentialRequestOptionsJSON -> m result
getUserVerificationUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getUserVerification (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-userverification PublicKeyCredentialRequestOptionsJSON.userVerification specification>
getUserVerificationUnchecked :: (MonadDOM m, FromJSString result) => PublicKeyCredentialRequestOptionsJSON -> m result
getUserVerificationUnchecked self = liftDOM ((pFromJSVal <$> (js_getUserVerification (self))))
foreign import javascript safe "(($1, $2) => { $1[\"hints\"] = $2; })"
js_setHints :: PublicKeyCredentialRequestOptionsJSON -> JSVal -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-hints PublicKeyCredentialRequestOptionsJSON.hints specification>
setHints :: (MonadDOM m, ToJSString val) => PublicKeyCredentialRequestOptionsJSON -> [val] -> m ()
setHints self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setHints (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"hints\"]; })"
js_getHints :: PublicKeyCredentialRequestOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-hints PublicKeyCredentialRequestOptionsJSON.hints specification>
getHints :: (MonadDOM m, FromJSString result) => PublicKeyCredentialRequestOptionsJSON -> m (Maybe [result])
getHints self = liftDOM (((js_getHints (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-hints PublicKeyCredentialRequestOptionsJSON.hints specification>
getHintsUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => PublicKeyCredentialRequestOptionsJSON -> m [result]
getHintsUnsafe self = liftDOM ((((js_getHints (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-hints PublicKeyCredentialRequestOptionsJSON.hints specification>
getHintsUnchecked :: (MonadDOM m, FromJSString result) => PublicKeyCredentialRequestOptionsJSON -> m [result]
getHintsUnchecked self = liftDOM (((js_getHints (self)) >>= fromJSValUnchecked))
foreign import javascript safe "(($1, $2) => { $1[\"extensions\"] = $2; })"
js_setExtensions :: PublicKeyCredentialRequestOptionsJSON -> AuthenticationExtensionsClientInputsJSON -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-extensions PublicKeyCredentialRequestOptionsJSON.extensions specification>
setExtensions :: (MonadDOM m) => PublicKeyCredentialRequestOptionsJSON -> AuthenticationExtensionsClientInputsJSON -> m ()
setExtensions self val = liftDOM (void ((js_setExtensions (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"extensions\"]; })"
js_getExtensions :: PublicKeyCredentialRequestOptionsJSON -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-extensions PublicKeyCredentialRequestOptionsJSON.extensions specification>
getExtensions :: (MonadDOM m) => PublicKeyCredentialRequestOptionsJSON -> m (Maybe AuthenticationExtensionsClientInputsJSON)
getExtensions self = liftDOM (((js_getExtensions (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-extensions PublicKeyCredentialRequestOptionsJSON.extensions specification>
getExtensionsUnsafe :: (MonadDOM m, HasCallStack) => PublicKeyCredentialRequestOptionsJSON -> m AuthenticationExtensionsClientInputsJSON
getExtensionsUnsafe self = liftDOM ((((js_getExtensions (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-publickeycredentialrequestoptionsjson-extensions PublicKeyCredentialRequestOptionsJSON.extensions specification>
getExtensionsUnchecked :: (MonadDOM m) => PublicKeyCredentialRequestOptionsJSON -> m AuthenticationExtensionsClientInputsJSON
getExtensionsUnchecked self = liftDOM ((pFromJSVal <$> (js_getExtensions (self))))