packages feed

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

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from CSP3 (webref). Do not edit.
module JSDOM.Generated.SecurityPolicyViolationEventInit
       (newSecurityPolicyViolationEventInit, setDocumentURI, getDocumentURI, getDocumentURIUnsafe, getDocumentURIUnchecked, setReferrer, getReferrer, getReferrerUnsafe, getReferrerUnchecked, setBlockedURI, getBlockedURI, getBlockedURIUnsafe, getBlockedURIUnchecked, setViolatedDirective, getViolatedDirective, getViolatedDirectiveUnsafe, getViolatedDirectiveUnchecked, setEffectiveDirective, getEffectiveDirective, getEffectiveDirectiveUnsafe, getEffectiveDirectiveUnchecked, setOriginalPolicy, getOriginalPolicy, getOriginalPolicyUnsafe, getOriginalPolicyUnchecked, setSourceFile, getSourceFile, getSourceFileUnsafe, getSourceFileUnchecked, setSample, getSample, getSampleUnsafe, getSampleUnchecked, setDisposition, getDisposition, getDispositionUnsafe, getDispositionUnchecked, setStatusCode, getStatusCode, getStatusCodeUnsafe, getStatusCodeUnchecked, setLineNumber, getLineNumber, getLineNumberUnsafe, getLineNumberUnchecked, setColumnNumber, getColumnNumber, getColumnNumberUnsafe, getColumnNumberUnchecked, SecurityPolicyViolationEventInit(..), gTypeSecurityPolicyViolationEventInit)
       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/webappsec-csp/#dictdef-securitypolicyviolationeventinit SecurityPolicyViolationEventInit specification>
newSecurityPolicyViolationEventInit :: (MonadDOM m) => m SecurityPolicyViolationEventInit
newSecurityPolicyViolationEventInit = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-documenturi SecurityPolicyViolationEventInit.documentURI specification>
setDocumentURI :: (MonadDOM m, ToJSString val) => SecurityPolicyViolationEventInit -> val -> m ()
setDocumentURI self val = liftDOM (void (self ^. jss "documentURI" (toJSVal val)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-documenturi SecurityPolicyViolationEventInit.documentURI specification>
getDocumentURI :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m (Maybe result)
getDocumentURI self = liftDOM (((self ^. js "documentURI") >>= fromMaybeJSString))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-documenturi SecurityPolicyViolationEventInit.documentURI specification>
getDocumentURIUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getDocumentURIUnsafe self = liftDOM ((((self ^. js "documentURI") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-documenturi SecurityPolicyViolationEventInit.documentURI specification>
getDocumentURIUnchecked :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getDocumentURIUnchecked self = liftDOM (((self ^. js "documentURI") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-referrer SecurityPolicyViolationEventInit.referrer specification>
setReferrer :: (MonadDOM m, ToJSString val) => SecurityPolicyViolationEventInit -> val -> m ()
setReferrer self val = liftDOM (void (self ^. jss "referrer" (toJSVal val)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-referrer SecurityPolicyViolationEventInit.referrer specification>
getReferrer :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m (Maybe result)
getReferrer self = liftDOM (((self ^. js "referrer") >>= fromMaybeJSString))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-referrer SecurityPolicyViolationEventInit.referrer specification>
getReferrerUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getReferrerUnsafe self = liftDOM ((((self ^. js "referrer") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-referrer SecurityPolicyViolationEventInit.referrer specification>
getReferrerUnchecked :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getReferrerUnchecked self = liftDOM (((self ^. js "referrer") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-blockeduri SecurityPolicyViolationEventInit.blockedURI specification>
setBlockedURI :: (MonadDOM m, ToJSString val) => SecurityPolicyViolationEventInit -> val -> m ()
setBlockedURI self val = liftDOM (void (self ^. jss "blockedURI" (toJSVal val)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-blockeduri SecurityPolicyViolationEventInit.blockedURI specification>
getBlockedURI :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m (Maybe result)
getBlockedURI self = liftDOM (((self ^. js "blockedURI") >>= fromMaybeJSString))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-blockeduri SecurityPolicyViolationEventInit.blockedURI specification>
getBlockedURIUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getBlockedURIUnsafe self = liftDOM ((((self ^. js "blockedURI") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-blockeduri SecurityPolicyViolationEventInit.blockedURI specification>
getBlockedURIUnchecked :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getBlockedURIUnchecked self = liftDOM (((self ^. js "blockedURI") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-violateddirective SecurityPolicyViolationEventInit.violatedDirective specification>
setViolatedDirective :: (MonadDOM m, ToJSString val) => SecurityPolicyViolationEventInit -> val -> m ()
setViolatedDirective self val = liftDOM (void (self ^. jss "violatedDirective" (toJSVal val)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-violateddirective SecurityPolicyViolationEventInit.violatedDirective specification>
getViolatedDirective :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m (Maybe result)
getViolatedDirective self = liftDOM (((self ^. js "violatedDirective") >>= fromMaybeJSString))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-violateddirective SecurityPolicyViolationEventInit.violatedDirective specification>
getViolatedDirectiveUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getViolatedDirectiveUnsafe self = liftDOM ((((self ^. js "violatedDirective") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-violateddirective SecurityPolicyViolationEventInit.violatedDirective specification>
getViolatedDirectiveUnchecked :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getViolatedDirectiveUnchecked self = liftDOM (((self ^. js "violatedDirective") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-effectivedirective SecurityPolicyViolationEventInit.effectiveDirective specification>
setEffectiveDirective :: (MonadDOM m, ToJSString val) => SecurityPolicyViolationEventInit -> val -> m ()
setEffectiveDirective self val = liftDOM (void (self ^. jss "effectiveDirective" (toJSVal val)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-effectivedirective SecurityPolicyViolationEventInit.effectiveDirective specification>
getEffectiveDirective :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m (Maybe result)
getEffectiveDirective self = liftDOM (((self ^. js "effectiveDirective") >>= fromMaybeJSString))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-effectivedirective SecurityPolicyViolationEventInit.effectiveDirective specification>
getEffectiveDirectiveUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getEffectiveDirectiveUnsafe self = liftDOM ((((self ^. js "effectiveDirective") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-effectivedirective SecurityPolicyViolationEventInit.effectiveDirective specification>
getEffectiveDirectiveUnchecked :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getEffectiveDirectiveUnchecked self = liftDOM (((self ^. js "effectiveDirective") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-originalpolicy SecurityPolicyViolationEventInit.originalPolicy specification>
setOriginalPolicy :: (MonadDOM m, ToJSString val) => SecurityPolicyViolationEventInit -> val -> m ()
setOriginalPolicy self val = liftDOM (void (self ^. jss "originalPolicy" (toJSVal val)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-originalpolicy SecurityPolicyViolationEventInit.originalPolicy specification>
getOriginalPolicy :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m (Maybe result)
getOriginalPolicy self = liftDOM (((self ^. js "originalPolicy") >>= fromMaybeJSString))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-originalpolicy SecurityPolicyViolationEventInit.originalPolicy specification>
getOriginalPolicyUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getOriginalPolicyUnsafe self = liftDOM ((((self ^. js "originalPolicy") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-originalpolicy SecurityPolicyViolationEventInit.originalPolicy specification>
getOriginalPolicyUnchecked :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getOriginalPolicyUnchecked self = liftDOM (((self ^. js "originalPolicy") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-sourcefile SecurityPolicyViolationEventInit.sourceFile specification>
setSourceFile :: (MonadDOM m, ToJSString val) => SecurityPolicyViolationEventInit -> val -> m ()
setSourceFile self val = liftDOM (void (self ^. jss "sourceFile" (toJSVal val)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-sourcefile SecurityPolicyViolationEventInit.sourceFile specification>
getSourceFile :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m (Maybe result)
getSourceFile self = liftDOM (((self ^. js "sourceFile") >>= fromMaybeJSString))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-sourcefile SecurityPolicyViolationEventInit.sourceFile specification>
getSourceFileUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getSourceFileUnsafe self = liftDOM ((((self ^. js "sourceFile") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-sourcefile SecurityPolicyViolationEventInit.sourceFile specification>
getSourceFileUnchecked :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getSourceFileUnchecked self = liftDOM (((self ^. js "sourceFile") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-sample SecurityPolicyViolationEventInit.sample specification>
setSample :: (MonadDOM m, ToJSString val) => SecurityPolicyViolationEventInit -> val -> m ()
setSample self val = liftDOM (void (self ^. jss "sample" (toJSVal val)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-sample SecurityPolicyViolationEventInit.sample specification>
getSample :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m (Maybe result)
getSample self = liftDOM (((self ^. js "sample") >>= fromMaybeJSString))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-sample SecurityPolicyViolationEventInit.sample specification>
getSampleUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getSampleUnsafe self = liftDOM ((((self ^. js "sample") >>= fromMaybeJSString) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-sample SecurityPolicyViolationEventInit.sample specification>
getSampleUnchecked :: (MonadDOM m, FromJSString result) => SecurityPolicyViolationEventInit -> m result
getSampleUnchecked self = liftDOM (((self ^. js "sample") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-disposition SecurityPolicyViolationEventInit.disposition specification>
setDisposition :: (MonadDOM m) => SecurityPolicyViolationEventInit -> SecurityPolicyViolationEventDisposition -> m ()
setDisposition self val = liftDOM (void (self ^. jss "disposition" (toJSVal val)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-disposition SecurityPolicyViolationEventInit.disposition specification>
getDisposition :: (MonadDOM m) => SecurityPolicyViolationEventInit -> m (Maybe SecurityPolicyViolationEventDisposition)
getDisposition self = liftDOM (((self ^. js "disposition") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-disposition SecurityPolicyViolationEventInit.disposition specification>
getDispositionUnsafe :: (MonadDOM m, HasCallStack) => SecurityPolicyViolationEventInit -> m SecurityPolicyViolationEventDisposition
getDispositionUnsafe self = liftDOM ((((self ^. js "disposition") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-disposition SecurityPolicyViolationEventInit.disposition specification>
getDispositionUnchecked :: (MonadDOM m) => SecurityPolicyViolationEventInit -> m SecurityPolicyViolationEventDisposition
getDispositionUnchecked self = liftDOM (((self ^. js "disposition") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-statuscode SecurityPolicyViolationEventInit.statusCode specification>
setStatusCode :: (MonadDOM m) => SecurityPolicyViolationEventInit -> Word -> m ()
setStatusCode self val = liftDOM (void (self ^. jss "statusCode" (toJSVal val)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-statuscode SecurityPolicyViolationEventInit.statusCode specification>
getStatusCode :: (MonadDOM m) => SecurityPolicyViolationEventInit -> m (Maybe Word)
getStatusCode self = liftDOM (((self ^. js "statusCode") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-statuscode SecurityPolicyViolationEventInit.statusCode specification>
getStatusCodeUnsafe :: (MonadDOM m, HasCallStack) => SecurityPolicyViolationEventInit -> m Word
getStatusCodeUnsafe self = liftDOM ((((self ^. js "statusCode") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-statuscode SecurityPolicyViolationEventInit.statusCode specification>
getStatusCodeUnchecked :: (MonadDOM m) => SecurityPolicyViolationEventInit -> m Word
getStatusCodeUnchecked self = liftDOM ((P.round <$> ((self ^. js "statusCode") >>= valToNumber)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-linenumber SecurityPolicyViolationEventInit.lineNumber specification>
setLineNumber :: (MonadDOM m) => SecurityPolicyViolationEventInit -> Word -> m ()
setLineNumber self val = liftDOM (void (self ^. jss "lineNumber" (toJSVal val)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-linenumber SecurityPolicyViolationEventInit.lineNumber specification>
getLineNumber :: (MonadDOM m) => SecurityPolicyViolationEventInit -> m (Maybe Word)
getLineNumber self = liftDOM (((self ^. js "lineNumber") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-linenumber SecurityPolicyViolationEventInit.lineNumber specification>
getLineNumberUnsafe :: (MonadDOM m, HasCallStack) => SecurityPolicyViolationEventInit -> m Word
getLineNumberUnsafe self = liftDOM ((((self ^. js "lineNumber") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-linenumber SecurityPolicyViolationEventInit.lineNumber specification>
getLineNumberUnchecked :: (MonadDOM m) => SecurityPolicyViolationEventInit -> m Word
getLineNumberUnchecked self = liftDOM ((P.round <$> ((self ^. js "lineNumber") >>= valToNumber)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-columnnumber SecurityPolicyViolationEventInit.columnNumber specification>
setColumnNumber :: (MonadDOM m) => SecurityPolicyViolationEventInit -> Word -> m ()
setColumnNumber self val = liftDOM (void (self ^. jss "columnNumber" (toJSVal val)))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-columnnumber SecurityPolicyViolationEventInit.columnNumber specification>
getColumnNumber :: (MonadDOM m) => SecurityPolicyViolationEventInit -> m (Maybe Word)
getColumnNumber self = liftDOM (((self ^. js "columnNumber") >>= fromJSValUnchecked))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-columnnumber SecurityPolicyViolationEventInit.columnNumber specification>
getColumnNumberUnsafe :: (MonadDOM m, HasCallStack) => SecurityPolicyViolationEventInit -> m Word
getColumnNumberUnsafe self = liftDOM ((((self ^. js "columnNumber") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://w3c.github.io/webappsec-csp/#dom-securitypolicyviolationeventinit-columnnumber SecurityPolicyViolationEventInit.columnNumber specification>
getColumnNumberUnchecked :: (MonadDOM m) => SecurityPolicyViolationEventInit -> m Word
getColumnNumberUnchecked self = liftDOM ((P.round <$> ((self ^. js "columnNumber") >>= valToNumber)))