packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/PaymentOptions.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from payment-request (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.PaymentOptions
       (js_newPaymentOptions, js_setRequestPayerName, js_getRequestPayerName, js_setRequestBillingAddress, js_getRequestBillingAddress, js_setRequestPayerEmail, js_getRequestPayerEmail, js_setRequestPayerPhone, js_getRequestPayerPhone, js_setRequestShipping, js_getRequestShipping, js_setShippingType, js_getShippingType, newPaymentOptions, setRequestPayerName, getRequestPayerName, getRequestPayerNameUnsafe, getRequestPayerNameUnchecked, setRequestBillingAddress, getRequestBillingAddress, getRequestBillingAddressUnsafe, getRequestBillingAddressUnchecked, setRequestPayerEmail, getRequestPayerEmail, getRequestPayerEmailUnsafe, getRequestPayerEmailUnchecked, setRequestPayerPhone, getRequestPayerPhone, getRequestPayerPhoneUnsafe, getRequestPayerPhoneUnchecked, setRequestShipping, getRequestShipping, getRequestShippingUnsafe, getRequestShippingUnchecked, setShippingType, getShippingType, getShippingTypeUnsafe, getShippingTypeUnchecked, PaymentOptions(..), gTypePaymentOptions)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(() => { return ({}); })"
        js_newPaymentOptions :: IO PaymentOptions
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions PaymentOptions specification>
newPaymentOptions :: (MonadDOM m) => m PaymentOptions
newPaymentOptions = liftDOM ((js_newPaymentOptions))

foreign import javascript safe "(($1, $2) => { $1[\"requestPayerName\"] = $2; })"
        js_setRequestPayerName :: PaymentOptions -> Bool -> IO ()
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestpayername PaymentOptions.requestPayerName specification>
setRequestPayerName :: (MonadDOM m) => PaymentOptions -> Bool -> m ()
setRequestPayerName self val = liftDOM (void ((js_setRequestPayerName (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"requestPayerName\"]; })"
        js_getRequestPayerName :: PaymentOptions -> IO JSVal
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestpayername PaymentOptions.requestPayerName specification>
getRequestPayerName :: (MonadDOM m) => PaymentOptions -> m (Maybe Bool)
getRequestPayerName self = liftDOM (((js_getRequestPayerName (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestpayername PaymentOptions.requestPayerName specification>
getRequestPayerNameUnsafe :: (MonadDOM m, HasCallStack) => PaymentOptions -> m Bool
getRequestPayerNameUnsafe self = liftDOM ((((js_getRequestPayerName (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestpayername PaymentOptions.requestPayerName specification>
getRequestPayerNameUnchecked :: (MonadDOM m) => PaymentOptions -> m Bool
getRequestPayerNameUnchecked self = liftDOM ((pFromJSVal <$> (js_getRequestPayerName (self))))

foreign import javascript safe "(($1, $2) => { $1[\"requestBillingAddress\"] = $2; })"
        js_setRequestBillingAddress :: PaymentOptions -> Bool -> IO ()
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestbillingaddress PaymentOptions.requestBillingAddress specification>
setRequestBillingAddress :: (MonadDOM m) => PaymentOptions -> Bool -> m ()
setRequestBillingAddress self val = liftDOM (void ((js_setRequestBillingAddress (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"requestBillingAddress\"]; })"
        js_getRequestBillingAddress :: PaymentOptions -> IO JSVal
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestbillingaddress PaymentOptions.requestBillingAddress specification>
getRequestBillingAddress :: (MonadDOM m) => PaymentOptions -> m (Maybe Bool)
getRequestBillingAddress self = liftDOM (((js_getRequestBillingAddress (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestbillingaddress PaymentOptions.requestBillingAddress specification>
getRequestBillingAddressUnsafe :: (MonadDOM m, HasCallStack) => PaymentOptions -> m Bool
getRequestBillingAddressUnsafe self = liftDOM ((((js_getRequestBillingAddress (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestbillingaddress PaymentOptions.requestBillingAddress specification>
getRequestBillingAddressUnchecked :: (MonadDOM m) => PaymentOptions -> m Bool
getRequestBillingAddressUnchecked self = liftDOM ((pFromJSVal <$> (js_getRequestBillingAddress (self))))

foreign import javascript safe "(($1, $2) => { $1[\"requestPayerEmail\"] = $2; })"
        js_setRequestPayerEmail :: PaymentOptions -> Bool -> IO ()
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestpayeremail PaymentOptions.requestPayerEmail specification>
setRequestPayerEmail :: (MonadDOM m) => PaymentOptions -> Bool -> m ()
setRequestPayerEmail self val = liftDOM (void ((js_setRequestPayerEmail (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"requestPayerEmail\"]; })"
        js_getRequestPayerEmail :: PaymentOptions -> IO JSVal
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestpayeremail PaymentOptions.requestPayerEmail specification>
getRequestPayerEmail :: (MonadDOM m) => PaymentOptions -> m (Maybe Bool)
getRequestPayerEmail self = liftDOM (((js_getRequestPayerEmail (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestpayeremail PaymentOptions.requestPayerEmail specification>
getRequestPayerEmailUnsafe :: (MonadDOM m, HasCallStack) => PaymentOptions -> m Bool
getRequestPayerEmailUnsafe self = liftDOM ((((js_getRequestPayerEmail (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestpayeremail PaymentOptions.requestPayerEmail specification>
getRequestPayerEmailUnchecked :: (MonadDOM m) => PaymentOptions -> m Bool
getRequestPayerEmailUnchecked self = liftDOM ((pFromJSVal <$> (js_getRequestPayerEmail (self))))

foreign import javascript safe "(($1, $2) => { $1[\"requestPayerPhone\"] = $2; })"
        js_setRequestPayerPhone :: PaymentOptions -> Bool -> IO ()
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestpayerphone PaymentOptions.requestPayerPhone specification>
setRequestPayerPhone :: (MonadDOM m) => PaymentOptions -> Bool -> m ()
setRequestPayerPhone self val = liftDOM (void ((js_setRequestPayerPhone (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"requestPayerPhone\"]; })"
        js_getRequestPayerPhone :: PaymentOptions -> IO JSVal
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestpayerphone PaymentOptions.requestPayerPhone specification>
getRequestPayerPhone :: (MonadDOM m) => PaymentOptions -> m (Maybe Bool)
getRequestPayerPhone self = liftDOM (((js_getRequestPayerPhone (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestpayerphone PaymentOptions.requestPayerPhone specification>
getRequestPayerPhoneUnsafe :: (MonadDOM m, HasCallStack) => PaymentOptions -> m Bool
getRequestPayerPhoneUnsafe self = liftDOM ((((js_getRequestPayerPhone (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestpayerphone PaymentOptions.requestPayerPhone specification>
getRequestPayerPhoneUnchecked :: (MonadDOM m) => PaymentOptions -> m Bool
getRequestPayerPhoneUnchecked self = liftDOM ((pFromJSVal <$> (js_getRequestPayerPhone (self))))

foreign import javascript safe "(($1, $2) => { $1[\"requestShipping\"] = $2; })"
        js_setRequestShipping :: PaymentOptions -> Bool -> IO ()
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestshipping PaymentOptions.requestShipping specification>
setRequestShipping :: (MonadDOM m) => PaymentOptions -> Bool -> m ()
setRequestShipping self val = liftDOM (void ((js_setRequestShipping (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"requestShipping\"]; })"
        js_getRequestShipping :: PaymentOptions -> IO JSVal
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestshipping PaymentOptions.requestShipping specification>
getRequestShipping :: (MonadDOM m) => PaymentOptions -> m (Maybe Bool)
getRequestShipping self = liftDOM (((js_getRequestShipping (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestshipping PaymentOptions.requestShipping specification>
getRequestShippingUnsafe :: (MonadDOM m, HasCallStack) => PaymentOptions -> m Bool
getRequestShippingUnsafe self = liftDOM ((((js_getRequestShipping (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-requestshipping PaymentOptions.requestShipping specification>
getRequestShippingUnchecked :: (MonadDOM m) => PaymentOptions -> m Bool
getRequestShippingUnchecked self = liftDOM ((pFromJSVal <$> (js_getRequestShipping (self))))

foreign import javascript safe "(($1, $2) => { $1[\"shippingType\"] = $2; })"
        js_setShippingType :: PaymentOptions -> JSVal -> IO ()
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-shippingtype PaymentOptions.shippingType specification>
setShippingType :: (MonadDOM m) => PaymentOptions -> PaymentShippingType -> m ()
setShippingType self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setShippingType (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"shippingType\"]; })"
        js_getShippingType :: PaymentOptions -> IO JSVal
-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-shippingtype PaymentOptions.shippingType specification>
getShippingType :: (MonadDOM m) => PaymentOptions -> m (Maybe PaymentShippingType)
getShippingType self = liftDOM (((js_getShippingType (self)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-shippingtype PaymentOptions.shippingType specification>
getShippingTypeUnsafe :: (MonadDOM m, HasCallStack) => PaymentOptions -> m PaymentShippingType
getShippingTypeUnsafe self = liftDOM ((((js_getShippingType (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-paymentoptions-shippingtype PaymentOptions.shippingType specification>
getShippingTypeUnchecked :: (MonadDOM m) => PaymentOptions -> m PaymentShippingType
getShippingTypeUnchecked self = liftDOM ((pFromJSVal <$> (js_getShippingType (self))))