packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/AuthenticationExtensionsPRFOutputs.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webauthn-4 (webref). Do not edit.
module JSDOM.Generated.AuthenticationExtensionsPRFOutputs
       (newAuthenticationExtensionsPRFOutputs, setEnabled, getEnabled, getEnabledUnsafe, getEnabledUnchecked, setResults, getResults, getResultsUnsafe, getResultsUnchecked, AuthenticationExtensionsPRFOutputs(..), gTypeAuthenticationExtensionsPRFOutputs)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums

-- | <https://w3c.github.io/webauthn/#dictdef-authenticationextensionsprfoutputs AuthenticationExtensionsPRFOutputs specification>
newAuthenticationExtensionsPRFOutputs :: (MonadDOM m) => m AuthenticationExtensionsPRFOutputs
newAuthenticationExtensionsPRFOutputs = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-enabled AuthenticationExtensionsPRFOutputs.enabled specification>
setEnabled :: (MonadDOM m) => AuthenticationExtensionsPRFOutputs -> Bool -> m ()
setEnabled self val = liftDOM (void (self ^. jss "enabled" (toJSVal val)))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-enabled AuthenticationExtensionsPRFOutputs.enabled specification>
getEnabled :: (MonadDOM m) => AuthenticationExtensionsPRFOutputs -> m (Maybe Bool)
getEnabled self = liftDOM (((self ^. js "enabled") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-enabled AuthenticationExtensionsPRFOutputs.enabled specification>
getEnabledUnsafe :: (MonadDOM m, HasCallStack) => AuthenticationExtensionsPRFOutputs -> m Bool
getEnabledUnsafe self = liftDOM ((((self ^. js "enabled") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-enabled AuthenticationExtensionsPRFOutputs.enabled specification>
getEnabledUnchecked :: (MonadDOM m) => AuthenticationExtensionsPRFOutputs -> m Bool
getEnabledUnchecked self = liftDOM (((self ^. js "enabled") >>= valToBool))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-results AuthenticationExtensionsPRFOutputs.results specification>
setResults :: (MonadDOM m) => AuthenticationExtensionsPRFOutputs -> AuthenticationExtensionsPRFValues -> m ()
setResults self val = liftDOM (void (self ^. jss "results" (toJSVal val)))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-results AuthenticationExtensionsPRFOutputs.results specification>
getResults :: (MonadDOM m) => AuthenticationExtensionsPRFOutputs -> m (Maybe AuthenticationExtensionsPRFValues)
getResults self = liftDOM (((self ^. js "results") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-results AuthenticationExtensionsPRFOutputs.results specification>
getResultsUnsafe :: (MonadDOM m, HasCallStack) => AuthenticationExtensionsPRFOutputs -> m AuthenticationExtensionsPRFValues
getResultsUnsafe self = liftDOM ((((self ^. js "results") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfoutputs-results AuthenticationExtensionsPRFOutputs.results specification>
getResultsUnchecked :: (MonadDOM m) => AuthenticationExtensionsPRFOutputs -> m AuthenticationExtensionsPRFValues
getResultsUnchecked self = liftDOM (((self ^. js "results") >>= fromJSValUnchecked))