jsaddle-dom-0.10.0.0: src/JSDOM/Generated/AuthenticatorAttestationResponse.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.AuthenticatorAttestationResponse
(getAuthenticatorData, getAuthenticatorData_, getPublicKey, getPublicKey_, getPublicKeyUnsafe, getPublicKeyUnchecked, getPublicKeyAlgorithm, getPublicKeyAlgorithm_, getTransports, getTransports_, getAttestationObject, AuthenticatorAttestationResponse(..), gTypeAuthenticatorAttestationResponse)
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://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getAuthenticatorData MDN AuthenticatorAttestationResponse.getAuthenticatorData documentation>
getAuthenticatorData :: (MonadDOM m) => AuthenticatorAttestationResponse -> m ArrayBuffer
getAuthenticatorData self = liftDOM (((self ^. jsf "getAuthenticatorData" ()) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getAuthenticatorData MDN AuthenticatorAttestationResponse.getAuthenticatorData documentation>
getAuthenticatorData_ :: (MonadDOM m) => AuthenticatorAttestationResponse -> m ()
getAuthenticatorData_ self = liftDOM (void (self ^. jsf "getAuthenticatorData" ()))
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKey MDN AuthenticatorAttestationResponse.getPublicKey documentation>
getPublicKey :: (MonadDOM m) => AuthenticatorAttestationResponse -> m (Maybe ArrayBuffer)
getPublicKey self = liftDOM (((self ^. jsf "getPublicKey" ()) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKey MDN AuthenticatorAttestationResponse.getPublicKey documentation>
getPublicKey_ :: (MonadDOM m) => AuthenticatorAttestationResponse -> m ()
getPublicKey_ self = liftDOM (void (self ^. jsf "getPublicKey" ()))
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKey MDN AuthenticatorAttestationResponse.getPublicKey documentation>
getPublicKeyUnsafe :: (MonadDOM m, HasCallStack) => AuthenticatorAttestationResponse -> m ArrayBuffer
getPublicKeyUnsafe self = liftDOM ((((self ^. jsf "getPublicKey" ()) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKey MDN AuthenticatorAttestationResponse.getPublicKey documentation>
getPublicKeyUnchecked :: (MonadDOM m) => AuthenticatorAttestationResponse -> m ArrayBuffer
getPublicKeyUnchecked self = liftDOM (((self ^. jsf "getPublicKey" ()) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKeyAlgorithm MDN AuthenticatorAttestationResponse.getPublicKeyAlgorithm documentation>
getPublicKeyAlgorithm :: (MonadDOM m) => AuthenticatorAttestationResponse -> m Int
getPublicKeyAlgorithm self = liftDOM ((P.round <$> ((self ^. jsf "getPublicKeyAlgorithm" ()) >>= valToNumber)))
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKeyAlgorithm MDN AuthenticatorAttestationResponse.getPublicKeyAlgorithm documentation>
getPublicKeyAlgorithm_ :: (MonadDOM m) => AuthenticatorAttestationResponse -> m ()
getPublicKeyAlgorithm_ self = liftDOM (void (self ^. jsf "getPublicKeyAlgorithm" ()))
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getTransports MDN AuthenticatorAttestationResponse.getTransports documentation>
getTransports :: (MonadDOM m, FromJSString result) => AuthenticatorAttestationResponse -> m [result]
getTransports self = liftDOM (((self ^. jsf "getTransports" ()) >>= fromJSValUnchecked))
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getTransports MDN AuthenticatorAttestationResponse.getTransports documentation>
getTransports_ :: (MonadDOM m) => AuthenticatorAttestationResponse -> m ()
getTransports_ self = liftDOM (void (self ^. jsf "getTransports" ()))
-- | <https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/attestationObject MDN AuthenticatorAttestationResponse.attestationObject documentation>
getAttestationObject :: (MonadDOM m) => AuthenticatorAttestationResponse -> m ArrayBuffer
getAttestationObject self = liftDOM (((self ^. js "attestationObject") >>= fromJSValUnchecked))