{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)

/No description available in the introspection data./
-}

#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
       && !defined(__HADDOCK_VERSION__))

module GI.Soup.Objects.SessionSync
    (

-- * Exported types
    SessionSync(..)                         ,
    IsSessionSync                           ,
    toSessionSync                           ,
    noSessionSync                           ,


 -- * Methods
-- ** new #method:new#

    sessionSyncNew                          ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Soup.Objects.Session as Soup.Session

-- | Memory-managed wrapper type.
newtype SessionSync = SessionSync (ManagedPtr SessionSync)
foreign import ccall "soup_session_sync_get_type"
    c_soup_session_sync_get_type :: IO GType

instance GObject SessionSync where
    gobjectType = c_soup_session_sync_get_type


-- | Type class for types which can be safely cast to `SessionSync`, for instance with `toSessionSync`.
class (GObject o, O.IsDescendantOf SessionSync o) => IsSessionSync o
instance (GObject o, O.IsDescendantOf SessionSync o) => IsSessionSync o

instance O.HasParentTypes SessionSync
type instance O.ParentTypes SessionSync = '[Soup.Session.Session, GObject.Object.Object]

-- | Cast to `SessionSync`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toSessionSync :: (MonadIO m, IsSessionSync o) => o -> m SessionSync
toSessionSync = liftIO . unsafeCastTo SessionSync

-- | A convenience alias for `Nothing` :: `Maybe` `SessionSync`.
noSessionSync :: Maybe SessionSync
noSessionSync = Nothing

#if ENABLE_OVERLOADING
type family ResolveSessionSyncMethod (t :: Symbol) (o :: *) :: * where
    ResolveSessionSyncMethod "abort" o = Soup.Session.SessionAbortMethodInfo
    ResolveSessionSyncMethod "addFeature" o = Soup.Session.SessionAddFeatureMethodInfo
    ResolveSessionSyncMethod "addFeatureByType" o = Soup.Session.SessionAddFeatureByTypeMethodInfo
    ResolveSessionSyncMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSessionSyncMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSessionSyncMethod "cancelMessage" o = Soup.Session.SessionCancelMessageMethodInfo
    ResolveSessionSyncMethod "connectAsync" o = Soup.Session.SessionConnectAsyncMethodInfo
    ResolveSessionSyncMethod "connectFinish" o = Soup.Session.SessionConnectFinishMethodInfo
    ResolveSessionSyncMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSessionSyncMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSessionSyncMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveSessionSyncMethod "hasFeature" o = Soup.Session.SessionHasFeatureMethodInfo
    ResolveSessionSyncMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSessionSyncMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSessionSyncMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSessionSyncMethod "pauseMessage" o = Soup.Session.SessionPauseMessageMethodInfo
    ResolveSessionSyncMethod "prefetchDns" o = Soup.Session.SessionPrefetchDnsMethodInfo
    ResolveSessionSyncMethod "prepareForUri" o = Soup.Session.SessionPrepareForUriMethodInfo
    ResolveSessionSyncMethod "queueMessage" o = Soup.Session.SessionQueueMessageMethodInfo
    ResolveSessionSyncMethod "redirectMessage" o = Soup.Session.SessionRedirectMessageMethodInfo
    ResolveSessionSyncMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSessionSyncMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSessionSyncMethod "removeFeature" o = Soup.Session.SessionRemoveFeatureMethodInfo
    ResolveSessionSyncMethod "removeFeatureByType" o = Soup.Session.SessionRemoveFeatureByTypeMethodInfo
    ResolveSessionSyncMethod "request" o = Soup.Session.SessionRequestMethodInfo
    ResolveSessionSyncMethod "requestHttp" o = Soup.Session.SessionRequestHttpMethodInfo
    ResolveSessionSyncMethod "requestHttpUri" o = Soup.Session.SessionRequestHttpUriMethodInfo
    ResolveSessionSyncMethod "requestUri" o = Soup.Session.SessionRequestUriMethodInfo
    ResolveSessionSyncMethod "requeueMessage" o = Soup.Session.SessionRequeueMessageMethodInfo
    ResolveSessionSyncMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSessionSyncMethod "send" o = Soup.Session.SessionSendMethodInfo
    ResolveSessionSyncMethod "sendAsync" o = Soup.Session.SessionSendAsyncMethodInfo
    ResolveSessionSyncMethod "sendFinish" o = Soup.Session.SessionSendFinishMethodInfo
    ResolveSessionSyncMethod "sendMessage" o = Soup.Session.SessionSendMessageMethodInfo
    ResolveSessionSyncMethod "stealConnection" o = Soup.Session.SessionStealConnectionMethodInfo
    ResolveSessionSyncMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSessionSyncMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSessionSyncMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSessionSyncMethod "unpauseMessage" o = Soup.Session.SessionUnpauseMessageMethodInfo
    ResolveSessionSyncMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSessionSyncMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSessionSyncMethod "websocketConnectAsync" o = Soup.Session.SessionWebsocketConnectAsyncMethodInfo
    ResolveSessionSyncMethod "websocketConnectFinish" o = Soup.Session.SessionWebsocketConnectFinishMethodInfo
    ResolveSessionSyncMethod "wouldRedirect" o = Soup.Session.SessionWouldRedirectMethodInfo
    ResolveSessionSyncMethod "getAsyncContext" o = Soup.Session.SessionGetAsyncContextMethodInfo
    ResolveSessionSyncMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSessionSyncMethod "getFeature" o = Soup.Session.SessionGetFeatureMethodInfo
    ResolveSessionSyncMethod "getFeatureForMessage" o = Soup.Session.SessionGetFeatureForMessageMethodInfo
    ResolveSessionSyncMethod "getFeatures" o = Soup.Session.SessionGetFeaturesMethodInfo
    ResolveSessionSyncMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveSessionSyncMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSessionSyncMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSessionSyncMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveSessionSyncMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSessionSyncMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveSessionSyncMethod t SessionSync, O.MethodInfo info SessionSync p) => OL.IsLabel t (SessionSync -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList SessionSync
type instance O.AttributeList SessionSync = SessionSyncAttributeList
type SessionSyncAttributeList = ('[ '("acceptLanguage", Soup.Session.SessionAcceptLanguagePropertyInfo), '("acceptLanguageAuto", Soup.Session.SessionAcceptLanguageAutoPropertyInfo), '("asyncContext", Soup.Session.SessionAsyncContextPropertyInfo), '("httpAliases", Soup.Session.SessionHttpAliasesPropertyInfo), '("httpsAliases", Soup.Session.SessionHttpsAliasesPropertyInfo), '("idleTimeout", Soup.Session.SessionIdleTimeoutPropertyInfo), '("localAddress", Soup.Session.SessionLocalAddressPropertyInfo), '("maxConns", Soup.Session.SessionMaxConnsPropertyInfo), '("maxConnsPerHost", Soup.Session.SessionMaxConnsPerHostPropertyInfo), '("proxyResolver", Soup.Session.SessionProxyResolverPropertyInfo), '("proxyUri", Soup.Session.SessionProxyUriPropertyInfo), '("sslCaFile", Soup.Session.SessionSslCaFilePropertyInfo), '("sslStrict", Soup.Session.SessionSslStrictPropertyInfo), '("sslUseSystemCaFile", Soup.Session.SessionSslUseSystemCaFilePropertyInfo), '("timeout", Soup.Session.SessionTimeoutPropertyInfo), '("tlsDatabase", Soup.Session.SessionTlsDatabasePropertyInfo), '("tlsInteraction", Soup.Session.SessionTlsInteractionPropertyInfo), '("useNtlm", Soup.Session.SessionUseNtlmPropertyInfo), '("useThreadContext", Soup.Session.SessionUseThreadContextPropertyInfo), '("userAgent", Soup.Session.SessionUserAgentPropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
#endif

#if ENABLE_OVERLOADING
type instance O.SignalList SessionSync = SessionSyncSignalList
type SessionSyncSignalList = ('[ '("authenticate", Soup.Session.SessionAuthenticateSignalInfo), '("connectionCreated", Soup.Session.SessionConnectionCreatedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("requestQueued", Soup.Session.SessionRequestQueuedSignalInfo), '("requestStarted", Soup.Session.SessionRequestStartedSignalInfo), '("requestUnqueued", Soup.Session.SessionRequestUnqueuedSignalInfo), '("tunneling", Soup.Session.SessionTunnelingSignalInfo)] :: [(Symbol, *)])

#endif

-- method SessionSync::new
-- method type : Constructor
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Soup", name = "SessionSync"}))
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_sync_new" soup_session_sync_new ::
    IO (Ptr SessionSync)

{-# DEPRECATED sessionSyncNew ["'GI.Soup.Objects.SessionSync.SessionSync' is deprecated; use a plain","'GI.Soup.Objects.Session.Session', created with 'GI.Soup.Objects.Session.sessionNew'. See the \\<link","linkend=\\\"libsoup-session-porting\\\">porting guide\\<\\/link>."] #-}
{- |
Creates an synchronous 'GI.Soup.Objects.Session.Session' with the default options.
-}
sessionSyncNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m SessionSync
    {- ^ __Returns:__ the new session. -}
sessionSyncNew  = liftIO $ do
    result <- soup_session_sync_new
    checkUnexpectedReturnNULL "sessionSyncNew" result
    result' <- (wrapObject SessionSync) result
    return result'

#if ENABLE_OVERLOADING
#endif