packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/AuthenticatorSelectionCriteria.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.AuthenticatorSelectionCriteria
       (js_newAuthenticatorSelectionCriteria, js_setAuthenticatorAttachment, js_getAuthenticatorAttachment, js_setResidentKey, js_getResidentKey, js_setRequireResidentKey, js_getRequireResidentKey, js_setUserVerification, js_getUserVerification, newAuthenticatorSelectionCriteria, setAuthenticatorAttachment, getAuthenticatorAttachment, getAuthenticatorAttachmentUnsafe, getAuthenticatorAttachmentUnchecked, setResidentKey, getResidentKey, getResidentKeyUnsafe, getResidentKeyUnchecked, setRequireResidentKey, getRequireResidentKey, getRequireResidentKeyUnsafe, getRequireResidentKeyUnchecked, setUserVerification, getUserVerification, getUserVerificationUnsafe, getUserVerificationUnchecked, AuthenticatorSelectionCriteria(..), gTypeAuthenticatorSelectionCriteria)
       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 "(() => { return ({}); })"
        js_newAuthenticatorSelectionCriteria :: IO AuthenticatorSelectionCriteria
-- | <https://w3c.github.io/webauthn/#dictdef-authenticatorselectioncriteria AuthenticatorSelectionCriteria specification>
newAuthenticatorSelectionCriteria :: (MonadDOM m) => m AuthenticatorSelectionCriteria
newAuthenticatorSelectionCriteria = liftDOM ((js_newAuthenticatorSelectionCriteria))

foreign import javascript safe "(($1, $2) => { $1[\"authenticatorAttachment\"] = $2; })"
        js_setAuthenticatorAttachment :: AuthenticatorSelectionCriteria -> JSString -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-authenticatorselectioncriteria-authenticatorattachment AuthenticatorSelectionCriteria.authenticatorAttachment specification>
setAuthenticatorAttachment :: (MonadDOM m, ToJSString val) => AuthenticatorSelectionCriteria -> val -> m ()
setAuthenticatorAttachment self val = liftDOM (void ((js_setAuthenticatorAttachment (self) (toJSString val))))

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

-- | <https://w3c.github.io/webauthn/#dom-authenticatorselectioncriteria-authenticatorattachment AuthenticatorSelectionCriteria.authenticatorAttachment specification>
getAuthenticatorAttachmentUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AuthenticatorSelectionCriteria -> m result
getAuthenticatorAttachmentUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getAuthenticatorAttachment (self))) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-authenticatorselectioncriteria-authenticatorattachment AuthenticatorSelectionCriteria.authenticatorAttachment specification>
getAuthenticatorAttachmentUnchecked :: (MonadDOM m, FromJSString result) => AuthenticatorSelectionCriteria -> m result
getAuthenticatorAttachmentUnchecked self = liftDOM ((pFromJSVal <$> (js_getAuthenticatorAttachment (self))))

foreign import javascript safe "(($1, $2) => { $1[\"residentKey\"] = $2; })"
        js_setResidentKey :: AuthenticatorSelectionCriteria -> JSString -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-authenticatorselectioncriteria-residentkey AuthenticatorSelectionCriteria.residentKey specification>
setResidentKey :: (MonadDOM m, ToJSString val) => AuthenticatorSelectionCriteria -> val -> m ()
setResidentKey self val = liftDOM (void ((js_setResidentKey (self) (toJSString val))))

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

-- | <https://w3c.github.io/webauthn/#dom-authenticatorselectioncriteria-residentkey AuthenticatorSelectionCriteria.residentKey specification>
getResidentKeyUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AuthenticatorSelectionCriteria -> m result
getResidentKeyUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getResidentKey (self))) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-authenticatorselectioncriteria-residentkey AuthenticatorSelectionCriteria.residentKey specification>
getResidentKeyUnchecked :: (MonadDOM m, FromJSString result) => AuthenticatorSelectionCriteria -> m result
getResidentKeyUnchecked self = liftDOM ((pFromJSVal <$> (js_getResidentKey (self))))

foreign import javascript safe "(($1, $2) => { $1[\"requireResidentKey\"] = $2; })"
        js_setRequireResidentKey :: AuthenticatorSelectionCriteria -> Bool -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-authenticatorselectioncriteria-requireresidentkey AuthenticatorSelectionCriteria.requireResidentKey specification>
setRequireResidentKey :: (MonadDOM m) => AuthenticatorSelectionCriteria -> Bool -> m ()
setRequireResidentKey self val = liftDOM (void ((js_setRequireResidentKey (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"requireResidentKey\"]; })"
        js_getRequireResidentKey :: AuthenticatorSelectionCriteria -> IO JSVal
-- | <https://w3c.github.io/webauthn/#dom-authenticatorselectioncriteria-requireresidentkey AuthenticatorSelectionCriteria.requireResidentKey specification>
getRequireResidentKey :: (MonadDOM m) => AuthenticatorSelectionCriteria -> m (Maybe Bool)
getRequireResidentKey self = liftDOM (((js_getRequireResidentKey (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-authenticatorselectioncriteria-requireresidentkey AuthenticatorSelectionCriteria.requireResidentKey specification>
getRequireResidentKeyUnsafe :: (MonadDOM m, HasCallStack) => AuthenticatorSelectionCriteria -> m Bool
getRequireResidentKeyUnsafe self = liftDOM ((((js_getRequireResidentKey (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-authenticatorselectioncriteria-requireresidentkey AuthenticatorSelectionCriteria.requireResidentKey specification>
getRequireResidentKeyUnchecked :: (MonadDOM m) => AuthenticatorSelectionCriteria -> m Bool
getRequireResidentKeyUnchecked self = liftDOM ((pFromJSVal <$> (js_getRequireResidentKey (self))))

foreign import javascript safe "(($1, $2) => { $1[\"userVerification\"] = $2; })"
        js_setUserVerification :: AuthenticatorSelectionCriteria -> JSString -> IO ()
-- | <https://w3c.github.io/webauthn/#dom-authenticatorselectioncriteria-userverification AuthenticatorSelectionCriteria.userVerification specification>
setUserVerification :: (MonadDOM m, ToJSString val) => AuthenticatorSelectionCriteria -> val -> m ()
setUserVerification self val = liftDOM (void ((js_setUserVerification (self) (toJSString val))))

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

-- | <https://w3c.github.io/webauthn/#dom-authenticatorselectioncriteria-userverification AuthenticatorSelectionCriteria.userVerification specification>
getUserVerificationUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AuthenticatorSelectionCriteria -> 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-authenticatorselectioncriteria-userverification AuthenticatorSelectionCriteria.userVerification specification>
getUserVerificationUnchecked :: (MonadDOM m, FromJSString result) => AuthenticatorSelectionCriteria -> m result
getUserVerificationUnchecked self = liftDOM ((pFromJSVal <$> (js_getUserVerification (self))))