ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/RTCPeerConnectionIceErrorEventInit.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webrtc (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.RTCPeerConnectionIceErrorEventInit
(js_newRTCPeerConnectionIceErrorEventInit, js_setAddress, js_getAddress, js_setPort, js_getPort, js_setUrl, js_getUrl, js_setErrorCode, js_getErrorCode, js_setErrorText, js_getErrorText, newRTCPeerConnectionIceErrorEventInit, setAddress, getAddress, getAddressUnsafe, getAddressUnchecked, setPort, getPort, getPortUnsafe, getPortUnchecked, setUrl, getUrl, getUrlUnsafe, getUrlUnchecked, setErrorCode, getErrorCode, setErrorText, getErrorText, getErrorTextUnsafe, getErrorTextUnchecked, RTCPeerConnectionIceErrorEventInit(..), gTypeRTCPeerConnectionIceErrorEventInit)
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 "(($1) => { return ({\"errorCode\": $1}); })"
js_newRTCPeerConnectionIceErrorEventInit :: Word -> IO RTCPeerConnectionIceErrorEventInit
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit RTCPeerConnectionIceErrorEventInit specification>
newRTCPeerConnectionIceErrorEventInit :: (MonadDOM m) => Word -> m RTCPeerConnectionIceErrorEventInit
newRTCPeerConnectionIceErrorEventInit errorCode = liftDOM ((js_newRTCPeerConnectionIceErrorEventInit (errorCode)))
foreign import javascript safe "(($1, $2) => { $1[\"address\"] = $2; })"
js_setAddress :: RTCPeerConnectionIceErrorEventInit -> (Nullable JSString) -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-address RTCPeerConnectionIceErrorEventInit.address specification>
setAddress :: (MonadDOM m, ToJSString val) => RTCPeerConnectionIceErrorEventInit -> Maybe val -> m ()
setAddress self val = liftDOM (void ((js_setAddress (self) (toMaybeJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"address\"]; })"
js_getAddress :: RTCPeerConnectionIceErrorEventInit -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-address RTCPeerConnectionIceErrorEventInit.address specification>
getAddress :: (MonadDOM m, FromJSString result) => RTCPeerConnectionIceErrorEventInit -> m (Maybe result)
getAddress self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getAddress (self))))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-address RTCPeerConnectionIceErrorEventInit.address specification>
getAddressUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => RTCPeerConnectionIceErrorEventInit -> m result
getAddressUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getAddress (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-address RTCPeerConnectionIceErrorEventInit.address specification>
getAddressUnchecked :: (MonadDOM m, FromJSString result) => RTCPeerConnectionIceErrorEventInit -> m result
getAddressUnchecked self = liftDOM ((pFromJSVal <$> (js_getAddress (self))))
foreign import javascript safe "(($1, $2) => { $1[\"port\"] = $2; })"
js_setPort :: RTCPeerConnectionIceErrorEventInit -> JSVal -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-port RTCPeerConnectionIceErrorEventInit.port specification>
setPort :: (MonadDOM m) => RTCPeerConnectionIceErrorEventInit -> Maybe Word -> m ()
setPort self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setPort (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"port\"]; })"
js_getPort :: RTCPeerConnectionIceErrorEventInit -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-port RTCPeerConnectionIceErrorEventInit.port specification>
getPort :: (MonadDOM m) => RTCPeerConnectionIceErrorEventInit -> m (Maybe Word)
getPort self = liftDOM (((js_getPort (self)) >>= fromJSValUnchecked))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-port RTCPeerConnectionIceErrorEventInit.port specification>
getPortUnsafe :: (MonadDOM m, HasCallStack) => RTCPeerConnectionIceErrorEventInit -> m Word
getPortUnsafe self = liftDOM ((((js_getPort (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-port RTCPeerConnectionIceErrorEventInit.port specification>
getPortUnchecked :: (MonadDOM m) => RTCPeerConnectionIceErrorEventInit -> m Word
getPortUnchecked self = liftDOM ((pFromJSVal <$> (js_getPort (self))))
foreign import javascript safe "(($1, $2) => { $1[\"url\"] = $2; })"
js_setUrl :: RTCPeerConnectionIceErrorEventInit -> JSString -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-url RTCPeerConnectionIceErrorEventInit.url specification>
setUrl :: (MonadDOM m, ToJSString val) => RTCPeerConnectionIceErrorEventInit -> val -> m ()
setUrl self val = liftDOM (void ((js_setUrl (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"url\"]; })"
js_getUrl :: RTCPeerConnectionIceErrorEventInit -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-url RTCPeerConnectionIceErrorEventInit.url specification>
getUrl :: (MonadDOM m, FromJSString result) => RTCPeerConnectionIceErrorEventInit -> m (Maybe result)
getUrl self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getUrl (self))))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-url RTCPeerConnectionIceErrorEventInit.url specification>
getUrlUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => RTCPeerConnectionIceErrorEventInit -> m result
getUrlUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getUrl (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-url RTCPeerConnectionIceErrorEventInit.url specification>
getUrlUnchecked :: (MonadDOM m, FromJSString result) => RTCPeerConnectionIceErrorEventInit -> m result
getUrlUnchecked self = liftDOM ((pFromJSVal <$> (js_getUrl (self))))
foreign import javascript safe "(($1, $2) => { $1[\"errorCode\"] = $2; })"
js_setErrorCode :: RTCPeerConnectionIceErrorEventInit -> Word -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-errorcode RTCPeerConnectionIceErrorEventInit.errorCode specification>
setErrorCode :: (MonadDOM m) => RTCPeerConnectionIceErrorEventInit -> Word -> m ()
setErrorCode self val = liftDOM (void ((js_setErrorCode (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"errorCode\"]; })"
js_getErrorCode :: RTCPeerConnectionIceErrorEventInit -> IO Word
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-errorcode RTCPeerConnectionIceErrorEventInit.errorCode specification>
getErrorCode :: (MonadDOM m) => RTCPeerConnectionIceErrorEventInit -> m Word
getErrorCode self = liftDOM ((js_getErrorCode (self)))
foreign import javascript safe "(($1, $2) => { $1[\"errorText\"] = $2; })"
js_setErrorText :: RTCPeerConnectionIceErrorEventInit -> JSString -> IO ()
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-errortext RTCPeerConnectionIceErrorEventInit.errorText specification>
setErrorText :: (MonadDOM m, ToJSString val) => RTCPeerConnectionIceErrorEventInit -> val -> m ()
setErrorText self val = liftDOM (void ((js_setErrorText (self) (toJSString val))))
foreign import javascript unsafe "(($1) => { return $1[\"errorText\"]; })"
js_getErrorText :: RTCPeerConnectionIceErrorEventInit -> IO JSVal
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-errortext RTCPeerConnectionIceErrorEventInit.errorText specification>
getErrorText :: (MonadDOM m, FromJSString result) => RTCPeerConnectionIceErrorEventInit -> m (Maybe result)
getErrorText self = liftDOM (((fromMaybeJSString . Nullable) <$> (js_getErrorText (self))))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-errortext RTCPeerConnectionIceErrorEventInit.errorText specification>
getErrorTextUnsafe :: (MonadDOM m, HasCallStack, FromJSString result) => RTCPeerConnectionIceErrorEventInit -> m result
getErrorTextUnsafe self = liftDOM ((((fromMaybeJSString . Nullable) <$> (js_getErrorText (self))) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerroreventinit-errortext RTCPeerConnectionIceErrorEventInit.errorText specification>
getErrorTextUnchecked :: (MonadDOM m, FromJSString result) => RTCPeerConnectionIceErrorEventInit -> m result
getErrorTextUnchecked self = liftDOM ((pFromJSVal <$> (js_getErrorText (self))))