packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/AuthenticationExtensionsPRFValues.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.AuthenticationExtensionsPRFValues
       (newAuthenticationExtensionsPRFValues, setFirst, getFirst, setSecond, getSecond, getSecondUnsafe, getSecondUnchecked, AuthenticationExtensionsPRFValues(..), gTypeAuthenticationExtensionsPRFValues)
       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-authenticationextensionsprfvalues AuthenticationExtensionsPRFValues specification>
newAuthenticationExtensionsPRFValues :: (MonadDOM m, IsBufferSource first) => first -> m AuthenticationExtensionsPRFValues
newAuthenticationExtensionsPRFValues first = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "first" (toJSVal first)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfvalues-first AuthenticationExtensionsPRFValues.first specification>
setFirst :: (MonadDOM m, IsBufferSource val) => AuthenticationExtensionsPRFValues -> val -> m ()
setFirst self val = liftDOM (void (self ^. jss "first" (toJSVal val)))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfvalues-first AuthenticationExtensionsPRFValues.first specification>
getFirst :: (MonadDOM m) => AuthenticationExtensionsPRFValues -> m BufferSource
getFirst self = liftDOM (((self ^. js "first") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfvalues-second AuthenticationExtensionsPRFValues.second specification>
setSecond :: (MonadDOM m, IsBufferSource val) => AuthenticationExtensionsPRFValues -> val -> m ()
setSecond self val = liftDOM (void (self ^. jss "second" (toJSVal val)))

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfvalues-second AuthenticationExtensionsPRFValues.second specification>
getSecond :: (MonadDOM m) => AuthenticationExtensionsPRFValues -> m (Maybe BufferSource)
getSecond self = liftDOM (((self ^. js "second") >>= fromJSValUnchecked))

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

-- | <https://w3c.github.io/webauthn/#dom-authenticationextensionsprfvalues-second AuthenticationExtensionsPRFValues.second specification>
getSecondUnchecked :: (MonadDOM m) => AuthenticationExtensionsPRFValues -> m BufferSource
getSecondUnchecked self = liftDOM (((self ^. js "second") >>= fromJSValUnchecked))