{-# LANGUAGE ImplicitParams, RankNTypes, 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.Session
    ( 

-- * Exported types
    Session(..)                             ,
    IsSession                               ,
    toSession                               ,


 -- * 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)
    ResolveSessionMethod                    ,
#endif

-- ** abort #method:abort#

#if defined(ENABLE_OVERLOADING)
    SessionAbortMethodInfo                  ,
#endif
    sessionAbort                            ,


-- ** addFeature #method:addFeature#

#if defined(ENABLE_OVERLOADING)
    SessionAddFeatureMethodInfo             ,
#endif
    sessionAddFeature                       ,


-- ** addFeatureByType #method:addFeatureByType#

#if defined(ENABLE_OVERLOADING)
    SessionAddFeatureByTypeMethodInfo       ,
#endif
    sessionAddFeatureByType                 ,


-- ** cancelMessage #method:cancelMessage#

#if defined(ENABLE_OVERLOADING)
    SessionCancelMessageMethodInfo          ,
#endif
    sessionCancelMessage                    ,


-- ** connectAsync #method:connectAsync#

#if defined(ENABLE_OVERLOADING)
    SessionConnectAsyncMethodInfo           ,
#endif
    sessionConnectAsync                     ,


-- ** connectFinish #method:connectFinish#

#if defined(ENABLE_OVERLOADING)
    SessionConnectFinishMethodInfo          ,
#endif
    sessionConnectFinish                    ,


-- ** getAsyncContext #method:getAsyncContext#

#if defined(ENABLE_OVERLOADING)
    SessionGetAsyncContextMethodInfo        ,
#endif
    sessionGetAsyncContext                  ,


-- ** getFeature #method:getFeature#

#if defined(ENABLE_OVERLOADING)
    SessionGetFeatureMethodInfo             ,
#endif
    sessionGetFeature                       ,


-- ** getFeatureForMessage #method:getFeatureForMessage#

#if defined(ENABLE_OVERLOADING)
    SessionGetFeatureForMessageMethodInfo   ,
#endif
    sessionGetFeatureForMessage             ,


-- ** getFeatures #method:getFeatures#

#if defined(ENABLE_OVERLOADING)
    SessionGetFeaturesMethodInfo            ,
#endif
    sessionGetFeatures                      ,


-- ** hasFeature #method:hasFeature#

#if defined(ENABLE_OVERLOADING)
    SessionHasFeatureMethodInfo             ,
#endif
    sessionHasFeature                       ,


-- ** new #method:new#

    sessionNew                              ,


-- ** pauseMessage #method:pauseMessage#

#if defined(ENABLE_OVERLOADING)
    SessionPauseMessageMethodInfo           ,
#endif
    sessionPauseMessage                     ,


-- ** prefetchDns #method:prefetchDns#

#if defined(ENABLE_OVERLOADING)
    SessionPrefetchDnsMethodInfo            ,
#endif
    sessionPrefetchDns                      ,


-- ** prepareForUri #method:prepareForUri#

#if defined(ENABLE_OVERLOADING)
    SessionPrepareForUriMethodInfo          ,
#endif
    sessionPrepareForUri                    ,


-- ** queueMessage #method:queueMessage#

#if defined(ENABLE_OVERLOADING)
    SessionQueueMessageMethodInfo           ,
#endif
    sessionQueueMessage                     ,


-- ** redirectMessage #method:redirectMessage#

#if defined(ENABLE_OVERLOADING)
    SessionRedirectMessageMethodInfo        ,
#endif
    sessionRedirectMessage                  ,


-- ** removeFeature #method:removeFeature#

#if defined(ENABLE_OVERLOADING)
    SessionRemoveFeatureMethodInfo          ,
#endif
    sessionRemoveFeature                    ,


-- ** removeFeatureByType #method:removeFeatureByType#

#if defined(ENABLE_OVERLOADING)
    SessionRemoveFeatureByTypeMethodInfo    ,
#endif
    sessionRemoveFeatureByType              ,


-- ** request #method:request#

#if defined(ENABLE_OVERLOADING)
    SessionRequestMethodInfo                ,
#endif
    sessionRequest                          ,


-- ** requestHttp #method:requestHttp#

#if defined(ENABLE_OVERLOADING)
    SessionRequestHttpMethodInfo            ,
#endif
    sessionRequestHttp                      ,


-- ** requestHttpUri #method:requestHttpUri#

#if defined(ENABLE_OVERLOADING)
    SessionRequestHttpUriMethodInfo         ,
#endif
    sessionRequestHttpUri                   ,


-- ** requestUri #method:requestUri#

#if defined(ENABLE_OVERLOADING)
    SessionRequestUriMethodInfo             ,
#endif
    sessionRequestUri                       ,


-- ** requeueMessage #method:requeueMessage#

#if defined(ENABLE_OVERLOADING)
    SessionRequeueMessageMethodInfo         ,
#endif
    sessionRequeueMessage                   ,


-- ** send #method:send#

#if defined(ENABLE_OVERLOADING)
    SessionSendMethodInfo                   ,
#endif
    sessionSend                             ,


-- ** sendAsync #method:sendAsync#

#if defined(ENABLE_OVERLOADING)
    SessionSendAsyncMethodInfo              ,
#endif
    sessionSendAsync                        ,


-- ** sendFinish #method:sendFinish#

#if defined(ENABLE_OVERLOADING)
    SessionSendFinishMethodInfo             ,
#endif
    sessionSendFinish                       ,


-- ** sendMessage #method:sendMessage#

#if defined(ENABLE_OVERLOADING)
    SessionSendMessageMethodInfo            ,
#endif
    sessionSendMessage                      ,


-- ** stealConnection #method:stealConnection#

#if defined(ENABLE_OVERLOADING)
    SessionStealConnectionMethodInfo        ,
#endif
    sessionStealConnection                  ,


-- ** unpauseMessage #method:unpauseMessage#

#if defined(ENABLE_OVERLOADING)
    SessionUnpauseMessageMethodInfo         ,
#endif
    sessionUnpauseMessage                   ,


-- ** websocketConnectAsync #method:websocketConnectAsync#

#if defined(ENABLE_OVERLOADING)
    SessionWebsocketConnectAsyncMethodInfo  ,
#endif
    sessionWebsocketConnectAsync            ,


-- ** websocketConnectFinish #method:websocketConnectFinish#

#if defined(ENABLE_OVERLOADING)
    SessionWebsocketConnectFinishMethodInfo ,
#endif
    sessionWebsocketConnectFinish           ,


-- ** wouldRedirect #method:wouldRedirect#

#if defined(ENABLE_OVERLOADING)
    SessionWouldRedirectMethodInfo          ,
#endif
    sessionWouldRedirect                    ,




 -- * Properties


-- ** acceptLanguage #attr:acceptLanguage#
-- | If non-'P.Nothing', the value to use for the \"Accept-Language\" header
-- on t'GI.Soup.Objects.Message.Message's sent from this session.
-- 
-- Setting this will disable
-- t'GI.Soup.Objects.Session.Session':@/accept-language-auto/@.
-- 
-- /Since: 2.30/

#if defined(ENABLE_OVERLOADING)
    SessionAcceptLanguagePropertyInfo       ,
#endif
    clearSessionAcceptLanguage              ,
    constructSessionAcceptLanguage          ,
    getSessionAcceptLanguage                ,
#if defined(ENABLE_OVERLOADING)
    sessionAcceptLanguage                   ,
#endif
    setSessionAcceptLanguage                ,


-- ** acceptLanguageAuto #attr:acceptLanguageAuto#
-- | If 'P.True', t'GI.Soup.Objects.Session.Session' will automatically set the string
-- for the \"Accept-Language\" header on every t'GI.Soup.Objects.Message.Message'
-- sent, based on the return value of 'GI.GLib.Functions.getLanguageNames'.
-- 
-- Setting this will override any previous value of
-- t'GI.Soup.Objects.Session.Session':@/accept-language/@.
-- 
-- /Since: 2.30/

#if defined(ENABLE_OVERLOADING)
    SessionAcceptLanguageAutoPropertyInfo   ,
#endif
    constructSessionAcceptLanguageAuto      ,
    getSessionAcceptLanguageAuto            ,
#if defined(ENABLE_OVERLOADING)
    sessionAcceptLanguageAuto               ,
#endif
    setSessionAcceptLanguageAuto            ,


-- ** asyncContext #attr:asyncContext#
-- | The t'GI.GLib.Structs.MainContext.MainContext' that miscellaneous session-related
-- asynchronous callbacks are invoked on. (Eg, setting
-- t'GI.Soup.Objects.Session.Session':@/idle-timeout/@ will add a timeout source on this
-- context.)
-- 
-- For a plain t'GI.Soup.Objects.Session.Session', this property is always set to
-- the t'GI.GLib.Structs.MainContext.MainContext' that is the thread-default at the time
-- the session was created, and cannot be overridden. For the
-- deprecated t'GI.Soup.Objects.Session.Session' subclasses, the default value is
-- 'P.Nothing', meaning to use the global default t'GI.GLib.Structs.MainContext.MainContext'.
-- 
-- If t'GI.Soup.Objects.Session.Session':@/use-thread-context/@ is 'P.False', this context
-- will also be used for asynchronous HTTP I\/O.

#if defined(ENABLE_OVERLOADING)
    SessionAsyncContextPropertyInfo         ,
#endif
    constructSessionAsyncContext            ,
    getSessionAsyncContext                  ,
#if defined(ENABLE_OVERLOADING)
    sessionAsyncContext                     ,
#endif


-- ** httpAliases #attr:httpAliases#
-- | A 'P.Nothing'-terminated array of URI schemes that should be
-- considered to be aliases for \"http\". Eg, if this included
-- \<literal>\"dav\"\<\/literal>, than a URI of
-- \<literal>dav:\/\/example.com\/path\<\/literal> would be treated
-- identically to \<literal>http:\/\/example.com\/path\<\/literal>.
-- 
-- In a plain t'GI.Soup.Objects.Session.Session', the default value is 'P.Nothing',
-- meaning that only \"http\" is recognized as meaning \"http\".
-- In t'GI.Soup.Objects.SessionAsync.SessionAsync' and t'GI.Soup.Objects.SessionSync.SessionSync', for backward
-- compatibility, the default value is an array containing the
-- single element \<literal>\"*\"\<\/literal>, a special value
-- which means that any scheme except \"https\" is considered to
-- be an alias for \"http\".
-- 
-- See also t'GI.Soup.Objects.Session.Session':@/https-aliases/@.
-- 
-- /Since: 2.38/

#if defined(ENABLE_OVERLOADING)
    SessionHttpAliasesPropertyInfo          ,
#endif
    clearSessionHttpAliases                 ,
    constructSessionHttpAliases             ,
    getSessionHttpAliases                   ,
#if defined(ENABLE_OVERLOADING)
    sessionHttpAliases                      ,
#endif
    setSessionHttpAliases                   ,


-- ** httpsAliases #attr:httpsAliases#
-- | A comma-delimited list of URI schemes that should be
-- considered to be aliases for \"https\". See
-- t'GI.Soup.Objects.Session.Session':@/http-aliases/@ for more information.
-- 
-- The default value is 'P.Nothing', meaning that no URI schemes
-- are considered aliases for \"https\".
-- 
-- /Since: 2.38/

#if defined(ENABLE_OVERLOADING)
    SessionHttpsAliasesPropertyInfo         ,
#endif
    clearSessionHttpsAliases                ,
    constructSessionHttpsAliases            ,
    getSessionHttpsAliases                  ,
#if defined(ENABLE_OVERLOADING)
    sessionHttpsAliases                     ,
#endif
    setSessionHttpsAliases                  ,


-- ** idleTimeout #attr:idleTimeout#
-- | Connection lifetime (in seconds) when idle. Any connection
-- left idle longer than this will be closed.
-- 
-- Although you can change this property at any time, it will
-- only affect newly-created connections, not currently-open
-- ones. You can call 'GI.Soup.Objects.Session.sessionAbort' after setting this
-- if you want to ensure that all future connections will have
-- this timeout value.
-- 
-- Note that the default value of 60 seconds only applies to
-- plain @/SoupSessions/@. If you are using t'GI.Soup.Objects.SessionAsync.SessionAsync' or
-- t'GI.Soup.Objects.SessionSync.SessionSync', the default value is 0 (meaning idle
-- connections will never time out).
-- 
-- /Since: 2.24/

#if defined(ENABLE_OVERLOADING)
    SessionIdleTimeoutPropertyInfo          ,
#endif
    constructSessionIdleTimeout             ,
    getSessionIdleTimeout                   ,
#if defined(ENABLE_OVERLOADING)
    sessionIdleTimeout                      ,
#endif
    setSessionIdleTimeout                   ,


-- ** localAddress #attr:localAddress#
-- | Sets the t'GI.Soup.Objects.Address.Address' to use for the client side of
-- the connection.
-- 
-- Use this property if you want for instance to bind the
-- local socket to a specific IP address.
-- 
-- /Since: 2.42/

#if defined(ENABLE_OVERLOADING)
    SessionLocalAddressPropertyInfo         ,
#endif
    constructSessionLocalAddress            ,
    getSessionLocalAddress                  ,
#if defined(ENABLE_OVERLOADING)
    sessionLocalAddress                     ,
#endif


-- ** maxConns #attr:maxConns#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    SessionMaxConnsPropertyInfo             ,
#endif
    constructSessionMaxConns                ,
    getSessionMaxConns                      ,
#if defined(ENABLE_OVERLOADING)
    sessionMaxConns                         ,
#endif
    setSessionMaxConns                      ,


-- ** maxConnsPerHost #attr:maxConnsPerHost#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    SessionMaxConnsPerHostPropertyInfo      ,
#endif
    constructSessionMaxConnsPerHost         ,
    getSessionMaxConnsPerHost               ,
#if defined(ENABLE_OVERLOADING)
    sessionMaxConnsPerHost                  ,
#endif
    setSessionMaxConnsPerHost               ,


-- ** proxyResolver #attr:proxyResolver#
-- | A t'GI.Gio.Interfaces.ProxyResolver.ProxyResolver' to use with this session. Setting this
-- will clear the t'GI.Soup.Objects.Session.Session':@/proxy-uri/@ property, and remove
-- any \<type>SoupProxyURIResolver\<\/type> features that have
-- been added to the session.
-- 
-- By default, in a plain t'GI.Soup.Objects.Session.Session', this is set to the
-- default t'GI.Gio.Interfaces.ProxyResolver.ProxyResolver', but you can set it to 'P.Nothing' if you
-- don\'t want to use proxies, or set it to your own
-- t'GI.Gio.Interfaces.ProxyResolver.ProxyResolver' if you want to control what proxies get
-- used.
-- 
-- /Since: 2.42/

#if defined(ENABLE_OVERLOADING)
    SessionProxyResolverPropertyInfo        ,
#endif
    clearSessionProxyResolver               ,
    constructSessionProxyResolver           ,
    getSessionProxyResolver                 ,
#if defined(ENABLE_OVERLOADING)
    sessionProxyResolver                    ,
#endif
    setSessionProxyResolver                 ,


-- ** proxyUri #attr:proxyUri#
-- | A proxy to use for all http and https requests in this
-- session. Setting this will clear the
-- t'GI.Soup.Objects.Session.Session':@/proxy-resolver/@ property, and remove any
-- \<type>SoupProxyURIResolver\<\/type> features that have been
-- added to the session. Setting this property will also
-- cancel all currently pending messages.
-- 
-- Note that t'GI.Soup.Objects.Session.Session' will normally handle looking up the
-- user\'s proxy settings for you; you should only use
-- t'GI.Soup.Objects.Session.Session':@/proxy-uri/@ if you need to override the user\'s
-- normal proxy settings.
-- 
-- Also note that this proxy will be used for
-- \<emphasis>all\<\/emphasis> requests; even requests to
-- \<literal>localhost\<\/literal>. If you need more control over
-- proxies, you can create a t'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver' and set the
-- t'GI.Soup.Objects.Session.Session':@/proxy-resolver/@ property.

#if defined(ENABLE_OVERLOADING)
    SessionProxyUriPropertyInfo             ,
#endif
    clearSessionProxyUri                    ,
    constructSessionProxyUri                ,
    getSessionProxyUri                      ,
#if defined(ENABLE_OVERLOADING)
    sessionProxyUri                         ,
#endif
    setSessionProxyUri                      ,


-- ** sslCaFile #attr:sslCaFile#
-- | File containing SSL CA certificates.
-- 
-- If the specified file does not exist or cannot be read,
-- then libsoup will print a warning, and then behave as
-- though it had read in a empty CA file, meaning that all SSL
-- certificates will be considered invalid.

#if defined(ENABLE_OVERLOADING)
    SessionSslCaFilePropertyInfo            ,
#endif
    clearSessionSslCaFile                   ,
    constructSessionSslCaFile               ,
    getSessionSslCaFile                     ,
#if defined(ENABLE_OVERLOADING)
    sessionSslCaFile                        ,
#endif
    setSessionSslCaFile                     ,


-- ** sslStrict #attr:sslStrict#
-- | Normally, if t'GI.Soup.Objects.Session.Session':@/tls-database/@ is set (including if
-- it was set via t'GI.Soup.Objects.Session.Session':@/ssl-use-system-ca-file/@ or
-- t'GI.Soup.Objects.Session.Session':@/ssl-ca-file/@), then libsoup will reject any
-- certificate that is invalid (ie, expired) or that is not
-- signed by one of the given CA certificates, and the
-- t'GI.Soup.Objects.Message.Message' will fail with the status
-- 'GI.Soup.Enums.StatusSslFailed'.
-- 
-- If you set t'GI.Soup.Objects.Session.Session':@/ssl-strict/@ to 'P.False', then all
-- certificates will be accepted, and you will need to call
-- 'GI.Soup.Objects.Message.messageGetHttpsStatus' to distinguish valid from
-- invalid certificates. (This can be used, eg, if you want to
-- accept invalid certificates after giving some sort of
-- warning.)
-- 
-- For a plain t'GI.Soup.Objects.Session.Session', if the session has no CA file or
-- TLS database, and this property is 'P.True', then all
-- certificates will be rejected. However, beware that the
-- deprecated t'GI.Soup.Objects.Session.Session' subclasses (t'GI.Soup.Objects.SessionAsync.SessionAsync' and
-- t'GI.Soup.Objects.SessionSync.SessionSync') have the opposite behavior: if there is
-- no CA file or TLS database, then all certificates are always
-- accepted, and this property has no effect.
-- 
-- /Since: 2.30/

#if defined(ENABLE_OVERLOADING)
    SessionSslStrictPropertyInfo            ,
#endif
    constructSessionSslStrict               ,
    getSessionSslStrict                     ,
#if defined(ENABLE_OVERLOADING)
    sessionSslStrict                        ,
#endif
    setSessionSslStrict                     ,


-- ** sslUseSystemCaFile #attr:sslUseSystemCaFile#
-- | Setting this to 'P.True' is equivalent to setting
-- t'GI.Soup.Objects.Session.Session':@/tls-database/@ to the default system CA database.
-- (and likewise, setting t'GI.Soup.Objects.Session.Session':@/tls-database/@ to the
-- default database by hand will cause this property to
-- become 'P.True').
-- 
-- Setting this to 'P.False' (when it was previously 'P.True') will
-- clear the t'GI.Soup.Objects.Session.Session':@/tls-database/@ field.
-- 
-- See t'GI.Soup.Objects.Session.Session':@/ssl-strict/@ for more information on how
-- https certificate validation is handled.
-- 
-- If you are using t'GI.Soup.Objects.SessionAsync.SessionAsync' or
-- t'GI.Soup.Objects.SessionSync.SessionSync', on libsoup older than 2.74.0, the default value
-- is 'P.False', for backward compatibility.
-- 
-- /Since: 2.38/

#if defined(ENABLE_OVERLOADING)
    SessionSslUseSystemCaFilePropertyInfo   ,
#endif
    constructSessionSslUseSystemCaFile      ,
    getSessionSslUseSystemCaFile            ,
#if defined(ENABLE_OVERLOADING)
    sessionSslUseSystemCaFile               ,
#endif
    setSessionSslUseSystemCaFile            ,


-- ** timeout #attr:timeout#
-- | The timeout (in seconds) for socket I\/O operations
-- (including connecting to a server, and waiting for a reply
-- to an HTTP request).
-- 
-- Although you can change this property at any time, it will
-- only affect newly-created connections, not currently-open
-- ones. You can call 'GI.Soup.Objects.Session.sessionAbort' after setting this
-- if you want to ensure that all future connections will have
-- this timeout value.
-- 
-- Note that the default value of 60 seconds only applies to
-- plain @/SoupSessions/@. If you are using t'GI.Soup.Objects.SessionAsync.SessionAsync' or
-- t'GI.Soup.Objects.SessionSync.SessionSync', the default value is 0 (meaning socket I\/O
-- will not time out).
-- 
-- Not to be confused with t'GI.Soup.Objects.Session.Session':@/idle-timeout/@ (which is
-- the length of time that idle persistent connections will be
-- kept open).

#if defined(ENABLE_OVERLOADING)
    SessionTimeoutPropertyInfo              ,
#endif
    constructSessionTimeout                 ,
    getSessionTimeout                       ,
#if defined(ENABLE_OVERLOADING)
    sessionTimeout                          ,
#endif
    setSessionTimeout                       ,


-- ** tlsDatabase #attr:tlsDatabase#
-- | Sets the t'GI.Gio.Objects.TlsDatabase.TlsDatabase' to use for validating SSL\/TLS
-- certificates.
-- 
-- Note that setting the t'GI.Soup.Objects.Session.Session':@/ssl-ca-file/@ or
-- t'GI.Soup.Objects.Session.Session':@/ssl-use-system-ca-file/@ property will cause
-- this property to be set to a t'GI.Gio.Objects.TlsDatabase.TlsDatabase' corresponding to
-- the indicated file or system default.
-- 
-- See t'GI.Soup.Objects.Session.Session':@/ssl-strict/@ for more information on how
-- https certificate validation is handled.
-- 
-- If you are using a plain t'GI.Soup.Objects.Session.Session' then
-- t'GI.Soup.Objects.Session.Session':@/ssl-use-system-ca-file/@ will be 'P.True' by
-- default, and so this property will be a copy of the system
-- CA database. If you are using t'GI.Soup.Objects.SessionAsync.SessionAsync' or
-- t'GI.Soup.Objects.SessionSync.SessionSync', on libsoup older than 2.74.0, this property
-- will be 'P.Nothing' by default.
-- 
-- /Since: 2.38/

#if defined(ENABLE_OVERLOADING)
    SessionTlsDatabasePropertyInfo          ,
#endif
    clearSessionTlsDatabase                 ,
    constructSessionTlsDatabase             ,
    getSessionTlsDatabase                   ,
#if defined(ENABLE_OVERLOADING)
    sessionTlsDatabase                      ,
#endif
    setSessionTlsDatabase                   ,


-- ** tlsInteraction #attr:tlsInteraction#
-- | A t'GI.Gio.Objects.TlsInteraction.TlsInteraction' object that will be passed on to any
-- @/GTlsConnections/@ created by the session. (This can be used to
-- provide client-side certificates, for example.)
-- 
-- /Since: 2.48/

#if defined(ENABLE_OVERLOADING)
    SessionTlsInteractionPropertyInfo       ,
#endif
    clearSessionTlsInteraction              ,
    constructSessionTlsInteraction          ,
    getSessionTlsInteraction                ,
#if defined(ENABLE_OVERLOADING)
    sessionTlsInteraction                   ,
#endif
    setSessionTlsInteraction                ,


-- ** useNtlm #attr:useNtlm#
-- | Whether or not to use NTLM authentication.

#if defined(ENABLE_OVERLOADING)
    SessionUseNtlmPropertyInfo              ,
#endif
    constructSessionUseNtlm                 ,
    getSessionUseNtlm                       ,
#if defined(ENABLE_OVERLOADING)
    sessionUseNtlm                          ,
#endif
    setSessionUseNtlm                       ,


-- ** useThreadContext #attr:useThreadContext#
-- | If 'P.True' (which it always is on a plain t'GI.Soup.Objects.Session.Session'),
-- asynchronous HTTP requests in this session will run in
-- whatever the thread-default t'GI.GLib.Structs.MainContext.MainContext' is at the time
-- they are started, rather than always occurring in
-- t'GI.Soup.Objects.Session.Session':@/async-context/@.
-- 
-- /Since: 2.38/

#if defined(ENABLE_OVERLOADING)
    SessionUseThreadContextPropertyInfo     ,
#endif
    constructSessionUseThreadContext        ,
    getSessionUseThreadContext              ,
#if defined(ENABLE_OVERLOADING)
    sessionUseThreadContext                 ,
#endif
    setSessionUseThreadContext              ,


-- ** userAgent #attr:userAgent#
-- | If non-'P.Nothing', the value to use for the \"User-Agent\" header
-- on t'GI.Soup.Objects.Message.Message's sent from this session.
-- 
-- RFC 2616 says: \"The User-Agent request-header field
-- contains information about the user agent originating the
-- request. This is for statistical purposes, the tracing of
-- protocol violations, and automated recognition of user
-- agents for the sake of tailoring responses to avoid
-- particular user agent limitations. User agents SHOULD
-- include this field with requests.\"
-- 
-- The User-Agent header contains a list of one or more
-- product tokens, separated by whitespace, with the most
-- significant product token coming first. The tokens must be
-- brief, ASCII, and mostly alphanumeric (although \"-\", \"_\",
-- and \".\" are also allowed), and may optionally include a \"\/\"
-- followed by a version string. You may also put comments,
-- enclosed in parentheses, between or after the tokens.
-- 
-- If you set a t'GI.Soup.Objects.Session.Session':@/user_agent/@ property that has trailing
-- whitespace, t'GI.Soup.Objects.Session.Session' will append its own product token
-- (eg, \"\<literal>libsoup\/2.3.2\<\/literal>\") to the end of the
-- header for you.

#if defined(ENABLE_OVERLOADING)
    SessionUserAgentPropertyInfo            ,
#endif
    clearSessionUserAgent                   ,
    constructSessionUserAgent               ,
    getSessionUserAgent                     ,
#if defined(ENABLE_OVERLOADING)
    sessionUserAgent                        ,
#endif
    setSessionUserAgent                     ,




 -- * Signals


-- ** authenticate #signal:authenticate#

    SessionAuthenticateCallback             ,
#if defined(ENABLE_OVERLOADING)
    SessionAuthenticateSignalInfo           ,
#endif
    afterSessionAuthenticate                ,
    onSessionAuthenticate                   ,


-- ** connectionCreated #signal:connectionCreated#

    SessionConnectionCreatedCallback        ,
#if defined(ENABLE_OVERLOADING)
    SessionConnectionCreatedSignalInfo      ,
#endif
    afterSessionConnectionCreated           ,
    onSessionConnectionCreated              ,


-- ** requestQueued #signal:requestQueued#

    SessionRequestQueuedCallback            ,
#if defined(ENABLE_OVERLOADING)
    SessionRequestQueuedSignalInfo          ,
#endif
    afterSessionRequestQueued               ,
    onSessionRequestQueued                  ,


-- ** requestStarted #signal:requestStarted#

    SessionRequestStartedCallback           ,
#if defined(ENABLE_OVERLOADING)
    SessionRequestStartedSignalInfo         ,
#endif
    afterSessionRequestStarted              ,
    onSessionRequestStarted                 ,


-- ** requestUnqueued #signal:requestUnqueued#

    SessionRequestUnqueuedCallback          ,
#if defined(ENABLE_OVERLOADING)
    SessionRequestUnqueuedSignalInfo        ,
#endif
    afterSessionRequestUnqueued             ,
    onSessionRequestUnqueued                ,


-- ** tunneling #signal:tunneling#

    SessionTunnelingCallback                ,
#if defined(ENABLE_OVERLOADING)
    SessionTunnelingSignalInfo              ,
#endif
    afterSessionTunneling                   ,
    onSessionTunneling                      ,




    ) 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.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.GLib.Structs.MainContext as GLib.MainContext
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.ProxyResolver as Gio.ProxyResolver
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.IOStream as Gio.IOStream
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.TlsDatabase as Gio.TlsDatabase
import qualified GI.Gio.Objects.TlsInteraction as Gio.TlsInteraction
import qualified GI.Soup.Callbacks as Soup.Callbacks
import {-# SOURCE #-} qualified GI.Soup.Interfaces.SessionFeature as Soup.SessionFeature
import {-# SOURCE #-} qualified GI.Soup.Objects.Address as Soup.Address
import {-# SOURCE #-} qualified GI.Soup.Objects.Auth as Soup.Auth
import {-# SOURCE #-} qualified GI.Soup.Objects.Message as Soup.Message
import {-# SOURCE #-} qualified GI.Soup.Objects.Request as Soup.Request
import {-# SOURCE #-} qualified GI.Soup.Objects.RequestHTTP as Soup.RequestHTTP
import {-# SOURCE #-} qualified GI.Soup.Objects.Socket as Soup.Socket
import {-# SOURCE #-} qualified GI.Soup.Objects.WebsocketConnection as Soup.WebsocketConnection
import {-# SOURCE #-} qualified GI.Soup.Structs.URI as Soup.URI

-- | Memory-managed wrapper type.
newtype Session = Session (SP.ManagedPtr Session)
    deriving (Session -> Session -> Bool
(Session -> Session -> Bool)
-> (Session -> Session -> Bool) -> Eq Session
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Session -> Session -> Bool
$c/= :: Session -> Session -> Bool
== :: Session -> Session -> Bool
$c== :: Session -> Session -> Bool
Eq)

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

foreign import ccall "soup_session_get_type"
    c_soup_session_get_type :: IO B.Types.GType

instance B.Types.TypedObject Session where
    glibType :: IO GType
glibType = IO GType
c_soup_session_get_type

instance B.Types.GObject Session

-- | Type class for types which can be safely cast to `Session`, for instance with `toSession`.
class (SP.GObject o, O.IsDescendantOf Session o) => IsSession o
instance (SP.GObject o, O.IsDescendantOf Session o) => IsSession o

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

-- | Cast to `Session`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toSession :: (MIO.MonadIO m, IsSession o) => o -> m Session
toSession :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m Session
toSession = IO Session -> m Session
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Session -> m Session) -> (o -> IO Session) -> o -> m Session
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Session -> Session) -> o -> IO Session
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Session -> Session
Session

-- | Convert 'Session' 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 Session) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_soup_session_get_type
    gvalueSet_ :: Ptr GValue -> Maybe Session -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Session
P.Nothing = Ptr GValue -> Ptr Session -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Session
forall a. Ptr a
FP.nullPtr :: FP.Ptr Session)
    gvalueSet_ Ptr GValue
gv (P.Just Session
obj) = Session -> (Ptr Session -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Session
obj (Ptr GValue -> Ptr Session -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe Session)
gvalueGet_ Ptr GValue
gv = do
        Ptr Session
ptr <- Ptr GValue -> IO (Ptr Session)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Session)
        if Ptr Session
ptr Ptr Session -> Ptr Session -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Session
forall a. Ptr a
FP.nullPtr
        then Session -> Maybe Session
forall a. a -> Maybe a
P.Just (Session -> Maybe Session) -> IO Session -> IO (Maybe Session)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Session -> Session) -> Ptr Session -> IO Session
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Session -> Session
Session Ptr Session
ptr
        else Maybe Session -> IO (Maybe Session)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Session
forall a. Maybe a
P.Nothing
        
    

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

instance (info ~ ResolveSessionMethod t Session, O.OverloadedMethod info Session p) => OL.IsLabel t (Session -> 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 ~ ResolveSessionMethod t Session, O.OverloadedMethod info Session p, R.HasField t Session p) => R.HasField t Session p where
    getField = O.overloadedMethod @info

#endif

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

#endif

-- signal Session::authenticate
-- | Emitted when the session requires authentication. If
-- credentials are available call 'GI.Soup.Objects.Auth.authAuthenticate' on
-- /@auth@/. If these credentials fail, the signal will be
-- emitted again, with /@retrying@/ set to 'P.True', which will
-- continue until you return without calling
-- 'GI.Soup.Objects.Auth.authAuthenticate' on /@auth@/.
-- 
-- Note that this may be emitted before /@msg@/\'s body has been
-- fully read.
-- 
-- If you call 'GI.Soup.Objects.Session.sessionPauseMessage' on /@msg@/ before
-- returning, then you can authenticate /@auth@/ asynchronously
-- (as long as you 'GI.GObject.Objects.Object.objectRef' it to make sure it doesn\'t
-- get destroyed), and then unpause /@msg@/ when you are ready
-- for it to continue.
type SessionAuthenticateCallback =
    Soup.Message.Message
    -- ^ /@msg@/: the t'GI.Soup.Objects.Message.Message' being sent
    -> Soup.Auth.Auth
    -- ^ /@auth@/: the t'GI.Soup.Objects.Auth.Auth' to authenticate
    -> Bool
    -- ^ /@retrying@/: 'P.True' if this is the second (or later) attempt
    -> IO ()

type C_SessionAuthenticateCallback =
    Ptr Session ->                          -- object
    Ptr Soup.Message.Message ->
    Ptr Soup.Auth.Auth ->
    CInt ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_SessionAuthenticateCallback`.
foreign import ccall "wrapper"
    mk_SessionAuthenticateCallback :: C_SessionAuthenticateCallback -> IO (FunPtr C_SessionAuthenticateCallback)

wrap_SessionAuthenticateCallback :: 
    GObject a => (a -> SessionAuthenticateCallback) ->
    C_SessionAuthenticateCallback
wrap_SessionAuthenticateCallback :: forall a.
GObject a =>
(a -> SessionAuthenticateCallback) -> C_SessionAuthenticateCallback
wrap_SessionAuthenticateCallback a -> SessionAuthenticateCallback
gi'cb Ptr Session
gi'selfPtr Ptr Message
msg Ptr Auth
auth CInt
retrying Ptr ()
_ = do
    Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
    Auth
auth' <- ((ManagedPtr Auth -> Auth) -> Ptr Auth -> IO Auth
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Auth -> Auth
Soup.Auth.Auth) Ptr Auth
auth
    let retrying' :: Bool
retrying' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
retrying
    Ptr Session -> (Session -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Session
gi'selfPtr ((Session -> IO ()) -> IO ()) -> (Session -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Session
gi'self -> a -> SessionAuthenticateCallback
gi'cb (Session -> a
Coerce.coerce Session
gi'self)  Message
msg' Auth
auth' Bool
retrying'


-- | Connect a signal handler for the [authenticate](#signal:authenticate) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' session #authenticate callback
-- @
-- 
-- 
onSessionAuthenticate :: (IsSession a, MonadIO m) => a -> ((?self :: a) => SessionAuthenticateCallback) -> m SignalHandlerId
onSessionAuthenticate :: forall a (m :: * -> *).
(IsSession a, MonadIO m) =>
a
-> ((?self::a) => SessionAuthenticateCallback) -> m SignalHandlerId
onSessionAuthenticate a
obj (?self::a) => SessionAuthenticateCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> SessionAuthenticateCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SessionAuthenticateCallback
SessionAuthenticateCallback
cb
    let wrapped' :: C_SessionAuthenticateCallback
wrapped' = (a -> SessionAuthenticateCallback) -> C_SessionAuthenticateCallback
forall a.
GObject a =>
(a -> SessionAuthenticateCallback) -> C_SessionAuthenticateCallback
wrap_SessionAuthenticateCallback a -> SessionAuthenticateCallback
wrapped
    FunPtr C_SessionAuthenticateCallback
wrapped'' <- C_SessionAuthenticateCallback
-> IO (FunPtr C_SessionAuthenticateCallback)
mk_SessionAuthenticateCallback C_SessionAuthenticateCallback
wrapped'
    a
-> Text
-> FunPtr C_SessionAuthenticateCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"authenticate" FunPtr C_SessionAuthenticateCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [authenticate](#signal:authenticate) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' session #authenticate callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterSessionAuthenticate :: (IsSession a, MonadIO m) => a -> ((?self :: a) => SessionAuthenticateCallback) -> m SignalHandlerId
afterSessionAuthenticate :: forall a (m :: * -> *).
(IsSession a, MonadIO m) =>
a
-> ((?self::a) => SessionAuthenticateCallback) -> m SignalHandlerId
afterSessionAuthenticate a
obj (?self::a) => SessionAuthenticateCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> SessionAuthenticateCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SessionAuthenticateCallback
SessionAuthenticateCallback
cb
    let wrapped' :: C_SessionAuthenticateCallback
wrapped' = (a -> SessionAuthenticateCallback) -> C_SessionAuthenticateCallback
forall a.
GObject a =>
(a -> SessionAuthenticateCallback) -> C_SessionAuthenticateCallback
wrap_SessionAuthenticateCallback a -> SessionAuthenticateCallback
wrapped
    FunPtr C_SessionAuthenticateCallback
wrapped'' <- C_SessionAuthenticateCallback
-> IO (FunPtr C_SessionAuthenticateCallback)
mk_SessionAuthenticateCallback C_SessionAuthenticateCallback
wrapped'
    a
-> Text
-> FunPtr C_SessionAuthenticateCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"authenticate" FunPtr C_SessionAuthenticateCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data SessionAuthenticateSignalInfo
instance SignalInfo SessionAuthenticateSignalInfo where
    type HaskellCallbackType SessionAuthenticateSignalInfo = SessionAuthenticateCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_SessionAuthenticateCallback cb
        cb'' <- mk_SessionAuthenticateCallback cb'
        connectSignalFunPtr obj "authenticate" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session::authenticate"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:signal:authenticate"})

#endif

-- signal Session::connection-created
-- | Emitted when a new connection is created. This is an
-- internal signal intended only to be used for debugging
-- purposes, and may go away in the future.
-- 
-- /Since: 2.30/
type SessionConnectionCreatedCallback =
    GObject.Object.Object
    -- ^ /@connection@/: the connection
    -> IO ()

type C_SessionConnectionCreatedCallback =
    Ptr Session ->                          -- object
    Ptr GObject.Object.Object ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_SessionConnectionCreatedCallback`.
foreign import ccall "wrapper"
    mk_SessionConnectionCreatedCallback :: C_SessionConnectionCreatedCallback -> IO (FunPtr C_SessionConnectionCreatedCallback)

wrap_SessionConnectionCreatedCallback :: 
    GObject a => (a -> SessionConnectionCreatedCallback) ->
    C_SessionConnectionCreatedCallback
wrap_SessionConnectionCreatedCallback :: forall a.
GObject a =>
(a -> SessionConnectionCreatedCallback)
-> C_SessionConnectionCreatedCallback
wrap_SessionConnectionCreatedCallback a -> SessionConnectionCreatedCallback
gi'cb Ptr Session
gi'selfPtr Ptr Object
connection Ptr ()
_ = do
    Object
connection' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) Ptr Object
connection
    Ptr Session -> (Session -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Session
gi'selfPtr ((Session -> IO ()) -> IO ()) -> (Session -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Session
gi'self -> a -> SessionConnectionCreatedCallback
gi'cb (Session -> a
Coerce.coerce Session
gi'self)  Object
connection'


-- | Connect a signal handler for the [connectionCreated](#signal:connectionCreated) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' session #connectionCreated callback
-- @
-- 
-- 
onSessionConnectionCreated :: (IsSession a, MonadIO m) => a -> ((?self :: a) => SessionConnectionCreatedCallback) -> m SignalHandlerId
onSessionConnectionCreated :: forall a (m :: * -> *).
(IsSession a, MonadIO m) =>
a
-> ((?self::a) => SessionConnectionCreatedCallback)
-> m SignalHandlerId
onSessionConnectionCreated a
obj (?self::a) => SessionConnectionCreatedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> SessionConnectionCreatedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SessionConnectionCreatedCallback
SessionConnectionCreatedCallback
cb
    let wrapped' :: C_SessionConnectionCreatedCallback
wrapped' = (a -> SessionConnectionCreatedCallback)
-> C_SessionConnectionCreatedCallback
forall a.
GObject a =>
(a -> SessionConnectionCreatedCallback)
-> C_SessionConnectionCreatedCallback
wrap_SessionConnectionCreatedCallback a -> SessionConnectionCreatedCallback
wrapped
    FunPtr C_SessionConnectionCreatedCallback
wrapped'' <- C_SessionConnectionCreatedCallback
-> IO (FunPtr C_SessionConnectionCreatedCallback)
mk_SessionConnectionCreatedCallback C_SessionConnectionCreatedCallback
wrapped'
    a
-> Text
-> FunPtr C_SessionConnectionCreatedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"connection-created" FunPtr C_SessionConnectionCreatedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [connectionCreated](#signal:connectionCreated) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' session #connectionCreated callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterSessionConnectionCreated :: (IsSession a, MonadIO m) => a -> ((?self :: a) => SessionConnectionCreatedCallback) -> m SignalHandlerId
afterSessionConnectionCreated :: forall a (m :: * -> *).
(IsSession a, MonadIO m) =>
a
-> ((?self::a) => SessionConnectionCreatedCallback)
-> m SignalHandlerId
afterSessionConnectionCreated a
obj (?self::a) => SessionConnectionCreatedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> SessionConnectionCreatedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SessionConnectionCreatedCallback
SessionConnectionCreatedCallback
cb
    let wrapped' :: C_SessionConnectionCreatedCallback
wrapped' = (a -> SessionConnectionCreatedCallback)
-> C_SessionConnectionCreatedCallback
forall a.
GObject a =>
(a -> SessionConnectionCreatedCallback)
-> C_SessionConnectionCreatedCallback
wrap_SessionConnectionCreatedCallback a -> SessionConnectionCreatedCallback
wrapped
    FunPtr C_SessionConnectionCreatedCallback
wrapped'' <- C_SessionConnectionCreatedCallback
-> IO (FunPtr C_SessionConnectionCreatedCallback)
mk_SessionConnectionCreatedCallback C_SessionConnectionCreatedCallback
wrapped'
    a
-> Text
-> FunPtr C_SessionConnectionCreatedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"connection-created" FunPtr C_SessionConnectionCreatedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data SessionConnectionCreatedSignalInfo
instance SignalInfo SessionConnectionCreatedSignalInfo where
    type HaskellCallbackType SessionConnectionCreatedSignalInfo = SessionConnectionCreatedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_SessionConnectionCreatedCallback cb
        cb'' <- mk_SessionConnectionCreatedCallback cb'
        connectSignalFunPtr obj "connection-created" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session::connection-created"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:signal:connectionCreated"})

#endif

-- signal Session::request-queued
-- | Emitted when a request is queued on /@session@/. (Note that
-- \"queued\" doesn\'t just mean 'GI.Soup.Objects.Session.sessionQueueMessage';
-- 'GI.Soup.Objects.Session.sessionSendMessage' implicitly queues the message
-- as well.)
-- 
-- When sending a request, first t'GI.Soup.Objects.Session.Session'::@/request_queued/@
-- is emitted, indicating that the session has become aware of
-- the request.
-- 
-- Once a connection is available to send the request on, the
-- session emits t'GI.Soup.Objects.Session.Session'::@/request_started/@. Then, various
-- t'GI.Soup.Objects.Message.Message' signals are emitted as the message is
-- processed. If the message is requeued, it will emit
-- [restarted]("GI.Soup.Objects.Message#g:signal:restarted"), which will then be followed by
-- another t'GI.Soup.Objects.Session.Session'::@/request_started/@ and another set of
-- t'GI.Soup.Objects.Message.Message' signals when the message is re-sent.
-- 
-- Eventually, the message will emit [finished]("GI.Soup.Objects.Message#g:signal:finished").
-- Normally, this signals the completion of message
-- processing. However, it is possible that the application
-- will requeue the message from the \"finished\" handler (or
-- equivalently, from the 'GI.Soup.Objects.Session.sessionQueueMessage'
-- callback). In that case, the process will loop back to
-- t'GI.Soup.Objects.Session.Session'::@/request_started/@.
-- 
-- Eventually, a message will reach \"finished\" and not be
-- requeued. At that point, the session will emit
-- t'GI.Soup.Objects.Session.Session'::@/request_unqueued/@ to indicate that it is done
-- with the message.
-- 
-- To sum up: t'GI.Soup.Objects.Session.Session'::@/request_queued/@ and
-- t'GI.Soup.Objects.Session.Session'::@/request_unqueued/@ are guaranteed to be emitted
-- exactly once, but t'GI.Soup.Objects.Session.Session'::@/request_started/@ and
-- [finished]("GI.Soup.Objects.Message#g:signal:finished") (and all of the other t'GI.Soup.Objects.Message.Message'
-- signals) may be invoked multiple times for a given message.
-- 
-- /Since: 2.24/
type SessionRequestQueuedCallback =
    Soup.Message.Message
    -- ^ /@msg@/: the request that was queued
    -> IO ()

type C_SessionRequestQueuedCallback =
    Ptr Session ->                          -- object
    Ptr Soup.Message.Message ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_SessionRequestQueuedCallback`.
foreign import ccall "wrapper"
    mk_SessionRequestQueuedCallback :: C_SessionRequestQueuedCallback -> IO (FunPtr C_SessionRequestQueuedCallback)

wrap_SessionRequestQueuedCallback :: 
    GObject a => (a -> SessionRequestQueuedCallback) ->
    C_SessionRequestQueuedCallback
wrap_SessionRequestQueuedCallback :: forall a.
GObject a =>
(a -> SessionRequestQueuedCallback)
-> C_SessionRequestQueuedCallback
wrap_SessionRequestQueuedCallback a -> SessionRequestQueuedCallback
gi'cb Ptr Session
gi'selfPtr Ptr Message
msg Ptr ()
_ = do
    Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
    Ptr Session -> (Session -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Session
gi'selfPtr ((Session -> IO ()) -> IO ()) -> (Session -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Session
gi'self -> a -> SessionRequestQueuedCallback
gi'cb (Session -> a
Coerce.coerce Session
gi'self)  Message
msg'


-- | Connect a signal handler for the [requestQueued](#signal:requestQueued) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' session #requestQueued callback
-- @
-- 
-- 
onSessionRequestQueued :: (IsSession a, MonadIO m) => a -> ((?self :: a) => SessionRequestQueuedCallback) -> m SignalHandlerId
onSessionRequestQueued :: forall a (m :: * -> *).
(IsSession a, MonadIO m) =>
a
-> ((?self::a) => SessionRequestQueuedCallback)
-> m SignalHandlerId
onSessionRequestQueued a
obj (?self::a) => SessionRequestQueuedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> SessionRequestQueuedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SessionRequestQueuedCallback
SessionRequestQueuedCallback
cb
    let wrapped' :: C_SessionRequestQueuedCallback
wrapped' = (a -> SessionRequestQueuedCallback)
-> C_SessionRequestQueuedCallback
forall a.
GObject a =>
(a -> SessionRequestQueuedCallback)
-> C_SessionRequestQueuedCallback
wrap_SessionRequestQueuedCallback a -> SessionRequestQueuedCallback
wrapped
    FunPtr C_SessionRequestQueuedCallback
wrapped'' <- C_SessionRequestQueuedCallback
-> IO (FunPtr C_SessionRequestQueuedCallback)
mk_SessionRequestQueuedCallback C_SessionRequestQueuedCallback
wrapped'
    a
-> Text
-> FunPtr C_SessionRequestQueuedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"request-queued" FunPtr C_SessionRequestQueuedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [requestQueued](#signal:requestQueued) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' session #requestQueued callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterSessionRequestQueued :: (IsSession a, MonadIO m) => a -> ((?self :: a) => SessionRequestQueuedCallback) -> m SignalHandlerId
afterSessionRequestQueued :: forall a (m :: * -> *).
(IsSession a, MonadIO m) =>
a
-> ((?self::a) => SessionRequestQueuedCallback)
-> m SignalHandlerId
afterSessionRequestQueued a
obj (?self::a) => SessionRequestQueuedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> SessionRequestQueuedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SessionRequestQueuedCallback
SessionRequestQueuedCallback
cb
    let wrapped' :: C_SessionRequestQueuedCallback
wrapped' = (a -> SessionRequestQueuedCallback)
-> C_SessionRequestQueuedCallback
forall a.
GObject a =>
(a -> SessionRequestQueuedCallback)
-> C_SessionRequestQueuedCallback
wrap_SessionRequestQueuedCallback a -> SessionRequestQueuedCallback
wrapped
    FunPtr C_SessionRequestQueuedCallback
wrapped'' <- C_SessionRequestQueuedCallback
-> IO (FunPtr C_SessionRequestQueuedCallback)
mk_SessionRequestQueuedCallback C_SessionRequestQueuedCallback
wrapped'
    a
-> Text
-> FunPtr C_SessionRequestQueuedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"request-queued" FunPtr C_SessionRequestQueuedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data SessionRequestQueuedSignalInfo
instance SignalInfo SessionRequestQueuedSignalInfo where
    type HaskellCallbackType SessionRequestQueuedSignalInfo = SessionRequestQueuedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_SessionRequestQueuedCallback cb
        cb'' <- mk_SessionRequestQueuedCallback cb'
        connectSignalFunPtr obj "request-queued" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session::request-queued"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:signal:requestQueued"})

#endif

-- signal Session::request-started
{-# DEPRECATED SessionRequestStartedCallback ["(Since version 2.50.)","Use [starting](\"GI.Soup.Objects.Message#g:signal:starting\") instead."] #-}
-- | Emitted just before a request is sent. See
-- t'GI.Soup.Objects.Session.Session'::@/request_queued/@ for a detailed description of
-- the message lifecycle within a session.
type SessionRequestStartedCallback =
    Soup.Message.Message
    -- ^ /@msg@/: the request being sent
    -> Soup.Socket.Socket
    -- ^ /@socket@/: the socket the request is being sent on
    -> IO ()

type C_SessionRequestStartedCallback =
    Ptr Session ->                          -- object
    Ptr Soup.Message.Message ->
    Ptr Soup.Socket.Socket ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_SessionRequestStartedCallback`.
foreign import ccall "wrapper"
    mk_SessionRequestStartedCallback :: C_SessionRequestStartedCallback -> IO (FunPtr C_SessionRequestStartedCallback)

wrap_SessionRequestStartedCallback :: 
    GObject a => (a -> SessionRequestStartedCallback) ->
    C_SessionRequestStartedCallback
wrap_SessionRequestStartedCallback :: forall a.
GObject a =>
(a -> SessionRequestStartedCallback)
-> C_SessionRequestStartedCallback
wrap_SessionRequestStartedCallback a -> SessionRequestStartedCallback
gi'cb Ptr Session
gi'selfPtr Ptr Message
msg Ptr Socket
socket Ptr ()
_ = do
    Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
    Socket
socket' <- ((ManagedPtr Socket -> Socket) -> Ptr Socket -> IO Socket
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Socket -> Socket
Soup.Socket.Socket) Ptr Socket
socket
    Ptr Session -> (Session -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Session
gi'selfPtr ((Session -> IO ()) -> IO ()) -> (Session -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Session
gi'self -> a -> SessionRequestStartedCallback
gi'cb (Session -> a
Coerce.coerce Session
gi'self)  Message
msg' Socket
socket'


-- | Connect a signal handler for the [requestStarted](#signal:requestStarted) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' session #requestStarted callback
-- @
-- 
-- 
onSessionRequestStarted :: (IsSession a, MonadIO m) => a -> ((?self :: a) => SessionRequestStartedCallback) -> m SignalHandlerId
onSessionRequestStarted :: forall a (m :: * -> *).
(IsSession a, MonadIO m) =>
a
-> ((?self::a) => SessionRequestStartedCallback)
-> m SignalHandlerId
onSessionRequestStarted a
obj (?self::a) => SessionRequestStartedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> SessionRequestStartedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SessionRequestStartedCallback
SessionRequestStartedCallback
cb
    let wrapped' :: C_SessionRequestStartedCallback
wrapped' = (a -> SessionRequestStartedCallback)
-> C_SessionRequestStartedCallback
forall a.
GObject a =>
(a -> SessionRequestStartedCallback)
-> C_SessionRequestStartedCallback
wrap_SessionRequestStartedCallback a -> SessionRequestStartedCallback
wrapped
    FunPtr C_SessionRequestStartedCallback
wrapped'' <- C_SessionRequestStartedCallback
-> IO (FunPtr C_SessionRequestStartedCallback)
mk_SessionRequestStartedCallback C_SessionRequestStartedCallback
wrapped'
    a
-> Text
-> FunPtr C_SessionRequestStartedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"request-started" FunPtr C_SessionRequestStartedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [requestStarted](#signal:requestStarted) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' session #requestStarted callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterSessionRequestStarted :: (IsSession a, MonadIO m) => a -> ((?self :: a) => SessionRequestStartedCallback) -> m SignalHandlerId
afterSessionRequestStarted :: forall a (m :: * -> *).
(IsSession a, MonadIO m) =>
a
-> ((?self::a) => SessionRequestStartedCallback)
-> m SignalHandlerId
afterSessionRequestStarted a
obj (?self::a) => SessionRequestStartedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> SessionRequestStartedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SessionRequestStartedCallback
SessionRequestStartedCallback
cb
    let wrapped' :: C_SessionRequestStartedCallback
wrapped' = (a -> SessionRequestStartedCallback)
-> C_SessionRequestStartedCallback
forall a.
GObject a =>
(a -> SessionRequestStartedCallback)
-> C_SessionRequestStartedCallback
wrap_SessionRequestStartedCallback a -> SessionRequestStartedCallback
wrapped
    FunPtr C_SessionRequestStartedCallback
wrapped'' <- C_SessionRequestStartedCallback
-> IO (FunPtr C_SessionRequestStartedCallback)
mk_SessionRequestStartedCallback C_SessionRequestStartedCallback
wrapped'
    a
-> Text
-> FunPtr C_SessionRequestStartedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"request-started" FunPtr C_SessionRequestStartedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data SessionRequestStartedSignalInfo
instance SignalInfo SessionRequestStartedSignalInfo where
    type HaskellCallbackType SessionRequestStartedSignalInfo = SessionRequestStartedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_SessionRequestStartedCallback cb
        cb'' <- mk_SessionRequestStartedCallback cb'
        connectSignalFunPtr obj "request-started" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session::request-started"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:signal:requestStarted"})

#endif

-- signal Session::request-unqueued
-- | Emitted when a request is removed from /@session@/\'s queue,
-- indicating that /@session@/ is done with it. See
-- t'GI.Soup.Objects.Session.Session'::@/request_queued/@ for a detailed description of the
-- message lifecycle within a session.
-- 
-- /Since: 2.24/
type SessionRequestUnqueuedCallback =
    Soup.Message.Message
    -- ^ /@msg@/: the request that was unqueued
    -> IO ()

type C_SessionRequestUnqueuedCallback =
    Ptr Session ->                          -- object
    Ptr Soup.Message.Message ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_SessionRequestUnqueuedCallback`.
foreign import ccall "wrapper"
    mk_SessionRequestUnqueuedCallback :: C_SessionRequestUnqueuedCallback -> IO (FunPtr C_SessionRequestUnqueuedCallback)

wrap_SessionRequestUnqueuedCallback :: 
    GObject a => (a -> SessionRequestUnqueuedCallback) ->
    C_SessionRequestUnqueuedCallback
wrap_SessionRequestUnqueuedCallback :: forall a.
GObject a =>
(a -> SessionRequestQueuedCallback)
-> C_SessionRequestQueuedCallback
wrap_SessionRequestUnqueuedCallback a -> SessionRequestQueuedCallback
gi'cb Ptr Session
gi'selfPtr Ptr Message
msg Ptr ()
_ = do
    Message
msg' <- ((ManagedPtr Message -> Message) -> Ptr Message -> IO Message
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Message -> Message
Soup.Message.Message) Ptr Message
msg
    Ptr Session -> (Session -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Session
gi'selfPtr ((Session -> IO ()) -> IO ()) -> (Session -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Session
gi'self -> a -> SessionRequestQueuedCallback
gi'cb (Session -> a
Coerce.coerce Session
gi'self)  Message
msg'


-- | Connect a signal handler for the [requestUnqueued](#signal:requestUnqueued) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' session #requestUnqueued callback
-- @
-- 
-- 
onSessionRequestUnqueued :: (IsSession a, MonadIO m) => a -> ((?self :: a) => SessionRequestUnqueuedCallback) -> m SignalHandlerId
onSessionRequestUnqueued :: forall a (m :: * -> *).
(IsSession a, MonadIO m) =>
a
-> ((?self::a) => SessionRequestQueuedCallback)
-> m SignalHandlerId
onSessionRequestUnqueued a
obj (?self::a) => SessionRequestQueuedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> SessionRequestQueuedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SessionRequestQueuedCallback
SessionRequestQueuedCallback
cb
    let wrapped' :: C_SessionRequestQueuedCallback
wrapped' = (a -> SessionRequestQueuedCallback)
-> C_SessionRequestQueuedCallback
forall a.
GObject a =>
(a -> SessionRequestQueuedCallback)
-> C_SessionRequestQueuedCallback
wrap_SessionRequestUnqueuedCallback a -> SessionRequestQueuedCallback
wrapped
    FunPtr C_SessionRequestQueuedCallback
wrapped'' <- C_SessionRequestQueuedCallback
-> IO (FunPtr C_SessionRequestQueuedCallback)
mk_SessionRequestUnqueuedCallback C_SessionRequestQueuedCallback
wrapped'
    a
-> Text
-> FunPtr C_SessionRequestQueuedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"request-unqueued" FunPtr C_SessionRequestQueuedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [requestUnqueued](#signal:requestUnqueued) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' session #requestUnqueued callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterSessionRequestUnqueued :: (IsSession a, MonadIO m) => a -> ((?self :: a) => SessionRequestUnqueuedCallback) -> m SignalHandlerId
afterSessionRequestUnqueued :: forall a (m :: * -> *).
(IsSession a, MonadIO m) =>
a
-> ((?self::a) => SessionRequestQueuedCallback)
-> m SignalHandlerId
afterSessionRequestUnqueued a
obj (?self::a) => SessionRequestQueuedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> SessionRequestQueuedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SessionRequestQueuedCallback
SessionRequestQueuedCallback
cb
    let wrapped' :: C_SessionRequestQueuedCallback
wrapped' = (a -> SessionRequestQueuedCallback)
-> C_SessionRequestQueuedCallback
forall a.
GObject a =>
(a -> SessionRequestQueuedCallback)
-> C_SessionRequestQueuedCallback
wrap_SessionRequestUnqueuedCallback a -> SessionRequestQueuedCallback
wrapped
    FunPtr C_SessionRequestQueuedCallback
wrapped'' <- C_SessionRequestQueuedCallback
-> IO (FunPtr C_SessionRequestQueuedCallback)
mk_SessionRequestUnqueuedCallback C_SessionRequestQueuedCallback
wrapped'
    a
-> Text
-> FunPtr C_SessionRequestQueuedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"request-unqueued" FunPtr C_SessionRequestQueuedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data SessionRequestUnqueuedSignalInfo
instance SignalInfo SessionRequestUnqueuedSignalInfo where
    type HaskellCallbackType SessionRequestUnqueuedSignalInfo = SessionRequestUnqueuedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_SessionRequestUnqueuedCallback cb
        cb'' <- mk_SessionRequestUnqueuedCallback cb'
        connectSignalFunPtr obj "request-unqueued" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session::request-unqueued"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:signal:requestUnqueued"})

#endif

-- signal Session::tunneling
-- | Emitted when an SSL tunnel is being created on a proxy
-- connection. This is an internal signal intended only to be
-- used for debugging purposes, and may go away in the future.
-- 
-- /Since: 2.30/
type SessionTunnelingCallback =
    GObject.Object.Object
    -- ^ /@connection@/: the connection
    -> IO ()

type C_SessionTunnelingCallback =
    Ptr Session ->                          -- object
    Ptr GObject.Object.Object ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_SessionTunnelingCallback`.
foreign import ccall "wrapper"
    mk_SessionTunnelingCallback :: C_SessionTunnelingCallback -> IO (FunPtr C_SessionTunnelingCallback)

wrap_SessionTunnelingCallback :: 
    GObject a => (a -> SessionTunnelingCallback) ->
    C_SessionTunnelingCallback
wrap_SessionTunnelingCallback :: forall a.
GObject a =>
(a -> SessionConnectionCreatedCallback)
-> C_SessionConnectionCreatedCallback
wrap_SessionTunnelingCallback a -> SessionConnectionCreatedCallback
gi'cb Ptr Session
gi'selfPtr Ptr Object
connection Ptr ()
_ = do
    Object
connection' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) Ptr Object
connection
    Ptr Session -> (Session -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Session
gi'selfPtr ((Session -> IO ()) -> IO ()) -> (Session -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Session
gi'self -> a -> SessionConnectionCreatedCallback
gi'cb (Session -> a
Coerce.coerce Session
gi'self)  Object
connection'


-- | Connect a signal handler for the [tunneling](#signal:tunneling) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' session #tunneling callback
-- @
-- 
-- 
onSessionTunneling :: (IsSession a, MonadIO m) => a -> ((?self :: a) => SessionTunnelingCallback) -> m SignalHandlerId
onSessionTunneling :: forall a (m :: * -> *).
(IsSession a, MonadIO m) =>
a
-> ((?self::a) => SessionConnectionCreatedCallback)
-> m SignalHandlerId
onSessionTunneling a
obj (?self::a) => SessionConnectionCreatedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> SessionConnectionCreatedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SessionConnectionCreatedCallback
SessionConnectionCreatedCallback
cb
    let wrapped' :: C_SessionConnectionCreatedCallback
wrapped' = (a -> SessionConnectionCreatedCallback)
-> C_SessionConnectionCreatedCallback
forall a.
GObject a =>
(a -> SessionConnectionCreatedCallback)
-> C_SessionConnectionCreatedCallback
wrap_SessionTunnelingCallback a -> SessionConnectionCreatedCallback
wrapped
    FunPtr C_SessionConnectionCreatedCallback
wrapped'' <- C_SessionConnectionCreatedCallback
-> IO (FunPtr C_SessionConnectionCreatedCallback)
mk_SessionTunnelingCallback C_SessionConnectionCreatedCallback
wrapped'
    a
-> Text
-> FunPtr C_SessionConnectionCreatedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"tunneling" FunPtr C_SessionConnectionCreatedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [tunneling](#signal:tunneling) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' session #tunneling callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterSessionTunneling :: (IsSession a, MonadIO m) => a -> ((?self :: a) => SessionTunnelingCallback) -> m SignalHandlerId
afterSessionTunneling :: forall a (m :: * -> *).
(IsSession a, MonadIO m) =>
a
-> ((?self::a) => SessionConnectionCreatedCallback)
-> m SignalHandlerId
afterSessionTunneling a
obj (?self::a) => SessionConnectionCreatedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> SessionConnectionCreatedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SessionConnectionCreatedCallback
SessionConnectionCreatedCallback
cb
    let wrapped' :: C_SessionConnectionCreatedCallback
wrapped' = (a -> SessionConnectionCreatedCallback)
-> C_SessionConnectionCreatedCallback
forall a.
GObject a =>
(a -> SessionConnectionCreatedCallback)
-> C_SessionConnectionCreatedCallback
wrap_SessionTunnelingCallback a -> SessionConnectionCreatedCallback
wrapped
    FunPtr C_SessionConnectionCreatedCallback
wrapped'' <- C_SessionConnectionCreatedCallback
-> IO (FunPtr C_SessionConnectionCreatedCallback)
mk_SessionTunnelingCallback C_SessionConnectionCreatedCallback
wrapped'
    a
-> Text
-> FunPtr C_SessionConnectionCreatedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"tunneling" FunPtr C_SessionConnectionCreatedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data SessionTunnelingSignalInfo
instance SignalInfo SessionTunnelingSignalInfo where
    type HaskellCallbackType SessionTunnelingSignalInfo = SessionTunnelingCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_SessionTunnelingCallback cb
        cb'' <- mk_SessionTunnelingCallback cb'
        connectSignalFunPtr obj "tunneling" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session::tunneling"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:signal:tunneling"})

#endif

-- VVV Prop "accept-language"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@accept-language@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #acceptLanguage
-- @
getSessionAcceptLanguage :: (MonadIO m, IsSession o) => o -> m (Maybe T.Text)
getSessionAcceptLanguage :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> m (Maybe Text)
getSessionAcceptLanguage o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"accept-language"

-- | Set the value of the “@accept-language@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #acceptLanguage 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionAcceptLanguage :: (MonadIO m, IsSession o) => o -> T.Text -> m ()
setSessionAcceptLanguage :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> Text -> m ()
setSessionAcceptLanguage o
obj Text
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"accept-language" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

-- | Construct a `GValueConstruct` with valid value for the “@accept-language@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionAcceptLanguage :: (IsSession o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructSessionAcceptLanguage :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructSessionAcceptLanguage Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"accept-language" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)

-- | Set the value of the “@accept-language@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #acceptLanguage
-- @
clearSessionAcceptLanguage :: (MonadIO m, IsSession o) => o -> m ()
clearSessionAcceptLanguage :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m ()
clearSessionAcceptLanguage o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"accept-language" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)

#if defined(ENABLE_OVERLOADING)
data SessionAcceptLanguagePropertyInfo
instance AttrInfo SessionAcceptLanguagePropertyInfo where
    type AttrAllowedOps SessionAcceptLanguagePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SessionAcceptLanguagePropertyInfo = IsSession
    type AttrSetTypeConstraint SessionAcceptLanguagePropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint SessionAcceptLanguagePropertyInfo = (~) T.Text
    type AttrTransferType SessionAcceptLanguagePropertyInfo = T.Text
    type AttrGetType SessionAcceptLanguagePropertyInfo = (Maybe T.Text)
    type AttrLabel SessionAcceptLanguagePropertyInfo = "accept-language"
    type AttrOrigin SessionAcceptLanguagePropertyInfo = Session
    attrGet = getSessionAcceptLanguage
    attrSet = setSessionAcceptLanguage
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionAcceptLanguage
    attrClear = clearSessionAcceptLanguage
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.acceptLanguage"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:acceptLanguage"
        })
#endif

-- VVV Prop "accept-language-auto"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@accept-language-auto@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #acceptLanguageAuto
-- @
getSessionAcceptLanguageAuto :: (MonadIO m, IsSession o) => o -> m Bool
getSessionAcceptLanguageAuto :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m Bool
getSessionAcceptLanguageAuto o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"accept-language-auto"

-- | Set the value of the “@accept-language-auto@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #acceptLanguageAuto 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionAcceptLanguageAuto :: (MonadIO m, IsSession o) => o -> Bool -> m ()
setSessionAcceptLanguageAuto :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> Bool -> m ()
setSessionAcceptLanguageAuto o
obj Bool
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"accept-language-auto" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@accept-language-auto@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionAcceptLanguageAuto :: (IsSession o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructSessionAcceptLanguageAuto :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructSessionAcceptLanguageAuto Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"accept-language-auto" Bool
val

#if defined(ENABLE_OVERLOADING)
data SessionAcceptLanguageAutoPropertyInfo
instance AttrInfo SessionAcceptLanguageAutoPropertyInfo where
    type AttrAllowedOps SessionAcceptLanguageAutoPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SessionAcceptLanguageAutoPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionAcceptLanguageAutoPropertyInfo = (~) Bool
    type AttrTransferTypeConstraint SessionAcceptLanguageAutoPropertyInfo = (~) Bool
    type AttrTransferType SessionAcceptLanguageAutoPropertyInfo = Bool
    type AttrGetType SessionAcceptLanguageAutoPropertyInfo = Bool
    type AttrLabel SessionAcceptLanguageAutoPropertyInfo = "accept-language-auto"
    type AttrOrigin SessionAcceptLanguageAutoPropertyInfo = Session
    attrGet = getSessionAcceptLanguageAuto
    attrSet = setSessionAcceptLanguageAuto
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionAcceptLanguageAuto
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.acceptLanguageAuto"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:acceptLanguageAuto"
        })
#endif

-- VVV Prop "async-context"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@async-context@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #asyncContext
-- @
getSessionAsyncContext :: (MonadIO m, IsSession o) => o -> m (Ptr ())
getSessionAsyncContext :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m (Ptr ())
getSessionAsyncContext o
obj = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Ptr ())
forall a b. GObject a => a -> String -> IO (Ptr b)
B.Properties.getObjectPropertyPtr o
obj String
"async-context"

-- | Construct a `GValueConstruct` with valid value for the “@async-context@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionAsyncContext :: (IsSession o, MIO.MonadIO m) => Ptr () -> m (GValueConstruct o)
constructSessionAsyncContext :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Ptr () -> m (GValueConstruct o)
constructSessionAsyncContext Ptr ()
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Ptr () -> IO (GValueConstruct o)
forall b o. String -> Ptr b -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyPtr String
"async-context" Ptr ()
val

#if defined(ENABLE_OVERLOADING)
data SessionAsyncContextPropertyInfo
instance AttrInfo SessionAsyncContextPropertyInfo where
    type AttrAllowedOps SessionAsyncContextPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SessionAsyncContextPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionAsyncContextPropertyInfo = (~) (Ptr ())
    type AttrTransferTypeConstraint SessionAsyncContextPropertyInfo = (~) (Ptr ())
    type AttrTransferType SessionAsyncContextPropertyInfo = Ptr ()
    type AttrGetType SessionAsyncContextPropertyInfo = (Ptr ())
    type AttrLabel SessionAsyncContextPropertyInfo = "async-context"
    type AttrOrigin SessionAsyncContextPropertyInfo = Session
    attrGet = getSessionAsyncContext
    attrSet = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionAsyncContext
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.asyncContext"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:asyncContext"
        })
#endif

-- VVV Prop "http-aliases"
   -- Type: TCArray True (-1) (-1) (TBasicType TUTF8)
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@http-aliases@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #httpAliases
-- @
getSessionHttpAliases :: (MonadIO m, IsSession o) => o -> m (Maybe [T.Text])
getSessionHttpAliases :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> m (Maybe [Text])
getSessionHttpAliases o
obj = IO (Maybe [Text]) -> m (Maybe [Text])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe [Text]) -> m (Maybe [Text]))
-> IO (Maybe [Text]) -> m (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe [Text])
forall a. GObject a => a -> String -> IO (Maybe [Text])
B.Properties.getObjectPropertyStringArray o
obj String
"http-aliases"

-- | Set the value of the “@http-aliases@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #httpAliases 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionHttpAliases :: (MonadIO m, IsSession o) => o -> [T.Text] -> m ()
setSessionHttpAliases :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> [Text] -> m ()
setSessionHttpAliases o
obj [Text]
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe [Text] -> IO ()
forall a. GObject a => a -> String -> Maybe [Text] -> IO ()
B.Properties.setObjectPropertyStringArray o
obj String
"http-aliases" ([Text] -> Maybe [Text]
forall a. a -> Maybe a
Just [Text]
val)

-- | Construct a `GValueConstruct` with valid value for the “@http-aliases@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionHttpAliases :: (IsSession o, MIO.MonadIO m) => [T.Text] -> m (GValueConstruct o)
constructSessionHttpAliases :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
[Text] -> m (GValueConstruct o)
constructSessionHttpAliases [Text]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe [Text] -> IO (GValueConstruct o)
forall o. String -> Maybe [Text] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyStringArray String
"http-aliases" ([Text] -> Maybe [Text]
forall a. a -> Maybe a
P.Just [Text]
val)

-- | Set the value of the “@http-aliases@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #httpAliases
-- @
clearSessionHttpAliases :: (MonadIO m, IsSession o) => o -> m ()
clearSessionHttpAliases :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m ()
clearSessionHttpAliases o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe [Text] -> IO ()
forall a. GObject a => a -> String -> Maybe [Text] -> IO ()
B.Properties.setObjectPropertyStringArray o
obj String
"http-aliases" (Maybe [Text]
forall a. Maybe a
Nothing :: Maybe [T.Text])

#if defined(ENABLE_OVERLOADING)
data SessionHttpAliasesPropertyInfo
instance AttrInfo SessionHttpAliasesPropertyInfo where
    type AttrAllowedOps SessionHttpAliasesPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SessionHttpAliasesPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionHttpAliasesPropertyInfo = (~) [T.Text]
    type AttrTransferTypeConstraint SessionHttpAliasesPropertyInfo = (~) [T.Text]
    type AttrTransferType SessionHttpAliasesPropertyInfo = [T.Text]
    type AttrGetType SessionHttpAliasesPropertyInfo = (Maybe [T.Text])
    type AttrLabel SessionHttpAliasesPropertyInfo = "http-aliases"
    type AttrOrigin SessionHttpAliasesPropertyInfo = Session
    attrGet = getSessionHttpAliases
    attrSet = setSessionHttpAliases
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionHttpAliases
    attrClear = clearSessionHttpAliases
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.httpAliases"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:httpAliases"
        })
#endif

-- VVV Prop "https-aliases"
   -- Type: TCArray True (-1) (-1) (TBasicType TUTF8)
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@https-aliases@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #httpsAliases
-- @
getSessionHttpsAliases :: (MonadIO m, IsSession o) => o -> m (Maybe [T.Text])
getSessionHttpsAliases :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> m (Maybe [Text])
getSessionHttpsAliases o
obj = IO (Maybe [Text]) -> m (Maybe [Text])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe [Text]) -> m (Maybe [Text]))
-> IO (Maybe [Text]) -> m (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe [Text])
forall a. GObject a => a -> String -> IO (Maybe [Text])
B.Properties.getObjectPropertyStringArray o
obj String
"https-aliases"

-- | Set the value of the “@https-aliases@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #httpsAliases 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionHttpsAliases :: (MonadIO m, IsSession o) => o -> [T.Text] -> m ()
setSessionHttpsAliases :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> [Text] -> m ()
setSessionHttpsAliases o
obj [Text]
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe [Text] -> IO ()
forall a. GObject a => a -> String -> Maybe [Text] -> IO ()
B.Properties.setObjectPropertyStringArray o
obj String
"https-aliases" ([Text] -> Maybe [Text]
forall a. a -> Maybe a
Just [Text]
val)

-- | Construct a `GValueConstruct` with valid value for the “@https-aliases@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionHttpsAliases :: (IsSession o, MIO.MonadIO m) => [T.Text] -> m (GValueConstruct o)
constructSessionHttpsAliases :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
[Text] -> m (GValueConstruct o)
constructSessionHttpsAliases [Text]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe [Text] -> IO (GValueConstruct o)
forall o. String -> Maybe [Text] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyStringArray String
"https-aliases" ([Text] -> Maybe [Text]
forall a. a -> Maybe a
P.Just [Text]
val)

-- | Set the value of the “@https-aliases@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #httpsAliases
-- @
clearSessionHttpsAliases :: (MonadIO m, IsSession o) => o -> m ()
clearSessionHttpsAliases :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m ()
clearSessionHttpsAliases o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe [Text] -> IO ()
forall a. GObject a => a -> String -> Maybe [Text] -> IO ()
B.Properties.setObjectPropertyStringArray o
obj String
"https-aliases" (Maybe [Text]
forall a. Maybe a
Nothing :: Maybe [T.Text])

#if defined(ENABLE_OVERLOADING)
data SessionHttpsAliasesPropertyInfo
instance AttrInfo SessionHttpsAliasesPropertyInfo where
    type AttrAllowedOps SessionHttpsAliasesPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SessionHttpsAliasesPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionHttpsAliasesPropertyInfo = (~) [T.Text]
    type AttrTransferTypeConstraint SessionHttpsAliasesPropertyInfo = (~) [T.Text]
    type AttrTransferType SessionHttpsAliasesPropertyInfo = [T.Text]
    type AttrGetType SessionHttpsAliasesPropertyInfo = (Maybe [T.Text])
    type AttrLabel SessionHttpsAliasesPropertyInfo = "https-aliases"
    type AttrOrigin SessionHttpsAliasesPropertyInfo = Session
    attrGet = getSessionHttpsAliases
    attrSet = setSessionHttpsAliases
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionHttpsAliases
    attrClear = clearSessionHttpsAliases
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.httpsAliases"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:httpsAliases"
        })
#endif

-- VVV Prop "idle-timeout"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@idle-timeout@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #idleTimeout
-- @
getSessionIdleTimeout :: (MonadIO m, IsSession o) => o -> m Word32
getSessionIdleTimeout :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m Word32
getSessionIdleTimeout o
obj = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"idle-timeout"

-- | Set the value of the “@idle-timeout@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #idleTimeout 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionIdleTimeout :: (MonadIO m, IsSession o) => o -> Word32 -> m ()
setSessionIdleTimeout :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> Word32 -> m ()
setSessionIdleTimeout o
obj Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Word32 -> IO ()
forall a. GObject a => a -> String -> Word32 -> IO ()
B.Properties.setObjectPropertyUInt32 o
obj String
"idle-timeout" Word32
val

-- | Construct a `GValueConstruct` with valid value for the “@idle-timeout@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionIdleTimeout :: (IsSession o, MIO.MonadIO m) => Word32 -> m (GValueConstruct o)
constructSessionIdleTimeout :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Word32 -> m (GValueConstruct o)
constructSessionIdleTimeout Word32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 String
"idle-timeout" Word32
val

#if defined(ENABLE_OVERLOADING)
data SessionIdleTimeoutPropertyInfo
instance AttrInfo SessionIdleTimeoutPropertyInfo where
    type AttrAllowedOps SessionIdleTimeoutPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SessionIdleTimeoutPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionIdleTimeoutPropertyInfo = (~) Word32
    type AttrTransferTypeConstraint SessionIdleTimeoutPropertyInfo = (~) Word32
    type AttrTransferType SessionIdleTimeoutPropertyInfo = Word32
    type AttrGetType SessionIdleTimeoutPropertyInfo = Word32
    type AttrLabel SessionIdleTimeoutPropertyInfo = "idle-timeout"
    type AttrOrigin SessionIdleTimeoutPropertyInfo = Session
    attrGet = getSessionIdleTimeout
    attrSet = setSessionIdleTimeout
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionIdleTimeout
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.idleTimeout"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:idleTimeout"
        })
#endif

-- VVV Prop "local-address"
   -- Type: TInterface (Name {namespace = "Soup", name = "Address"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@local-address@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #localAddress
-- @
getSessionLocalAddress :: (MonadIO m, IsSession o) => o -> m (Maybe Soup.Address.Address)
getSessionLocalAddress :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> m (Maybe Address)
getSessionLocalAddress o
obj = IO (Maybe Address) -> m (Maybe Address)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Address) -> m (Maybe Address))
-> IO (Maybe Address) -> m (Maybe Address)
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Address -> Address) -> IO (Maybe Address)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"local-address" ManagedPtr Address -> Address
Soup.Address.Address

-- | Construct a `GValueConstruct` with valid value for the “@local-address@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionLocalAddress :: (IsSession o, MIO.MonadIO m, Soup.Address.IsAddress a) => a -> m (GValueConstruct o)
constructSessionLocalAddress :: forall o (m :: * -> *) a.
(IsSession o, MonadIO m, IsAddress a) =>
a -> m (GValueConstruct o)
constructSessionLocalAddress a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"local-address" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)

#if defined(ENABLE_OVERLOADING)
data SessionLocalAddressPropertyInfo
instance AttrInfo SessionLocalAddressPropertyInfo where
    type AttrAllowedOps SessionLocalAddressPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SessionLocalAddressPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionLocalAddressPropertyInfo = Soup.Address.IsAddress
    type AttrTransferTypeConstraint SessionLocalAddressPropertyInfo = Soup.Address.IsAddress
    type AttrTransferType SessionLocalAddressPropertyInfo = Soup.Address.Address
    type AttrGetType SessionLocalAddressPropertyInfo = (Maybe Soup.Address.Address)
    type AttrLabel SessionLocalAddressPropertyInfo = "local-address"
    type AttrOrigin SessionLocalAddressPropertyInfo = Session
    attrGet = getSessionLocalAddress
    attrSet = undefined
    attrTransfer _ v = do
        unsafeCastTo Soup.Address.Address v
    attrConstruct = constructSessionLocalAddress
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.localAddress"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:localAddress"
        })
#endif

-- VVV Prop "max-conns"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@max-conns@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #maxConns
-- @
getSessionMaxConns :: (MonadIO m, IsSession o) => o -> m Int32
getSessionMaxConns :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m Int32
getSessionMaxConns o
obj = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"max-conns"

-- | Set the value of the “@max-conns@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #maxConns 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionMaxConns :: (MonadIO m, IsSession o) => o -> Int32 -> m ()
setSessionMaxConns :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> Int32 -> m ()
setSessionMaxConns o
obj Int32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Int32 -> IO ()
forall a. GObject a => a -> String -> Int32 -> IO ()
B.Properties.setObjectPropertyInt32 o
obj String
"max-conns" Int32
val

-- | Construct a `GValueConstruct` with valid value for the “@max-conns@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionMaxConns :: (IsSession o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructSessionMaxConns :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructSessionMaxConns Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"max-conns" Int32
val

#if defined(ENABLE_OVERLOADING)
data SessionMaxConnsPropertyInfo
instance AttrInfo SessionMaxConnsPropertyInfo where
    type AttrAllowedOps SessionMaxConnsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SessionMaxConnsPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionMaxConnsPropertyInfo = (~) Int32
    type AttrTransferTypeConstraint SessionMaxConnsPropertyInfo = (~) Int32
    type AttrTransferType SessionMaxConnsPropertyInfo = Int32
    type AttrGetType SessionMaxConnsPropertyInfo = Int32
    type AttrLabel SessionMaxConnsPropertyInfo = "max-conns"
    type AttrOrigin SessionMaxConnsPropertyInfo = Session
    attrGet = getSessionMaxConns
    attrSet = setSessionMaxConns
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionMaxConns
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.maxConns"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:maxConns"
        })
#endif

-- VVV Prop "max-conns-per-host"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@max-conns-per-host@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #maxConnsPerHost
-- @
getSessionMaxConnsPerHost :: (MonadIO m, IsSession o) => o -> m Int32
getSessionMaxConnsPerHost :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m Int32
getSessionMaxConnsPerHost o
obj = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"max-conns-per-host"

-- | Set the value of the “@max-conns-per-host@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #maxConnsPerHost 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionMaxConnsPerHost :: (MonadIO m, IsSession o) => o -> Int32 -> m ()
setSessionMaxConnsPerHost :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> Int32 -> m ()
setSessionMaxConnsPerHost o
obj Int32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Int32 -> IO ()
forall a. GObject a => a -> String -> Int32 -> IO ()
B.Properties.setObjectPropertyInt32 o
obj String
"max-conns-per-host" Int32
val

-- | Construct a `GValueConstruct` with valid value for the “@max-conns-per-host@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionMaxConnsPerHost :: (IsSession o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructSessionMaxConnsPerHost :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructSessionMaxConnsPerHost Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"max-conns-per-host" Int32
val

#if defined(ENABLE_OVERLOADING)
data SessionMaxConnsPerHostPropertyInfo
instance AttrInfo SessionMaxConnsPerHostPropertyInfo where
    type AttrAllowedOps SessionMaxConnsPerHostPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SessionMaxConnsPerHostPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionMaxConnsPerHostPropertyInfo = (~) Int32
    type AttrTransferTypeConstraint SessionMaxConnsPerHostPropertyInfo = (~) Int32
    type AttrTransferType SessionMaxConnsPerHostPropertyInfo = Int32
    type AttrGetType SessionMaxConnsPerHostPropertyInfo = Int32
    type AttrLabel SessionMaxConnsPerHostPropertyInfo = "max-conns-per-host"
    type AttrOrigin SessionMaxConnsPerHostPropertyInfo = Session
    attrGet = getSessionMaxConnsPerHost
    attrSet = setSessionMaxConnsPerHost
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionMaxConnsPerHost
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.maxConnsPerHost"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:maxConnsPerHost"
        })
#endif

-- VVV Prop "proxy-resolver"
   -- Type: TInterface (Name {namespace = "Gio", name = "ProxyResolver"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@proxy-resolver@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #proxyResolver
-- @
getSessionProxyResolver :: (MonadIO m, IsSession o) => o -> m (Maybe Gio.ProxyResolver.ProxyResolver)
getSessionProxyResolver :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> m (Maybe ProxyResolver)
getSessionProxyResolver o
obj = IO (Maybe ProxyResolver) -> m (Maybe ProxyResolver)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe ProxyResolver) -> m (Maybe ProxyResolver))
-> IO (Maybe ProxyResolver) -> m (Maybe ProxyResolver)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr ProxyResolver -> ProxyResolver)
-> IO (Maybe ProxyResolver)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"proxy-resolver" ManagedPtr ProxyResolver -> ProxyResolver
Gio.ProxyResolver.ProxyResolver

-- | Set the value of the “@proxy-resolver@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #proxyResolver 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionProxyResolver :: (MonadIO m, IsSession o, Gio.ProxyResolver.IsProxyResolver a) => o -> a -> m ()
setSessionProxyResolver :: forall (m :: * -> *) o a.
(MonadIO m, IsSession o, IsProxyResolver a) =>
o -> a -> m ()
setSessionProxyResolver o
obj a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"proxy-resolver" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

-- | Construct a `GValueConstruct` with valid value for the “@proxy-resolver@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionProxyResolver :: (IsSession o, MIO.MonadIO m, Gio.ProxyResolver.IsProxyResolver a) => a -> m (GValueConstruct o)
constructSessionProxyResolver :: forall o (m :: * -> *) a.
(IsSession o, MonadIO m, IsProxyResolver a) =>
a -> m (GValueConstruct o)
constructSessionProxyResolver a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"proxy-resolver" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)

-- | Set the value of the “@proxy-resolver@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #proxyResolver
-- @
clearSessionProxyResolver :: (MonadIO m, IsSession o) => o -> m ()
clearSessionProxyResolver :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m ()
clearSessionProxyResolver o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe ProxyResolver -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"proxy-resolver" (Maybe ProxyResolver
forall a. Maybe a
Nothing :: Maybe Gio.ProxyResolver.ProxyResolver)

#if defined(ENABLE_OVERLOADING)
data SessionProxyResolverPropertyInfo
instance AttrInfo SessionProxyResolverPropertyInfo where
    type AttrAllowedOps SessionProxyResolverPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SessionProxyResolverPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionProxyResolverPropertyInfo = Gio.ProxyResolver.IsProxyResolver
    type AttrTransferTypeConstraint SessionProxyResolverPropertyInfo = Gio.ProxyResolver.IsProxyResolver
    type AttrTransferType SessionProxyResolverPropertyInfo = Gio.ProxyResolver.ProxyResolver
    type AttrGetType SessionProxyResolverPropertyInfo = (Maybe Gio.ProxyResolver.ProxyResolver)
    type AttrLabel SessionProxyResolverPropertyInfo = "proxy-resolver"
    type AttrOrigin SessionProxyResolverPropertyInfo = Session
    attrGet = getSessionProxyResolver
    attrSet = setSessionProxyResolver
    attrTransfer _ v = do
        unsafeCastTo Gio.ProxyResolver.ProxyResolver v
    attrConstruct = constructSessionProxyResolver
    attrClear = clearSessionProxyResolver
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.proxyResolver"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:proxyResolver"
        })
#endif

-- VVV Prop "proxy-uri"
   -- Type: TInterface (Name {namespace = "Soup", name = "URI"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@proxy-uri@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #proxyUri
-- @
getSessionProxyUri :: (MonadIO m, IsSession o) => o -> m (Maybe Soup.URI.URI)
getSessionProxyUri :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> m (Maybe URI)
getSessionProxyUri o
obj = IO (Maybe URI) -> m (Maybe URI)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe URI) -> m (Maybe URI))
-> IO (Maybe URI) -> m (Maybe URI)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr URI -> URI) -> IO (Maybe URI)
forall a b.
(GObject a, GBoxed b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj String
"proxy-uri" ManagedPtr URI -> URI
Soup.URI.URI

-- | Set the value of the “@proxy-uri@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #proxyUri 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionProxyUri :: (MonadIO m, IsSession o) => o -> Soup.URI.URI -> m ()
setSessionProxyUri :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> URI -> m ()
setSessionProxyUri o
obj URI
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe URI -> IO ()
forall a b.
(GObject a, GBoxed b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyBoxed o
obj String
"proxy-uri" (URI -> Maybe URI
forall a. a -> Maybe a
Just URI
val)

-- | Construct a `GValueConstruct` with valid value for the “@proxy-uri@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionProxyUri :: (IsSession o, MIO.MonadIO m) => Soup.URI.URI -> m (GValueConstruct o)
constructSessionProxyUri :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
URI -> m (GValueConstruct o)
constructSessionProxyUri URI
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe URI -> IO (GValueConstruct o)
forall a o. GBoxed a => String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBoxed String
"proxy-uri" (URI -> Maybe URI
forall a. a -> Maybe a
P.Just URI
val)

-- | Set the value of the “@proxy-uri@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #proxyUri
-- @
clearSessionProxyUri :: (MonadIO m, IsSession o) => o -> m ()
clearSessionProxyUri :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m ()
clearSessionProxyUri o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe URI -> IO ()
forall a b.
(GObject a, GBoxed b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyBoxed o
obj String
"proxy-uri" (Maybe URI
forall a. Maybe a
Nothing :: Maybe Soup.URI.URI)

#if defined(ENABLE_OVERLOADING)
data SessionProxyUriPropertyInfo
instance AttrInfo SessionProxyUriPropertyInfo where
    type AttrAllowedOps SessionProxyUriPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SessionProxyUriPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionProxyUriPropertyInfo = (~) Soup.URI.URI
    type AttrTransferTypeConstraint SessionProxyUriPropertyInfo = (~) Soup.URI.URI
    type AttrTransferType SessionProxyUriPropertyInfo = Soup.URI.URI
    type AttrGetType SessionProxyUriPropertyInfo = (Maybe Soup.URI.URI)
    type AttrLabel SessionProxyUriPropertyInfo = "proxy-uri"
    type AttrOrigin SessionProxyUriPropertyInfo = Session
    attrGet = getSessionProxyUri
    attrSet = setSessionProxyUri
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionProxyUri
    attrClear = clearSessionProxyUri
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.proxyUri"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:proxyUri"
        })
#endif

-- VVV Prop "ssl-ca-file"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@ssl-ca-file@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #sslCaFile
-- @
getSessionSslCaFile :: (MonadIO m, IsSession o) => o -> m (Maybe T.Text)
getSessionSslCaFile :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> m (Maybe Text)
getSessionSslCaFile o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"ssl-ca-file"

-- | Set the value of the “@ssl-ca-file@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #sslCaFile 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionSslCaFile :: (MonadIO m, IsSession o) => o -> T.Text -> m ()
setSessionSslCaFile :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> Text -> m ()
setSessionSslCaFile o
obj Text
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"ssl-ca-file" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

-- | Construct a `GValueConstruct` with valid value for the “@ssl-ca-file@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionSslCaFile :: (IsSession o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructSessionSslCaFile :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructSessionSslCaFile Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"ssl-ca-file" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)

-- | Set the value of the “@ssl-ca-file@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #sslCaFile
-- @
clearSessionSslCaFile :: (MonadIO m, IsSession o) => o -> m ()
clearSessionSslCaFile :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m ()
clearSessionSslCaFile o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"ssl-ca-file" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)

#if defined(ENABLE_OVERLOADING)
data SessionSslCaFilePropertyInfo
instance AttrInfo SessionSslCaFilePropertyInfo where
    type AttrAllowedOps SessionSslCaFilePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SessionSslCaFilePropertyInfo = IsSession
    type AttrSetTypeConstraint SessionSslCaFilePropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint SessionSslCaFilePropertyInfo = (~) T.Text
    type AttrTransferType SessionSslCaFilePropertyInfo = T.Text
    type AttrGetType SessionSslCaFilePropertyInfo = (Maybe T.Text)
    type AttrLabel SessionSslCaFilePropertyInfo = "ssl-ca-file"
    type AttrOrigin SessionSslCaFilePropertyInfo = Session
    attrGet = getSessionSslCaFile
    attrSet = setSessionSslCaFile
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionSslCaFile
    attrClear = clearSessionSslCaFile
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sslCaFile"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:sslCaFile"
        })
#endif

-- VVV Prop "ssl-strict"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@ssl-strict@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #sslStrict
-- @
getSessionSslStrict :: (MonadIO m, IsSession o) => o -> m Bool
getSessionSslStrict :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m Bool
getSessionSslStrict o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"ssl-strict"

-- | Set the value of the “@ssl-strict@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #sslStrict 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionSslStrict :: (MonadIO m, IsSession o) => o -> Bool -> m ()
setSessionSslStrict :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> Bool -> m ()
setSessionSslStrict o
obj Bool
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"ssl-strict" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@ssl-strict@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionSslStrict :: (IsSession o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructSessionSslStrict :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructSessionSslStrict Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"ssl-strict" Bool
val

#if defined(ENABLE_OVERLOADING)
data SessionSslStrictPropertyInfo
instance AttrInfo SessionSslStrictPropertyInfo where
    type AttrAllowedOps SessionSslStrictPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SessionSslStrictPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionSslStrictPropertyInfo = (~) Bool
    type AttrTransferTypeConstraint SessionSslStrictPropertyInfo = (~) Bool
    type AttrTransferType SessionSslStrictPropertyInfo = Bool
    type AttrGetType SessionSslStrictPropertyInfo = Bool
    type AttrLabel SessionSslStrictPropertyInfo = "ssl-strict"
    type AttrOrigin SessionSslStrictPropertyInfo = Session
    attrGet = getSessionSslStrict
    attrSet = setSessionSslStrict
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionSslStrict
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sslStrict"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:sslStrict"
        })
#endif

-- VVV Prop "ssl-use-system-ca-file"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@ssl-use-system-ca-file@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #sslUseSystemCaFile
-- @
getSessionSslUseSystemCaFile :: (MonadIO m, IsSession o) => o -> m Bool
getSessionSslUseSystemCaFile :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m Bool
getSessionSslUseSystemCaFile o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"ssl-use-system-ca-file"

-- | Set the value of the “@ssl-use-system-ca-file@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #sslUseSystemCaFile 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionSslUseSystemCaFile :: (MonadIO m, IsSession o) => o -> Bool -> m ()
setSessionSslUseSystemCaFile :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> Bool -> m ()
setSessionSslUseSystemCaFile o
obj Bool
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"ssl-use-system-ca-file" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@ssl-use-system-ca-file@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionSslUseSystemCaFile :: (IsSession o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructSessionSslUseSystemCaFile :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructSessionSslUseSystemCaFile Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"ssl-use-system-ca-file" Bool
val

#if defined(ENABLE_OVERLOADING)
data SessionSslUseSystemCaFilePropertyInfo
instance AttrInfo SessionSslUseSystemCaFilePropertyInfo where
    type AttrAllowedOps SessionSslUseSystemCaFilePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SessionSslUseSystemCaFilePropertyInfo = IsSession
    type AttrSetTypeConstraint SessionSslUseSystemCaFilePropertyInfo = (~) Bool
    type AttrTransferTypeConstraint SessionSslUseSystemCaFilePropertyInfo = (~) Bool
    type AttrTransferType SessionSslUseSystemCaFilePropertyInfo = Bool
    type AttrGetType SessionSslUseSystemCaFilePropertyInfo = Bool
    type AttrLabel SessionSslUseSystemCaFilePropertyInfo = "ssl-use-system-ca-file"
    type AttrOrigin SessionSslUseSystemCaFilePropertyInfo = Session
    attrGet = getSessionSslUseSystemCaFile
    attrSet = setSessionSslUseSystemCaFile
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionSslUseSystemCaFile
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sslUseSystemCaFile"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:sslUseSystemCaFile"
        })
#endif

-- VVV Prop "timeout"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@timeout@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #timeout
-- @
getSessionTimeout :: (MonadIO m, IsSession o) => o -> m Word32
getSessionTimeout :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m Word32
getSessionTimeout o
obj = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"timeout"

-- | Set the value of the “@timeout@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #timeout 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionTimeout :: (MonadIO m, IsSession o) => o -> Word32 -> m ()
setSessionTimeout :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> Word32 -> m ()
setSessionTimeout o
obj Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Word32 -> IO ()
forall a. GObject a => a -> String -> Word32 -> IO ()
B.Properties.setObjectPropertyUInt32 o
obj String
"timeout" Word32
val

-- | Construct a `GValueConstruct` with valid value for the “@timeout@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionTimeout :: (IsSession o, MIO.MonadIO m) => Word32 -> m (GValueConstruct o)
constructSessionTimeout :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Word32 -> m (GValueConstruct o)
constructSessionTimeout Word32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 String
"timeout" Word32
val

#if defined(ENABLE_OVERLOADING)
data SessionTimeoutPropertyInfo
instance AttrInfo SessionTimeoutPropertyInfo where
    type AttrAllowedOps SessionTimeoutPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SessionTimeoutPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionTimeoutPropertyInfo = (~) Word32
    type AttrTransferTypeConstraint SessionTimeoutPropertyInfo = (~) Word32
    type AttrTransferType SessionTimeoutPropertyInfo = Word32
    type AttrGetType SessionTimeoutPropertyInfo = Word32
    type AttrLabel SessionTimeoutPropertyInfo = "timeout"
    type AttrOrigin SessionTimeoutPropertyInfo = Session
    attrGet = getSessionTimeout
    attrSet = setSessionTimeout
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionTimeout
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.timeout"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:timeout"
        })
#endif

-- VVV Prop "tls-database"
   -- Type: TInterface (Name {namespace = "Gio", name = "TlsDatabase"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@tls-database@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #tlsDatabase
-- @
getSessionTlsDatabase :: (MonadIO m, IsSession o) => o -> m (Maybe Gio.TlsDatabase.TlsDatabase)
getSessionTlsDatabase :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> m (Maybe TlsDatabase)
getSessionTlsDatabase o
obj = IO (Maybe TlsDatabase) -> m (Maybe TlsDatabase)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe TlsDatabase) -> m (Maybe TlsDatabase))
-> IO (Maybe TlsDatabase) -> m (Maybe TlsDatabase)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr TlsDatabase -> TlsDatabase)
-> IO (Maybe TlsDatabase)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"tls-database" ManagedPtr TlsDatabase -> TlsDatabase
Gio.TlsDatabase.TlsDatabase

-- | Set the value of the “@tls-database@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #tlsDatabase 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionTlsDatabase :: (MonadIO m, IsSession o, Gio.TlsDatabase.IsTlsDatabase a) => o -> a -> m ()
setSessionTlsDatabase :: forall (m :: * -> *) o a.
(MonadIO m, IsSession o, IsTlsDatabase a) =>
o -> a -> m ()
setSessionTlsDatabase o
obj a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"tls-database" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

-- | Construct a `GValueConstruct` with valid value for the “@tls-database@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionTlsDatabase :: (IsSession o, MIO.MonadIO m, Gio.TlsDatabase.IsTlsDatabase a) => a -> m (GValueConstruct o)
constructSessionTlsDatabase :: forall o (m :: * -> *) a.
(IsSession o, MonadIO m, IsTlsDatabase a) =>
a -> m (GValueConstruct o)
constructSessionTlsDatabase a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"tls-database" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)

-- | Set the value of the “@tls-database@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #tlsDatabase
-- @
clearSessionTlsDatabase :: (MonadIO m, IsSession o) => o -> m ()
clearSessionTlsDatabase :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m ()
clearSessionTlsDatabase o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe TlsDatabase -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"tls-database" (Maybe TlsDatabase
forall a. Maybe a
Nothing :: Maybe Gio.TlsDatabase.TlsDatabase)

#if defined(ENABLE_OVERLOADING)
data SessionTlsDatabasePropertyInfo
instance AttrInfo SessionTlsDatabasePropertyInfo where
    type AttrAllowedOps SessionTlsDatabasePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SessionTlsDatabasePropertyInfo = IsSession
    type AttrSetTypeConstraint SessionTlsDatabasePropertyInfo = Gio.TlsDatabase.IsTlsDatabase
    type AttrTransferTypeConstraint SessionTlsDatabasePropertyInfo = Gio.TlsDatabase.IsTlsDatabase
    type AttrTransferType SessionTlsDatabasePropertyInfo = Gio.TlsDatabase.TlsDatabase
    type AttrGetType SessionTlsDatabasePropertyInfo = (Maybe Gio.TlsDatabase.TlsDatabase)
    type AttrLabel SessionTlsDatabasePropertyInfo = "tls-database"
    type AttrOrigin SessionTlsDatabasePropertyInfo = Session
    attrGet = getSessionTlsDatabase
    attrSet = setSessionTlsDatabase
    attrTransfer _ v = do
        unsafeCastTo Gio.TlsDatabase.TlsDatabase v
    attrConstruct = constructSessionTlsDatabase
    attrClear = clearSessionTlsDatabase
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.tlsDatabase"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:tlsDatabase"
        })
#endif

-- VVV Prop "tls-interaction"
   -- Type: TInterface (Name {namespace = "Gio", name = "TlsInteraction"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@tls-interaction@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #tlsInteraction
-- @
getSessionTlsInteraction :: (MonadIO m, IsSession o) => o -> m (Maybe Gio.TlsInteraction.TlsInteraction)
getSessionTlsInteraction :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> m (Maybe TlsInteraction)
getSessionTlsInteraction o
obj = IO (Maybe TlsInteraction) -> m (Maybe TlsInteraction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe TlsInteraction) -> m (Maybe TlsInteraction))
-> IO (Maybe TlsInteraction) -> m (Maybe TlsInteraction)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr TlsInteraction -> TlsInteraction)
-> IO (Maybe TlsInteraction)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"tls-interaction" ManagedPtr TlsInteraction -> TlsInteraction
Gio.TlsInteraction.TlsInteraction

-- | Set the value of the “@tls-interaction@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #tlsInteraction 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionTlsInteraction :: (MonadIO m, IsSession o, Gio.TlsInteraction.IsTlsInteraction a) => o -> a -> m ()
setSessionTlsInteraction :: forall (m :: * -> *) o a.
(MonadIO m, IsSession o, IsTlsInteraction a) =>
o -> a -> m ()
setSessionTlsInteraction o
obj a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"tls-interaction" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

-- | Construct a `GValueConstruct` with valid value for the “@tls-interaction@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionTlsInteraction :: (IsSession o, MIO.MonadIO m, Gio.TlsInteraction.IsTlsInteraction a) => a -> m (GValueConstruct o)
constructSessionTlsInteraction :: forall o (m :: * -> *) a.
(IsSession o, MonadIO m, IsTlsInteraction a) =>
a -> m (GValueConstruct o)
constructSessionTlsInteraction a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"tls-interaction" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)

-- | Set the value of the “@tls-interaction@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #tlsInteraction
-- @
clearSessionTlsInteraction :: (MonadIO m, IsSession o) => o -> m ()
clearSessionTlsInteraction :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m ()
clearSessionTlsInteraction o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe TlsInteraction -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"tls-interaction" (Maybe TlsInteraction
forall a. Maybe a
Nothing :: Maybe Gio.TlsInteraction.TlsInteraction)

#if defined(ENABLE_OVERLOADING)
data SessionTlsInteractionPropertyInfo
instance AttrInfo SessionTlsInteractionPropertyInfo where
    type AttrAllowedOps SessionTlsInteractionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SessionTlsInteractionPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionTlsInteractionPropertyInfo = Gio.TlsInteraction.IsTlsInteraction
    type AttrTransferTypeConstraint SessionTlsInteractionPropertyInfo = Gio.TlsInteraction.IsTlsInteraction
    type AttrTransferType SessionTlsInteractionPropertyInfo = Gio.TlsInteraction.TlsInteraction
    type AttrGetType SessionTlsInteractionPropertyInfo = (Maybe Gio.TlsInteraction.TlsInteraction)
    type AttrLabel SessionTlsInteractionPropertyInfo = "tls-interaction"
    type AttrOrigin SessionTlsInteractionPropertyInfo = Session
    attrGet = getSessionTlsInteraction
    attrSet = setSessionTlsInteraction
    attrTransfer _ v = do
        unsafeCastTo Gio.TlsInteraction.TlsInteraction v
    attrConstruct = constructSessionTlsInteraction
    attrClear = clearSessionTlsInteraction
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.tlsInteraction"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:tlsInteraction"
        })
#endif

-- VVV Prop "use-ntlm"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@use-ntlm@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #useNtlm
-- @
getSessionUseNtlm :: (MonadIO m, IsSession o) => o -> m Bool
getSessionUseNtlm :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m Bool
getSessionUseNtlm o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"use-ntlm"

-- | Set the value of the “@use-ntlm@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #useNtlm 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionUseNtlm :: (MonadIO m, IsSession o) => o -> Bool -> m ()
setSessionUseNtlm :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> Bool -> m ()
setSessionUseNtlm o
obj Bool
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"use-ntlm" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@use-ntlm@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionUseNtlm :: (IsSession o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructSessionUseNtlm :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructSessionUseNtlm Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"use-ntlm" Bool
val

#if defined(ENABLE_OVERLOADING)
data SessionUseNtlmPropertyInfo
instance AttrInfo SessionUseNtlmPropertyInfo where
    type AttrAllowedOps SessionUseNtlmPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SessionUseNtlmPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionUseNtlmPropertyInfo = (~) Bool
    type AttrTransferTypeConstraint SessionUseNtlmPropertyInfo = (~) Bool
    type AttrTransferType SessionUseNtlmPropertyInfo = Bool
    type AttrGetType SessionUseNtlmPropertyInfo = Bool
    type AttrLabel SessionUseNtlmPropertyInfo = "use-ntlm"
    type AttrOrigin SessionUseNtlmPropertyInfo = Session
    attrGet = getSessionUseNtlm
    attrSet = setSessionUseNtlm
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionUseNtlm
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.useNtlm"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:useNtlm"
        })
#endif

-- VVV Prop "use-thread-context"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@use-thread-context@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #useThreadContext
-- @
getSessionUseThreadContext :: (MonadIO m, IsSession o) => o -> m Bool
getSessionUseThreadContext :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m Bool
getSessionUseThreadContext o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"use-thread-context"

-- | Set the value of the “@use-thread-context@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #useThreadContext 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionUseThreadContext :: (MonadIO m, IsSession o) => o -> Bool -> m ()
setSessionUseThreadContext :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> Bool -> m ()
setSessionUseThreadContext o
obj Bool
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"use-thread-context" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@use-thread-context@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionUseThreadContext :: (IsSession o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructSessionUseThreadContext :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructSessionUseThreadContext Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"use-thread-context" Bool
val

#if defined(ENABLE_OVERLOADING)
data SessionUseThreadContextPropertyInfo
instance AttrInfo SessionUseThreadContextPropertyInfo where
    type AttrAllowedOps SessionUseThreadContextPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint SessionUseThreadContextPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionUseThreadContextPropertyInfo = (~) Bool
    type AttrTransferTypeConstraint SessionUseThreadContextPropertyInfo = (~) Bool
    type AttrTransferType SessionUseThreadContextPropertyInfo = Bool
    type AttrGetType SessionUseThreadContextPropertyInfo = Bool
    type AttrLabel SessionUseThreadContextPropertyInfo = "use-thread-context"
    type AttrOrigin SessionUseThreadContextPropertyInfo = Session
    attrGet = getSessionUseThreadContext
    attrSet = setSessionUseThreadContext
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionUseThreadContext
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.useThreadContext"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:useThreadContext"
        })
#endif

-- VVV Prop "user-agent"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@user-agent@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' session #userAgent
-- @
getSessionUserAgent :: (MonadIO m, IsSession o) => o -> m (Maybe T.Text)
getSessionUserAgent :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> m (Maybe Text)
getSessionUserAgent o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"user-agent"

-- | Set the value of the “@user-agent@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' session [ #userAgent 'Data.GI.Base.Attributes.:=' value ]
-- @
setSessionUserAgent :: (MonadIO m, IsSession o) => o -> T.Text -> m ()
setSessionUserAgent :: forall (m :: * -> *) o.
(MonadIO m, IsSession o) =>
o -> Text -> m ()
setSessionUserAgent o
obj Text
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"user-agent" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

-- | Construct a `GValueConstruct` with valid value for the “@user-agent@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSessionUserAgent :: (IsSession o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructSessionUserAgent :: forall o (m :: * -> *).
(IsSession o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructSessionUserAgent Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"user-agent" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)

-- | Set the value of the “@user-agent@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #userAgent
-- @
clearSessionUserAgent :: (MonadIO m, IsSession o) => o -> m ()
clearSessionUserAgent :: forall (m :: * -> *) o. (MonadIO m, IsSession o) => o -> m ()
clearSessionUserAgent o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"user-agent" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)

#if defined(ENABLE_OVERLOADING)
data SessionUserAgentPropertyInfo
instance AttrInfo SessionUserAgentPropertyInfo where
    type AttrAllowedOps SessionUserAgentPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SessionUserAgentPropertyInfo = IsSession
    type AttrSetTypeConstraint SessionUserAgentPropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint SessionUserAgentPropertyInfo = (~) T.Text
    type AttrTransferType SessionUserAgentPropertyInfo = T.Text
    type AttrGetType SessionUserAgentPropertyInfo = (Maybe T.Text)
    type AttrLabel SessionUserAgentPropertyInfo = "user-agent"
    type AttrOrigin SessionUserAgentPropertyInfo = Session
    attrGet = getSessionUserAgent
    attrSet = setSessionUserAgent
    attrTransfer _ v = do
        return v
    attrConstruct = constructSessionUserAgent
    attrClear = clearSessionUserAgent
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.userAgent"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#g:attr:userAgent"
        })
#endif

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

#if defined(ENABLE_OVERLOADING)
sessionAcceptLanguage :: AttrLabelProxy "acceptLanguage"
sessionAcceptLanguage = AttrLabelProxy

sessionAcceptLanguageAuto :: AttrLabelProxy "acceptLanguageAuto"
sessionAcceptLanguageAuto = AttrLabelProxy

sessionAsyncContext :: AttrLabelProxy "asyncContext"
sessionAsyncContext = AttrLabelProxy

sessionHttpAliases :: AttrLabelProxy "httpAliases"
sessionHttpAliases = AttrLabelProxy

sessionHttpsAliases :: AttrLabelProxy "httpsAliases"
sessionHttpsAliases = AttrLabelProxy

sessionIdleTimeout :: AttrLabelProxy "idleTimeout"
sessionIdleTimeout = AttrLabelProxy

sessionLocalAddress :: AttrLabelProxy "localAddress"
sessionLocalAddress = AttrLabelProxy

sessionMaxConns :: AttrLabelProxy "maxConns"
sessionMaxConns = AttrLabelProxy

sessionMaxConnsPerHost :: AttrLabelProxy "maxConnsPerHost"
sessionMaxConnsPerHost = AttrLabelProxy

sessionProxyResolver :: AttrLabelProxy "proxyResolver"
sessionProxyResolver = AttrLabelProxy

sessionProxyUri :: AttrLabelProxy "proxyUri"
sessionProxyUri = AttrLabelProxy

sessionSslCaFile :: AttrLabelProxy "sslCaFile"
sessionSslCaFile = AttrLabelProxy

sessionSslStrict :: AttrLabelProxy "sslStrict"
sessionSslStrict = AttrLabelProxy

sessionSslUseSystemCaFile :: AttrLabelProxy "sslUseSystemCaFile"
sessionSslUseSystemCaFile = AttrLabelProxy

sessionTimeout :: AttrLabelProxy "timeout"
sessionTimeout = AttrLabelProxy

sessionTlsDatabase :: AttrLabelProxy "tlsDatabase"
sessionTlsDatabase = AttrLabelProxy

sessionTlsInteraction :: AttrLabelProxy "tlsInteraction"
sessionTlsInteraction = AttrLabelProxy

sessionUseNtlm :: AttrLabelProxy "useNtlm"
sessionUseNtlm = AttrLabelProxy

sessionUseThreadContext :: AttrLabelProxy "useThreadContext"
sessionUseThreadContext = AttrLabelProxy

sessionUserAgent :: AttrLabelProxy "userAgent"
sessionUserAgent = AttrLabelProxy

#endif

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

#endif

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

foreign import ccall "soup_session_new" soup_session_new :: 
    IO (Ptr Session)

-- | Creates a t'GI.Soup.Objects.Session.Session' with the default options.
-- 
-- /Since: 2.42/
sessionNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Session
    -- ^ __Returns:__ the new session.
sessionNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Session
sessionNew  = IO Session -> m Session
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Session -> m Session) -> IO Session -> m Session
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
result <- IO (Ptr Session)
soup_session_new
    Text -> Ptr Session -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sessionNew" Ptr Session
result
    Session
result' <- ((ManagedPtr Session -> Session) -> Ptr Session -> IO Session
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Session -> Session
Session) Ptr Session
result
    Session -> IO Session
forall (m :: * -> *) a. Monad m => a -> m a
return Session
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method Session::abort
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the session" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_abort" soup_session_abort :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    IO ()

-- | Cancels all pending requests in /@session@/ and closes all idle
-- persistent connections.
-- 
-- The message cancellation has the same semantics as with
-- 'GI.Soup.Objects.Session.sessionCancelMessage'; asynchronous requests on a
-- t'GI.Soup.Objects.SessionAsync.SessionAsync' will have their callback called before
-- 'GI.Soup.Objects.Session.sessionAbort' returns. Requests on a plain t'GI.Soup.Objects.Session.Session' will
-- not.
sessionAbort ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a) =>
    a
    -- ^ /@session@/: the session
    -> m ()
sessionAbort :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSession a) =>
a -> m ()
sessionAbort a
session = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Session -> IO ()
soup_session_abort Ptr Session
session'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionAbortMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSession a) => O.OverloadedMethod SessionAbortMethodInfo a signature where
    overloadedMethod = sessionAbort

instance O.OverloadedMethodInfo SessionAbortMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionAbort",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionAbort"
        })


#endif

-- method Session::add_feature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "SessionFeature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an object that implements #SoupSessionFeature"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_add_feature" soup_session_add_feature :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.SessionFeature.SessionFeature -> -- feature : TInterface (Name {namespace = "Soup", name = "SessionFeature"})
    IO ()

-- | Adds /@feature@/\'s functionality to /@session@/. You can also add a
-- feature to the session at construct time by using the
-- @/SOUP_SESSION_ADD_FEATURE/@ property.
-- 
-- See the main t'GI.Soup.Objects.Session.Session' documentation for information on what
-- features are present in sessions by default.
-- 
-- /Since: 2.24/
sessionAddFeature ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.SessionFeature.IsSessionFeature b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@feature@/: an object that implements t'GI.Soup.Interfaces.SessionFeature.SessionFeature'
    -> m ()
sessionAddFeature :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsSessionFeature b) =>
a -> b -> m ()
sessionAddFeature a
session b
feature = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr SessionFeature
feature' <- b -> IO (Ptr SessionFeature)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
feature
    Ptr Session -> Ptr SessionFeature -> IO ()
soup_session_add_feature Ptr Session
session' Ptr SessionFeature
feature'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
feature
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionAddFeatureMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsSession a, Soup.SessionFeature.IsSessionFeature b) => O.OverloadedMethod SessionAddFeatureMethodInfo a signature where
    overloadedMethod = sessionAddFeature

instance O.OverloadedMethodInfo SessionAddFeatureMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionAddFeature",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionAddFeature"
        })


#endif

-- method Session::add_feature_by_type
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_type"
--           , argType = TBasicType TGType
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GType" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_add_feature_by_type" soup_session_add_feature_by_type :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    CGType ->                               -- feature_type : TBasicType TGType
    IO ()

-- | If /@featureType@/ is the type of a class that implements
-- t'GI.Soup.Interfaces.SessionFeature.SessionFeature', this creates a new feature of that type and
-- adds it to /@session@/ as with 'GI.Soup.Objects.Session.sessionAddFeature'. You can use
-- this when you don\'t need to customize the new feature in any way.
-- 
-- If /@featureType@/ is not a t'GI.Soup.Interfaces.SessionFeature.SessionFeature' type, this gives each
-- existing feature on /@session@/ the chance to accept /@featureType@/ as
-- a \"subfeature\". This can be used to add new t'GI.Soup.Objects.Auth.Auth' or
-- t'GI.Soup.Objects.Request.Request' types, for instance.
-- 
-- You can also add a feature to the session at construct time by
-- using the @/SOUP_SESSION_ADD_FEATURE_BY_TYPE/@ property.
-- 
-- See the main t'GI.Soup.Objects.Session.Session' documentation for information on what
-- features are present in sessions by default.
-- 
-- /Since: 2.24/
sessionAddFeatureByType ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> GType
    -- ^ /@featureType@/: a t'GType'
    -> m ()
sessionAddFeatureByType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSession a) =>
a -> GType -> m ()
sessionAddFeatureByType a
session GType
featureType = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    let featureType' :: CGType
featureType' = GType -> CGType
gtypeToCGType GType
featureType
    Ptr Session -> CGType -> IO ()
soup_session_add_feature_by_type Ptr Session
session' CGType
featureType'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionAddFeatureByTypeMethodInfo
instance (signature ~ (GType -> m ()), MonadIO m, IsSession a) => O.OverloadedMethod SessionAddFeatureByTypeMethodInfo a signature where
    overloadedMethod = sessionAddFeatureByType

instance O.OverloadedMethodInfo SessionAddFeatureByTypeMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionAddFeatureByType",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionAddFeatureByType"
        })


#endif

-- method Session::cancel_message
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the message to cancel"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "status_code"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "status code to set on @msg (generally\n%SOUP_STATUS_CANCELLED)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_cancel_message" soup_session_cancel_message :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    Word32 ->                               -- status_code : TBasicType TUInt
    IO ()

-- | Causes /@session@/ to immediately finish processing /@msg@/ (regardless
-- of its current state) with a final status_code of /@statusCode@/. You
-- may call this at any time after handing /@msg@/ off to /@session@/; if
-- /@session@/ has started sending the request but has not yet received
-- the complete response, then it will close the request\'s connection.
-- Note that with requests that have side effects (eg,
-- \<literal>POST\<\/literal>, \<literal>PUT\<\/literal>,
-- \<literal>DELETE\<\/literal>) it is possible that you might cancel the
-- request after the server acts on it, but before it returns a
-- response, leaving the remote resource in an unknown state.
-- 
-- If the message is cancelled while its response body is being read,
-- then the response body in /@msg@/ will be left partially-filled-in.
-- The response headers, on the other hand, will always be either
-- empty or complete.
-- 
-- Beware that with the deprecated t'GI.Soup.Objects.SessionAsync.SessionAsync', messages queued
-- with 'GI.Soup.Objects.Session.sessionQueueMessage' will have their callbacks invoked
-- before 'GI.Soup.Objects.Session.sessionCancelMessage' returns. The plain
-- t'GI.Soup.Objects.Session.Session' does not have this behavior; cancelling an
-- asynchronous message will merely queue its callback to be run after
-- returning to the main loop.
sessionCancelMessage ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@msg@/: the message to cancel
    -> Word32
    -- ^ /@statusCode@/: status code to set on /@msg@/ (generally
    -- 'GI.Soup.Enums.StatusCancelled')
    -> m ()
sessionCancelMessage :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsMessage b) =>
a -> b -> Word32 -> m ()
sessionCancelMessage a
session b
msg Word32
statusCode = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
    Ptr Session -> Ptr Message -> Word32 -> IO ()
soup_session_cancel_message Ptr Session
session' Ptr Message
msg' Word32
statusCode
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionCancelMessageMethodInfo
instance (signature ~ (b -> Word32 -> m ()), MonadIO m, IsSession a, Soup.Message.IsMessage b) => O.OverloadedMethod SessionCancelMessageMethodInfo a signature where
    overloadedMethod = sessionCancelMessage

instance O.OverloadedMethodInfo SessionCancelMessageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionCancelMessage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionCancelMessage"
        })


#endif

-- method Session::connect_async
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uri"
--           , argType = TInterface Name { namespace = "Soup" , name = "URI" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupURI to connect to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "progress_callback"
--           , argType =
--               TInterface
--                 Name
--                   { namespace = "Soup" , name = "SessionConnectProgressCallback" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a #SoupSessionConnectProgressCallback which\nwill be called for every network event that occurs during the connection."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the callback to invoke when the operation finishes"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 5
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data for @progress_callback and @callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_connect_async" soup_session_connect_async :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.URI.URI ->                     -- uri : TInterface (Name {namespace = "Soup", name = "URI"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Soup.Callbacks.C_SessionConnectProgressCallback -> -- progress_callback : TInterface (Name {namespace = "Soup", name = "SessionConnectProgressCallback"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Start a connection to /@uri@/. The operation can be monitored by providing a /@progressCallback@/
-- and finishes when the connection is done or an error ocurred.
-- 
-- Call 'GI.Soup.Objects.Session.sessionConnectFinish' to get the t'GI.Gio.Objects.IOStream.IOStream' to communicate with the server.
-- 
-- /Since: 2.62/
sessionConnectAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> Soup.URI.URI
    -- ^ /@uri@/: a t'GI.Soup.Structs.URI.URI' to connect to
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable'
    -> Maybe (Soup.Callbacks.SessionConnectProgressCallback)
    -- ^ /@progressCallback@/: a t'GI.Soup.Callbacks.SessionConnectProgressCallback' which
    -- will be called for every network event that occurs during the connection.
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: the callback to invoke when the operation finishes
    -> m ()
sessionConnectAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsCancellable b) =>
a
-> URI
-> Maybe b
-> Maybe SessionConnectProgressCallback
-> Maybe AsyncReadyCallback
-> m ()
sessionConnectAsync a
session URI
uri Maybe b
cancellable Maybe SessionConnectProgressCallback
progressCallback Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr URI
uri' <- URI -> IO (Ptr URI)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr URI
uri
    Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
        Just b
jCancellable -> do
            Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    FunPtr C_SessionConnectProgressCallback
maybeProgressCallback <- case Maybe SessionConnectProgressCallback
progressCallback of
        Maybe SessionConnectProgressCallback
Nothing -> FunPtr C_SessionConnectProgressCallback
-> IO (FunPtr C_SessionConnectProgressCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_SessionConnectProgressCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just SessionConnectProgressCallback
jProgressCallback -> do
            Ptr (FunPtr C_SessionConnectProgressCallback)
ptrprogressCallback <- IO (Ptr (FunPtr C_SessionConnectProgressCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Soup.Callbacks.C_SessionConnectProgressCallback))
            FunPtr C_SessionConnectProgressCallback
jProgressCallback' <- C_SessionConnectProgressCallback
-> IO (FunPtr C_SessionConnectProgressCallback)
Soup.Callbacks.mk_SessionConnectProgressCallback (Maybe (Ptr (FunPtr C_SessionConnectProgressCallback))
-> SessionConnectProgressCallback_WithClosures
-> C_SessionConnectProgressCallback
Soup.Callbacks.wrap_SessionConnectProgressCallback (Ptr (FunPtr C_SessionConnectProgressCallback)
-> Maybe (Ptr (FunPtr C_SessionConnectProgressCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_SessionConnectProgressCallback)
ptrprogressCallback) (SessionConnectProgressCallback
-> SessionConnectProgressCallback_WithClosures
Soup.Callbacks.drop_closures_SessionConnectProgressCallback SessionConnectProgressCallback
jProgressCallback))
            Ptr (FunPtr C_SessionConnectProgressCallback)
-> FunPtr C_SessionConnectProgressCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_SessionConnectProgressCallback)
ptrprogressCallback FunPtr C_SessionConnectProgressCallback
jProgressCallback'
            FunPtr C_SessionConnectProgressCallback
-> IO (FunPtr C_SessionConnectProgressCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_SessionConnectProgressCallback
jProgressCallback'
    FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
        Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just AsyncReadyCallback
jCallback -> do
            Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
            Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
            FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr Session
-> Ptr URI
-> Ptr Cancellable
-> FunPtr C_SessionConnectProgressCallback
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
soup_session_connect_async Ptr Session
session' Ptr URI
uri' Ptr Cancellable
maybeCancellable FunPtr C_SessionConnectProgressCallback
maybeProgressCallback FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    URI -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr URI
uri
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionConnectAsyncMethodInfo
instance (signature ~ (Soup.URI.URI -> Maybe (b) -> Maybe (Soup.Callbacks.SessionConnectProgressCallback) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSession a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SessionConnectAsyncMethodInfo a signature where
    overloadedMethod = sessionConnectAsync

instance O.OverloadedMethodInfo SessionConnectAsyncMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionConnectAsync",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionConnectAsync"
        })


#endif

-- method Session::connect_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GAsyncResult passed to your callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "IOStream" })
-- throws : True
-- Skip return : False

foreign import ccall "soup_session_connect_finish" soup_session_connect_finish :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Gio.IOStream.IOStream)

-- | Gets the t'GI.Gio.Objects.IOStream.IOStream' created for the connection to communicate with the server.
-- 
-- /Since: 2.62/
sessionConnectFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@result@/: the t'GI.Gio.Interfaces.AsyncResult.AsyncResult' passed to your callback
    -> m Gio.IOStream.IOStream
    -- ^ __Returns:__ a new t'GI.Gio.Objects.IOStream.IOStream', or 'P.Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/
sessionConnectFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsAsyncResult b) =>
a -> b -> m IOStream
sessionConnectFinish a
session b
result_ = IO IOStream -> m IOStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IOStream -> m IOStream) -> IO IOStream -> m IOStream
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
    IO IOStream -> IO () -> IO IOStream
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr IOStream
result <- (Ptr (Ptr GError) -> IO (Ptr IOStream)) -> IO (Ptr IOStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr IOStream)) -> IO (Ptr IOStream))
-> (Ptr (Ptr GError) -> IO (Ptr IOStream)) -> IO (Ptr IOStream)
forall a b. (a -> b) -> a -> b
$ Ptr Session
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr IOStream)
soup_session_connect_finish Ptr Session
session' Ptr AsyncResult
result_'
        Text -> Ptr IOStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sessionConnectFinish" Ptr IOStream
result
        IOStream
result' <- ((ManagedPtr IOStream -> IOStream) -> Ptr IOStream -> IO IOStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr IOStream -> IOStream
Gio.IOStream.IOStream) Ptr IOStream
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
        b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
        IOStream -> IO IOStream
forall (m :: * -> *) a. Monad m => a -> m a
return IOStream
result'
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SessionConnectFinishMethodInfo
instance (signature ~ (b -> m Gio.IOStream.IOStream), MonadIO m, IsSession a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod SessionConnectFinishMethodInfo a signature where
    overloadedMethod = sessionConnectFinish

instance O.OverloadedMethodInfo SessionConnectFinishMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionConnectFinish",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionConnectFinish"
        })


#endif

-- method Session::get_async_context
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GLib" , name = "MainContext" })
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_get_async_context" soup_session_get_async_context :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    IO (Ptr GLib.MainContext.MainContext)

-- | Gets /@session@/\'s t'GI.Soup.Objects.Session.Session':@/async-context/@. This does not add a ref
-- to the context, so you will need to ref it yourself if you want it
-- to outlive its session.
-- 
-- For a modern t'GI.Soup.Objects.Session.Session', this will always just return the
-- thread-default t'GI.GLib.Structs.MainContext.MainContext', and so is not especially useful.
sessionGetAsyncContext ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> m (Maybe GLib.MainContext.MainContext)
    -- ^ __Returns:__ /@session@/\'s t'GI.GLib.Structs.MainContext.MainContext',
    -- which may be 'P.Nothing'
sessionGetAsyncContext :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSession a) =>
a -> m (Maybe MainContext)
sessionGetAsyncContext a
session = IO (Maybe MainContext) -> m (Maybe MainContext)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe MainContext) -> m (Maybe MainContext))
-> IO (Maybe MainContext) -> m (Maybe MainContext)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr MainContext
result <- Ptr Session -> IO (Ptr MainContext)
soup_session_get_async_context Ptr Session
session'
    Maybe MainContext
maybeResult <- Ptr MainContext
-> (Ptr MainContext -> IO MainContext) -> IO (Maybe MainContext)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr MainContext
result ((Ptr MainContext -> IO MainContext) -> IO (Maybe MainContext))
-> (Ptr MainContext -> IO MainContext) -> IO (Maybe MainContext)
forall a b. (a -> b) -> a -> b
$ \Ptr MainContext
result' -> do
        MainContext
result'' <- ((ManagedPtr MainContext -> MainContext)
-> Ptr MainContext -> IO MainContext
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr MainContext -> MainContext
GLib.MainContext.MainContext) Ptr MainContext
result'
        MainContext -> IO MainContext
forall (m :: * -> *) a. Monad m => a -> m a
return MainContext
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    Maybe MainContext -> IO (Maybe MainContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe MainContext
maybeResult

#if defined(ENABLE_OVERLOADING)
data SessionGetAsyncContextMethodInfo
instance (signature ~ (m (Maybe GLib.MainContext.MainContext)), MonadIO m, IsSession a) => O.OverloadedMethod SessionGetAsyncContextMethodInfo a signature where
    overloadedMethod = sessionGetAsyncContext

instance O.OverloadedMethodInfo SessionGetAsyncContextMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionGetAsyncContext",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionGetAsyncContext"
        })


#endif

-- method Session::get_feature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_type"
--           , argType = TBasicType TGType
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GType of the feature to get"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Soup" , name = "SessionFeature" })
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_get_feature" soup_session_get_feature :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    CGType ->                               -- feature_type : TBasicType TGType
    IO (Ptr Soup.SessionFeature.SessionFeature)

-- | Gets the first feature in /@session@/ of type /@featureType@/. For
-- features where there may be more than one feature of a given type,
-- use 'GI.Soup.Objects.Session.sessionGetFeatures'.
-- 
-- /Since: 2.26/
sessionGetFeature ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> GType
    -- ^ /@featureType@/: the t'GType' of the feature to get
    -> m (Maybe Soup.SessionFeature.SessionFeature)
    -- ^ __Returns:__ a t'GI.Soup.Interfaces.SessionFeature.SessionFeature', or
    -- 'P.Nothing'. The feature is owned by /@session@/.
sessionGetFeature :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSession a) =>
a -> GType -> m (Maybe SessionFeature)
sessionGetFeature a
session GType
featureType = IO (Maybe SessionFeature) -> m (Maybe SessionFeature)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe SessionFeature) -> m (Maybe SessionFeature))
-> IO (Maybe SessionFeature) -> m (Maybe SessionFeature)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    let featureType' :: CGType
featureType' = GType -> CGType
gtypeToCGType GType
featureType
    Ptr SessionFeature
result <- Ptr Session -> CGType -> IO (Ptr SessionFeature)
soup_session_get_feature Ptr Session
session' CGType
featureType'
    Maybe SessionFeature
maybeResult <- Ptr SessionFeature
-> (Ptr SessionFeature -> IO SessionFeature)
-> IO (Maybe SessionFeature)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr SessionFeature
result ((Ptr SessionFeature -> IO SessionFeature)
 -> IO (Maybe SessionFeature))
-> (Ptr SessionFeature -> IO SessionFeature)
-> IO (Maybe SessionFeature)
forall a b. (a -> b) -> a -> b
$ \Ptr SessionFeature
result' -> do
        SessionFeature
result'' <- ((ManagedPtr SessionFeature -> SessionFeature)
-> Ptr SessionFeature -> IO SessionFeature
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr SessionFeature -> SessionFeature
Soup.SessionFeature.SessionFeature) Ptr SessionFeature
result'
        SessionFeature -> IO SessionFeature
forall (m :: * -> *) a. Monad m => a -> m a
return SessionFeature
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    Maybe SessionFeature -> IO (Maybe SessionFeature)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe SessionFeature
maybeResult

#if defined(ENABLE_OVERLOADING)
data SessionGetFeatureMethodInfo
instance (signature ~ (GType -> m (Maybe Soup.SessionFeature.SessionFeature)), MonadIO m, IsSession a) => O.OverloadedMethod SessionGetFeatureMethodInfo a signature where
    overloadedMethod = sessionGetFeature

instance O.OverloadedMethodInfo SessionGetFeatureMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionGetFeature",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionGetFeature"
        })


#endif

-- method Session::get_feature_for_message
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_type"
--           , argType = TBasicType TGType
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GType of the feature to get"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupMessage" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Soup" , name = "SessionFeature" })
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_get_feature_for_message" soup_session_get_feature_for_message :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    CGType ->                               -- feature_type : TBasicType TGType
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO (Ptr Soup.SessionFeature.SessionFeature)

-- | Gets the first feature in /@session@/ of type /@featureType@/, provided
-- that it is not disabled for /@msg@/. As with
-- 'GI.Soup.Objects.Session.sessionGetFeature', this should only be used for features
-- where /@featureType@/ is only expected to match a single feature. In
-- particular, if there are two matching features, and the first is
-- disabled on /@msg@/, and the second is not, then this will return
-- 'P.Nothing', not the second feature.
-- 
-- /Since: 2.28/
sessionGetFeatureForMessage ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> GType
    -- ^ /@featureType@/: the t'GType' of the feature to get
    -> b
    -- ^ /@msg@/: a t'GI.Soup.Objects.Message.Message'
    -> m (Maybe Soup.SessionFeature.SessionFeature)
    -- ^ __Returns:__ a t'GI.Soup.Interfaces.SessionFeature.SessionFeature', or 'P.Nothing'. The
    -- feature is owned by /@session@/.
sessionGetFeatureForMessage :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsMessage b) =>
a -> GType -> b -> m (Maybe SessionFeature)
sessionGetFeatureForMessage a
session GType
featureType b
msg = IO (Maybe SessionFeature) -> m (Maybe SessionFeature)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe SessionFeature) -> m (Maybe SessionFeature))
-> IO (Maybe SessionFeature) -> m (Maybe SessionFeature)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    let featureType' :: CGType
featureType' = GType -> CGType
gtypeToCGType GType
featureType
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
    Ptr SessionFeature
result <- Ptr Session -> CGType -> Ptr Message -> IO (Ptr SessionFeature)
soup_session_get_feature_for_message Ptr Session
session' CGType
featureType' Ptr Message
msg'
    Maybe SessionFeature
maybeResult <- Ptr SessionFeature
-> (Ptr SessionFeature -> IO SessionFeature)
-> IO (Maybe SessionFeature)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr SessionFeature
result ((Ptr SessionFeature -> IO SessionFeature)
 -> IO (Maybe SessionFeature))
-> (Ptr SessionFeature -> IO SessionFeature)
-> IO (Maybe SessionFeature)
forall a b. (a -> b) -> a -> b
$ \Ptr SessionFeature
result' -> do
        SessionFeature
result'' <- ((ManagedPtr SessionFeature -> SessionFeature)
-> Ptr SessionFeature -> IO SessionFeature
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr SessionFeature -> SessionFeature
Soup.SessionFeature.SessionFeature) Ptr SessionFeature
result'
        SessionFeature -> IO SessionFeature
forall (m :: * -> *) a. Monad m => a -> m a
return SessionFeature
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
    Maybe SessionFeature -> IO (Maybe SessionFeature)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe SessionFeature
maybeResult

#if defined(ENABLE_OVERLOADING)
data SessionGetFeatureForMessageMethodInfo
instance (signature ~ (GType -> b -> m (Maybe Soup.SessionFeature.SessionFeature)), MonadIO m, IsSession a, Soup.Message.IsMessage b) => O.OverloadedMethod SessionGetFeatureForMessageMethodInfo a signature where
    overloadedMethod = sessionGetFeatureForMessage

instance O.OverloadedMethodInfo SessionGetFeatureForMessageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionGetFeatureForMessage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionGetFeatureForMessage"
        })


#endif

-- method Session::get_features
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_type"
--           , argType = TBasicType TGType
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GType of the class of features to get"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGSList
--                  (TInterface Name { namespace = "Soup" , name = "SessionFeature" }))
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_get_features" soup_session_get_features :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    CGType ->                               -- feature_type : TBasicType TGType
    IO (Ptr (GSList (Ptr Soup.SessionFeature.SessionFeature)))

-- | Generates a list of /@session@/\'s features of type /@featureType@/. (If
-- you want to see all features, you can pass @/SOUP_TYPE_SESSION_FEATURE/@
-- for /@featureType@/.)
-- 
-- /Since: 2.26/
sessionGetFeatures ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> GType
    -- ^ /@featureType@/: the t'GType' of the class of features to get
    -> m [Soup.SessionFeature.SessionFeature]
    -- ^ __Returns:__ 
    -- a list of features. You must free the list, but not its contents
sessionGetFeatures :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSession a) =>
a -> GType -> m [SessionFeature]
sessionGetFeatures a
session GType
featureType = IO [SessionFeature] -> m [SessionFeature]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [SessionFeature] -> m [SessionFeature])
-> IO [SessionFeature] -> m [SessionFeature]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    let featureType' :: CGType
featureType' = GType -> CGType
gtypeToCGType GType
featureType
    Ptr (GSList (Ptr SessionFeature))
result <- Ptr Session -> CGType -> IO (Ptr (GSList (Ptr SessionFeature)))
soup_session_get_features Ptr Session
session' CGType
featureType'
    [Ptr SessionFeature]
result' <- Ptr (GSList (Ptr SessionFeature)) -> IO [Ptr SessionFeature]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr SessionFeature))
result
    [SessionFeature]
result'' <- (Ptr SessionFeature -> IO SessionFeature)
-> [Ptr SessionFeature] -> IO [SessionFeature]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr SessionFeature -> SessionFeature)
-> Ptr SessionFeature -> IO SessionFeature
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr SessionFeature -> SessionFeature
Soup.SessionFeature.SessionFeature) [Ptr SessionFeature]
result'
    Ptr (GSList (Ptr SessionFeature)) -> IO ()
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr SessionFeature))
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    [SessionFeature] -> IO [SessionFeature]
forall (m :: * -> *) a. Monad m => a -> m a
return [SessionFeature]
result''

#if defined(ENABLE_OVERLOADING)
data SessionGetFeaturesMethodInfo
instance (signature ~ (GType -> m [Soup.SessionFeature.SessionFeature]), MonadIO m, IsSession a) => O.OverloadedMethod SessionGetFeaturesMethodInfo a signature where
    overloadedMethod = sessionGetFeatures

instance O.OverloadedMethodInfo SessionGetFeaturesMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionGetFeatures",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionGetFeatures"
        })


#endif

-- method Session::has_feature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_type"
--           , argType = TBasicType TGType
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #GType of the class of features to check for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_has_feature" soup_session_has_feature :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    CGType ->                               -- feature_type : TBasicType TGType
    IO CInt

-- | Tests if /@session@/ has at a feature of type /@featureType@/ (which can
-- be the type of either a t'GI.Soup.Interfaces.SessionFeature.SessionFeature', or else a subtype of
-- some class managed by another feature, such as t'GI.Soup.Objects.Auth.Auth' or
-- t'GI.Soup.Objects.Request.Request').
-- 
-- /Since: 2.42/
sessionHasFeature ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> GType
    -- ^ /@featureType@/: the t'GType' of the class of features to check for
    -> m Bool
    -- ^ __Returns:__ 'P.True' or 'P.False'
sessionHasFeature :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSession a) =>
a -> GType -> m Bool
sessionHasFeature a
session GType
featureType = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    let featureType' :: CGType
featureType' = GType -> CGType
gtypeToCGType GType
featureType
    CInt
result <- Ptr Session -> CGType -> IO CInt
soup_session_has_feature Ptr Session
session' CGType
featureType'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SessionHasFeatureMethodInfo
instance (signature ~ (GType -> m Bool), MonadIO m, IsSession a) => O.OverloadedMethod SessionHasFeatureMethodInfo a signature where
    overloadedMethod = sessionHasFeature

instance O.OverloadedMethodInfo SessionHasFeatureMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionHasFeature",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionHasFeature"
        })


#endif

-- method Session::pause_message
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupMessage currently running on @session"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_pause_message" soup_session_pause_message :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO ()

-- | Pauses HTTP I\/O on /@msg@/. Call 'GI.Soup.Objects.Session.sessionUnpauseMessage' to
-- resume I\/O.
-- 
-- This may only be called for asynchronous messages (those sent on a
-- t'GI.Soup.Objects.SessionAsync.SessionAsync' or using 'GI.Soup.Objects.Session.sessionQueueMessage').
sessionPauseMessage ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@msg@/: a t'GI.Soup.Objects.Message.Message' currently running on /@session@/
    -> m ()
sessionPauseMessage :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsMessage b) =>
a -> b -> m ()
sessionPauseMessage a
session b
msg = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
    Ptr Session -> Ptr Message -> IO ()
soup_session_pause_message Ptr Session
session' Ptr Message
msg'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionPauseMessageMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsSession a, Soup.Message.IsMessage b) => O.OverloadedMethod SessionPauseMessageMethodInfo a signature where
    overloadedMethod = sessionPauseMessage

instance O.OverloadedMethodInfo SessionPauseMessageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionPauseMessage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionPauseMessage"
        })


#endif

-- method Session::prefetch_dns
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "hostname"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a hostname to be resolved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable object, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "AddressCallback" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "callback to call with the\n    result, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 4
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data for @callback" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_prefetch_dns" soup_session_prefetch_dns :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    CString ->                              -- hostname : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Soup.Callbacks.C_AddressCallback -> -- callback : TInterface (Name {namespace = "Soup", name = "AddressCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Tells /@session@/ that an URI from the given /@hostname@/ may be requested
-- shortly, and so the session can try to prepare by resolving the
-- domain name in advance, in order to work more quickly once the URI
-- is actually requested.
-- 
-- If /@cancellable@/ is non-'P.Nothing', it can be used to cancel the
-- resolution. /@callback@/ will still be invoked in this case, with a
-- status of 'GI.Soup.Enums.StatusCancelled'.
-- 
-- /Since: 2.38/
sessionPrefetchDns ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> T.Text
    -- ^ /@hostname@/: a hostname to be resolved
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable' object, or 'P.Nothing'
    -> Maybe (Soup.Callbacks.AddressCallback)
    -- ^ /@callback@/: callback to call with the
    --     result, or 'P.Nothing'
    -> m ()
sessionPrefetchDns :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsCancellable b) =>
a -> Text -> Maybe b -> Maybe AddressCallback -> m ()
sessionPrefetchDns a
session Text
hostname Maybe b
cancellable Maybe AddressCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    CString
hostname' <- Text -> IO CString
textToCString Text
hostname
    Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
        Just b
jCancellable -> do
            Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    FunPtr C_AddressCallback
maybeCallback <- case Maybe AddressCallback
callback of
        Maybe AddressCallback
Nothing -> FunPtr C_AddressCallback -> IO (FunPtr C_AddressCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AddressCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just AddressCallback
jCallback -> do
            Ptr (FunPtr C_AddressCallback)
ptrcallback <- IO (Ptr (FunPtr C_AddressCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Soup.Callbacks.C_AddressCallback))
            FunPtr C_AddressCallback
jCallback' <- C_AddressCallback -> IO (FunPtr C_AddressCallback)
Soup.Callbacks.mk_AddressCallback (Maybe (Ptr (FunPtr C_AddressCallback))
-> AddressCallback_WithClosures -> C_AddressCallback
Soup.Callbacks.wrap_AddressCallback (Ptr (FunPtr C_AddressCallback)
-> Maybe (Ptr (FunPtr C_AddressCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AddressCallback)
ptrcallback) (AddressCallback -> AddressCallback_WithClosures
Soup.Callbacks.drop_closures_AddressCallback AddressCallback
jCallback))
            Ptr (FunPtr C_AddressCallback) -> FunPtr C_AddressCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AddressCallback)
ptrcallback FunPtr C_AddressCallback
jCallback'
            FunPtr C_AddressCallback -> IO (FunPtr C_AddressCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AddressCallback
jCallback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr Session
-> CString
-> Ptr Cancellable
-> FunPtr C_AddressCallback
-> Ptr ()
-> IO ()
soup_session_prefetch_dns Ptr Session
session' CString
hostname' Ptr Cancellable
maybeCancellable FunPtr C_AddressCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
hostname'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionPrefetchDnsMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> Maybe (Soup.Callbacks.AddressCallback) -> m ()), MonadIO m, IsSession a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SessionPrefetchDnsMethodInfo a signature where
    overloadedMethod = sessionPrefetchDns

instance O.OverloadedMethodInfo SessionPrefetchDnsMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionPrefetchDns",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionPrefetchDns"
        })


#endif

-- method Session::prepare_for_uri
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uri"
--           , argType = TInterface Name { namespace = "Soup" , name = "URI" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupURI which may be required"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_prepare_for_uri" soup_session_prepare_for_uri :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.URI.URI ->                     -- uri : TInterface (Name {namespace = "Soup", name = "URI"})
    IO ()

{-# DEPRECATED sessionPrepareForUri ["(Since version 2.38)","use 'GI.Soup.Objects.Session.sessionPrefetchDns' instead"] #-}
-- | Tells /@session@/ that /@uri@/ may be requested shortly, and so the
-- session can try to prepare (resolving the domain name, obtaining
-- proxy address, etc.) in order to work more quickly once the URI is
-- actually requested.
-- 
-- /Since: 2.30/
sessionPrepareForUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> Soup.URI.URI
    -- ^ /@uri@/: a t'GI.Soup.Structs.URI.URI' which may be required
    -> m ()
sessionPrepareForUri :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSession a) =>
a -> URI -> m ()
sessionPrepareForUri a
session URI
uri = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr URI
uri' <- URI -> IO (Ptr URI)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr URI
uri
    Ptr Session -> Ptr URI -> IO ()
soup_session_prepare_for_uri Ptr Session
session' Ptr URI
uri'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    URI -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr URI
uri
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionPrepareForUriMethodInfo
instance (signature ~ (Soup.URI.URI -> m ()), MonadIO m, IsSession a) => O.OverloadedMethod SessionPrepareForUriMethodInfo a signature where
    overloadedMethod = sessionPrepareForUri

instance O.OverloadedMethodInfo SessionPrepareForUriMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionPrepareForUri",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionPrepareForUri"
        })


#endif

-- method Session::queue_message
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the message to queue"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "SessionCallback" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a #SoupSessionCallback which will\nbe called after the message completes or when an unrecoverable error occurs."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a pointer passed to @callback."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_queue_message" soup_session_queue_message :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    FunPtr Soup.Callbacks.C_SessionCallback -> -- callback : TInterface (Name {namespace = "Soup", name = "SessionCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Queues the message /@msg@/ for asynchronously sending the request and
-- receiving a response in the current thread-default t'GI.GLib.Structs.MainContext.MainContext'.
-- If /@msg@/ has been processed before, any resources related to the
-- time it was last sent are freed.
-- 
-- Upon message completion, the callback specified in /@callback@/ will
-- be invoked. If after returning from this callback the message has not
-- been requeued, /@msg@/ will be unreffed.
-- 
-- (The behavior above applies to a plain t'GI.Soup.Objects.Session.Session'; if you are
-- using t'GI.Soup.Objects.SessionAsync.SessionAsync' or t'GI.Soup.Objects.SessionSync.SessionSync', then the t'GI.GLib.Structs.MainContext.MainContext'
-- that is used depends on the settings of t'GI.Soup.Objects.Session.Session':@/async-context/@
-- and t'GI.Soup.Objects.Session.Session':@/use-thread-context/@, and for t'GI.Soup.Objects.SessionSync.SessionSync', the
-- message will actually be sent and processed in another thread, with
-- only the final callback occurring in the indicated t'GI.GLib.Structs.MainContext.MainContext'.)
-- 
-- Contrast this method with 'GI.Soup.Objects.Session.sessionSendAsync', which also
-- asynchronously sends a message, but returns before reading the
-- response body, and allows you to read the response via a
-- t'GI.Gio.Objects.InputStream.InputStream'.
sessionQueueMessage ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@msg@/: the message to queue
    -> Maybe (Soup.Callbacks.SessionCallback)
    -- ^ /@callback@/: a t'GI.Soup.Callbacks.SessionCallback' which will
    -- be called after the message completes or when an unrecoverable error occurs.
    -> m ()
sessionQueueMessage :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsMessage b) =>
a -> b -> Maybe SessionCallback -> m ()
sessionQueueMessage a
session b
msg Maybe SessionCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, GObject a) => a -> IO (Ptr b)
B.ManagedPtr.disownObject b
msg
    FunPtr C_SessionRequestQueuedCallback
maybeCallback <- case Maybe SessionCallback
callback of
        Maybe SessionCallback
Nothing -> FunPtr C_SessionRequestQueuedCallback
-> IO (FunPtr C_SessionRequestQueuedCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_SessionRequestQueuedCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just SessionCallback
jCallback -> do
            Ptr (FunPtr C_SessionRequestQueuedCallback)
ptrcallback <- IO (Ptr (FunPtr C_SessionRequestQueuedCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Soup.Callbacks.C_SessionCallback))
            FunPtr C_SessionRequestQueuedCallback
jCallback' <- C_SessionRequestQueuedCallback
-> IO (FunPtr C_SessionRequestQueuedCallback)
Soup.Callbacks.mk_SessionCallback (Maybe (Ptr (FunPtr C_SessionRequestQueuedCallback))
-> SessionCallback_WithClosures -> C_SessionRequestQueuedCallback
Soup.Callbacks.wrap_SessionCallback (Ptr (FunPtr C_SessionRequestQueuedCallback)
-> Maybe (Ptr (FunPtr C_SessionRequestQueuedCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_SessionRequestQueuedCallback)
ptrcallback) (SessionCallback -> SessionCallback_WithClosures
Soup.Callbacks.drop_closures_SessionCallback SessionCallback
jCallback))
            Ptr (FunPtr C_SessionRequestQueuedCallback)
-> FunPtr C_SessionRequestQueuedCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_SessionRequestQueuedCallback)
ptrcallback FunPtr C_SessionRequestQueuedCallback
jCallback'
            FunPtr C_SessionRequestQueuedCallback
-> IO (FunPtr C_SessionRequestQueuedCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_SessionRequestQueuedCallback
jCallback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr Session
-> Ptr Message
-> FunPtr C_SessionRequestQueuedCallback
-> Ptr ()
-> IO ()
soup_session_queue_message Ptr Session
session' Ptr Message
msg' FunPtr C_SessionRequestQueuedCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionQueueMessageMethodInfo
instance (signature ~ (b -> Maybe (Soup.Callbacks.SessionCallback) -> m ()), MonadIO m, IsSession a, Soup.Message.IsMessage b) => O.OverloadedMethod SessionQueueMessageMethodInfo a signature where
    overloadedMethod = sessionQueueMessage

instance O.OverloadedMethodInfo SessionQueueMessageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionQueueMessage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionQueueMessage"
        })


#endif

-- method Session::redirect_message
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the session" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #SoupMessage that has received a 3xx response"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_redirect_message" soup_session_redirect_message :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO CInt

-- | Updates /@msg@/\'s URI according to its status code and \"Location\"
-- header, and requeues it on /@session@/. Use this when you have set
-- 'GI.Soup.Flags.MessageFlagsNoRedirect' on a message, but have decided to allow a
-- particular redirection to occur, or if you want to allow a
-- redirection that t'GI.Soup.Objects.Session.Session' will not perform automatically (eg,
-- redirecting a non-safe method such as DELETE).
-- 
-- If /@msg@/\'s status code indicates that it should be retried as a GET
-- request, then /@msg@/ will be modified accordingly.
-- 
-- If /@msg@/ has already been redirected too many times, this will
-- cause it to fail with 'GI.Soup.Enums.StatusTooManyRedirects'.
-- 
-- /Since: 2.38/
sessionRedirectMessage ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b) =>
    a
    -- ^ /@session@/: the session
    -> b
    -- ^ /@msg@/: a t'GI.Soup.Objects.Message.Message' that has received a 3xx response
    -> m Bool
    -- ^ __Returns:__ 'P.True' if a redirection was applied, 'P.False' if not
    -- (eg, because there was no Location header, or it could not be
    -- parsed).
sessionRedirectMessage :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsMessage b) =>
a -> b -> m Bool
sessionRedirectMessage a
session b
msg = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
    CInt
result <- Ptr Session -> Ptr Message -> IO CInt
soup_session_redirect_message Ptr Session
session' Ptr Message
msg'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SessionRedirectMessageMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsSession a, Soup.Message.IsMessage b) => O.OverloadedMethod SessionRedirectMessageMethodInfo a signature where
    overloadedMethod = sessionRedirectMessage

instance O.OverloadedMethodInfo SessionRedirectMessageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionRedirectMessage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionRedirectMessage"
        })


#endif

-- method Session::remove_feature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "SessionFeature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a feature that has previously been added to @session"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_remove_feature" soup_session_remove_feature :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.SessionFeature.SessionFeature -> -- feature : TInterface (Name {namespace = "Soup", name = "SessionFeature"})
    IO ()

-- | Removes /@feature@/\'s functionality from /@session@/.
-- 
-- /Since: 2.24/
sessionRemoveFeature ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.SessionFeature.IsSessionFeature b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@feature@/: a feature that has previously been added to /@session@/
    -> m ()
sessionRemoveFeature :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsSessionFeature b) =>
a -> b -> m ()
sessionRemoveFeature a
session b
feature = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr SessionFeature
feature' <- b -> IO (Ptr SessionFeature)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
feature
    Ptr Session -> Ptr SessionFeature -> IO ()
soup_session_remove_feature Ptr Session
session' Ptr SessionFeature
feature'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
feature
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionRemoveFeatureMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsSession a, Soup.SessionFeature.IsSessionFeature b) => O.OverloadedMethod SessionRemoveFeatureMethodInfo a signature where
    overloadedMethod = sessionRemoveFeature

instance O.OverloadedMethodInfo SessionRemoveFeatureMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionRemoveFeature",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionRemoveFeature"
        })


#endif

-- method Session::remove_feature_by_type
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_type"
--           , argType = TBasicType TGType
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GType" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_remove_feature_by_type" soup_session_remove_feature_by_type :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    CGType ->                               -- feature_type : TBasicType TGType
    IO ()

-- | Removes all features of type /@featureType@/ (or any subclass of
-- /@featureType@/) from /@session@/. You can also remove standard features
-- from the session at construct time by using the
-- @/SOUP_SESSION_REMOVE_FEATURE_BY_TYPE/@ property.
-- 
-- /Since: 2.24/
sessionRemoveFeatureByType ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> GType
    -- ^ /@featureType@/: a t'GType'
    -> m ()
sessionRemoveFeatureByType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSession a) =>
a -> GType -> m ()
sessionRemoveFeatureByType a
session GType
featureType = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    let featureType' :: CGType
featureType' = GType -> CGType
gtypeToCGType GType
featureType
    Ptr Session -> CGType -> IO ()
soup_session_remove_feature_by_type Ptr Session
session' CGType
featureType'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionRemoveFeatureByTypeMethodInfo
instance (signature ~ (GType -> m ()), MonadIO m, IsSession a) => O.OverloadedMethod SessionRemoveFeatureByTypeMethodInfo a signature where
    overloadedMethod = sessionRemoveFeatureByType

instance O.OverloadedMethodInfo SessionRemoveFeatureByTypeMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionRemoveFeatureByType",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionRemoveFeatureByType"
        })


#endif

-- method Session::request
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uri_string"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a URI, in string form"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Soup" , name = "Request" })
-- throws : True
-- Skip return : False

foreign import ccall "soup_session_request" soup_session_request :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    CString ->                              -- uri_string : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Soup.Request.Request)

-- | Creates a t'GI.Soup.Objects.Request.Request' for retrieving /@uriString@/.
-- 
-- /Since: 2.42/
sessionRequest ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> T.Text
    -- ^ /@uriString@/: a URI, in string form
    -> m Soup.Request.Request
    -- ^ __Returns:__ a new t'GI.Soup.Objects.Request.Request', or
    --   'P.Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/
sessionRequest :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSession a) =>
a -> Text -> m Request
sessionRequest a
session Text
uriString = IO Request -> m Request
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Request -> m Request) -> IO Request -> m Request
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    CString
uriString' <- Text -> IO CString
textToCString Text
uriString
    IO Request -> IO () -> IO Request
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr Request
result <- (Ptr (Ptr GError) -> IO (Ptr Request)) -> IO (Ptr Request)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Request)) -> IO (Ptr Request))
-> (Ptr (Ptr GError) -> IO (Ptr Request)) -> IO (Ptr Request)
forall a b. (a -> b) -> a -> b
$ Ptr Session -> CString -> Ptr (Ptr GError) -> IO (Ptr Request)
soup_session_request Ptr Session
session' CString
uriString'
        Text -> Ptr Request -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sessionRequest" Ptr Request
result
        Request
result' <- ((ManagedPtr Request -> Request) -> Ptr Request -> IO Request
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Request -> Request
Soup.Request.Request) Ptr Request
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uriString'
        Request -> IO Request
forall (m :: * -> *) a. Monad m => a -> m a
return Request
result'
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uriString'
     )

#if defined(ENABLE_OVERLOADING)
data SessionRequestMethodInfo
instance (signature ~ (T.Text -> m Soup.Request.Request), MonadIO m, IsSession a) => O.OverloadedMethod SessionRequestMethodInfo a signature where
    overloadedMethod = sessionRequest

instance O.OverloadedMethodInfo SessionRequestMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionRequest",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionRequest"
        })


#endif

-- method Session::request_http
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "method"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an HTTP method" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uri_string"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a URI, in string form"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Soup" , name = "RequestHTTP" })
-- throws : True
-- Skip return : False

foreign import ccall "soup_session_request_http" soup_session_request_http :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    CString ->                              -- method : TBasicType TUTF8
    CString ->                              -- uri_string : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Soup.RequestHTTP.RequestHTTP)

-- | Creates a t'GI.Soup.Objects.Request.Request' for retrieving /@uriString@/, which must be an
-- \"http\" or \"https\" URI (or another protocol listed in /@session@/\'s
-- t'GI.Soup.Objects.Session.Session':@/http-aliases/@ or t'GI.Soup.Objects.Session.Session':@/https-aliases/@).
-- 
-- /Since: 2.42/
sessionRequestHttp ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> T.Text
    -- ^ /@method@/: an HTTP method
    -> T.Text
    -- ^ /@uriString@/: a URI, in string form
    -> m Soup.RequestHTTP.RequestHTTP
    -- ^ __Returns:__ a new t'GI.Soup.Objects.RequestHTTP.RequestHTTP', or
    --   'P.Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/
sessionRequestHttp :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSession a) =>
a -> Text -> Text -> m RequestHTTP
sessionRequestHttp a
session Text
method Text
uriString = IO RequestHTTP -> m RequestHTTP
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RequestHTTP -> m RequestHTTP)
-> IO RequestHTTP -> m RequestHTTP
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    CString
method' <- Text -> IO CString
textToCString Text
method
    CString
uriString' <- Text -> IO CString
textToCString Text
uriString
    IO RequestHTTP -> IO () -> IO RequestHTTP
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr RequestHTTP
result <- (Ptr (Ptr GError) -> IO (Ptr RequestHTTP)) -> IO (Ptr RequestHTTP)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr RequestHTTP))
 -> IO (Ptr RequestHTTP))
-> (Ptr (Ptr GError) -> IO (Ptr RequestHTTP))
-> IO (Ptr RequestHTTP)
forall a b. (a -> b) -> a -> b
$ Ptr Session
-> CString -> CString -> Ptr (Ptr GError) -> IO (Ptr RequestHTTP)
soup_session_request_http Ptr Session
session' CString
method' CString
uriString'
        Text -> Ptr RequestHTTP -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sessionRequestHttp" Ptr RequestHTTP
result
        RequestHTTP
result' <- ((ManagedPtr RequestHTTP -> RequestHTTP)
-> Ptr RequestHTTP -> IO RequestHTTP
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr RequestHTTP -> RequestHTTP
Soup.RequestHTTP.RequestHTTP) Ptr RequestHTTP
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
method'
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uriString'
        RequestHTTP -> IO RequestHTTP
forall (m :: * -> *) a. Monad m => a -> m a
return RequestHTTP
result'
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
method'
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uriString'
     )

#if defined(ENABLE_OVERLOADING)
data SessionRequestHttpMethodInfo
instance (signature ~ (T.Text -> T.Text -> m Soup.RequestHTTP.RequestHTTP), MonadIO m, IsSession a) => O.OverloadedMethod SessionRequestHttpMethodInfo a signature where
    overloadedMethod = sessionRequestHttp

instance O.OverloadedMethodInfo SessionRequestHttpMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionRequestHttp",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionRequestHttp"
        })


#endif

-- method Session::request_http_uri
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "method"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an HTTP method" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uri"
--           , argType = TInterface Name { namespace = "Soup" , name = "URI" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupURI representing the URI to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Soup" , name = "RequestHTTP" })
-- throws : True
-- Skip return : False

foreign import ccall "soup_session_request_http_uri" soup_session_request_http_uri :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    CString ->                              -- method : TBasicType TUTF8
    Ptr Soup.URI.URI ->                     -- uri : TInterface (Name {namespace = "Soup", name = "URI"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Soup.RequestHTTP.RequestHTTP)

-- | Creates a t'GI.Soup.Objects.Request.Request' for retrieving /@uri@/, which must be an
-- \"http\" or \"https\" URI (or another protocol listed in /@session@/\'s
-- t'GI.Soup.Objects.Session.Session':@/http-aliases/@ or t'GI.Soup.Objects.Session.Session':@/https-aliases/@).
-- 
-- /Since: 2.42/
sessionRequestHttpUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> T.Text
    -- ^ /@method@/: an HTTP method
    -> Soup.URI.URI
    -- ^ /@uri@/: a t'GI.Soup.Structs.URI.URI' representing the URI to retrieve
    -> m Soup.RequestHTTP.RequestHTTP
    -- ^ __Returns:__ a new t'GI.Soup.Objects.RequestHTTP.RequestHTTP', or
    --   'P.Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/
sessionRequestHttpUri :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSession a) =>
a -> Text -> URI -> m RequestHTTP
sessionRequestHttpUri a
session Text
method URI
uri = IO RequestHTTP -> m RequestHTTP
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RequestHTTP -> m RequestHTTP)
-> IO RequestHTTP -> m RequestHTTP
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    CString
method' <- Text -> IO CString
textToCString Text
method
    Ptr URI
uri' <- URI -> IO (Ptr URI)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr URI
uri
    IO RequestHTTP -> IO () -> IO RequestHTTP
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr RequestHTTP
result <- (Ptr (Ptr GError) -> IO (Ptr RequestHTTP)) -> IO (Ptr RequestHTTP)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr RequestHTTP))
 -> IO (Ptr RequestHTTP))
-> (Ptr (Ptr GError) -> IO (Ptr RequestHTTP))
-> IO (Ptr RequestHTTP)
forall a b. (a -> b) -> a -> b
$ Ptr Session
-> CString -> Ptr URI -> Ptr (Ptr GError) -> IO (Ptr RequestHTTP)
soup_session_request_http_uri Ptr Session
session' CString
method' Ptr URI
uri'
        Text -> Ptr RequestHTTP -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sessionRequestHttpUri" Ptr RequestHTTP
result
        RequestHTTP
result' <- ((ManagedPtr RequestHTTP -> RequestHTTP)
-> Ptr RequestHTTP -> IO RequestHTTP
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr RequestHTTP -> RequestHTTP
Soup.RequestHTTP.RequestHTTP) Ptr RequestHTTP
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
        URI -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr URI
uri
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
method'
        RequestHTTP -> IO RequestHTTP
forall (m :: * -> *) a. Monad m => a -> m a
return RequestHTTP
result'
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
method'
     )

#if defined(ENABLE_OVERLOADING)
data SessionRequestHttpUriMethodInfo
instance (signature ~ (T.Text -> Soup.URI.URI -> m Soup.RequestHTTP.RequestHTTP), MonadIO m, IsSession a) => O.OverloadedMethod SessionRequestHttpUriMethodInfo a signature where
    overloadedMethod = sessionRequestHttpUri

instance O.OverloadedMethodInfo SessionRequestHttpUriMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionRequestHttpUri",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionRequestHttpUri"
        })


#endif

-- method Session::request_uri
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uri"
--           , argType = TInterface Name { namespace = "Soup" , name = "URI" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupURI representing the URI to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Soup" , name = "Request" })
-- throws : True
-- Skip return : False

foreign import ccall "soup_session_request_uri" soup_session_request_uri :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.URI.URI ->                     -- uri : TInterface (Name {namespace = "Soup", name = "URI"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Soup.Request.Request)

-- | Creates a t'GI.Soup.Objects.Request.Request' for retrieving /@uri@/.
-- 
-- /Since: 2.42/
sessionRequestUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> Soup.URI.URI
    -- ^ /@uri@/: a t'GI.Soup.Structs.URI.URI' representing the URI to retrieve
    -> m Soup.Request.Request
    -- ^ __Returns:__ a new t'GI.Soup.Objects.Request.Request', or
    --   'P.Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/
sessionRequestUri :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSession a) =>
a -> URI -> m Request
sessionRequestUri a
session URI
uri = IO Request -> m Request
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Request -> m Request) -> IO Request -> m Request
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr URI
uri' <- URI -> IO (Ptr URI)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr URI
uri
    IO Request -> IO () -> IO Request
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr Request
result <- (Ptr (Ptr GError) -> IO (Ptr Request)) -> IO (Ptr Request)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Request)) -> IO (Ptr Request))
-> (Ptr (Ptr GError) -> IO (Ptr Request)) -> IO (Ptr Request)
forall a b. (a -> b) -> a -> b
$ Ptr Session -> Ptr URI -> Ptr (Ptr GError) -> IO (Ptr Request)
soup_session_request_uri Ptr Session
session' Ptr URI
uri'
        Text -> Ptr Request -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sessionRequestUri" Ptr Request
result
        Request
result' <- ((ManagedPtr Request -> Request) -> Ptr Request -> IO Request
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Request -> Request
Soup.Request.Request) Ptr Request
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
        URI -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr URI
uri
        Request -> IO Request
forall (m :: * -> *) a. Monad m => a -> m a
return Request
result'
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SessionRequestUriMethodInfo
instance (signature ~ (Soup.URI.URI -> m Soup.Request.Request), MonadIO m, IsSession a) => O.OverloadedMethod SessionRequestUriMethodInfo a signature where
    overloadedMethod = sessionRequestUri

instance O.OverloadedMethodInfo SessionRequestUriMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionRequestUri",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionRequestUri"
        })


#endif

-- method Session::requeue_message
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the message to requeue"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_requeue_message" soup_session_requeue_message :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO ()

-- | This causes /@msg@/ to be placed back on the queue to be attempted
-- again.
sessionRequeueMessage ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@msg@/: the message to requeue
    -> m ()
sessionRequeueMessage :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsMessage b) =>
a -> b -> m ()
sessionRequeueMessage a
session b
msg = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
    Ptr Session -> Ptr Message -> IO ()
soup_session_requeue_message Ptr Session
session' Ptr Message
msg'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionRequeueMessageMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsSession a, Soup.Message.IsMessage b) => O.OverloadedMethod SessionRequeueMessageMethodInfo a signature where
    overloadedMethod = sessionRequeueMessage

instance O.OverloadedMethodInfo SessionRequeueMessageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionRequeueMessage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionRequeueMessage"
        })


#endif

-- method Session::send
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupMessage" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "InputStream" })
-- throws : True
-- Skip return : False

foreign import ccall "soup_session_send" soup_session_send :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Gio.InputStream.InputStream)

-- | Synchronously sends /@msg@/ and waits for the beginning of a response.
-- On success, a t'GI.Gio.Objects.InputStream.InputStream' will be returned which you can use to
-- read the response body. (\"Success\" here means only that an HTTP
-- response was received and understood; it does not necessarily mean
-- that a 2xx class status code was received.)
-- 
-- If non-'P.Nothing', /@cancellable@/ can be used to cancel the request;
-- 'GI.Soup.Objects.Session.sessionSend' will return a 'GI.Gio.Enums.IOErrorEnumCancelled' error. Note
-- that with requests that have side effects (eg,
-- \<literal>POST\<\/literal>, \<literal>PUT\<\/literal>,
-- \<literal>DELETE\<\/literal>) it is possible that you might cancel the
-- request after the server acts on it, but before it returns a
-- response, leaving the remote resource in an unknown state.
-- 
-- If /@msg@/ is requeued due to a redirect or authentication, the
-- initial (3xx\/401\/407) response body will be suppressed, and
-- 'GI.Soup.Objects.Session.sessionSend' will only return once a final response has been
-- received.
-- 
-- Contrast this method with 'GI.Soup.Objects.Session.sessionSendMessage', which also
-- synchronously sends a t'GI.Soup.Objects.Message.Message', but doesn\'t return until the
-- response has been completely read.
-- 
-- (Note that this method cannot be called on the deprecated
-- t'GI.Soup.Objects.SessionAsync.SessionAsync' subclass.)
-- 
-- /Since: 2.42/
sessionSend ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@msg@/: a t'GI.Soup.Objects.Message.Message'
    -> Maybe (c)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m Gio.InputStream.InputStream
    -- ^ __Returns:__ a t'GI.Gio.Objects.InputStream.InputStream' for reading the
    --   response body, or 'P.Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/
sessionSend :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSession a, IsMessage b,
 IsCancellable c) =>
a -> b -> Maybe c -> m InputStream
sessionSend a
session b
msg Maybe c
cancellable = IO InputStream -> m InputStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO InputStream -> m InputStream)
-> IO InputStream -> m InputStream
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
    Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
        Just c
jCancellable -> do
            Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    IO InputStream -> IO () -> IO InputStream
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr InputStream
result <- (Ptr (Ptr GError) -> IO (Ptr InputStream)) -> IO (Ptr InputStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr InputStream))
 -> IO (Ptr InputStream))
-> (Ptr (Ptr GError) -> IO (Ptr InputStream))
-> IO (Ptr InputStream)
forall a b. (a -> b) -> a -> b
$ Ptr Session
-> Ptr Message
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr InputStream)
soup_session_send Ptr Session
session' Ptr Message
msg' Ptr Cancellable
maybeCancellable
        Text -> Ptr InputStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sessionSend" Ptr InputStream
result
        InputStream
result' <- ((ManagedPtr InputStream -> InputStream)
-> Ptr InputStream -> IO InputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream) Ptr InputStream
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
        b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
        Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
        InputStream -> IO InputStream
forall (m :: * -> *) a. Monad m => a -> m a
return InputStream
result'
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SessionSendMethodInfo
instance (signature ~ (b -> Maybe (c) -> m Gio.InputStream.InputStream), MonadIO m, IsSession a, Soup.Message.IsMessage b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod SessionSendMethodInfo a signature where
    overloadedMethod = sessionSend

instance O.OverloadedMethodInfo SessionSendMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionSend",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionSend"
        })


#endif

-- method Session::send_async
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupMessage" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the callback to invoke"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 4
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data for @callback" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_send_async" soup_session_send_async :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Asynchronously sends /@msg@/ and waits for the beginning of a
-- response. When /@callback@/ is called, then either /@msg@/ has been sent,
-- and its response headers received, or else an error has occurred.
-- Call 'GI.Soup.Objects.Session.sessionSendFinish' to get a t'GI.Gio.Objects.InputStream.InputStream' for reading
-- the response body.
-- 
-- See 'GI.Soup.Objects.Session.sessionSend' for more details on the general semantics.
-- 
-- Contrast this method with 'GI.Soup.Objects.Session.sessionQueueMessage', which also
-- asynchronously sends a t'GI.Soup.Objects.Message.Message', but doesn\'t invoke its
-- callback until the response has been completely read.
-- 
-- (Note that this method cannot be called on the deprecated
-- t'GI.Soup.Objects.SessionSync.SessionSync' subclass, and can only be called on
-- t'GI.Soup.Objects.SessionAsync.SessionAsync' if you have set the
-- t'GI.Soup.Objects.Session.Session':@/use-thread-context/@ property.)
-- 
-- /Since: 2.42/
sessionSendAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@msg@/: a t'GI.Soup.Objects.Message.Message'
    -> Maybe (c)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable'
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: the callback to invoke
    -> m ()
sessionSendAsync :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSession a, IsMessage b,
 IsCancellable c) =>
a -> b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
sessionSendAsync a
session b
msg Maybe c
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
    Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
        Just c
jCancellable -> do
            Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
        Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just AsyncReadyCallback
jCallback -> do
            Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
            Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
            FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr Session
-> Ptr Message
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
soup_session_send_async Ptr Session
session' Ptr Message
msg' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
    Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionSendAsyncMethodInfo
instance (signature ~ (b -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSession a, Soup.Message.IsMessage b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod SessionSendAsyncMethodInfo a signature where
    overloadedMethod = sessionSendAsync

instance O.OverloadedMethodInfo SessionSendAsyncMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionSendAsync",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionSendAsync"
        })


#endif

-- method Session::send_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GAsyncResult passed to your callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "InputStream" })
-- throws : True
-- Skip return : False

foreign import ccall "soup_session_send_finish" soup_session_send_finish :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Gio.InputStream.InputStream)

-- | Gets the response to a 'GI.Soup.Objects.Session.sessionSendAsync' call and (if
-- successful), returns a t'GI.Gio.Objects.InputStream.InputStream' that can be used to read the
-- response body.
-- 
-- /Since: 2.42/
sessionSendFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@result@/: the t'GI.Gio.Interfaces.AsyncResult.AsyncResult' passed to your callback
    -> m Gio.InputStream.InputStream
    -- ^ __Returns:__ a t'GI.Gio.Objects.InputStream.InputStream' for reading the
    --   response body, or 'P.Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/
sessionSendFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsAsyncResult b) =>
a -> b -> m InputStream
sessionSendFinish a
session b
result_ = IO InputStream -> m InputStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO InputStream -> m InputStream)
-> IO InputStream -> m InputStream
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
    IO InputStream -> IO () -> IO InputStream
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr InputStream
result <- (Ptr (Ptr GError) -> IO (Ptr InputStream)) -> IO (Ptr InputStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr InputStream))
 -> IO (Ptr InputStream))
-> (Ptr (Ptr GError) -> IO (Ptr InputStream))
-> IO (Ptr InputStream)
forall a b. (a -> b) -> a -> b
$ Ptr Session
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr InputStream)
soup_session_send_finish Ptr Session
session' Ptr AsyncResult
result_'
        Text -> Ptr InputStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sessionSendFinish" Ptr InputStream
result
        InputStream
result' <- ((ManagedPtr InputStream -> InputStream)
-> Ptr InputStream -> IO InputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream) Ptr InputStream
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
        b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
        InputStream -> IO InputStream
forall (m :: * -> *) a. Monad m => a -> m a
return InputStream
result'
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SessionSendFinishMethodInfo
instance (signature ~ (b -> m Gio.InputStream.InputStream), MonadIO m, IsSession a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod SessionSendFinishMethodInfo a signature where
    overloadedMethod = sessionSendFinish

instance O.OverloadedMethodInfo SessionSendFinishMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionSendFinish",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionSendFinish"
        })


#endif

-- method Session::send_message
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the message to send"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_send_message" soup_session_send_message :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO Word32

-- | Synchronously send /@msg@/. This call will not return until the
-- transfer is finished successfully or there is an unrecoverable
-- error.
-- 
-- Unlike with 'GI.Soup.Objects.Session.sessionQueueMessage', /@msg@/ is not freed upon
-- return.
-- 
-- (Note that if you call this method on a t'GI.Soup.Objects.SessionAsync.SessionAsync', it will
-- still use asynchronous I\/O internally, running the glib main loop
-- to process the message, which may also cause other events to be
-- processed.)
-- 
-- Contrast this method with 'GI.Soup.Objects.Session.sessionSend', which also
-- synchronously sends a message, but returns before reading the
-- response body, and allows you to read the response via a
-- t'GI.Gio.Objects.InputStream.InputStream'.
sessionSendMessage ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@msg@/: the message to send
    -> m Word32
    -- ^ __Returns:__ the HTTP status code of the response
sessionSendMessage :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsMessage b) =>
a -> b -> m Word32
sessionSendMessage a
session b
msg = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
    Word32
result <- Ptr Session -> Ptr Message -> IO Word32
soup_session_send_message Ptr Session
session' Ptr Message
msg'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data SessionSendMessageMethodInfo
instance (signature ~ (b -> m Word32), MonadIO m, IsSession a, Soup.Message.IsMessage b) => O.OverloadedMethod SessionSendMessageMethodInfo a signature where
    overloadedMethod = sessionSendMessage

instance O.OverloadedMethodInfo SessionSendMessageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionSendMessage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionSendMessage"
        })


#endif

-- method Session::steal_connection
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the message whose connection is to be stolen"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "IOStream" })
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_steal_connection" soup_session_steal_connection :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO (Ptr Gio.IOStream.IOStream)

-- | \"Steals\" the HTTP connection associated with /@msg@/ from /@session@/.
-- This happens immediately, regardless of the current state of the
-- connection, and /@msg@/\'s callback will not be called. You can steal
-- the connection from a t'GI.Soup.Objects.Message.Message' signal handler if you need to
-- wait for part or all of the response to be received first.
-- 
-- Calling this function may cause /@msg@/ to be freed if you are not
-- holding any other reference to it.
-- 
-- /Since: 2.50/
sessionStealConnection ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@msg@/: the message whose connection is to be stolen
    -> m Gio.IOStream.IOStream
    -- ^ __Returns:__ the t'GI.Gio.Objects.IOStream.IOStream' formerly associated
    --   with /@msg@/ (or 'P.Nothing' if /@msg@/ was no longer associated with a
    --   connection). No guarantees are made about what kind of t'GI.Gio.Objects.IOStream.IOStream'
    --   is returned.
sessionStealConnection :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsMessage b) =>
a -> b -> m IOStream
sessionStealConnection a
session b
msg = IO IOStream -> m IOStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IOStream -> m IOStream) -> IO IOStream -> m IOStream
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
    Ptr IOStream
result <- Ptr Session -> Ptr Message -> IO (Ptr IOStream)
soup_session_steal_connection Ptr Session
session' Ptr Message
msg'
    Text -> Ptr IOStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sessionStealConnection" Ptr IOStream
result
    IOStream
result' <- ((ManagedPtr IOStream -> IOStream) -> Ptr IOStream -> IO IOStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr IOStream -> IOStream
Gio.IOStream.IOStream) Ptr IOStream
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
    IOStream -> IO IOStream
forall (m :: * -> *) a. Monad m => a -> m a
return IOStream
result'

#if defined(ENABLE_OVERLOADING)
data SessionStealConnectionMethodInfo
instance (signature ~ (b -> m Gio.IOStream.IOStream), MonadIO m, IsSession a, Soup.Message.IsMessage b) => O.OverloadedMethod SessionStealConnectionMethodInfo a signature where
    overloadedMethod = sessionStealConnection

instance O.OverloadedMethodInfo SessionStealConnectionMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionStealConnection",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionStealConnection"
        })


#endif

-- method Session::unpause_message
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupMessage currently running on @session"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_unpause_message" soup_session_unpause_message :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO ()

-- | Resumes HTTP I\/O on /@msg@/. Use this to resume after calling
-- 'GI.Soup.Objects.Session.sessionPauseMessage'.
-- 
-- If /@msg@/ is being sent via blocking I\/O, this will resume reading or
-- writing immediately. If /@msg@/ is using non-blocking I\/O, then
-- reading or writing won\'t resume until you return to the main loop.
-- 
-- This may only be called for asynchronous messages (those sent on a
-- t'GI.Soup.Objects.SessionAsync.SessionAsync' or using 'GI.Soup.Objects.Session.sessionQueueMessage').
sessionUnpauseMessage ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@msg@/: a t'GI.Soup.Objects.Message.Message' currently running on /@session@/
    -> m ()
sessionUnpauseMessage :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsMessage b) =>
a -> b -> m ()
sessionUnpauseMessage a
session b
msg = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
    Ptr Session -> Ptr Message -> IO ()
soup_session_unpause_message Ptr Session
session' Ptr Message
msg'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionUnpauseMessageMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsSession a, Soup.Message.IsMessage b) => O.OverloadedMethod SessionUnpauseMessageMethodInfo a signature where
    overloadedMethod = sessionUnpauseMessage

instance O.OverloadedMethodInfo SessionUnpauseMessageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionUnpauseMessage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionUnpauseMessage"
        })


#endif

-- method Session::websocket_connect_async
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "#SoupMessage indicating the WebSocket server to connect to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "origin"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "origin of the connection"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "protocols"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a\n  %NULL-terminated array of protocols supported"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the callback to invoke"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 6
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data for @callback" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_websocket_connect_async" soup_session_websocket_connect_async :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    CString ->                              -- origin : TBasicType TUTF8
    Ptr CString ->                          -- protocols : TCArray True (-1) (-1) (TBasicType TUTF8)
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Asynchronously creates a t'GI.Soup.Objects.WebsocketConnection.WebsocketConnection' to communicate
-- with a remote server.
-- 
-- All necessary WebSocket-related headers will be added to /@msg@/, and
-- it will then be sent and asynchronously processed normally
-- (including handling of redirection and HTTP authentication).
-- 
-- If the server returns \"101 Switching Protocols\", then /@msg@/\'s status
-- code and response headers will be updated, and then the WebSocket
-- handshake will be completed. On success,
-- 'GI.Soup.Objects.Session.sessionWebsocketConnectFinish' will return a new
-- t'GI.Soup.Objects.WebsocketConnection.WebsocketConnection'. On failure it will return a t'GError'.
-- 
-- If the server returns a status other than \"101 Switching
-- Protocols\", then /@msg@/ will contain the complete response headers
-- and body from the server\'s response, and
-- 'GI.Soup.Objects.Session.sessionWebsocketConnectFinish' will return
-- 'GI.Soup.Enums.WebsocketErrorNotWebsocket'.
-- 
-- /Since: 2.50/
sessionWebsocketConnectAsync ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@msg@/: t'GI.Soup.Objects.Message.Message' indicating the WebSocket server to connect to
    -> Maybe (T.Text)
    -- ^ /@origin@/: origin of the connection
    -> Maybe ([T.Text])
    -- ^ /@protocols@/: a
    --   'P.Nothing'-terminated array of protocols supported
    -> Maybe (c)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable'
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: the callback to invoke
    -> m ()
sessionWebsocketConnectAsync :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSession a, IsMessage b,
 IsCancellable c) =>
a
-> b
-> Maybe Text
-> Maybe [Text]
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
sessionWebsocketConnectAsync a
session b
msg Maybe Text
origin Maybe [Text]
protocols Maybe c
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
    CString
maybeOrigin <- case Maybe Text
origin of
        Maybe Text
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
        Just Text
jOrigin -> do
            CString
jOrigin' <- Text -> IO CString
textToCString Text
jOrigin
            CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jOrigin'
    Ptr CString
maybeProtocols <- case Maybe [Text]
protocols of
        Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
        Just [Text]
jProtocols -> do
            Ptr CString
jProtocols' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jProtocols
            Ptr CString -> IO (Ptr CString)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jProtocols'
    Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
        Just c
jCancellable -> do
            Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
        Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just AsyncReadyCallback
jCallback -> do
            Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
            Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
            FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr Session
-> Ptr Message
-> CString
-> Ptr CString
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
soup_session_websocket_connect_async Ptr Session
session' Ptr Message
msg' CString
maybeOrigin Ptr CString
maybeProtocols Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
    Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeOrigin
    (CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeProtocols
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeProtocols
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data SessionWebsocketConnectAsyncMethodInfo
instance (signature ~ (b -> Maybe (T.Text) -> Maybe ([T.Text]) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSession a, Soup.Message.IsMessage b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod SessionWebsocketConnectAsyncMethodInfo a signature where
    overloadedMethod = sessionWebsocketConnectAsync

instance O.OverloadedMethodInfo SessionWebsocketConnectAsyncMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionWebsocketConnectAsync",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionWebsocketConnectAsync"
        })


#endif

-- method Session::websocket_connect_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GAsyncResult passed to your callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "Soup" , name = "WebsocketConnection" })
-- throws : True
-- Skip return : False

foreign import ccall "soup_session_websocket_connect_finish" soup_session_websocket_connect_finish :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Soup.WebsocketConnection.WebsocketConnection)

-- | Gets the t'GI.Soup.Objects.WebsocketConnection.WebsocketConnection' response to a
-- 'GI.Soup.Objects.Session.sessionWebsocketConnectAsync' call and (if successful),
-- returns a t'GI.Soup.Objects.WebsocketConnection.WebsocketConnection' that can be used to communicate
-- with the server.
-- 
-- /Since: 2.50/
sessionWebsocketConnectFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@result@/: the t'GI.Gio.Interfaces.AsyncResult.AsyncResult' passed to your callback
    -> m Soup.WebsocketConnection.WebsocketConnection
    -- ^ __Returns:__ a new t'GI.Soup.Objects.WebsocketConnection.WebsocketConnection', or
    --   'P.Nothing' on error. /(Can throw 'Data.GI.Base.GError.GError')/
sessionWebsocketConnectFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsAsyncResult b) =>
a -> b -> m WebsocketConnection
sessionWebsocketConnectFinish a
session b
result_ = IO WebsocketConnection -> m WebsocketConnection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WebsocketConnection -> m WebsocketConnection)
-> IO WebsocketConnection -> m WebsocketConnection
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
    IO WebsocketConnection -> IO () -> IO WebsocketConnection
forall a b. IO a -> IO b -> IO a
onException (do
        Ptr WebsocketConnection
result <- (Ptr (Ptr GError) -> IO (Ptr WebsocketConnection))
-> IO (Ptr WebsocketConnection)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr WebsocketConnection))
 -> IO (Ptr WebsocketConnection))
-> (Ptr (Ptr GError) -> IO (Ptr WebsocketConnection))
-> IO (Ptr WebsocketConnection)
forall a b. (a -> b) -> a -> b
$ Ptr Session
-> Ptr AsyncResult
-> Ptr (Ptr GError)
-> IO (Ptr WebsocketConnection)
soup_session_websocket_connect_finish Ptr Session
session' Ptr AsyncResult
result_'
        Text -> Ptr WebsocketConnection -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sessionWebsocketConnectFinish" Ptr WebsocketConnection
result
        WebsocketConnection
result' <- ((ManagedPtr WebsocketConnection -> WebsocketConnection)
-> Ptr WebsocketConnection -> IO WebsocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr WebsocketConnection -> WebsocketConnection
Soup.WebsocketConnection.WebsocketConnection) Ptr WebsocketConnection
result
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
        b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
        WebsocketConnection -> IO WebsocketConnection
forall (m :: * -> *) a. Monad m => a -> m a
return WebsocketConnection
result'
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data SessionWebsocketConnectFinishMethodInfo
instance (signature ~ (b -> m Soup.WebsocketConnection.WebsocketConnection), MonadIO m, IsSession a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod SessionWebsocketConnectFinishMethodInfo a signature where
    overloadedMethod = sessionWebsocketConnectFinish

instance O.OverloadedMethodInfo SessionWebsocketConnectFinishMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionWebsocketConnectFinish",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionWebsocketConnectFinish"
        })


#endif

-- method Session::would_redirect
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "session"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Session" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupSession" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "msg"
--           , argType =
--               TInterface Name { namespace = "Soup" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #SoupMessage that has response headers"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "soup_session_would_redirect" soup_session_would_redirect :: 
    Ptr Session ->                          -- session : TInterface (Name {namespace = "Soup", name = "Session"})
    Ptr Soup.Message.Message ->             -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO CInt

-- | Checks if /@msg@/ contains a response that would cause /@session@/ to
-- redirect it to a new URL (ignoring /@msg@/\'s 'GI.Soup.Flags.MessageFlagsNoRedirect'
-- flag, and the number of times it has already been redirected).
-- 
-- /Since: 2.38/
sessionWouldRedirect ::
    (B.CallStack.HasCallStack, MonadIO m, IsSession a, Soup.Message.IsMessage b) =>
    a
    -- ^ /@session@/: a t'GI.Soup.Objects.Session.Session'
    -> b
    -- ^ /@msg@/: a t'GI.Soup.Objects.Message.Message' that has response headers
    -> m Bool
    -- ^ __Returns:__ whether /@msg@/ would be redirected
sessionWouldRedirect :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSession a, IsMessage b) =>
a -> b -> m Bool
sessionWouldRedirect a
session b
msg = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Session
session' <- a -> IO (Ptr Session)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
session
    Ptr Message
msg' <- b -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
msg
    CInt
result <- Ptr Session -> Ptr Message -> IO CInt
soup_session_would_redirect Ptr Session
session' Ptr Message
msg'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
session
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
msg
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data SessionWouldRedirectMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsSession a, Soup.Message.IsMessage b) => O.OverloadedMethod SessionWouldRedirectMethodInfo a signature where
    overloadedMethod = sessionWouldRedirect

instance O.OverloadedMethodInfo SessionWouldRedirectMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.Session.sessionWouldRedirect",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.25/docs/GI-Soup-Objects-Session.html#v:sessionWouldRedirect"
        })


#endif