{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

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

module GI.Soup.Objects.SessionSync
    ( 

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


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [abort]("GI.Soup.Objects.Session#g:method:abort"), [addFeature]("GI.Soup.Objects.Session#g:method:addFeature"), [addFeatureByType]("GI.Soup.Objects.Session#g:method:addFeatureByType"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [cancelMessage]("GI.Soup.Objects.Session#g:method:cancelMessage"), [connectAsync]("GI.Soup.Objects.Session#g:method:connectAsync"), [connectFinish]("GI.Soup.Objects.Session#g:method:connectFinish"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [hasFeature]("GI.Soup.Objects.Session#g:method:hasFeature"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [pauseMessage]("GI.Soup.Objects.Session#g:method:pauseMessage"), [prefetchDns]("GI.Soup.Objects.Session#g:method:prefetchDns"), [prepareForUri]("GI.Soup.Objects.Session#g:method:prepareForUri"), [queueMessage]("GI.Soup.Objects.Session#g:method:queueMessage"), [redirectMessage]("GI.Soup.Objects.Session#g:method:redirectMessage"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [removeFeature]("GI.Soup.Objects.Session#g:method:removeFeature"), [removeFeatureByType]("GI.Soup.Objects.Session#g:method:removeFeatureByType"), [request]("GI.Soup.Objects.Session#g:method:request"), [requestHttp]("GI.Soup.Objects.Session#g:method:requestHttp"), [requestHttpUri]("GI.Soup.Objects.Session#g:method:requestHttpUri"), [requestUri]("GI.Soup.Objects.Session#g:method:requestUri"), [requeueMessage]("GI.Soup.Objects.Session#g:method:requeueMessage"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [send]("GI.Soup.Objects.Session#g:method:send"), [sendAsync]("GI.Soup.Objects.Session#g:method:sendAsync"), [sendFinish]("GI.Soup.Objects.Session#g:method:sendFinish"), [sendMessage]("GI.Soup.Objects.Session#g:method:sendMessage"), [stealConnection]("GI.Soup.Objects.Session#g:method:stealConnection"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unpauseMessage]("GI.Soup.Objects.Session#g:method:unpauseMessage"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure"), [websocketConnectAsync]("GI.Soup.Objects.Session#g:method:websocketConnectAsync"), [websocketConnectFinish]("GI.Soup.Objects.Session#g:method:websocketConnectFinish"), [wouldRedirect]("GI.Soup.Objects.Session#g:method:wouldRedirect").
-- 
-- ==== Getters
-- [getAsyncContext]("GI.Soup.Objects.Session#g:method:getAsyncContext"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getFeature]("GI.Soup.Objects.Session#g:method:getFeature"), [getFeatureForMessage]("GI.Soup.Objects.Session#g:method:getFeatureForMessage"), [getFeatures]("GI.Soup.Objects.Session#g:method:getFeatures"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveSessionSyncMethod                ,
#endif

-- ** 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
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 GHC.Records as R

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 (SP.ManagedPtr SessionSync)
    deriving (SessionSync -> SessionSync -> Bool
(SessionSync -> SessionSync -> Bool)
-> (SessionSync -> SessionSync -> Bool) -> Eq SessionSync
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SessionSync -> SessionSync -> Bool
== :: SessionSync -> SessionSync -> Bool
$c/= :: SessionSync -> SessionSync -> Bool
/= :: SessionSync -> SessionSync -> Bool
Eq)

instance SP.ManagedPtrNewtype SessionSync where
    toManagedPtr :: SessionSync -> ManagedPtr SessionSync
toManagedPtr (SessionSync ManagedPtr SessionSync
p) = ManagedPtr SessionSync
p

foreign import ccall "soup_session_sync_get_type"
    c_soup_session_sync_get_type :: IO B.Types.GType

instance B.Types.TypedObject SessionSync where
    glibType :: IO GType
glibType = IO GType
c_soup_session_sync_get_type

instance B.Types.GObject SessionSync

-- | Type class for types which can be safely cast to `SessionSync`, for instance with `toSessionSync`.
class (SP.GObject o, O.IsDescendantOf SessionSync o) => IsSessionSync o
instance (SP.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 :: (MIO.MonadIO m, IsSessionSync o) => o -> m SessionSync
toSessionSync :: forall (m :: * -> *) o.
(MonadIO m, IsSessionSync o) =>
o -> m SessionSync
toSessionSync = IO SessionSync -> m SessionSync
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO SessionSync -> m SessionSync)
-> (o -> IO SessionSync) -> o -> m SessionSync
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr SessionSync -> SessionSync) -> o -> IO SessionSync
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr SessionSync -> SessionSync
SessionSync

-- | Convert 'SessionSync' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe SessionSync) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_soup_session_sync_get_type
    gvalueSet_ :: Ptr GValue -> Maybe SessionSync -> IO ()
gvalueSet_ Ptr GValue
gv Maybe SessionSync
P.Nothing = Ptr GValue -> Ptr SessionSync -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr SessionSync
forall a. Ptr a
FP.nullPtr :: FP.Ptr SessionSync)
    gvalueSet_ Ptr GValue
gv (P.Just SessionSync
obj) = SessionSync -> (Ptr SessionSync -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SessionSync
obj (Ptr GValue -> Ptr SessionSync -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe SessionSync)
gvalueGet_ Ptr GValue
gv = do
        Ptr SessionSync
ptr <- Ptr GValue -> IO (Ptr SessionSync)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr SessionSync)
        if Ptr SessionSync
ptr Ptr SessionSync -> Ptr SessionSync -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr SessionSync
forall a. Ptr a
FP.nullPtr
        then SessionSync -> Maybe SessionSync
forall a. a -> Maybe a
P.Just (SessionSync -> Maybe SessionSync)
-> IO SessionSync -> IO (Maybe SessionSync)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr SessionSync -> SessionSync)
-> Ptr SessionSync -> IO SessionSync
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr SessionSync -> SessionSync
SessionSync Ptr SessionSync
ptr
        else Maybe SessionSync -> IO (Maybe SessionSync)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe SessionSync
forall a. Maybe a
P.Nothing
        
    

#if defined(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.OverloadedMethod info SessionSync p) => OL.IsLabel t (SessionSync -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveSessionSyncMethod t SessionSync, O.OverloadedMethod info SessionSync p, R.HasField t SessionSync p) => R.HasField t SessionSync p where
    getField = O.overloadedMethod @info

#endif

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

#endif

#if defined(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 defined(ENABLE_OVERLOADING)
#endif

#if defined(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 ["t'GI.Soup.Objects.SessionSync.SessionSync' is deprecated; use a plain","t'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 t'GI.Soup.Objects.Session.Session' with the default options.
sessionSyncNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m SessionSync
    -- ^ __Returns:__ the new session.
sessionSyncNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SessionSync
sessionSyncNew  = IO SessionSync -> m SessionSync
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SessionSync -> m SessionSync)
-> IO SessionSync -> m SessionSync
forall a b. (a -> b) -> a -> b
$ do
    Ptr SessionSync
result <- IO (Ptr SessionSync)
soup_session_sync_new
    Text -> Ptr SessionSync -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sessionSyncNew" Ptr SessionSync
result
    SessionSync
result' <- ((ManagedPtr SessionSync -> SessionSync)
-> Ptr SessionSync -> IO SessionSync
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SessionSync -> SessionSync
SessionSync) Ptr SessionSync
result
    SessionSync -> IO SessionSync
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SessionSync
result'

#if defined(ENABLE_OVERLOADING)
#endif