packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/AddressErrors.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from payment-request (webref). Do not edit.
module JSDOM.Generated.AddressErrors
       (newAddressErrors, setAddressLine, getAddressLine, getAddressLineUnsafe, getAddressLineUnchecked, setCity, getCity, getCityUnsafe, getCityUnchecked, setCountry, getCountry, getCountryUnsafe, getCountryUnchecked, setDependentLocality, getDependentLocality, getDependentLocalityUnsafe, getDependentLocalityUnchecked, setOrganization, getOrganization, getOrganizationUnsafe, getOrganizationUnchecked, setPhone, getPhone, getPhoneUnsafe, getPhoneUnchecked, setPostalCode, getPostalCode, getPostalCodeUnsafe, getPostalCodeUnchecked, setRecipient, getRecipient, getRecipientUnsafe, getRecipientUnchecked, setRegion, getRegion, getRegionUnsafe, getRegionUnchecked, setSortingCode, getSortingCode, getSortingCodeUnsafe, getSortingCodeUnchecked, AddressErrors(..), gTypeAddressErrors)
       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/payment-request/#dom-addresserrors AddressErrors specification>
newAddressErrors :: (MonadDOM m) => m AddressErrors
newAddressErrors = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-addressline AddressErrors.addressLine specification>
setAddressLine :: (MonadDOM m, ToJSString val) => AddressErrors -> val -> m ()
setAddressLine self val = liftDOM (void (self ^. jss "addressLine" (toJSVal val)))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-addressline AddressErrors.addressLine specification>
getAddressLine :: (MonadDOM m, FromJSString result) => AddressErrors -> m (Maybe result)
getAddressLine self = liftDOM (((self ^. js "addressLine") >>= fromMaybeJSString))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-addressline AddressErrors.addressLine specification>
getAddressLineUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AddressErrors -> m result
getAddressLineUnsafe self = liftDOM ((((self ^. js "addressLine") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-addressline AddressErrors.addressLine specification>
getAddressLineUnchecked :: (MonadDOM m, FromJSString result) => AddressErrors -> m result
getAddressLineUnchecked self = liftDOM (((self ^. js "addressLine") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-city AddressErrors.city specification>
setCity :: (MonadDOM m, ToJSString val) => AddressErrors -> val -> m ()
setCity self val = liftDOM (void (self ^. jss "city" (toJSVal val)))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-city AddressErrors.city specification>
getCity :: (MonadDOM m, FromJSString result) => AddressErrors -> m (Maybe result)
getCity self = liftDOM (((self ^. js "city") >>= fromMaybeJSString))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-city AddressErrors.city specification>
getCityUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AddressErrors -> m result
getCityUnsafe self = liftDOM ((((self ^. js "city") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-city AddressErrors.city specification>
getCityUnchecked :: (MonadDOM m, FromJSString result) => AddressErrors -> m result
getCityUnchecked self = liftDOM (((self ^. js "city") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-country AddressErrors.country specification>
setCountry :: (MonadDOM m, ToJSString val) => AddressErrors -> val -> m ()
setCountry self val = liftDOM (void (self ^. jss "country" (toJSVal val)))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-country AddressErrors.country specification>
getCountry :: (MonadDOM m, FromJSString result) => AddressErrors -> m (Maybe result)
getCountry self = liftDOM (((self ^. js "country") >>= fromMaybeJSString))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-country AddressErrors.country specification>
getCountryUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AddressErrors -> m result
getCountryUnsafe self = liftDOM ((((self ^. js "country") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-country AddressErrors.country specification>
getCountryUnchecked :: (MonadDOM m, FromJSString result) => AddressErrors -> m result
getCountryUnchecked self = liftDOM (((self ^. js "country") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-dependentlocality AddressErrors.dependentLocality specification>
setDependentLocality :: (MonadDOM m, ToJSString val) => AddressErrors -> val -> m ()
setDependentLocality self val = liftDOM (void (self ^. jss "dependentLocality" (toJSVal val)))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-dependentlocality AddressErrors.dependentLocality specification>
getDependentLocality :: (MonadDOM m, FromJSString result) => AddressErrors -> m (Maybe result)
getDependentLocality self = liftDOM (((self ^. js "dependentLocality") >>= fromMaybeJSString))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-dependentlocality AddressErrors.dependentLocality specification>
getDependentLocalityUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AddressErrors -> m result
getDependentLocalityUnsafe self = liftDOM ((((self ^. js "dependentLocality") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-dependentlocality AddressErrors.dependentLocality specification>
getDependentLocalityUnchecked :: (MonadDOM m, FromJSString result) => AddressErrors -> m result
getDependentLocalityUnchecked self = liftDOM (((self ^. js "dependentLocality") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-organization AddressErrors.organization specification>
setOrganization :: (MonadDOM m, ToJSString val) => AddressErrors -> val -> m ()
setOrganization self val = liftDOM (void (self ^. jss "organization" (toJSVal val)))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-organization AddressErrors.organization specification>
getOrganization :: (MonadDOM m, FromJSString result) => AddressErrors -> m (Maybe result)
getOrganization self = liftDOM (((self ^. js "organization") >>= fromMaybeJSString))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-organization AddressErrors.organization specification>
getOrganizationUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AddressErrors -> m result
getOrganizationUnsafe self = liftDOM ((((self ^. js "organization") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-organization AddressErrors.organization specification>
getOrganizationUnchecked :: (MonadDOM m, FromJSString result) => AddressErrors -> m result
getOrganizationUnchecked self = liftDOM (((self ^. js "organization") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-phone AddressErrors.phone specification>
setPhone :: (MonadDOM m, ToJSString val) => AddressErrors -> val -> m ()
setPhone self val = liftDOM (void (self ^. jss "phone" (toJSVal val)))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-phone AddressErrors.phone specification>
getPhone :: (MonadDOM m, FromJSString result) => AddressErrors -> m (Maybe result)
getPhone self = liftDOM (((self ^. js "phone") >>= fromMaybeJSString))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-phone AddressErrors.phone specification>
getPhoneUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AddressErrors -> m result
getPhoneUnsafe self = liftDOM ((((self ^. js "phone") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-phone AddressErrors.phone specification>
getPhoneUnchecked :: (MonadDOM m, FromJSString result) => AddressErrors -> m result
getPhoneUnchecked self = liftDOM (((self ^. js "phone") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-postalcode AddressErrors.postalCode specification>
setPostalCode :: (MonadDOM m, ToJSString val) => AddressErrors -> val -> m ()
setPostalCode self val = liftDOM (void (self ^. jss "postalCode" (toJSVal val)))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-postalcode AddressErrors.postalCode specification>
getPostalCode :: (MonadDOM m, FromJSString result) => AddressErrors -> m (Maybe result)
getPostalCode self = liftDOM (((self ^. js "postalCode") >>= fromMaybeJSString))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-postalcode AddressErrors.postalCode specification>
getPostalCodeUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AddressErrors -> m result
getPostalCodeUnsafe self = liftDOM ((((self ^. js "postalCode") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-postalcode AddressErrors.postalCode specification>
getPostalCodeUnchecked :: (MonadDOM m, FromJSString result) => AddressErrors -> m result
getPostalCodeUnchecked self = liftDOM (((self ^. js "postalCode") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-recipient AddressErrors.recipient specification>
setRecipient :: (MonadDOM m, ToJSString val) => AddressErrors -> val -> m ()
setRecipient self val = liftDOM (void (self ^. jss "recipient" (toJSVal val)))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-recipient AddressErrors.recipient specification>
getRecipient :: (MonadDOM m, FromJSString result) => AddressErrors -> m (Maybe result)
getRecipient self = liftDOM (((self ^. js "recipient") >>= fromMaybeJSString))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-recipient AddressErrors.recipient specification>
getRecipientUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AddressErrors -> m result
getRecipientUnsafe self = liftDOM ((((self ^. js "recipient") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-recipient AddressErrors.recipient specification>
getRecipientUnchecked :: (MonadDOM m, FromJSString result) => AddressErrors -> m result
getRecipientUnchecked self = liftDOM (((self ^. js "recipient") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-region AddressErrors.region specification>
setRegion :: (MonadDOM m, ToJSString val) => AddressErrors -> val -> m ()
setRegion self val = liftDOM (void (self ^. jss "region" (toJSVal val)))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-region AddressErrors.region specification>
getRegion :: (MonadDOM m, FromJSString result) => AddressErrors -> m (Maybe result)
getRegion self = liftDOM (((self ^. js "region") >>= fromMaybeJSString))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-region AddressErrors.region specification>
getRegionUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AddressErrors -> m result
getRegionUnsafe self = liftDOM ((((self ^. js "region") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-region AddressErrors.region specification>
getRegionUnchecked :: (MonadDOM m, FromJSString result) => AddressErrors -> m result
getRegionUnchecked self = liftDOM (((self ^. js "region") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-sortingcode AddressErrors.sortingCode specification>
setSortingCode :: (MonadDOM m, ToJSString val) => AddressErrors -> val -> m ()
setSortingCode self val = liftDOM (void (self ^. jss "sortingCode" (toJSVal val)))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-sortingcode AddressErrors.sortingCode specification>
getSortingCode :: (MonadDOM m, FromJSString result) => AddressErrors -> m (Maybe result)
getSortingCode self = liftDOM (((self ^. js "sortingCode") >>= fromMaybeJSString))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-sortingcode AddressErrors.sortingCode specification>
getSortingCodeUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => AddressErrors -> m result
getSortingCodeUnsafe self = liftDOM ((((self ^. js "sortingCode") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/payment-request/#dom-addresserrors-sortingcode AddressErrors.sortingCode specification>
getSortingCodeUnchecked :: (MonadDOM m, FromJSString result) => AddressErrors -> m result
getSortingCodeUnchecked self = liftDOM (((self ^. js "sortingCode") >>= fromJSValUnchecked))