jsaddle-dom-0.10.0.0: src/JSDOM/Generated/AuthenticationExtensionsPaymentOutputs.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from secure-payment-confirmation (webref). Do not edit.
module JSDOM.Generated.AuthenticationExtensionsPaymentOutputs
(newAuthenticationExtensionsPaymentOutputs, setBrowserBoundSignature, getBrowserBoundSignature, getBrowserBoundSignatureUnsafe, getBrowserBoundSignatureUnchecked, AuthenticationExtensionsPaymentOutputs(..), gTypeAuthenticationExtensionsPaymentOutputs)
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/secure-payment-confirmation/#dictdef-authenticationextensionspaymentoutputs AuthenticationExtensionsPaymentOutputs specification>
newAuthenticationExtensionsPaymentOutputs :: (MonadDOM m) => m AuthenticationExtensionsPaymentOutputs
newAuthenticationExtensionsPaymentOutputs = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/secure-payment-confirmation/#dom-authenticationextensionspaymentoutputs-browserboundsignature AuthenticationExtensionsPaymentOutputs.browserBoundSignature specification>
setBrowserBoundSignature :: (MonadDOM m) => AuthenticationExtensionsPaymentOutputs -> BrowserBoundSignature -> m ()
setBrowserBoundSignature self val = liftDOM (void (self ^. jss "browserBoundSignature" (toJSVal val)))
-- | <https://w3c.github.io/secure-payment-confirmation/#dom-authenticationextensionspaymentoutputs-browserboundsignature AuthenticationExtensionsPaymentOutputs.browserBoundSignature specification>
getBrowserBoundSignature :: (MonadDOM m) => AuthenticationExtensionsPaymentOutputs -> m (Maybe BrowserBoundSignature)
getBrowserBoundSignature self = liftDOM (((self ^. js "browserBoundSignature") >>= fromJSValUnchecked))
-- | <https://w3c.github.io/secure-payment-confirmation/#dom-authenticationextensionspaymentoutputs-browserboundsignature AuthenticationExtensionsPaymentOutputs.browserBoundSignature specification>
getBrowserBoundSignatureUnsafe :: (MonadDOM m, HasCallStack) => AuthenticationExtensionsPaymentOutputs -> m BrowserBoundSignature
getBrowserBoundSignatureUnsafe self = liftDOM ((((self ^. js "browserBoundSignature") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/secure-payment-confirmation/#dom-authenticationextensionspaymentoutputs-browserboundsignature AuthenticationExtensionsPaymentOutputs.browserBoundSignature specification>
getBrowserBoundSignatureUnchecked :: (MonadDOM m) => AuthenticationExtensionsPaymentOutputs -> m BrowserBoundSignature
getBrowserBoundSignatureUnchecked self = liftDOM (((self ^. js "browserBoundSignature") >>= fromJSValUnchecked))