jsaddle-dom-0.10.0.0: src/JSDOM/Generated/AuthenticationExtensionsPRFInputsJSON.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.AuthenticationExtensionsPRFInputsJSON
(newAuthenticationExtensionsPRFInputsJSON, setEval, getEval, getEvalUnsafe, getEvalUnchecked, setEvalByCredential, getEvalByCredential, getEvalByCredentialUnsafe, getEvalByCredentialUnchecked, AuthenticationExtensionsPRFInputsJSON(..), gTypeAuthenticationExtensionsPRFInputsJSON)
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-authenticationextensionsprfinputsjson AuthenticationExtensionsPRFInputsJSON specification>
newAuthenticationExtensionsPRFInputsJSON :: (MonadDOM m) => m AuthenticationExtensionsPRFInputsJSON
newAuthenticationExtensionsPRFInputsJSON = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-eval AuthenticationExtensionsPRFInputsJSON.eval specification>
setEval :: (MonadDOM m) => AuthenticationExtensionsPRFInputsJSON -> AuthenticationExtensionsPRFValuesJSON -> m ()
setEval self val = liftDOM (void (self ^. jss "eval" (toJSVal val)))
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-eval AuthenticationExtensionsPRFInputsJSON.eval specification>
getEval :: (MonadDOM m) => AuthenticationExtensionsPRFInputsJSON -> m (Maybe AuthenticationExtensionsPRFValuesJSON)
getEval self = liftDOM (((self ^. js "eval") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-eval AuthenticationExtensionsPRFInputsJSON.eval specification>
getEvalUnsafe :: (MonadDOM m, HasCallStack) => AuthenticationExtensionsPRFInputsJSON -> m AuthenticationExtensionsPRFValuesJSON
getEvalUnsafe self = liftDOM ((((self ^. js "eval") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-eval AuthenticationExtensionsPRFInputsJSON.eval specification>
getEvalUnchecked :: (MonadDOM m) => AuthenticationExtensionsPRFInputsJSON -> m AuthenticationExtensionsPRFValuesJSON
getEvalUnchecked self = liftDOM (((self ^. js "eval") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-evalbycredential AuthenticationExtensionsPRFInputsJSON.evalByCredential specification>
setEvalByCredential :: (MonadDOM m) => AuthenticationExtensionsPRFInputsJSON -> (Record JSString JSVal) -> m ()
setEvalByCredential self val = liftDOM (void (self ^. jss "evalByCredential" (toJSVal val)))
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-evalbycredential AuthenticationExtensionsPRFInputsJSON.evalByCredential specification>
getEvalByCredential :: (MonadDOM m) => AuthenticationExtensionsPRFInputsJSON -> m (Maybe (Record JSString JSVal))
getEvalByCredential self = liftDOM (((self ^. js "evalByCredential") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-evalbycredential AuthenticationExtensionsPRFInputsJSON.evalByCredential specification>
getEvalByCredentialUnsafe :: (MonadDOM m, HasCallStack) => AuthenticationExtensionsPRFInputsJSON -> m (Record JSString JSVal)
getEvalByCredentialUnsafe self = liftDOM ((((self ^. js "evalByCredential") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfinputsjson-evalbycredential AuthenticationExtensionsPRFInputsJSON.evalByCredential specification>
getEvalByCredentialUnchecked :: (MonadDOM m) => AuthenticationExtensionsPRFInputsJSON -> m (Record JSString JSVal)
getEvalByCredentialUnchecked self = liftDOM (((self ^. js "evalByCredential") >>= fromJSValUnchecked))