jsaddle-dom-0.10.0.0: src/JSDOM/Generated/AllAcceptedCredentialsOptions.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.AllAcceptedCredentialsOptions
(newAllAcceptedCredentialsOptions, setRpId, getRpId, setUserId, getUserId, setAllAcceptedCredentialIds, getAllAcceptedCredentialIds, AllAcceptedCredentialsOptions(..), gTypeAllAcceptedCredentialsOptions)
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-allacceptedcredentialsoptions AllAcceptedCredentialsOptions specification>
newAllAcceptedCredentialsOptions :: (MonadDOM m, ToJSString rpId, ToJSString userId, ToJSString allAcceptedCredentialIds) => rpId -> userId -> [allAcceptedCredentialIds] -> m AllAcceptedCredentialsOptions
newAllAcceptedCredentialsOptions rpId userId allAcceptedCredentialIds = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "rpId" (toJSVal rpId)) P.>> (o ^. jss "userId" (toJSVal userId)) P.>> (o ^. jss "allAcceptedCredentialIds" (toJSVal allAcceptedCredentialIds)) P.>> P.return o)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-allacceptedcredentialsoptions-rpid AllAcceptedCredentialsOptions.rpId specification>
setRpId :: (MonadDOM m, ToJSString val) => AllAcceptedCredentialsOptions -> val -> m ()
setRpId self val = liftDOM (void (self ^. jss "rpId" (toJSVal val)))
-- | <https://w3c.github.io/webauthn/#dom-allacceptedcredentialsoptions-rpid AllAcceptedCredentialsOptions.rpId specification>
getRpId :: (MonadDOM m, FromJSString result) => AllAcceptedCredentialsOptions -> m result
getRpId self = liftDOM (((self ^. js "rpId") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-allacceptedcredentialsoptions-userid AllAcceptedCredentialsOptions.userId specification>
setUserId :: (MonadDOM m, ToJSString val) => AllAcceptedCredentialsOptions -> val -> m ()
setUserId self val = liftDOM (void (self ^. jss "userId" (toJSVal val)))
-- | <https://w3c.github.io/webauthn/#dom-allacceptedcredentialsoptions-userid AllAcceptedCredentialsOptions.userId specification>
getUserId :: (MonadDOM m, FromJSString result) => AllAcceptedCredentialsOptions -> m result
getUserId self = liftDOM (((self ^. js "userId") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webauthn/#dom-allacceptedcredentialsoptions-allacceptedcredentialids AllAcceptedCredentialsOptions.allAcceptedCredentialIds specification>
setAllAcceptedCredentialIds :: (MonadDOM m, ToJSString val) => AllAcceptedCredentialsOptions -> [val] -> m ()
setAllAcceptedCredentialIds self val = liftDOM (void (self ^. jss "allAcceptedCredentialIds" (toJSVal val)))
-- | <https://w3c.github.io/webauthn/#dom-allacceptedcredentialsoptions-allacceptedcredentialids AllAcceptedCredentialsOptions.allAcceptedCredentialIds specification>
getAllAcceptedCredentialIds :: (MonadDOM m, FromJSString result) => AllAcceptedCredentialsOptions -> m [result]
getAllAcceptedCredentialIds self = liftDOM (((self ^. js "allAcceptedCredentialIds") >>= fromJSValUnchecked))