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

Represents an HTTP message being sent or received.

/@statusCode@/ will normally be a 'GI.Soup.Enums.Status' value, eg,
'GI.Soup.Enums.StatusOk', though of course it might actually be an unknown
status code. /@reasonPhrase@/ is the actual text returned from the
server, which may or may not correspond to the \"standard\"
description of /@statusCode@/. At any rate, it is almost certainly
not localized, and not very descriptive even if it is in the user\'s
language; you should not use /@reasonPhrase@/ in user-visible
messages. Rather, you should look at /@statusCode@/, and determine an
end-user-appropriate message based on that and on what you were
trying to do.

As described in the 'GI.Soup.Structs.MessageBody.MessageBody' documentation, the
/@requestBody@/ and /@responseBody@/ \<literal>data\<\/literal> fields
will not necessarily be filled in at all times. When the body
fields are filled in, they will be terminated with a \'\\0\' byte
(which is not included in the \<literal>length\<\/literal>), so you
can use them as ordinary C strings (assuming that you know that the
body doesn\'t have any other \'\\0\' bytes).

For a client-side 'GI.Soup.Objects.Message.Message', /@requestBody@/\'s
\<literal>data\<\/literal> is usually filled in right before libsoup
writes the request to the network, but you should not count on
this; use 'GI.Soup.Structs.MessageBody.messageBodyFlatten' if you want to ensure that
\<literal>data\<\/literal> is filled in. If you are not using
'GI.Soup.Objects.Request.Request' to read the response, then /@responseBody@/\'s
\<literal>data\<\/literal> will be filled in before
'GI.Soup.Objects.Message.Message'::@/finished/@ is emitted. (If you are using 'GI.Soup.Objects.Request.Request',
then the message body is not accumulated by default, so
/@responseBody@/\'s \<literal>data\<\/literal> will always be 'Nothing'.)

For a server-side 'GI.Soup.Objects.Message.Message', /@requestBody@/\'s @/data/@ will be
filled in before 'GI.Soup.Objects.Message.Message'::@/got_body/@ is emitted.

To prevent the @/data/@ field from being filled in at all (eg, if you
are handling the data from a 'GI.Soup.Objects.Message.Message'::@/got_chunk/@, and so don\'t
need to see it all at the end), call
'GI.Soup.Structs.MessageBody.messageBodySetAccumulate' on /@responseBody@/ or
/@requestBody@/ as appropriate, passing 'False'.
-}

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

module GI.Soup.Objects.Message
    (

-- * Exported types
    Message(..)                             ,
    IsMessage                               ,
    toMessage                               ,
    noMessage                               ,


 -- * Methods
-- ** contentSniffed #method:contentSniffed#

#if ENABLE_OVERLOADING
    MessageContentSniffedMethodInfo         ,
#endif
    messageContentSniffed                   ,


-- ** disableFeature #method:disableFeature#

#if ENABLE_OVERLOADING
    MessageDisableFeatureMethodInfo         ,
#endif
    messageDisableFeature                   ,


-- ** finished #method:finished#

#if ENABLE_OVERLOADING
    MessageFinishedMethodInfo               ,
#endif
    messageFinished                         ,


-- ** getAddress #method:getAddress#

#if ENABLE_OVERLOADING
    MessageGetAddressMethodInfo             ,
#endif
    messageGetAddress                       ,


-- ** getFirstParty #method:getFirstParty#

#if ENABLE_OVERLOADING
    MessageGetFirstPartyMethodInfo          ,
#endif
    messageGetFirstParty                    ,


-- ** getFlags #method:getFlags#

#if ENABLE_OVERLOADING
    MessageGetFlagsMethodInfo               ,
#endif
    messageGetFlags                         ,


-- ** getHttpVersion #method:getHttpVersion#

#if ENABLE_OVERLOADING
    MessageGetHttpVersionMethodInfo         ,
#endif
    messageGetHttpVersion                   ,


-- ** getHttpsStatus #method:getHttpsStatus#

#if ENABLE_OVERLOADING
    MessageGetHttpsStatusMethodInfo         ,
#endif
    messageGetHttpsStatus                   ,


-- ** getPriority #method:getPriority#

#if ENABLE_OVERLOADING
    MessageGetPriorityMethodInfo            ,
#endif
    messageGetPriority                      ,


-- ** getSoupRequest #method:getSoupRequest#

#if ENABLE_OVERLOADING
    MessageGetSoupRequestMethodInfo         ,
#endif
    messageGetSoupRequest                   ,


-- ** getUri #method:getUri#

#if ENABLE_OVERLOADING
    MessageGetUriMethodInfo                 ,
#endif
    messageGetUri                           ,


-- ** gotBody #method:gotBody#

#if ENABLE_OVERLOADING
    MessageGotBodyMethodInfo                ,
#endif
    messageGotBody                          ,


-- ** gotChunk #method:gotChunk#

#if ENABLE_OVERLOADING
    MessageGotChunkMethodInfo               ,
#endif
    messageGotChunk                         ,


-- ** gotHeaders #method:gotHeaders#

#if ENABLE_OVERLOADING
    MessageGotHeadersMethodInfo             ,
#endif
    messageGotHeaders                       ,


-- ** gotInformational #method:gotInformational#

#if ENABLE_OVERLOADING
    MessageGotInformationalMethodInfo       ,
#endif
    messageGotInformational                 ,


-- ** isKeepalive #method:isKeepalive#

#if ENABLE_OVERLOADING
    MessageIsKeepaliveMethodInfo            ,
#endif
    messageIsKeepalive                      ,


-- ** new #method:new#

    messageNew                              ,


-- ** newFromUri #method:newFromUri#

    messageNewFromUri                       ,


-- ** restarted #method:restarted#

#if ENABLE_OVERLOADING
    MessageRestartedMethodInfo              ,
#endif
    messageRestarted                        ,


-- ** setChunkAllocator #method:setChunkAllocator#

#if ENABLE_OVERLOADING
    MessageSetChunkAllocatorMethodInfo      ,
#endif
    messageSetChunkAllocator                ,


-- ** setFirstParty #method:setFirstParty#

#if ENABLE_OVERLOADING
    MessageSetFirstPartyMethodInfo          ,
#endif
    messageSetFirstParty                    ,


-- ** setFlags #method:setFlags#

#if ENABLE_OVERLOADING
    MessageSetFlagsMethodInfo               ,
#endif
    messageSetFlags                         ,


-- ** setHttpVersion #method:setHttpVersion#

#if ENABLE_OVERLOADING
    MessageSetHttpVersionMethodInfo         ,
#endif
    messageSetHttpVersion                   ,


-- ** setPriority #method:setPriority#

#if ENABLE_OVERLOADING
    MessageSetPriorityMethodInfo            ,
#endif
    messageSetPriority                      ,


-- ** setRedirect #method:setRedirect#

#if ENABLE_OVERLOADING
    MessageSetRedirectMethodInfo            ,
#endif
    messageSetRedirect                      ,


-- ** setRequest #method:setRequest#

#if ENABLE_OVERLOADING
    MessageSetRequestMethodInfo             ,
#endif
    messageSetRequest                       ,


-- ** setResponse #method:setResponse#

#if ENABLE_OVERLOADING
    MessageSetResponseMethodInfo            ,
#endif
    messageSetResponse                      ,


-- ** setStatus #method:setStatus#

#if ENABLE_OVERLOADING
    MessageSetStatusMethodInfo              ,
#endif
    messageSetStatus                        ,


-- ** setStatusFull #method:setStatusFull#

#if ENABLE_OVERLOADING
    MessageSetStatusFullMethodInfo          ,
#endif
    messageSetStatusFull                    ,


-- ** setUri #method:setUri#

#if ENABLE_OVERLOADING
    MessageSetUriMethodInfo                 ,
#endif
    messageSetUri                           ,


-- ** starting #method:starting#

#if ENABLE_OVERLOADING
    MessageStartingMethodInfo               ,
#endif
    messageStarting                         ,


-- ** wroteBody #method:wroteBody#

#if ENABLE_OVERLOADING
    MessageWroteBodyMethodInfo              ,
#endif
    messageWroteBody                        ,


-- ** wroteBodyData #method:wroteBodyData#

#if ENABLE_OVERLOADING
    MessageWroteBodyDataMethodInfo          ,
#endif
    messageWroteBodyData                    ,


-- ** wroteChunk #method:wroteChunk#

#if ENABLE_OVERLOADING
    MessageWroteChunkMethodInfo             ,
#endif
    messageWroteChunk                       ,


-- ** wroteHeaders #method:wroteHeaders#

#if ENABLE_OVERLOADING
    MessageWroteHeadersMethodInfo           ,
#endif
    messageWroteHeaders                     ,


-- ** wroteInformational #method:wroteInformational#

#if ENABLE_OVERLOADING
    MessageWroteInformationalMethodInfo     ,
#endif
    messageWroteInformational               ,




 -- * Properties
-- ** firstParty #attr:firstParty#
{- | The 'GI.Soup.Structs.URI.URI' loaded in the application when the message was
queued.

/Since: 2.30/
-}
#if ENABLE_OVERLOADING
    MessageFirstPartyPropertyInfo           ,
#endif
    constructMessageFirstParty              ,
    getMessageFirstParty                    ,
#if ENABLE_OVERLOADING
    messageFirstParty                       ,
#endif
    setMessageFirstParty                    ,


-- ** flags #attr:flags#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    MessageFlagsPropertyInfo                ,
#endif
    constructMessageFlags                   ,
    getMessageFlags                         ,
#if ENABLE_OVERLOADING
    messageFlags                            ,
#endif
    setMessageFlags                         ,


-- ** httpVersion #attr:httpVersion#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    MessageHttpVersionPropertyInfo          ,
#endif
    constructMessageHttpVersion             ,
    getMessageHttpVersion                   ,
#if ENABLE_OVERLOADING
    messageHttpVersion                      ,
#endif
    setMessageHttpVersion                   ,


-- ** method #attr:method#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    MessageMethodPropertyInfo               ,
#endif
    clearMessageMethod                      ,
    constructMessageMethod                  ,
    getMessageMethod                        ,
#if ENABLE_OVERLOADING
    messageMethod                           ,
#endif
    setMessageMethod                        ,


-- ** priority #attr:priority#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    MessagePriorityPropertyInfo             ,
#endif
    constructMessagePriority                ,
    getMessagePriority                      ,
#if ENABLE_OVERLOADING
    messagePriority                         ,
#endif
    setMessagePriority                      ,


-- ** reasonPhrase #attr:reasonPhrase#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    MessageReasonPhrasePropertyInfo         ,
#endif
    clearMessageReasonPhrase                ,
    constructMessageReasonPhrase            ,
    getMessageReasonPhrase                  ,
#if ENABLE_OVERLOADING
    messageReasonPhrase                     ,
#endif
    setMessageReasonPhrase                  ,


-- ** requestBody #attr:requestBody#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    MessageRequestBodyPropertyInfo          ,
#endif
    getMessageRequestBody                   ,
#if ENABLE_OVERLOADING
    messageRequestBody                      ,
#endif


-- ** requestBodyData #attr:requestBodyData#
{- | The message\'s HTTP request body, as a 'GI.GLib.Structs.Bytes.Bytes'.

/Since: 2.46/
-}
#if ENABLE_OVERLOADING
    MessageRequestBodyDataPropertyInfo      ,
#endif
    getMessageRequestBodyData               ,
#if ENABLE_OVERLOADING
    messageRequestBodyData                  ,
#endif


-- ** requestHeaders #attr:requestHeaders#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    MessageRequestHeadersPropertyInfo       ,
#endif
    getMessageRequestHeaders                ,
#if ENABLE_OVERLOADING
    messageRequestHeaders                   ,
#endif


-- ** responseBody #attr:responseBody#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    MessageResponseBodyPropertyInfo         ,
#endif
    getMessageResponseBody                  ,
#if ENABLE_OVERLOADING
    messageResponseBody                     ,
#endif


-- ** responseBodyData #attr:responseBodyData#
{- | The message\'s HTTP response body, as a 'GI.GLib.Structs.Bytes.Bytes'.

/Since: 2.46/
-}
#if ENABLE_OVERLOADING
    MessageResponseBodyDataPropertyInfo     ,
#endif
    getMessageResponseBodyData              ,
#if ENABLE_OVERLOADING
    messageResponseBodyData                 ,
#endif


-- ** responseHeaders #attr:responseHeaders#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    MessageResponseHeadersPropertyInfo      ,
#endif
    getMessageResponseHeaders               ,
#if ENABLE_OVERLOADING
    messageResponseHeaders                  ,
#endif


-- ** serverSide #attr:serverSide#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    MessageServerSidePropertyInfo           ,
#endif
    constructMessageServerSide              ,
    getMessageServerSide                    ,
#if ENABLE_OVERLOADING
    messageServerSide                       ,
#endif


-- ** statusCode #attr:statusCode#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    MessageStatusCodePropertyInfo           ,
#endif
    constructMessageStatusCode              ,
    getMessageStatusCode                    ,
#if ENABLE_OVERLOADING
    messageStatusCode                       ,
#endif
    setMessageStatusCode                    ,


-- ** tlsCertificate #attr:tlsCertificate#
{- | The 'GI.Gio.Objects.TlsCertificate.TlsCertificate' associated with the message

/Since: 2.34/
-}
#if ENABLE_OVERLOADING
    MessageTlsCertificatePropertyInfo       ,
#endif
    clearMessageTlsCertificate              ,
    constructMessageTlsCertificate          ,
    getMessageTlsCertificate                ,
#if ENABLE_OVERLOADING
    messageTlsCertificate                   ,
#endif
    setMessageTlsCertificate                ,


-- ** tlsErrors #attr:tlsErrors#
{- | The verification errors on 'GI.Soup.Objects.Message.Message':@/tls-certificate/@

/Since: 2.34/
-}
#if ENABLE_OVERLOADING
    MessageTlsErrorsPropertyInfo            ,
#endif
    constructMessageTlsErrors               ,
    getMessageTlsErrors                     ,
#if ENABLE_OVERLOADING
    messageTlsErrors                        ,
#endif
    setMessageTlsErrors                     ,


-- ** uri #attr:uri#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    MessageUriPropertyInfo                  ,
#endif
    constructMessageUri                     ,
    getMessageUri                           ,
#if ENABLE_OVERLOADING
    messageUri                              ,
#endif
    setMessageUri                           ,




 -- * Signals
-- ** contentSniffed #signal:contentSniffed#

    C_MessageContentSniffedCallback         ,
    MessageContentSniffedCallback           ,
#if ENABLE_OVERLOADING
    MessageContentSniffedSignalInfo         ,
#endif
    afterMessageContentSniffed              ,
    genClosure_MessageContentSniffed        ,
    mk_MessageContentSniffedCallback        ,
    noMessageContentSniffedCallback         ,
    onMessageContentSniffed                 ,
    wrap_MessageContentSniffedCallback      ,


-- ** finished #signal:finished#

    C_MessageFinishedCallback               ,
    MessageFinishedCallback                 ,
#if ENABLE_OVERLOADING
    MessageFinishedSignalInfo               ,
#endif
    afterMessageFinished                    ,
    genClosure_MessageFinished              ,
    mk_MessageFinishedCallback              ,
    noMessageFinishedCallback               ,
    onMessageFinished                       ,
    wrap_MessageFinishedCallback            ,


-- ** gotBody #signal:gotBody#

    C_MessageGotBodyCallback                ,
    MessageGotBodyCallback                  ,
#if ENABLE_OVERLOADING
    MessageGotBodySignalInfo                ,
#endif
    afterMessageGotBody                     ,
    genClosure_MessageGotBody               ,
    mk_MessageGotBodyCallback               ,
    noMessageGotBodyCallback                ,
    onMessageGotBody                        ,
    wrap_MessageGotBodyCallback             ,


-- ** gotChunk #signal:gotChunk#

    C_MessageGotChunkCallback               ,
    MessageGotChunkCallback                 ,
#if ENABLE_OVERLOADING
    MessageGotChunkSignalInfo               ,
#endif
    afterMessageGotChunk                    ,
    genClosure_MessageGotChunk              ,
    mk_MessageGotChunkCallback              ,
    noMessageGotChunkCallback               ,
    onMessageGotChunk                       ,
    wrap_MessageGotChunkCallback            ,


-- ** gotHeaders #signal:gotHeaders#

    C_MessageGotHeadersCallback             ,
    MessageGotHeadersCallback               ,
#if ENABLE_OVERLOADING
    MessageGotHeadersSignalInfo             ,
#endif
    afterMessageGotHeaders                  ,
    genClosure_MessageGotHeaders            ,
    mk_MessageGotHeadersCallback            ,
    noMessageGotHeadersCallback             ,
    onMessageGotHeaders                     ,
    wrap_MessageGotHeadersCallback          ,


-- ** gotInformational #signal:gotInformational#

    C_MessageGotInformationalCallback       ,
    MessageGotInformationalCallback         ,
#if ENABLE_OVERLOADING
    MessageGotInformationalSignalInfo       ,
#endif
    afterMessageGotInformational            ,
    genClosure_MessageGotInformational      ,
    mk_MessageGotInformationalCallback      ,
    noMessageGotInformationalCallback       ,
    onMessageGotInformational               ,
    wrap_MessageGotInformationalCallback    ,


-- ** networkEvent #signal:networkEvent#

    C_MessageNetworkEventCallback           ,
    MessageNetworkEventCallback             ,
#if ENABLE_OVERLOADING
    MessageNetworkEventSignalInfo           ,
#endif
    afterMessageNetworkEvent                ,
    genClosure_MessageNetworkEvent          ,
    mk_MessageNetworkEventCallback          ,
    noMessageNetworkEventCallback           ,
    onMessageNetworkEvent                   ,
    wrap_MessageNetworkEventCallback        ,


-- ** restarted #signal:restarted#

    C_MessageRestartedCallback              ,
    MessageRestartedCallback                ,
#if ENABLE_OVERLOADING
    MessageRestartedSignalInfo              ,
#endif
    afterMessageRestarted                   ,
    genClosure_MessageRestarted             ,
    mk_MessageRestartedCallback             ,
    noMessageRestartedCallback              ,
    onMessageRestarted                      ,
    wrap_MessageRestartedCallback           ,


-- ** starting #signal:starting#

    C_MessageStartingCallback               ,
    MessageStartingCallback                 ,
#if ENABLE_OVERLOADING
    MessageStartingSignalInfo               ,
#endif
    afterMessageStarting                    ,
    genClosure_MessageStarting              ,
    mk_MessageStartingCallback              ,
    noMessageStartingCallback               ,
    onMessageStarting                       ,
    wrap_MessageStartingCallback            ,


-- ** wroteBody #signal:wroteBody#

    C_MessageWroteBodyCallback              ,
    MessageWroteBodyCallback                ,
#if ENABLE_OVERLOADING
    MessageWroteBodySignalInfo              ,
#endif
    afterMessageWroteBody                   ,
    genClosure_MessageWroteBody             ,
    mk_MessageWroteBodyCallback             ,
    noMessageWroteBodyCallback              ,
    onMessageWroteBody                      ,
    wrap_MessageWroteBodyCallback           ,


-- ** wroteBodyData #signal:wroteBodyData#

    C_MessageWroteBodyDataCallback          ,
    MessageWroteBodyDataCallback            ,
#if ENABLE_OVERLOADING
    MessageWroteBodyDataSignalInfo          ,
#endif
    afterMessageWroteBodyData               ,
    genClosure_MessageWroteBodyData         ,
    mk_MessageWroteBodyDataCallback         ,
    noMessageWroteBodyDataCallback          ,
    onMessageWroteBodyData                  ,
    wrap_MessageWroteBodyDataCallback       ,


-- ** wroteChunk #signal:wroteChunk#

    C_MessageWroteChunkCallback             ,
    MessageWroteChunkCallback               ,
#if ENABLE_OVERLOADING
    MessageWroteChunkSignalInfo             ,
#endif
    afterMessageWroteChunk                  ,
    genClosure_MessageWroteChunk            ,
    mk_MessageWroteChunkCallback            ,
    noMessageWroteChunkCallback             ,
    onMessageWroteChunk                     ,
    wrap_MessageWroteChunkCallback          ,


-- ** wroteHeaders #signal:wroteHeaders#

    C_MessageWroteHeadersCallback           ,
    MessageWroteHeadersCallback             ,
#if ENABLE_OVERLOADING
    MessageWroteHeadersSignalInfo           ,
#endif
    afterMessageWroteHeaders                ,
    genClosure_MessageWroteHeaders          ,
    mk_MessageWroteHeadersCallback          ,
    noMessageWroteHeadersCallback           ,
    onMessageWroteHeaders                   ,
    wrap_MessageWroteHeadersCallback        ,


-- ** wroteInformational #signal:wroteInformational#

    C_MessageWroteInformationalCallback     ,
    MessageWroteInformationalCallback       ,
#if ENABLE_OVERLOADING
    MessageWroteInformationalSignalInfo     ,
#endif
    afterMessageWroteInformational          ,
    genClosure_MessageWroteInformational    ,
    mk_MessageWroteInformationalCallback    ,
    noMessageWroteInformationalCallback     ,
    onMessageWroteInformational             ,
    wrap_MessageWroteInformationalCallback  ,




    ) where

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

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

import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Enums as Gio.Enums
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Objects.IOStream as Gio.IOStream
import qualified GI.Gio.Objects.TlsCertificate as Gio.TlsCertificate
import qualified GI.Soup.Callbacks as Soup.Callbacks
import {-# SOURCE #-} qualified GI.Soup.Enums as Soup.Enums
import {-# SOURCE #-} qualified GI.Soup.Flags as Soup.Flags
import {-# SOURCE #-} qualified GI.Soup.Objects.Address as Soup.Address
import {-# SOURCE #-} qualified GI.Soup.Objects.Request as Soup.Request
import {-# SOURCE #-} qualified GI.Soup.Structs.Buffer as Soup.Buffer
import {-# SOURCE #-} qualified GI.Soup.Structs.MessageBody as Soup.MessageBody
import {-# SOURCE #-} qualified GI.Soup.Structs.MessageHeaders as Soup.MessageHeaders
import {-# SOURCE #-} qualified GI.Soup.Structs.URI as Soup.URI

-- | Memory-managed wrapper type.
newtype Message = Message (ManagedPtr Message)
foreign import ccall "soup_message_get_type"
    c_soup_message_get_type :: IO GType

instance GObject Message where
    gobjectType = c_soup_message_get_type


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

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

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

-- | A convenience alias for `Nothing` :: `Maybe` `Message`.
noMessage :: Maybe Message
noMessage = Nothing

#if ENABLE_OVERLOADING
type family ResolveMessageMethod (t :: Symbol) (o :: *) :: * where
    ResolveMessageMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveMessageMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveMessageMethod "contentSniffed" o = MessageContentSniffedMethodInfo
    ResolveMessageMethod "disableFeature" o = MessageDisableFeatureMethodInfo
    ResolveMessageMethod "finished" o = MessageFinishedMethodInfo
    ResolveMessageMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveMessageMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveMessageMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveMessageMethod "gotBody" o = MessageGotBodyMethodInfo
    ResolveMessageMethod "gotChunk" o = MessageGotChunkMethodInfo
    ResolveMessageMethod "gotHeaders" o = MessageGotHeadersMethodInfo
    ResolveMessageMethod "gotInformational" o = MessageGotInformationalMethodInfo
    ResolveMessageMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveMessageMethod "isKeepalive" o = MessageIsKeepaliveMethodInfo
    ResolveMessageMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveMessageMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveMessageMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveMessageMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveMessageMethod "restarted" o = MessageRestartedMethodInfo
    ResolveMessageMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveMessageMethod "starting" o = MessageStartingMethodInfo
    ResolveMessageMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveMessageMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveMessageMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveMessageMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveMessageMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveMessageMethod "wroteBody" o = MessageWroteBodyMethodInfo
    ResolveMessageMethod "wroteBodyData" o = MessageWroteBodyDataMethodInfo
    ResolveMessageMethod "wroteChunk" o = MessageWroteChunkMethodInfo
    ResolveMessageMethod "wroteHeaders" o = MessageWroteHeadersMethodInfo
    ResolveMessageMethod "wroteInformational" o = MessageWroteInformationalMethodInfo
    ResolveMessageMethod "getAddress" o = MessageGetAddressMethodInfo
    ResolveMessageMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveMessageMethod "getFirstParty" o = MessageGetFirstPartyMethodInfo
    ResolveMessageMethod "getFlags" o = MessageGetFlagsMethodInfo
    ResolveMessageMethod "getHttpVersion" o = MessageGetHttpVersionMethodInfo
    ResolveMessageMethod "getHttpsStatus" o = MessageGetHttpsStatusMethodInfo
    ResolveMessageMethod "getPriority" o = MessageGetPriorityMethodInfo
    ResolveMessageMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveMessageMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveMessageMethod "getSoupRequest" o = MessageGetSoupRequestMethodInfo
    ResolveMessageMethod "getUri" o = MessageGetUriMethodInfo
    ResolveMessageMethod "setChunkAllocator" o = MessageSetChunkAllocatorMethodInfo
    ResolveMessageMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveMessageMethod "setFirstParty" o = MessageSetFirstPartyMethodInfo
    ResolveMessageMethod "setFlags" o = MessageSetFlagsMethodInfo
    ResolveMessageMethod "setHttpVersion" o = MessageSetHttpVersionMethodInfo
    ResolveMessageMethod "setPriority" o = MessageSetPriorityMethodInfo
    ResolveMessageMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveMessageMethod "setRedirect" o = MessageSetRedirectMethodInfo
    ResolveMessageMethod "setRequest" o = MessageSetRequestMethodInfo
    ResolveMessageMethod "setResponse" o = MessageSetResponseMethodInfo
    ResolveMessageMethod "setStatus" o = MessageSetStatusMethodInfo
    ResolveMessageMethod "setStatusFull" o = MessageSetStatusFullMethodInfo
    ResolveMessageMethod "setUri" o = MessageSetUriMethodInfo
    ResolveMessageMethod l o = O.MethodResolutionFailed l o

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

#endif

-- signal Message::content-sniffed
{- |
This signal is emitted after 'GI.Soup.Objects.Message.Message'::@/got-headers/@, and
before the first 'GI.Soup.Objects.Message.Message'::@/got-chunk/@. If content
sniffing is disabled, or no content sniffing will be
performed, due to the sniffer deciding to trust the
Content-Type sent by the server, this signal is emitted
immediately after 'GI.Soup.Objects.Message.Message'::@/got-headers/@, and /@type@/ is
'Nothing'.

If the 'GI.Soup.Objects.ContentSniffer.ContentSniffer' feature is enabled, and the
sniffer decided to perform sniffing, the first
'GI.Soup.Objects.Message.Message'::@/got-chunk/@ emission may be delayed, so that the
sniffer has enough data to correctly sniff the content. It
notified the library user that the content has been
sniffed, and allows it to change the header contents in the
message, if desired.

After this signal is emitted, the data that was spooled so
that sniffing could be done is delivered on the first
emission of 'GI.Soup.Objects.Message.Message'::@/got-chunk/@.

/Since: 2.28/
-}
type MessageContentSniffedCallback =
    T.Text
    {- ^ /@type@/: the content type that we got from sniffing -}
    -> Map.Map T.Text T.Text
    {- ^ /@params@/: a 'GI.GLib.Structs.HashTable.HashTable' with the parameters -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageContentSniffedCallback`@.
noMessageContentSniffedCallback :: Maybe MessageContentSniffedCallback
noMessageContentSniffedCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageContentSniffedCallback =
    Ptr () ->                               -- object
    CString ->
    Ptr (GHashTable CString CString) ->
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageContentSniffed :: MonadIO m => MessageContentSniffedCallback -> m (GClosure C_MessageContentSniffedCallback)
genClosure_MessageContentSniffed cb = liftIO $ do
    let cb' = wrap_MessageContentSniffedCallback cb
    mk_MessageContentSniffedCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageContentSniffedCallback` into a `C_MessageContentSniffedCallback`.
wrap_MessageContentSniffedCallback ::
    MessageContentSniffedCallback ->
    C_MessageContentSniffedCallback
wrap_MessageContentSniffedCallback _cb _ type_ params _ = do
    type_' <- cstringToText type_
    params' <- unpackGHashTable params
    let params'' = mapFirst cstringUnpackPtr params'
    params''' <- mapFirstA cstringToText params''
    let params'''' = mapSecond cstringUnpackPtr params'''
    params''''' <- mapSecondA cstringToText params''''
    let params'''''' = Map.fromList params'''''
    _cb  type_' params''''''


{- |
Connect a signal handler for the “@content-sniffed@” 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' message #contentSniffed callback
@
-}
onMessageContentSniffed :: (IsMessage a, MonadIO m) => a -> MessageContentSniffedCallback -> m SignalHandlerId
onMessageContentSniffed obj cb = liftIO $ do
    let cb' = wrap_MessageContentSniffedCallback cb
    cb'' <- mk_MessageContentSniffedCallback cb'
    connectSignalFunPtr obj "content-sniffed" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@content-sniffed@” 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' message #contentSniffed callback
@
-}
afterMessageContentSniffed :: (IsMessage a, MonadIO m) => a -> MessageContentSniffedCallback -> m SignalHandlerId
afterMessageContentSniffed obj cb = liftIO $ do
    let cb' = wrap_MessageContentSniffedCallback cb
    cb'' <- mk_MessageContentSniffedCallback cb'
    connectSignalFunPtr obj "content-sniffed" cb'' SignalConnectAfter


-- signal Message::finished
{- |
Emitted when all HTTP processing is finished for a message.
(After 'GI.Soup.Objects.Message.Message'::@/got_body/@ for client-side messages, or
after 'GI.Soup.Objects.Message.Message'::@/wrote_body/@ for server-side messages.)
-}
type MessageFinishedCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageFinishedCallback`@.
noMessageFinishedCallback :: Maybe MessageFinishedCallback
noMessageFinishedCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageFinishedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageFinished :: MonadIO m => MessageFinishedCallback -> m (GClosure C_MessageFinishedCallback)
genClosure_MessageFinished cb = liftIO $ do
    let cb' = wrap_MessageFinishedCallback cb
    mk_MessageFinishedCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageFinishedCallback` into a `C_MessageFinishedCallback`.
wrap_MessageFinishedCallback ::
    MessageFinishedCallback ->
    C_MessageFinishedCallback
wrap_MessageFinishedCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@finished@” 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' message #finished callback
@
-}
onMessageFinished :: (IsMessage a, MonadIO m) => a -> MessageFinishedCallback -> m SignalHandlerId
onMessageFinished obj cb = liftIO $ do
    let cb' = wrap_MessageFinishedCallback cb
    cb'' <- mk_MessageFinishedCallback cb'
    connectSignalFunPtr obj "finished" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@finished@” 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' message #finished callback
@
-}
afterMessageFinished :: (IsMessage a, MonadIO m) => a -> MessageFinishedCallback -> m SignalHandlerId
afterMessageFinished obj cb = liftIO $ do
    let cb' = wrap_MessageFinishedCallback cb
    cb'' <- mk_MessageFinishedCallback cb'
    connectSignalFunPtr obj "finished" cb'' SignalConnectAfter


-- signal Message::got-body
{- |
Emitted after receiving the complete message body. (For a
server-side message, this means it has received the request
body. For a client-side message, this means it has received
the response body and is nearly done with the message.)

See also @/soup_message_add_header_handler()/@ and
@/soup_message_add_status_code_handler()/@, which can be used
to connect to a subset of emissions of this signal.
-}
type MessageGotBodyCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageGotBodyCallback`@.
noMessageGotBodyCallback :: Maybe MessageGotBodyCallback
noMessageGotBodyCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageGotBodyCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageGotBody :: MonadIO m => MessageGotBodyCallback -> m (GClosure C_MessageGotBodyCallback)
genClosure_MessageGotBody cb = liftIO $ do
    let cb' = wrap_MessageGotBodyCallback cb
    mk_MessageGotBodyCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageGotBodyCallback` into a `C_MessageGotBodyCallback`.
wrap_MessageGotBodyCallback ::
    MessageGotBodyCallback ->
    C_MessageGotBodyCallback
wrap_MessageGotBodyCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@got-body@” 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' message #gotBody callback
@
-}
onMessageGotBody :: (IsMessage a, MonadIO m) => a -> MessageGotBodyCallback -> m SignalHandlerId
onMessageGotBody obj cb = liftIO $ do
    let cb' = wrap_MessageGotBodyCallback cb
    cb'' <- mk_MessageGotBodyCallback cb'
    connectSignalFunPtr obj "got-body" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@got-body@” 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' message #gotBody callback
@
-}
afterMessageGotBody :: (IsMessage a, MonadIO m) => a -> MessageGotBodyCallback -> m SignalHandlerId
afterMessageGotBody obj cb = liftIO $ do
    let cb' = wrap_MessageGotBodyCallback cb
    cb'' <- mk_MessageGotBodyCallback cb'
    connectSignalFunPtr obj "got-body" cb'' SignalConnectAfter


-- signal Message::got-chunk
{- |
Emitted after receiving a chunk of a message body. Note
that \"chunk\" in this context means any subpiece of the
body, not necessarily the specific HTTP 1.1 chunks sent by
the other side.

If you cancel or requeue /@msg@/ while processing this signal,
then the current HTTP I\/O will be stopped after this signal
emission finished, and /@msg@/\'s connection will be closed.
-}
type MessageGotChunkCallback =
    Soup.Buffer.Buffer
    {- ^ /@chunk@/: the just-read chunk -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageGotChunkCallback`@.
noMessageGotChunkCallback :: Maybe MessageGotChunkCallback
noMessageGotChunkCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageGotChunkCallback =
    Ptr () ->                               -- object
    Ptr Soup.Buffer.Buffer ->
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageGotChunk :: MonadIO m => MessageGotChunkCallback -> m (GClosure C_MessageGotChunkCallback)
genClosure_MessageGotChunk cb = liftIO $ do
    let cb' = wrap_MessageGotChunkCallback cb
    mk_MessageGotChunkCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageGotChunkCallback` into a `C_MessageGotChunkCallback`.
wrap_MessageGotChunkCallback ::
    MessageGotChunkCallback ->
    C_MessageGotChunkCallback
wrap_MessageGotChunkCallback _cb _ chunk _ = do
    B.ManagedPtr.withTransient Soup.Buffer.Buffer chunk $ \chunk' -> do
        _cb  chunk'


{- |
Connect a signal handler for the “@got-chunk@” 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' message #gotChunk callback
@
-}
onMessageGotChunk :: (IsMessage a, MonadIO m) => a -> MessageGotChunkCallback -> m SignalHandlerId
onMessageGotChunk obj cb = liftIO $ do
    let cb' = wrap_MessageGotChunkCallback cb
    cb'' <- mk_MessageGotChunkCallback cb'
    connectSignalFunPtr obj "got-chunk" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@got-chunk@” 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' message #gotChunk callback
@
-}
afterMessageGotChunk :: (IsMessage a, MonadIO m) => a -> MessageGotChunkCallback -> m SignalHandlerId
afterMessageGotChunk obj cb = liftIO $ do
    let cb' = wrap_MessageGotChunkCallback cb
    cb'' <- mk_MessageGotChunkCallback cb'
    connectSignalFunPtr obj "got-chunk" cb'' SignalConnectAfter


-- signal Message::got-headers
{- |
Emitted after receiving all message headers for a message.
(For a client-side message, this is after receiving the
Status-Line and response headers; for a server-side
message, it is after receiving the Request-Line and request
headers.)

See also @/soup_message_add_header_handler()/@ and
@/soup_message_add_status_code_handler()/@, which can be used
to connect to a subset of emissions of this signal.

If you cancel or requeue /@msg@/ while processing this signal,
then the current HTTP I\/O will be stopped after this signal
emission finished, and /@msg@/\'s connection will be closed.
(If you need to requeue a message--eg, after handling
authentication or redirection--it is usually better to
requeue it from a 'GI.Soup.Objects.Message.Message'::@/got_body/@ handler rather
than a 'GI.Soup.Objects.Message.Message'::@/got_headers/@ handler, so that the
existing HTTP connection can be reused.)
-}
type MessageGotHeadersCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageGotHeadersCallback`@.
noMessageGotHeadersCallback :: Maybe MessageGotHeadersCallback
noMessageGotHeadersCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageGotHeadersCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageGotHeaders :: MonadIO m => MessageGotHeadersCallback -> m (GClosure C_MessageGotHeadersCallback)
genClosure_MessageGotHeaders cb = liftIO $ do
    let cb' = wrap_MessageGotHeadersCallback cb
    mk_MessageGotHeadersCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageGotHeadersCallback` into a `C_MessageGotHeadersCallback`.
wrap_MessageGotHeadersCallback ::
    MessageGotHeadersCallback ->
    C_MessageGotHeadersCallback
wrap_MessageGotHeadersCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@got-headers@” 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' message #gotHeaders callback
@
-}
onMessageGotHeaders :: (IsMessage a, MonadIO m) => a -> MessageGotHeadersCallback -> m SignalHandlerId
onMessageGotHeaders obj cb = liftIO $ do
    let cb' = wrap_MessageGotHeadersCallback cb
    cb'' <- mk_MessageGotHeadersCallback cb'
    connectSignalFunPtr obj "got-headers" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@got-headers@” 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' message #gotHeaders callback
@
-}
afterMessageGotHeaders :: (IsMessage a, MonadIO m) => a -> MessageGotHeadersCallback -> m SignalHandlerId
afterMessageGotHeaders obj cb = liftIO $ do
    let cb' = wrap_MessageGotHeadersCallback cb
    cb'' <- mk_MessageGotHeadersCallback cb'
    connectSignalFunPtr obj "got-headers" cb'' SignalConnectAfter


-- signal Message::got-informational
{- |
Emitted after receiving a 1xx (Informational) response for
a (client-side) message. The response_headers will be
filled in with the headers associated with the
informational response; however, those header values will
be erased after this signal is done.

If you cancel or requeue /@msg@/ while processing this signal,
then the current HTTP I\/O will be stopped after this signal
emission finished, and /@msg@/\'s connection will be closed.
-}
type MessageGotInformationalCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageGotInformationalCallback`@.
noMessageGotInformationalCallback :: Maybe MessageGotInformationalCallback
noMessageGotInformationalCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageGotInformationalCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageGotInformational :: MonadIO m => MessageGotInformationalCallback -> m (GClosure C_MessageGotInformationalCallback)
genClosure_MessageGotInformational cb = liftIO $ do
    let cb' = wrap_MessageGotInformationalCallback cb
    mk_MessageGotInformationalCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageGotInformationalCallback` into a `C_MessageGotInformationalCallback`.
wrap_MessageGotInformationalCallback ::
    MessageGotInformationalCallback ->
    C_MessageGotInformationalCallback
wrap_MessageGotInformationalCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@got-informational@” 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' message #gotInformational callback
@
-}
onMessageGotInformational :: (IsMessage a, MonadIO m) => a -> MessageGotInformationalCallback -> m SignalHandlerId
onMessageGotInformational obj cb = liftIO $ do
    let cb' = wrap_MessageGotInformationalCallback cb
    cb'' <- mk_MessageGotInformationalCallback cb'
    connectSignalFunPtr obj "got-informational" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@got-informational@” 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' message #gotInformational callback
@
-}
afterMessageGotInformational :: (IsMessage a, MonadIO m) => a -> MessageGotInformationalCallback -> m SignalHandlerId
afterMessageGotInformational obj cb = liftIO $ do
    let cb' = wrap_MessageGotInformationalCallback cb
    cb'' <- mk_MessageGotInformationalCallback cb'
    connectSignalFunPtr obj "got-informational" cb'' SignalConnectAfter


-- signal Message::network-event
{- |
Emitted to indicate that some network-related event
related to /@msg@/ has occurred. This essentially proxies the
'GI.Gio.Objects.SocketClient.SocketClient'::@/event/@ signal, but only for events that
occur while /@msg@/ \"owns\" the connection; if /@msg@/ is sent on
an existing persistent connection, then this signal will
not be emitted. (If you want to force the message to be
sent on a new connection, set the
'GI.Soup.Flags.MessageFlagsNewConnection' flag on it.)

See 'GI.Gio.Objects.SocketClient.SocketClient'::@/event/@ for more information on what
the different values of /@event@/ correspond to, and what
/@connection@/ will be in each case.

/Since: 2.38/
-}
type MessageNetworkEventCallback =
    Gio.Enums.SocketClientEvent
    {- ^ /@event@/: the network event -}
    -> Gio.IOStream.IOStream
    {- ^ /@connection@/: the current state of the network connection -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageNetworkEventCallback`@.
noMessageNetworkEventCallback :: Maybe MessageNetworkEventCallback
noMessageNetworkEventCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageNetworkEventCallback =
    Ptr () ->                               -- object
    CUInt ->
    Ptr Gio.IOStream.IOStream ->
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageNetworkEvent :: MonadIO m => MessageNetworkEventCallback -> m (GClosure C_MessageNetworkEventCallback)
genClosure_MessageNetworkEvent cb = liftIO $ do
    let cb' = wrap_MessageNetworkEventCallback cb
    mk_MessageNetworkEventCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageNetworkEventCallback` into a `C_MessageNetworkEventCallback`.
wrap_MessageNetworkEventCallback ::
    MessageNetworkEventCallback ->
    C_MessageNetworkEventCallback
wrap_MessageNetworkEventCallback _cb _ event connection _ = do
    let event' = (toEnum . fromIntegral) event
    connection' <- (newObject Gio.IOStream.IOStream) connection
    _cb  event' connection'


{- |
Connect a signal handler for the “@network-event@” 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' message #networkEvent callback
@
-}
onMessageNetworkEvent :: (IsMessage a, MonadIO m) => a -> MessageNetworkEventCallback -> m SignalHandlerId
onMessageNetworkEvent obj cb = liftIO $ do
    let cb' = wrap_MessageNetworkEventCallback cb
    cb'' <- mk_MessageNetworkEventCallback cb'
    connectSignalFunPtr obj "network-event" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@network-event@” 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' message #networkEvent callback
@
-}
afterMessageNetworkEvent :: (IsMessage a, MonadIO m) => a -> MessageNetworkEventCallback -> m SignalHandlerId
afterMessageNetworkEvent obj cb = liftIO $ do
    let cb' = wrap_MessageNetworkEventCallback cb
    cb'' <- mk_MessageNetworkEventCallback cb'
    connectSignalFunPtr obj "network-event" cb'' SignalConnectAfter


-- signal Message::restarted
{- |
Emitted when a request that was already sent once is now
being sent again (eg, because the first attempt received a
redirection response, or because we needed to use
authentication).
-}
type MessageRestartedCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageRestartedCallback`@.
noMessageRestartedCallback :: Maybe MessageRestartedCallback
noMessageRestartedCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageRestartedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageRestarted :: MonadIO m => MessageRestartedCallback -> m (GClosure C_MessageRestartedCallback)
genClosure_MessageRestarted cb = liftIO $ do
    let cb' = wrap_MessageRestartedCallback cb
    mk_MessageRestartedCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageRestartedCallback` into a `C_MessageRestartedCallback`.
wrap_MessageRestartedCallback ::
    MessageRestartedCallback ->
    C_MessageRestartedCallback
wrap_MessageRestartedCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@restarted@” 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' message #restarted callback
@
-}
onMessageRestarted :: (IsMessage a, MonadIO m) => a -> MessageRestartedCallback -> m SignalHandlerId
onMessageRestarted obj cb = liftIO $ do
    let cb' = wrap_MessageRestartedCallback cb
    cb'' <- mk_MessageRestartedCallback cb'
    connectSignalFunPtr obj "restarted" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@restarted@” 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' message #restarted callback
@
-}
afterMessageRestarted :: (IsMessage a, MonadIO m) => a -> MessageRestartedCallback -> m SignalHandlerId
afterMessageRestarted obj cb = liftIO $ do
    let cb' = wrap_MessageRestartedCallback cb
    cb'' <- mk_MessageRestartedCallback cb'
    connectSignalFunPtr obj "restarted" cb'' SignalConnectAfter


-- signal Message::starting
{- |
Emitted just before a message is sent.

/Since: 2.50/
-}
type MessageStartingCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageStartingCallback`@.
noMessageStartingCallback :: Maybe MessageStartingCallback
noMessageStartingCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageStartingCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageStarting :: MonadIO m => MessageStartingCallback -> m (GClosure C_MessageStartingCallback)
genClosure_MessageStarting cb = liftIO $ do
    let cb' = wrap_MessageStartingCallback cb
    mk_MessageStartingCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageStartingCallback` into a `C_MessageStartingCallback`.
wrap_MessageStartingCallback ::
    MessageStartingCallback ->
    C_MessageStartingCallback
wrap_MessageStartingCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@starting@” 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' message #starting callback
@
-}
onMessageStarting :: (IsMessage a, MonadIO m) => a -> MessageStartingCallback -> m SignalHandlerId
onMessageStarting obj cb = liftIO $ do
    let cb' = wrap_MessageStartingCallback cb
    cb'' <- mk_MessageStartingCallback cb'
    connectSignalFunPtr obj "starting" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@starting@” 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' message #starting callback
@
-}
afterMessageStarting :: (IsMessage a, MonadIO m) => a -> MessageStartingCallback -> m SignalHandlerId
afterMessageStarting obj cb = liftIO $ do
    let cb' = wrap_MessageStartingCallback cb
    cb'' <- mk_MessageStartingCallback cb'
    connectSignalFunPtr obj "starting" cb'' SignalConnectAfter


-- signal Message::wrote-body
{- |
Emitted immediately after writing the complete body for a
message. (For a client-side message, this means that
libsoup is done writing and is now waiting for the response
from the server. For a server-side message, this means that
libsoup has finished writing the response and is nearly
done with the message.)
-}
type MessageWroteBodyCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageWroteBodyCallback`@.
noMessageWroteBodyCallback :: Maybe MessageWroteBodyCallback
noMessageWroteBodyCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageWroteBodyCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageWroteBody :: MonadIO m => MessageWroteBodyCallback -> m (GClosure C_MessageWroteBodyCallback)
genClosure_MessageWroteBody cb = liftIO $ do
    let cb' = wrap_MessageWroteBodyCallback cb
    mk_MessageWroteBodyCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageWroteBodyCallback` into a `C_MessageWroteBodyCallback`.
wrap_MessageWroteBodyCallback ::
    MessageWroteBodyCallback ->
    C_MessageWroteBodyCallback
wrap_MessageWroteBodyCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@wrote-body@” 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' message #wroteBody callback
@
-}
onMessageWroteBody :: (IsMessage a, MonadIO m) => a -> MessageWroteBodyCallback -> m SignalHandlerId
onMessageWroteBody obj cb = liftIO $ do
    let cb' = wrap_MessageWroteBodyCallback cb
    cb'' <- mk_MessageWroteBodyCallback cb'
    connectSignalFunPtr obj "wrote-body" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@wrote-body@” 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' message #wroteBody callback
@
-}
afterMessageWroteBody :: (IsMessage a, MonadIO m) => a -> MessageWroteBodyCallback -> m SignalHandlerId
afterMessageWroteBody obj cb = liftIO $ do
    let cb' = wrap_MessageWroteBodyCallback cb
    cb'' <- mk_MessageWroteBodyCallback cb'
    connectSignalFunPtr obj "wrote-body" cb'' SignalConnectAfter


-- signal Message::wrote-body-data
{- |
Emitted immediately after writing a portion of the message
body to the network.

Unlike 'GI.Soup.Objects.Message.Message'::@/wrote_chunk/@, this is emitted after
every successful @/write()/@ call, not only after finishing a
complete \"chunk\".

/Since: 2.24/
-}
type MessageWroteBodyDataCallback =
    Soup.Buffer.Buffer
    {- ^ /@chunk@/: the data written -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageWroteBodyDataCallback`@.
noMessageWroteBodyDataCallback :: Maybe MessageWroteBodyDataCallback
noMessageWroteBodyDataCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageWroteBodyDataCallback =
    Ptr () ->                               -- object
    Ptr Soup.Buffer.Buffer ->
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageWroteBodyData :: MonadIO m => MessageWroteBodyDataCallback -> m (GClosure C_MessageWroteBodyDataCallback)
genClosure_MessageWroteBodyData cb = liftIO $ do
    let cb' = wrap_MessageWroteBodyDataCallback cb
    mk_MessageWroteBodyDataCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageWroteBodyDataCallback` into a `C_MessageWroteBodyDataCallback`.
wrap_MessageWroteBodyDataCallback ::
    MessageWroteBodyDataCallback ->
    C_MessageWroteBodyDataCallback
wrap_MessageWroteBodyDataCallback _cb _ chunk _ = do
    B.ManagedPtr.withTransient Soup.Buffer.Buffer chunk $ \chunk' -> do
        _cb  chunk'


{- |
Connect a signal handler for the “@wrote-body-data@” 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' message #wroteBodyData callback
@
-}
onMessageWroteBodyData :: (IsMessage a, MonadIO m) => a -> MessageWroteBodyDataCallback -> m SignalHandlerId
onMessageWroteBodyData obj cb = liftIO $ do
    let cb' = wrap_MessageWroteBodyDataCallback cb
    cb'' <- mk_MessageWroteBodyDataCallback cb'
    connectSignalFunPtr obj "wrote-body-data" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@wrote-body-data@” 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' message #wroteBodyData callback
@
-}
afterMessageWroteBodyData :: (IsMessage a, MonadIO m) => a -> MessageWroteBodyDataCallback -> m SignalHandlerId
afterMessageWroteBodyData obj cb = liftIO $ do
    let cb' = wrap_MessageWroteBodyDataCallback cb
    cb'' <- mk_MessageWroteBodyDataCallback cb'
    connectSignalFunPtr obj "wrote-body-data" cb'' SignalConnectAfter


-- signal Message::wrote-chunk
{- |
Emitted immediately after writing a body chunk for a message.

Note that this signal is not parallel to
'GI.Soup.Objects.Message.Message'::@/got_chunk/@; it is emitted only when a complete
chunk (added with @/soup_message_body_append()/@ or
'GI.Soup.Structs.MessageBody.messageBodyAppendBuffer') has been written. To get
more useful continuous progress information, use
'GI.Soup.Objects.Message.Message'::@/wrote_body_data/@.
-}
type MessageWroteChunkCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageWroteChunkCallback`@.
noMessageWroteChunkCallback :: Maybe MessageWroteChunkCallback
noMessageWroteChunkCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageWroteChunkCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageWroteChunk :: MonadIO m => MessageWroteChunkCallback -> m (GClosure C_MessageWroteChunkCallback)
genClosure_MessageWroteChunk cb = liftIO $ do
    let cb' = wrap_MessageWroteChunkCallback cb
    mk_MessageWroteChunkCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageWroteChunkCallback` into a `C_MessageWroteChunkCallback`.
wrap_MessageWroteChunkCallback ::
    MessageWroteChunkCallback ->
    C_MessageWroteChunkCallback
wrap_MessageWroteChunkCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@wrote-chunk@” 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' message #wroteChunk callback
@
-}
onMessageWroteChunk :: (IsMessage a, MonadIO m) => a -> MessageWroteChunkCallback -> m SignalHandlerId
onMessageWroteChunk obj cb = liftIO $ do
    let cb' = wrap_MessageWroteChunkCallback cb
    cb'' <- mk_MessageWroteChunkCallback cb'
    connectSignalFunPtr obj "wrote-chunk" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@wrote-chunk@” 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' message #wroteChunk callback
@
-}
afterMessageWroteChunk :: (IsMessage a, MonadIO m) => a -> MessageWroteChunkCallback -> m SignalHandlerId
afterMessageWroteChunk obj cb = liftIO $ do
    let cb' = wrap_MessageWroteChunkCallback cb
    cb'' <- mk_MessageWroteChunkCallback cb'
    connectSignalFunPtr obj "wrote-chunk" cb'' SignalConnectAfter


-- signal Message::wrote-headers
{- |
Emitted immediately after writing the headers for a
message. (For a client-side message, this is after writing
the request headers; for a server-side message, it is after
writing the response headers.)
-}
type MessageWroteHeadersCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageWroteHeadersCallback`@.
noMessageWroteHeadersCallback :: Maybe MessageWroteHeadersCallback
noMessageWroteHeadersCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageWroteHeadersCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageWroteHeaders :: MonadIO m => MessageWroteHeadersCallback -> m (GClosure C_MessageWroteHeadersCallback)
genClosure_MessageWroteHeaders cb = liftIO $ do
    let cb' = wrap_MessageWroteHeadersCallback cb
    mk_MessageWroteHeadersCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageWroteHeadersCallback` into a `C_MessageWroteHeadersCallback`.
wrap_MessageWroteHeadersCallback ::
    MessageWroteHeadersCallback ->
    C_MessageWroteHeadersCallback
wrap_MessageWroteHeadersCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@wrote-headers@” 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' message #wroteHeaders callback
@
-}
onMessageWroteHeaders :: (IsMessage a, MonadIO m) => a -> MessageWroteHeadersCallback -> m SignalHandlerId
onMessageWroteHeaders obj cb = liftIO $ do
    let cb' = wrap_MessageWroteHeadersCallback cb
    cb'' <- mk_MessageWroteHeadersCallback cb'
    connectSignalFunPtr obj "wrote-headers" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@wrote-headers@” 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' message #wroteHeaders callback
@
-}
afterMessageWroteHeaders :: (IsMessage a, MonadIO m) => a -> MessageWroteHeadersCallback -> m SignalHandlerId
afterMessageWroteHeaders obj cb = liftIO $ do
    let cb' = wrap_MessageWroteHeadersCallback cb
    cb'' <- mk_MessageWroteHeadersCallback cb'
    connectSignalFunPtr obj "wrote-headers" cb'' SignalConnectAfter


-- signal Message::wrote-informational
{- |
Emitted immediately after writing a 1xx (Informational)
response for a (server-side) message.
-}
type MessageWroteInformationalCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MessageWroteInformationalCallback`@.
noMessageWroteInformationalCallback :: Maybe MessageWroteInformationalCallback
noMessageWroteInformationalCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MessageWroteInformationalCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_MessageWroteInformational :: MonadIO m => MessageWroteInformationalCallback -> m (GClosure C_MessageWroteInformationalCallback)
genClosure_MessageWroteInformational cb = liftIO $ do
    let cb' = wrap_MessageWroteInformationalCallback cb
    mk_MessageWroteInformationalCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `MessageWroteInformationalCallback` into a `C_MessageWroteInformationalCallback`.
wrap_MessageWroteInformationalCallback ::
    MessageWroteInformationalCallback ->
    C_MessageWroteInformationalCallback
wrap_MessageWroteInformationalCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@wrote-informational@” 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' message #wroteInformational callback
@
-}
onMessageWroteInformational :: (IsMessage a, MonadIO m) => a -> MessageWroteInformationalCallback -> m SignalHandlerId
onMessageWroteInformational obj cb = liftIO $ do
    let cb' = wrap_MessageWroteInformationalCallback cb
    cb'' <- mk_MessageWroteInformationalCallback cb'
    connectSignalFunPtr obj "wrote-informational" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@wrote-informational@” 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' message #wroteInformational callback
@
-}
afterMessageWroteInformational :: (IsMessage a, MonadIO m) => a -> MessageWroteInformationalCallback -> m SignalHandlerId
afterMessageWroteInformational obj cb = liftIO $ do
    let cb' = wrap_MessageWroteInformationalCallback cb
    cb'' <- mk_MessageWroteInformationalCallback cb'
    connectSignalFunPtr obj "wrote-informational" cb'' SignalConnectAfter


-- VVV Prop "first-party"
   -- Type: TInterface (Name {namespace = "Soup", name = "URI"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

{- |
Get the value of the “@first-party@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #firstParty
@
-}
getMessageFirstParty :: (MonadIO m, IsMessage o) => o -> m Soup.URI.URI
getMessageFirstParty obj = liftIO $ checkUnexpectedNothing "getMessageFirstParty" $ B.Properties.getObjectPropertyBoxed obj "first-party" Soup.URI.URI

{- |
Set the value of the “@first-party@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' message [ #firstParty 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMessageFirstParty :: (MonadIO m, IsMessage o) => o -> Soup.URI.URI -> m ()
setMessageFirstParty obj val = liftIO $ B.Properties.setObjectPropertyBoxed obj "first-party" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@first-party@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMessageFirstParty :: (IsMessage o) => Soup.URI.URI -> IO (GValueConstruct o)
constructMessageFirstParty val = B.Properties.constructObjectPropertyBoxed "first-party" (Just val)

#if ENABLE_OVERLOADING
data MessageFirstPartyPropertyInfo
instance AttrInfo MessageFirstPartyPropertyInfo where
    type AttrAllowedOps MessageFirstPartyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MessageFirstPartyPropertyInfo = (~) Soup.URI.URI
    type AttrBaseTypeConstraint MessageFirstPartyPropertyInfo = IsMessage
    type AttrGetType MessageFirstPartyPropertyInfo = Soup.URI.URI
    type AttrLabel MessageFirstPartyPropertyInfo = "first-party"
    type AttrOrigin MessageFirstPartyPropertyInfo = Message
    attrGet _ = getMessageFirstParty
    attrSet _ = setMessageFirstParty
    attrConstruct _ = constructMessageFirstParty
    attrClear _ = undefined
#endif

-- VVV Prop "flags"
   -- Type: TInterface (Name {namespace = "Soup", name = "MessageFlags"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

{- |
Get the value of the “@flags@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #flags
@
-}
getMessageFlags :: (MonadIO m, IsMessage o) => o -> m [Soup.Flags.MessageFlags]
getMessageFlags obj = liftIO $ B.Properties.getObjectPropertyFlags obj "flags"

{- |
Set the value of the “@flags@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' message [ #flags 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMessageFlags :: (MonadIO m, IsMessage o) => o -> [Soup.Flags.MessageFlags] -> m ()
setMessageFlags obj val = liftIO $ B.Properties.setObjectPropertyFlags obj "flags" val

{- |
Construct a `GValueConstruct` with valid value for the “@flags@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMessageFlags :: (IsMessage o) => [Soup.Flags.MessageFlags] -> IO (GValueConstruct o)
constructMessageFlags val = B.Properties.constructObjectPropertyFlags "flags" val

#if ENABLE_OVERLOADING
data MessageFlagsPropertyInfo
instance AttrInfo MessageFlagsPropertyInfo where
    type AttrAllowedOps MessageFlagsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MessageFlagsPropertyInfo = (~) [Soup.Flags.MessageFlags]
    type AttrBaseTypeConstraint MessageFlagsPropertyInfo = IsMessage
    type AttrGetType MessageFlagsPropertyInfo = [Soup.Flags.MessageFlags]
    type AttrLabel MessageFlagsPropertyInfo = "flags"
    type AttrOrigin MessageFlagsPropertyInfo = Message
    attrGet _ = getMessageFlags
    attrSet _ = setMessageFlags
    attrConstruct _ = constructMessageFlags
    attrClear _ = undefined
#endif

-- VVV Prop "http-version"
   -- Type: TInterface (Name {namespace = "Soup", name = "HTTPVersion"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

{- |
Get the value of the “@http-version@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #httpVersion
@
-}
getMessageHttpVersion :: (MonadIO m, IsMessage o) => o -> m Soup.Enums.HTTPVersion
getMessageHttpVersion obj = liftIO $ B.Properties.getObjectPropertyEnum obj "http-version"

{- |
Set the value of the “@http-version@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' message [ #httpVersion 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMessageHttpVersion :: (MonadIO m, IsMessage o) => o -> Soup.Enums.HTTPVersion -> m ()
setMessageHttpVersion obj val = liftIO $ B.Properties.setObjectPropertyEnum obj "http-version" val

{- |
Construct a `GValueConstruct` with valid value for the “@http-version@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMessageHttpVersion :: (IsMessage o) => Soup.Enums.HTTPVersion -> IO (GValueConstruct o)
constructMessageHttpVersion val = B.Properties.constructObjectPropertyEnum "http-version" val

#if ENABLE_OVERLOADING
data MessageHttpVersionPropertyInfo
instance AttrInfo MessageHttpVersionPropertyInfo where
    type AttrAllowedOps MessageHttpVersionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MessageHttpVersionPropertyInfo = (~) Soup.Enums.HTTPVersion
    type AttrBaseTypeConstraint MessageHttpVersionPropertyInfo = IsMessage
    type AttrGetType MessageHttpVersionPropertyInfo = Soup.Enums.HTTPVersion
    type AttrLabel MessageHttpVersionPropertyInfo = "http-version"
    type AttrOrigin MessageHttpVersionPropertyInfo = Message
    attrGet _ = getMessageHttpVersion
    attrSet _ = setMessageHttpVersion
    attrConstruct _ = constructMessageHttpVersion
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@method@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #method
@
-}
getMessageMethod :: (MonadIO m, IsMessage o) => o -> m (Maybe T.Text)
getMessageMethod obj = liftIO $ B.Properties.getObjectPropertyString obj "method"

{- |
Set the value of the “@method@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' message [ #method 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMessageMethod :: (MonadIO m, IsMessage o) => o -> T.Text -> m ()
setMessageMethod obj val = liftIO $ B.Properties.setObjectPropertyString obj "method" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@method@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMessageMethod :: (IsMessage o) => T.Text -> IO (GValueConstruct o)
constructMessageMethod val = B.Properties.constructObjectPropertyString "method" (Just val)

{- |
Set the value of the “@method@” 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' #method
@
-}
clearMessageMethod :: (MonadIO m, IsMessage o) => o -> m ()
clearMessageMethod obj = liftIO $ B.Properties.setObjectPropertyString obj "method" (Nothing :: Maybe T.Text)

#if ENABLE_OVERLOADING
data MessageMethodPropertyInfo
instance AttrInfo MessageMethodPropertyInfo where
    type AttrAllowedOps MessageMethodPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint MessageMethodPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint MessageMethodPropertyInfo = IsMessage
    type AttrGetType MessageMethodPropertyInfo = (Maybe T.Text)
    type AttrLabel MessageMethodPropertyInfo = "method"
    type AttrOrigin MessageMethodPropertyInfo = Message
    attrGet _ = getMessageMethod
    attrSet _ = setMessageMethod
    attrConstruct _ = constructMessageMethod
    attrClear _ = clearMessageMethod
#endif

-- VVV Prop "priority"
   -- Type: TInterface (Name {namespace = "Soup", name = "MessagePriority"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

{- |
Get the value of the “@priority@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #priority
@
-}
getMessagePriority :: (MonadIO m, IsMessage o) => o -> m Soup.Enums.MessagePriority
getMessagePriority obj = liftIO $ B.Properties.getObjectPropertyEnum obj "priority"

{- |
Set the value of the “@priority@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' message [ #priority 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMessagePriority :: (MonadIO m, IsMessage o) => o -> Soup.Enums.MessagePriority -> m ()
setMessagePriority obj val = liftIO $ B.Properties.setObjectPropertyEnum obj "priority" val

{- |
Construct a `GValueConstruct` with valid value for the “@priority@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMessagePriority :: (IsMessage o) => Soup.Enums.MessagePriority -> IO (GValueConstruct o)
constructMessagePriority val = B.Properties.constructObjectPropertyEnum "priority" val

#if ENABLE_OVERLOADING
data MessagePriorityPropertyInfo
instance AttrInfo MessagePriorityPropertyInfo where
    type AttrAllowedOps MessagePriorityPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MessagePriorityPropertyInfo = (~) Soup.Enums.MessagePriority
    type AttrBaseTypeConstraint MessagePriorityPropertyInfo = IsMessage
    type AttrGetType MessagePriorityPropertyInfo = Soup.Enums.MessagePriority
    type AttrLabel MessagePriorityPropertyInfo = "priority"
    type AttrOrigin MessagePriorityPropertyInfo = Message
    attrGet _ = getMessagePriority
    attrSet _ = setMessagePriority
    attrConstruct _ = constructMessagePriority
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@reason-phrase@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #reasonPhrase
@
-}
getMessageReasonPhrase :: (MonadIO m, IsMessage o) => o -> m (Maybe T.Text)
getMessageReasonPhrase obj = liftIO $ B.Properties.getObjectPropertyString obj "reason-phrase"

{- |
Set the value of the “@reason-phrase@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' message [ #reasonPhrase 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMessageReasonPhrase :: (MonadIO m, IsMessage o) => o -> T.Text -> m ()
setMessageReasonPhrase obj val = liftIO $ B.Properties.setObjectPropertyString obj "reason-phrase" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@reason-phrase@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMessageReasonPhrase :: (IsMessage o) => T.Text -> IO (GValueConstruct o)
constructMessageReasonPhrase val = B.Properties.constructObjectPropertyString "reason-phrase" (Just val)

{- |
Set the value of the “@reason-phrase@” 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' #reasonPhrase
@
-}
clearMessageReasonPhrase :: (MonadIO m, IsMessage o) => o -> m ()
clearMessageReasonPhrase obj = liftIO $ B.Properties.setObjectPropertyString obj "reason-phrase" (Nothing :: Maybe T.Text)

#if ENABLE_OVERLOADING
data MessageReasonPhrasePropertyInfo
instance AttrInfo MessageReasonPhrasePropertyInfo where
    type AttrAllowedOps MessageReasonPhrasePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint MessageReasonPhrasePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint MessageReasonPhrasePropertyInfo = IsMessage
    type AttrGetType MessageReasonPhrasePropertyInfo = (Maybe T.Text)
    type AttrLabel MessageReasonPhrasePropertyInfo = "reason-phrase"
    type AttrOrigin MessageReasonPhrasePropertyInfo = Message
    attrGet _ = getMessageReasonPhrase
    attrSet _ = setMessageReasonPhrase
    attrConstruct _ = constructMessageReasonPhrase
    attrClear _ = clearMessageReasonPhrase
#endif

-- VVV Prop "request-body"
   -- Type: TInterface (Name {namespace = "Soup", name = "MessageBody"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@request-body@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #requestBody
@
-}
getMessageRequestBody :: (MonadIO m, IsMessage o) => o -> m (Maybe Soup.MessageBody.MessageBody)
getMessageRequestBody obj = liftIO $ B.Properties.getObjectPropertyBoxed obj "request-body" Soup.MessageBody.MessageBody

#if ENABLE_OVERLOADING
data MessageRequestBodyPropertyInfo
instance AttrInfo MessageRequestBodyPropertyInfo where
    type AttrAllowedOps MessageRequestBodyPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint MessageRequestBodyPropertyInfo = (~) ()
    type AttrBaseTypeConstraint MessageRequestBodyPropertyInfo = IsMessage
    type AttrGetType MessageRequestBodyPropertyInfo = (Maybe Soup.MessageBody.MessageBody)
    type AttrLabel MessageRequestBodyPropertyInfo = "request-body"
    type AttrOrigin MessageRequestBodyPropertyInfo = Message
    attrGet _ = getMessageRequestBody
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "request-body-data"
   -- Type: TInterface (Name {namespace = "GLib", name = "Bytes"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@request-body-data@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #requestBodyData
@
-}
getMessageRequestBodyData :: (MonadIO m, IsMessage o) => o -> m (Maybe GLib.Bytes.Bytes)
getMessageRequestBodyData obj = liftIO $ B.Properties.getObjectPropertyBoxed obj "request-body-data" GLib.Bytes.Bytes

#if ENABLE_OVERLOADING
data MessageRequestBodyDataPropertyInfo
instance AttrInfo MessageRequestBodyDataPropertyInfo where
    type AttrAllowedOps MessageRequestBodyDataPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint MessageRequestBodyDataPropertyInfo = (~) ()
    type AttrBaseTypeConstraint MessageRequestBodyDataPropertyInfo = IsMessage
    type AttrGetType MessageRequestBodyDataPropertyInfo = (Maybe GLib.Bytes.Bytes)
    type AttrLabel MessageRequestBodyDataPropertyInfo = "request-body-data"
    type AttrOrigin MessageRequestBodyDataPropertyInfo = Message
    attrGet _ = getMessageRequestBodyData
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "request-headers"
   -- Type: TInterface (Name {namespace = "Soup", name = "MessageHeaders"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@request-headers@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #requestHeaders
@
-}
getMessageRequestHeaders :: (MonadIO m, IsMessage o) => o -> m (Maybe Soup.MessageHeaders.MessageHeaders)
getMessageRequestHeaders obj = liftIO $ B.Properties.getObjectPropertyBoxed obj "request-headers" Soup.MessageHeaders.MessageHeaders

#if ENABLE_OVERLOADING
data MessageRequestHeadersPropertyInfo
instance AttrInfo MessageRequestHeadersPropertyInfo where
    type AttrAllowedOps MessageRequestHeadersPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint MessageRequestHeadersPropertyInfo = (~) ()
    type AttrBaseTypeConstraint MessageRequestHeadersPropertyInfo = IsMessage
    type AttrGetType MessageRequestHeadersPropertyInfo = (Maybe Soup.MessageHeaders.MessageHeaders)
    type AttrLabel MessageRequestHeadersPropertyInfo = "request-headers"
    type AttrOrigin MessageRequestHeadersPropertyInfo = Message
    attrGet _ = getMessageRequestHeaders
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "response-body"
   -- Type: TInterface (Name {namespace = "Soup", name = "MessageBody"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@response-body@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #responseBody
@
-}
getMessageResponseBody :: (MonadIO m, IsMessage o) => o -> m (Maybe Soup.MessageBody.MessageBody)
getMessageResponseBody obj = liftIO $ B.Properties.getObjectPropertyBoxed obj "response-body" Soup.MessageBody.MessageBody

#if ENABLE_OVERLOADING
data MessageResponseBodyPropertyInfo
instance AttrInfo MessageResponseBodyPropertyInfo where
    type AttrAllowedOps MessageResponseBodyPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint MessageResponseBodyPropertyInfo = (~) ()
    type AttrBaseTypeConstraint MessageResponseBodyPropertyInfo = IsMessage
    type AttrGetType MessageResponseBodyPropertyInfo = (Maybe Soup.MessageBody.MessageBody)
    type AttrLabel MessageResponseBodyPropertyInfo = "response-body"
    type AttrOrigin MessageResponseBodyPropertyInfo = Message
    attrGet _ = getMessageResponseBody
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "response-body-data"
   -- Type: TInterface (Name {namespace = "GLib", name = "Bytes"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@response-body-data@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #responseBodyData
@
-}
getMessageResponseBodyData :: (MonadIO m, IsMessage o) => o -> m (Maybe GLib.Bytes.Bytes)
getMessageResponseBodyData obj = liftIO $ B.Properties.getObjectPropertyBoxed obj "response-body-data" GLib.Bytes.Bytes

#if ENABLE_OVERLOADING
data MessageResponseBodyDataPropertyInfo
instance AttrInfo MessageResponseBodyDataPropertyInfo where
    type AttrAllowedOps MessageResponseBodyDataPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint MessageResponseBodyDataPropertyInfo = (~) ()
    type AttrBaseTypeConstraint MessageResponseBodyDataPropertyInfo = IsMessage
    type AttrGetType MessageResponseBodyDataPropertyInfo = (Maybe GLib.Bytes.Bytes)
    type AttrLabel MessageResponseBodyDataPropertyInfo = "response-body-data"
    type AttrOrigin MessageResponseBodyDataPropertyInfo = Message
    attrGet _ = getMessageResponseBodyData
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "response-headers"
   -- Type: TInterface (Name {namespace = "Soup", name = "MessageHeaders"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@response-headers@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #responseHeaders
@
-}
getMessageResponseHeaders :: (MonadIO m, IsMessage o) => o -> m (Maybe Soup.MessageHeaders.MessageHeaders)
getMessageResponseHeaders obj = liftIO $ B.Properties.getObjectPropertyBoxed obj "response-headers" Soup.MessageHeaders.MessageHeaders

#if ENABLE_OVERLOADING
data MessageResponseHeadersPropertyInfo
instance AttrInfo MessageResponseHeadersPropertyInfo where
    type AttrAllowedOps MessageResponseHeadersPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint MessageResponseHeadersPropertyInfo = (~) ()
    type AttrBaseTypeConstraint MessageResponseHeadersPropertyInfo = IsMessage
    type AttrGetType MessageResponseHeadersPropertyInfo = (Maybe Soup.MessageHeaders.MessageHeaders)
    type AttrLabel MessageResponseHeadersPropertyInfo = "response-headers"
    type AttrOrigin MessageResponseHeadersPropertyInfo = Message
    attrGet _ = getMessageResponseHeaders
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "server-side"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@server-side@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #serverSide
@
-}
getMessageServerSide :: (MonadIO m, IsMessage o) => o -> m Bool
getMessageServerSide obj = liftIO $ B.Properties.getObjectPropertyBool obj "server-side"

{- |
Construct a `GValueConstruct` with valid value for the “@server-side@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMessageServerSide :: (IsMessage o) => Bool -> IO (GValueConstruct o)
constructMessageServerSide val = B.Properties.constructObjectPropertyBool "server-side" val

#if ENABLE_OVERLOADING
data MessageServerSidePropertyInfo
instance AttrInfo MessageServerSidePropertyInfo where
    type AttrAllowedOps MessageServerSidePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MessageServerSidePropertyInfo = (~) Bool
    type AttrBaseTypeConstraint MessageServerSidePropertyInfo = IsMessage
    type AttrGetType MessageServerSidePropertyInfo = Bool
    type AttrLabel MessageServerSidePropertyInfo = "server-side"
    type AttrOrigin MessageServerSidePropertyInfo = Message
    attrGet _ = getMessageServerSide
    attrSet _ = undefined
    attrConstruct _ = constructMessageServerSide
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@status-code@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #statusCode
@
-}
getMessageStatusCode :: (MonadIO m, IsMessage o) => o -> m Word32
getMessageStatusCode obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "status-code"

{- |
Set the value of the “@status-code@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' message [ #statusCode 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMessageStatusCode :: (MonadIO m, IsMessage o) => o -> Word32 -> m ()
setMessageStatusCode obj val = liftIO $ B.Properties.setObjectPropertyUInt32 obj "status-code" val

{- |
Construct a `GValueConstruct` with valid value for the “@status-code@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMessageStatusCode :: (IsMessage o) => Word32 -> IO (GValueConstruct o)
constructMessageStatusCode val = B.Properties.constructObjectPropertyUInt32 "status-code" val

#if ENABLE_OVERLOADING
data MessageStatusCodePropertyInfo
instance AttrInfo MessageStatusCodePropertyInfo where
    type AttrAllowedOps MessageStatusCodePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MessageStatusCodePropertyInfo = (~) Word32
    type AttrBaseTypeConstraint MessageStatusCodePropertyInfo = IsMessage
    type AttrGetType MessageStatusCodePropertyInfo = Word32
    type AttrLabel MessageStatusCodePropertyInfo = "status-code"
    type AttrOrigin MessageStatusCodePropertyInfo = Message
    attrGet _ = getMessageStatusCode
    attrSet _ = setMessageStatusCode
    attrConstruct _ = constructMessageStatusCode
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@tls-certificate@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #tlsCertificate
@
-}
getMessageTlsCertificate :: (MonadIO m, IsMessage o) => o -> m (Maybe Gio.TlsCertificate.TlsCertificate)
getMessageTlsCertificate obj = liftIO $ B.Properties.getObjectPropertyObject obj "tls-certificate" Gio.TlsCertificate.TlsCertificate

{- |
Set the value of the “@tls-certificate@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' message [ #tlsCertificate 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMessageTlsCertificate :: (MonadIO m, IsMessage o, Gio.TlsCertificate.IsTlsCertificate a) => o -> a -> m ()
setMessageTlsCertificate obj val = liftIO $ B.Properties.setObjectPropertyObject obj "tls-certificate" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@tls-certificate@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMessageTlsCertificate :: (IsMessage o, Gio.TlsCertificate.IsTlsCertificate a) => a -> IO (GValueConstruct o)
constructMessageTlsCertificate val = B.Properties.constructObjectPropertyObject "tls-certificate" (Just val)

{- |
Set the value of the “@tls-certificate@” 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' #tlsCertificate
@
-}
clearMessageTlsCertificate :: (MonadIO m, IsMessage o) => o -> m ()
clearMessageTlsCertificate obj = liftIO $ B.Properties.setObjectPropertyObject obj "tls-certificate" (Nothing :: Maybe Gio.TlsCertificate.TlsCertificate)

#if ENABLE_OVERLOADING
data MessageTlsCertificatePropertyInfo
instance AttrInfo MessageTlsCertificatePropertyInfo where
    type AttrAllowedOps MessageTlsCertificatePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint MessageTlsCertificatePropertyInfo = Gio.TlsCertificate.IsTlsCertificate
    type AttrBaseTypeConstraint MessageTlsCertificatePropertyInfo = IsMessage
    type AttrGetType MessageTlsCertificatePropertyInfo = (Maybe Gio.TlsCertificate.TlsCertificate)
    type AttrLabel MessageTlsCertificatePropertyInfo = "tls-certificate"
    type AttrOrigin MessageTlsCertificatePropertyInfo = Message
    attrGet _ = getMessageTlsCertificate
    attrSet _ = setMessageTlsCertificate
    attrConstruct _ = constructMessageTlsCertificate
    attrClear _ = clearMessageTlsCertificate
#endif

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

{- |
Get the value of the “@tls-errors@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #tlsErrors
@
-}
getMessageTlsErrors :: (MonadIO m, IsMessage o) => o -> m [Gio.Flags.TlsCertificateFlags]
getMessageTlsErrors obj = liftIO $ B.Properties.getObjectPropertyFlags obj "tls-errors"

{- |
Set the value of the “@tls-errors@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' message [ #tlsErrors 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMessageTlsErrors :: (MonadIO m, IsMessage o) => o -> [Gio.Flags.TlsCertificateFlags] -> m ()
setMessageTlsErrors obj val = liftIO $ B.Properties.setObjectPropertyFlags obj "tls-errors" val

{- |
Construct a `GValueConstruct` with valid value for the “@tls-errors@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMessageTlsErrors :: (IsMessage o) => [Gio.Flags.TlsCertificateFlags] -> IO (GValueConstruct o)
constructMessageTlsErrors val = B.Properties.constructObjectPropertyFlags "tls-errors" val

#if ENABLE_OVERLOADING
data MessageTlsErrorsPropertyInfo
instance AttrInfo MessageTlsErrorsPropertyInfo where
    type AttrAllowedOps MessageTlsErrorsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MessageTlsErrorsPropertyInfo = (~) [Gio.Flags.TlsCertificateFlags]
    type AttrBaseTypeConstraint MessageTlsErrorsPropertyInfo = IsMessage
    type AttrGetType MessageTlsErrorsPropertyInfo = [Gio.Flags.TlsCertificateFlags]
    type AttrLabel MessageTlsErrorsPropertyInfo = "tls-errors"
    type AttrOrigin MessageTlsErrorsPropertyInfo = Message
    attrGet _ = getMessageTlsErrors
    attrSet _ = setMessageTlsErrors
    attrConstruct _ = constructMessageTlsErrors
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@uri@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' message #uri
@
-}
getMessageUri :: (MonadIO m, IsMessage o) => o -> m Soup.URI.URI
getMessageUri obj = liftIO $ checkUnexpectedNothing "getMessageUri" $ B.Properties.getObjectPropertyBoxed obj "uri" Soup.URI.URI

{- |
Set the value of the “@uri@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' message [ #uri 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMessageUri :: (MonadIO m, IsMessage o) => o -> Soup.URI.URI -> m ()
setMessageUri obj val = liftIO $ B.Properties.setObjectPropertyBoxed obj "uri" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@uri@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMessageUri :: (IsMessage o) => Soup.URI.URI -> IO (GValueConstruct o)
constructMessageUri val = B.Properties.constructObjectPropertyBoxed "uri" (Just val)

#if ENABLE_OVERLOADING
data MessageUriPropertyInfo
instance AttrInfo MessageUriPropertyInfo where
    type AttrAllowedOps MessageUriPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MessageUriPropertyInfo = (~) Soup.URI.URI
    type AttrBaseTypeConstraint MessageUriPropertyInfo = IsMessage
    type AttrGetType MessageUriPropertyInfo = Soup.URI.URI
    type AttrLabel MessageUriPropertyInfo = "uri"
    type AttrOrigin MessageUriPropertyInfo = Message
    attrGet _ = getMessageUri
    attrSet _ = setMessageUri
    attrConstruct _ = constructMessageUri
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList Message
type instance O.AttributeList Message = MessageAttributeList
type MessageAttributeList = ('[ '("firstParty", MessageFirstPartyPropertyInfo), '("flags", MessageFlagsPropertyInfo), '("httpVersion", MessageHttpVersionPropertyInfo), '("method", MessageMethodPropertyInfo), '("priority", MessagePriorityPropertyInfo), '("reasonPhrase", MessageReasonPhrasePropertyInfo), '("requestBody", MessageRequestBodyPropertyInfo), '("requestBodyData", MessageRequestBodyDataPropertyInfo), '("requestHeaders", MessageRequestHeadersPropertyInfo), '("responseBody", MessageResponseBodyPropertyInfo), '("responseBodyData", MessageResponseBodyDataPropertyInfo), '("responseHeaders", MessageResponseHeadersPropertyInfo), '("serverSide", MessageServerSidePropertyInfo), '("statusCode", MessageStatusCodePropertyInfo), '("tlsCertificate", MessageTlsCertificatePropertyInfo), '("tlsErrors", MessageTlsErrorsPropertyInfo), '("uri", MessageUriPropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
messageFirstParty :: AttrLabelProxy "firstParty"
messageFirstParty = AttrLabelProxy

messageFlags :: AttrLabelProxy "flags"
messageFlags = AttrLabelProxy

messageHttpVersion :: AttrLabelProxy "httpVersion"
messageHttpVersion = AttrLabelProxy

messageMethod :: AttrLabelProxy "method"
messageMethod = AttrLabelProxy

messagePriority :: AttrLabelProxy "priority"
messagePriority = AttrLabelProxy

messageReasonPhrase :: AttrLabelProxy "reasonPhrase"
messageReasonPhrase = AttrLabelProxy

messageRequestBody :: AttrLabelProxy "requestBody"
messageRequestBody = AttrLabelProxy

messageRequestBodyData :: AttrLabelProxy "requestBodyData"
messageRequestBodyData = AttrLabelProxy

messageRequestHeaders :: AttrLabelProxy "requestHeaders"
messageRequestHeaders = AttrLabelProxy

messageResponseBody :: AttrLabelProxy "responseBody"
messageResponseBody = AttrLabelProxy

messageResponseBodyData :: AttrLabelProxy "responseBodyData"
messageResponseBodyData = AttrLabelProxy

messageResponseHeaders :: AttrLabelProxy "responseHeaders"
messageResponseHeaders = AttrLabelProxy

messageServerSide :: AttrLabelProxy "serverSide"
messageServerSide = AttrLabelProxy

messageStatusCode :: AttrLabelProxy "statusCode"
messageStatusCode = AttrLabelProxy

messageTlsCertificate :: AttrLabelProxy "tlsCertificate"
messageTlsCertificate = AttrLabelProxy

messageTlsErrors :: AttrLabelProxy "tlsErrors"
messageTlsErrors = AttrLabelProxy

messageUri :: AttrLabelProxy "uri"
messageUri = AttrLabelProxy

#endif

#if ENABLE_OVERLOADING
data MessageContentSniffedSignalInfo
instance SignalInfo MessageContentSniffedSignalInfo where
    type HaskellCallbackType MessageContentSniffedSignalInfo = MessageContentSniffedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageContentSniffedCallback cb
        cb'' <- mk_MessageContentSniffedCallback cb'
        connectSignalFunPtr obj "content-sniffed" cb'' connectMode

data MessageFinishedSignalInfo
instance SignalInfo MessageFinishedSignalInfo where
    type HaskellCallbackType MessageFinishedSignalInfo = MessageFinishedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageFinishedCallback cb
        cb'' <- mk_MessageFinishedCallback cb'
        connectSignalFunPtr obj "finished" cb'' connectMode

data MessageGotBodySignalInfo
instance SignalInfo MessageGotBodySignalInfo where
    type HaskellCallbackType MessageGotBodySignalInfo = MessageGotBodyCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageGotBodyCallback cb
        cb'' <- mk_MessageGotBodyCallback cb'
        connectSignalFunPtr obj "got-body" cb'' connectMode

data MessageGotChunkSignalInfo
instance SignalInfo MessageGotChunkSignalInfo where
    type HaskellCallbackType MessageGotChunkSignalInfo = MessageGotChunkCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageGotChunkCallback cb
        cb'' <- mk_MessageGotChunkCallback cb'
        connectSignalFunPtr obj "got-chunk" cb'' connectMode

data MessageGotHeadersSignalInfo
instance SignalInfo MessageGotHeadersSignalInfo where
    type HaskellCallbackType MessageGotHeadersSignalInfo = MessageGotHeadersCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageGotHeadersCallback cb
        cb'' <- mk_MessageGotHeadersCallback cb'
        connectSignalFunPtr obj "got-headers" cb'' connectMode

data MessageGotInformationalSignalInfo
instance SignalInfo MessageGotInformationalSignalInfo where
    type HaskellCallbackType MessageGotInformationalSignalInfo = MessageGotInformationalCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageGotInformationalCallback cb
        cb'' <- mk_MessageGotInformationalCallback cb'
        connectSignalFunPtr obj "got-informational" cb'' connectMode

data MessageNetworkEventSignalInfo
instance SignalInfo MessageNetworkEventSignalInfo where
    type HaskellCallbackType MessageNetworkEventSignalInfo = MessageNetworkEventCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageNetworkEventCallback cb
        cb'' <- mk_MessageNetworkEventCallback cb'
        connectSignalFunPtr obj "network-event" cb'' connectMode

data MessageRestartedSignalInfo
instance SignalInfo MessageRestartedSignalInfo where
    type HaskellCallbackType MessageRestartedSignalInfo = MessageRestartedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageRestartedCallback cb
        cb'' <- mk_MessageRestartedCallback cb'
        connectSignalFunPtr obj "restarted" cb'' connectMode

data MessageStartingSignalInfo
instance SignalInfo MessageStartingSignalInfo where
    type HaskellCallbackType MessageStartingSignalInfo = MessageStartingCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageStartingCallback cb
        cb'' <- mk_MessageStartingCallback cb'
        connectSignalFunPtr obj "starting" cb'' connectMode

data MessageWroteBodySignalInfo
instance SignalInfo MessageWroteBodySignalInfo where
    type HaskellCallbackType MessageWroteBodySignalInfo = MessageWroteBodyCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageWroteBodyCallback cb
        cb'' <- mk_MessageWroteBodyCallback cb'
        connectSignalFunPtr obj "wrote-body" cb'' connectMode

data MessageWroteBodyDataSignalInfo
instance SignalInfo MessageWroteBodyDataSignalInfo where
    type HaskellCallbackType MessageWroteBodyDataSignalInfo = MessageWroteBodyDataCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageWroteBodyDataCallback cb
        cb'' <- mk_MessageWroteBodyDataCallback cb'
        connectSignalFunPtr obj "wrote-body-data" cb'' connectMode

data MessageWroteChunkSignalInfo
instance SignalInfo MessageWroteChunkSignalInfo where
    type HaskellCallbackType MessageWroteChunkSignalInfo = MessageWroteChunkCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageWroteChunkCallback cb
        cb'' <- mk_MessageWroteChunkCallback cb'
        connectSignalFunPtr obj "wrote-chunk" cb'' connectMode

data MessageWroteHeadersSignalInfo
instance SignalInfo MessageWroteHeadersSignalInfo where
    type HaskellCallbackType MessageWroteHeadersSignalInfo = MessageWroteHeadersCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageWroteHeadersCallback cb
        cb'' <- mk_MessageWroteHeadersCallback cb'
        connectSignalFunPtr obj "wrote-headers" cb'' connectMode

data MessageWroteInformationalSignalInfo
instance SignalInfo MessageWroteInformationalSignalInfo where
    type HaskellCallbackType MessageWroteInformationalSignalInfo = MessageWroteInformationalCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MessageWroteInformationalCallback cb
        cb'' <- mk_MessageWroteInformationalCallback cb'
        connectSignalFunPtr obj "wrote-informational" cb'' connectMode

type instance O.SignalList Message = MessageSignalList
type MessageSignalList = ('[ '("contentSniffed", MessageContentSniffedSignalInfo), '("finished", MessageFinishedSignalInfo), '("gotBody", MessageGotBodySignalInfo), '("gotChunk", MessageGotChunkSignalInfo), '("gotHeaders", MessageGotHeadersSignalInfo), '("gotInformational", MessageGotInformationalSignalInfo), '("networkEvent", MessageNetworkEventSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("restarted", MessageRestartedSignalInfo), '("starting", MessageStartingSignalInfo), '("wroteBody", MessageWroteBodySignalInfo), '("wroteBodyData", MessageWroteBodyDataSignalInfo), '("wroteChunk", MessageWroteChunkSignalInfo), '("wroteHeaders", MessageWroteHeadersSignalInfo), '("wroteInformational", MessageWroteInformationalSignalInfo)] :: [(Symbol, *)])

#endif

-- method Message::new
-- method type : Constructor
-- Args : [Arg {argCName = "method", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the HTTP method for the created request", 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 "the destination endpoint (as a string)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Soup", name = "Message"}))
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_new" soup_message_new ::
    CString ->                              -- method : TBasicType TUTF8
    CString ->                              -- uri_string : TBasicType TUTF8
    IO (Ptr Message)

{- |
Creates a new empty 'GI.Soup.Objects.Message.Message', which will connect to /@uri@/
-}
messageNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@method@/: the HTTP method for the created request -}
    -> T.Text
    {- ^ /@uriString@/: the destination endpoint (as a string) -}
    -> m (Maybe Message)
    {- ^ __Returns:__ the new 'GI.Soup.Objects.Message.Message' (or 'Nothing' if /@uri@/
could not be parsed). -}
messageNew method uriString = liftIO $ do
    method' <- textToCString method
    uriString' <- textToCString uriString
    result <- soup_message_new method' uriString'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject Message) result'
        return result''
    freeMem method'
    freeMem uriString'
    return maybeResult

#if ENABLE_OVERLOADING
#endif

-- method Message::new_from_uri
-- method type : Constructor
-- Args : [Arg {argCName = "method", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the HTTP method for the created request", 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 "the destination endpoint (as a #SoupURI)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Soup", name = "Message"}))
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_new_from_uri" soup_message_new_from_uri ::
    CString ->                              -- method : TBasicType TUTF8
    Ptr Soup.URI.URI ->                     -- uri : TInterface (Name {namespace = "Soup", name = "URI"})
    IO (Ptr Message)

{- |
Creates a new empty 'GI.Soup.Objects.Message.Message', which will connect to /@uri@/
-}
messageNewFromUri ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@method@/: the HTTP method for the created request -}
    -> Soup.URI.URI
    {- ^ /@uri@/: the destination endpoint (as a 'GI.Soup.Structs.URI.URI') -}
    -> m Message
    {- ^ __Returns:__ the new 'GI.Soup.Objects.Message.Message' -}
messageNewFromUri method uri = liftIO $ do
    method' <- textToCString method
    uri' <- unsafeManagedPtrGetPtr uri
    result <- soup_message_new_from_uri method' uri'
    checkUnexpectedReturnNULL "messageNewFromUri" result
    result' <- (wrapObject Message) result
    touchManagedPtr uri
    freeMem method'
    return result'

#if ENABLE_OVERLOADING
#endif

-- method Message::content_sniffed
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "msg", argType = TInterface (Name {namespace = "Soup", name = "Message"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "content_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "params", argType = TGHash (TBasicType TPtr) (TBasicType TPtr), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_content_sniffed" soup_message_content_sniffed ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    CString ->                              -- content_type : TBasicType TUTF8
    Ptr (GHashTable (Ptr ()) (Ptr ())) ->   -- params : TGHash (TBasicType TPtr) (TBasicType TPtr)
    IO ()

{- |
/No description available in the introspection data./
-}
messageContentSniffed ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> T.Text
    -> Map.Map (Ptr ()) (Ptr ())
    -> m ()
messageContentSniffed msg contentType params = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    contentType' <- textToCString contentType
    let params' = Map.toList params
    let params'' = mapFirst ptrPackPtr params'
    let params''' = mapSecond ptrPackPtr params''
    params'''' <- packGHashTable gDirectHash gDirectEqual Nothing Nothing params'''
    soup_message_content_sniffed msg' contentType' params''''
    touchManagedPtr msg
    freeMem contentType'
    unrefGHashTable params''''
    return ()

#if ENABLE_OVERLOADING
data MessageContentSniffedMethodInfo
instance (signature ~ (T.Text -> Map.Map (Ptr ()) (Ptr ()) -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageContentSniffedMethodInfo a signature where
    overloadedMethod _ = messageContentSniffed

#endif

-- method Message::disable_feature
-- method type : OrdinaryMethod
-- Args : [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 = "feature_type", argType = TBasicType TGType, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GType of a #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_message_disable_feature" soup_message_disable_feature ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    CGType ->                               -- feature_type : TBasicType TGType
    IO ()

{- |
This disables the actions of 'GI.Soup.Interfaces.SessionFeature.SessionFeature'\<!-- -->s with the
given /@featureType@/ (or a subclass of that type) on /@msg@/, so that
/@msg@/ is processed as though the feature(s) hadn\'t been added to the
session. Eg, passing @/SOUP_TYPE_CONTENT_SNIFFER/@ for /@featureType@/
will disable Content-Type sniffing on the message.

You must call this before queueing /@msg@/ on a session; calling it on
a message that has already been queued is undefined. In particular,
you cannot call this on a message that is being requeued after a
redirect or authentication.

/Since: 2.28/
-}
messageDisableFeature ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> GType
    {- ^ /@featureType@/: the 'GType' of a 'GI.Soup.Interfaces.SessionFeature.SessionFeature' -}
    -> m ()
messageDisableFeature msg featureType = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    let featureType' = gtypeToCGType featureType
    soup_message_disable_feature msg' featureType'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageDisableFeatureMethodInfo
instance (signature ~ (GType -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageDisableFeatureMethodInfo a signature where
    overloadedMethod _ = messageDisableFeature

#endif

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

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

{- |
/No description available in the introspection data./
-}
messageFinished ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> m ()
messageFinished msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    soup_message_finished msg'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageFinishedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageFinishedMethodInfo a signature where
    overloadedMethod _ = messageFinished

#endif

-- method Message::get_address
-- method type : OrdinaryMethod
-- Args : [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 = "Address"}))
-- throws : False
-- Skip return : False

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

{- |
Gets the address /@msg@/\'s URI points to. After first setting the
URI on a message, this will be unresolved, although the message\'s
session will resolve it before sending the message.

/Since: 2.26/
-}
messageGetAddress ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> m Soup.Address.Address
    {- ^ __Returns:__ the address /@msg@/\'s URI points to -}
messageGetAddress msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    result <- soup_message_get_address msg'
    checkUnexpectedReturnNULL "messageGetAddress" result
    result' <- (newObject Soup.Address.Address) result
    touchManagedPtr msg
    return result'

#if ENABLE_OVERLOADING
data MessageGetAddressMethodInfo
instance (signature ~ (m Soup.Address.Address), MonadIO m, IsMessage a) => O.MethodInfo MessageGetAddressMethodInfo a signature where
    overloadedMethod _ = messageGetAddress

#endif

-- method Message::get_first_party
-- method type : OrdinaryMethod
-- Args : [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 = "URI"}))
-- throws : False
-- Skip return : False

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

{- |
Gets /@msg@/\'s first-party 'GI.Soup.Structs.URI.URI'

/Since: 2.30/
-}
messageGetFirstParty ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> m Soup.URI.URI
    {- ^ __Returns:__ the /@msg@/\'s first party 'GI.Soup.Structs.URI.URI' -}
messageGetFirstParty msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    result <- soup_message_get_first_party msg'
    checkUnexpectedReturnNULL "messageGetFirstParty" result
    result' <- (newBoxed Soup.URI.URI) result
    touchManagedPtr msg
    return result'

#if ENABLE_OVERLOADING
data MessageGetFirstPartyMethodInfo
instance (signature ~ (m Soup.URI.URI), MonadIO m, IsMessage a) => O.MethodInfo MessageGetFirstPartyMethodInfo a signature where
    overloadedMethod _ = messageGetFirstParty

#endif

-- method Message::get_flags
-- method type : OrdinaryMethod
-- Args : [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 = "MessageFlags"}))
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_get_flags" soup_message_get_flags ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO CUInt

{- |
Gets the flags on /@msg@/
-}
messageGetFlags ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> m [Soup.Flags.MessageFlags]
    {- ^ __Returns:__ the flags -}
messageGetFlags msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    result <- soup_message_get_flags msg'
    let result' = wordToGFlags result
    touchManagedPtr msg
    return result'

#if ENABLE_OVERLOADING
data MessageGetFlagsMethodInfo
instance (signature ~ (m [Soup.Flags.MessageFlags]), MonadIO m, IsMessage a) => O.MethodInfo MessageGetFlagsMethodInfo a signature where
    overloadedMethod _ = messageGetFlags

#endif

-- method Message::get_http_version
-- method type : OrdinaryMethod
-- Args : [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 = "HTTPVersion"}))
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_get_http_version" soup_message_get_http_version ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO CUInt

{- |
Gets the HTTP version of /@msg@/. This is the minimum of the
version from the request and the version from the response.
-}
messageGetHttpVersion ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> m Soup.Enums.HTTPVersion
    {- ^ __Returns:__ the HTTP version -}
messageGetHttpVersion msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    result <- soup_message_get_http_version msg'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr msg
    return result'

#if ENABLE_OVERLOADING
data MessageGetHttpVersionMethodInfo
instance (signature ~ (m Soup.Enums.HTTPVersion), MonadIO m, IsMessage a) => O.MethodInfo MessageGetHttpVersionMethodInfo a signature where
    overloadedMethod _ = messageGetHttpVersion

#endif

-- method Message::get_https_status
-- method type : OrdinaryMethod
-- Args : [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 = "certificate", argType = TInterface (Name {namespace = "Gio", name = "TlsCertificate"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "@msg's TLS certificate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "errors", argType = TInterface (Name {namespace = "Gio", name = "TlsCertificateFlags"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the verification status of @certificate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_get_https_status" soup_message_get_https_status ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    Ptr (Ptr Gio.TlsCertificate.TlsCertificate) -> -- certificate : TInterface (Name {namespace = "Gio", name = "TlsCertificate"})
    Ptr CUInt ->                            -- errors : TInterface (Name {namespace = "Gio", name = "TlsCertificateFlags"})
    IO CInt

{- |
If /@msg@/ is using https (or attempted to use https but got
'GI.Soup.Enums.StatusSslFailed'), this retrieves the 'GI.Gio.Objects.TlsCertificate.TlsCertificate'
associated with its connection, and the 'GI.Gio.Flags.TlsCertificateFlags'
showing what problems, if any, have been found with that
certificate.

\<note>\<para>This is only meaningful with messages processed by a 'GI.Soup.Objects.Session.Session' and is
not useful for messages received by a 'GI.Soup.Objects.Server.Server'\<\/para>\<\/note>

/Since: 2.34/
-}
messageGetHttpsStatus ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> m ((Bool, Gio.TlsCertificate.TlsCertificate, [Gio.Flags.TlsCertificateFlags]))
    {- ^ __Returns:__ 'True' if /@msg@/ used\/attempted https, 'False' if not -}
messageGetHttpsStatus msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    certificate <- allocMem :: IO (Ptr (Ptr Gio.TlsCertificate.TlsCertificate))
    errors <- allocMem :: IO (Ptr CUInt)
    result <- soup_message_get_https_status msg' certificate errors
    let result' = (/= 0) result
    certificate' <- peek certificate
    certificate'' <- (newObject Gio.TlsCertificate.TlsCertificate) certificate'
    errors' <- peek errors
    let errors'' = wordToGFlags errors'
    touchManagedPtr msg
    freeMem certificate
    freeMem errors
    return (result', certificate'', errors'')

#if ENABLE_OVERLOADING
data MessageGetHttpsStatusMethodInfo
instance (signature ~ (m ((Bool, Gio.TlsCertificate.TlsCertificate, [Gio.Flags.TlsCertificateFlags]))), MonadIO m, IsMessage a) => O.MethodInfo MessageGetHttpsStatusMethodInfo a signature where
    overloadedMethod _ = messageGetHttpsStatus

#endif

-- method Message::get_priority
-- method type : OrdinaryMethod
-- Args : [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 = "MessagePriority"}))
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_get_priority" soup_message_get_priority ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    IO CUInt

{- |
Retrieves the 'GI.Soup.Enums.MessagePriority'. If not set this value defaults
to @/SOUP_MESSAGE_PRIORITY_NORMAL/@.

/Since: 2.44/
-}
messageGetPriority ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> m Soup.Enums.MessagePriority
    {- ^ __Returns:__ the priority of the message. -}
messageGetPriority msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    result <- soup_message_get_priority msg'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr msg
    return result'

#if ENABLE_OVERLOADING
data MessageGetPriorityMethodInfo
instance (signature ~ (m Soup.Enums.MessagePriority), MonadIO m, IsMessage a) => O.MethodInfo MessageGetPriorityMethodInfo a signature where
    overloadedMethod _ = messageGetPriority

#endif

-- method Message::get_soup_request
-- method type : OrdinaryMethod
-- Args : [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 = "Request"}))
-- throws : False
-- Skip return : False

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

{- |
If /@msg@/ is associated with a 'GI.Soup.Objects.Request.Request', this returns that
request. Otherwise it returns 'Nothing'.

/Since: 2.42/
-}
messageGetSoupRequest ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> m Soup.Request.Request
    {- ^ __Returns:__ /@msg@/\'s associated 'GI.Soup.Objects.Request.Request' -}
messageGetSoupRequest msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    result <- soup_message_get_soup_request msg'
    checkUnexpectedReturnNULL "messageGetSoupRequest" result
    result' <- (newObject Soup.Request.Request) result
    touchManagedPtr msg
    return result'

#if ENABLE_OVERLOADING
data MessageGetSoupRequestMethodInfo
instance (signature ~ (m Soup.Request.Request), MonadIO m, IsMessage a) => O.MethodInfo MessageGetSoupRequestMethodInfo a signature where
    overloadedMethod _ = messageGetSoupRequest

#endif

-- method Message::get_uri
-- method type : OrdinaryMethod
-- Args : [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 = "URI"}))
-- throws : False
-- Skip return : False

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

{- |
Gets /@msg@/\'s URI
-}
messageGetUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> m Soup.URI.URI
    {- ^ __Returns:__ the URI /@msg@/ is targeted for. -}
messageGetUri msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    result <- soup_message_get_uri msg'
    checkUnexpectedReturnNULL "messageGetUri" result
    result' <- (newBoxed Soup.URI.URI) result
    touchManagedPtr msg
    return result'

#if ENABLE_OVERLOADING
data MessageGetUriMethodInfo
instance (signature ~ (m Soup.URI.URI), MonadIO m, IsMessage a) => O.MethodInfo MessageGetUriMethodInfo a signature where
    overloadedMethod _ = messageGetUri

#endif

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

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

{- |
/No description available in the introspection data./
-}
messageGotBody ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> m ()
messageGotBody msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    soup_message_got_body msg'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageGotBodyMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageGotBodyMethodInfo a signature where
    overloadedMethod _ = messageGotBody

#endif

-- method Message::got_chunk
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "msg", argType = TInterface (Name {namespace = "Soup", name = "Message"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "chunk", argType = TInterface (Name {namespace = "Soup", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_got_chunk" soup_message_got_chunk ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    Ptr Soup.Buffer.Buffer ->               -- chunk : TInterface (Name {namespace = "Soup", name = "Buffer"})
    IO ()

{- |
/No description available in the introspection data./
-}
messageGotChunk ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> Soup.Buffer.Buffer
    -> m ()
messageGotChunk msg chunk = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    chunk' <- unsafeManagedPtrGetPtr chunk
    soup_message_got_chunk msg' chunk'
    touchManagedPtr msg
    touchManagedPtr chunk
    return ()

#if ENABLE_OVERLOADING
data MessageGotChunkMethodInfo
instance (signature ~ (Soup.Buffer.Buffer -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageGotChunkMethodInfo a signature where
    overloadedMethod _ = messageGotChunk

#endif

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

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

{- |
/No description available in the introspection data./
-}
messageGotHeaders ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> m ()
messageGotHeaders msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    soup_message_got_headers msg'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageGotHeadersMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageGotHeadersMethodInfo a signature where
    overloadedMethod _ = messageGotHeaders

#endif

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

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

{- |
/No description available in the introspection data./
-}
messageGotInformational ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> m ()
messageGotInformational msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    soup_message_got_informational msg'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageGotInformationalMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageGotInformationalMethodInfo a signature where
    overloadedMethod _ = messageGotInformational

#endif

-- method Message::is_keepalive
-- method type : OrdinaryMethod
-- Args : [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 (TBasicType TBoolean)
-- throws : False
-- Skip return : False

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

{- |
Determines whether or not /@msg@/\'s connection can be kept alive for
further requests after processing /@msg@/, based on the HTTP version,
Connection header, etc.
-}
messageIsKeepalive ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> m Bool
    {- ^ __Returns:__ 'True' or 'False'. -}
messageIsKeepalive msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    result <- soup_message_is_keepalive msg'
    let result' = (/= 0) result
    touchManagedPtr msg
    return result'

#if ENABLE_OVERLOADING
data MessageIsKeepaliveMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMessage a) => O.MethodInfo MessageIsKeepaliveMethodInfo a signature where
    overloadedMethod _ = messageIsKeepalive

#endif

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

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

{- |
/No description available in the introspection data./
-}
messageRestarted ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> m ()
messageRestarted msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    soup_message_restarted msg'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageRestartedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageRestartedMethodInfo a signature where
    overloadedMethod _ = messageRestarted

#endif

-- method Message::set_chunk_allocator
-- method type : OrdinaryMethod
-- Args : [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 = "allocator", argType = TInterface (Name {namespace = "Soup", name = "ChunkAllocator"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the chunk allocator callback", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 2, argDestroy = 3, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to @allocator", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "destroy_notify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "destroy notifier to free @user_data when @msg is\ndestroyed", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_set_chunk_allocator" soup_message_set_chunk_allocator ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    FunPtr Soup.Callbacks.C_ChunkAllocator -> -- allocator : TInterface (Name {namespace = "Soup", name = "ChunkAllocator"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- destroy_notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

{-# DEPRECATED messageSetChunkAllocator ["'GI.Soup.Objects.Request.Request' provides a much simpler API that lets you","read the response directly into your own buffers without needing to","mess with callbacks, pausing\\/unpausing, etc."] #-}
{- |
Sets an alternate chunk-allocation function to use when reading
/@msg@/\'s body when using the traditional (ie,
non-'GI.Soup.Objects.Request.Request'\<!-- -->-based) API. Every time data is available
to read, libsoup will call /@allocator@/, which should return a
'GI.Soup.Structs.Buffer.Buffer'. (See 'GI.Soup.Callbacks.ChunkAllocator' for additional details.)
Libsoup will then read data from the network into that buffer, and
update the buffer\'s \<literal>length\<\/literal> to indicate how much
data it read.

Generally, a custom chunk allocator would be used in conjunction
with 'GI.Soup.Structs.MessageBody.messageBodySetAccumulate' 'False' and
'GI.Soup.Objects.Message.Message'::@/got_chunk/@, as part of a strategy to avoid unnecessary
copying of data. However, you cannot assume that every call to the
allocator will be followed by a call to your
'GI.Soup.Objects.Message.Message'::@/got_chunk/@ handler; if an I\/O error occurs, then the
buffer will be unreffed without ever having been used. If your
buffer-allocation strategy requires special cleanup, use
'GI.Soup.Structs.Buffer.bufferNewWithOwner' rather than doing the cleanup from the
'GI.Soup.Objects.Message.Message'::@/got_chunk/@ handler.

The other thing to remember when using non-accumulating message
bodies is that the buffer passed to the 'GI.Soup.Objects.Message.Message'::@/got_chunk/@
handler will be unreffed after the handler returns, just as it
would be in the non-custom-allocated case. If you want to hand the
chunk data off to some other part of your program to use later,
you\'ll need to ref the 'GI.Soup.Structs.Buffer.Buffer' (or its owner, in the
'GI.Soup.Structs.Buffer.bufferNewWithOwner' case) to ensure that the data remains
valid.
-}
messageSetChunkAllocator ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> Soup.Callbacks.ChunkAllocator
    {- ^ /@allocator@/: the chunk allocator callback -}
    -> m ()
messageSetChunkAllocator msg allocator = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    allocator' <- Soup.Callbacks.mk_ChunkAllocator (Soup.Callbacks.wrap_ChunkAllocator Nothing (Soup.Callbacks.drop_closures_ChunkAllocator allocator))
    let userData = castFunPtrToPtr allocator'
    let destroyNotify = safeFreeFunPtrPtr
    soup_message_set_chunk_allocator msg' allocator' userData destroyNotify
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageSetChunkAllocatorMethodInfo
instance (signature ~ (Soup.Callbacks.ChunkAllocator -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageSetChunkAllocatorMethodInfo a signature where
    overloadedMethod _ = messageSetChunkAllocator

#endif

-- method Message::set_first_party
-- method type : OrdinaryMethod
-- Args : [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 = "first_party", argType = TInterface (Name {namespace = "Soup", name = "URI"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #SoupURI for the @msg's first party", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_set_first_party" soup_message_set_first_party ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    Ptr Soup.URI.URI ->                     -- first_party : TInterface (Name {namespace = "Soup", name = "URI"})
    IO ()

{- |
Sets /@firstParty@/ as the main document 'GI.Soup.Structs.URI.URI' for /@msg@/. For
details of when and how this is used refer to the documentation for
'GI.Soup.Enums.CookieJarAcceptPolicy'.

/Since: 2.30/
-}
messageSetFirstParty ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> Soup.URI.URI
    {- ^ /@firstParty@/: the 'GI.Soup.Structs.URI.URI' for the /@msg@/\'s first party -}
    -> m ()
messageSetFirstParty msg firstParty = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    firstParty' <- unsafeManagedPtrGetPtr firstParty
    soup_message_set_first_party msg' firstParty'
    touchManagedPtr msg
    touchManagedPtr firstParty
    return ()

#if ENABLE_OVERLOADING
data MessageSetFirstPartyMethodInfo
instance (signature ~ (Soup.URI.URI -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageSetFirstPartyMethodInfo a signature where
    overloadedMethod _ = messageSetFirstParty

#endif

-- method Message::set_flags
-- method type : OrdinaryMethod
-- Args : [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 = "flags", argType = TInterface (Name {namespace = "Soup", name = "MessageFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a set of #SoupMessageFlags values", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_set_flags" soup_message_set_flags ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Soup", name = "MessageFlags"})
    IO ()

{- |
Sets the specified flags on /@msg@/.
-}
messageSetFlags ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> [Soup.Flags.MessageFlags]
    {- ^ /@flags@/: a set of 'GI.Soup.Flags.MessageFlags' values -}
    -> m ()
messageSetFlags msg flags = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    let flags' = gflagsToWord flags
    soup_message_set_flags msg' flags'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageSetFlagsMethodInfo
instance (signature ~ ([Soup.Flags.MessageFlags] -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageSetFlagsMethodInfo a signature where
    overloadedMethod _ = messageSetFlags

#endif

-- method Message::set_http_version
-- method type : OrdinaryMethod
-- Args : [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 = "version", argType = TInterface (Name {namespace = "Soup", name = "HTTPVersion"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the HTTP version", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_set_http_version" soup_message_set_http_version ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    CUInt ->                                -- version : TInterface (Name {namespace = "Soup", name = "HTTPVersion"})
    IO ()

{- |
Sets the HTTP version on /@msg@/. The default version is
'GI.Soup.Enums.HTTPVersionHttp11'. Setting it to 'GI.Soup.Enums.HTTPVersionHttp10' will prevent certain
functionality from being used.
-}
messageSetHttpVersion ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> Soup.Enums.HTTPVersion
    {- ^ /@version@/: the HTTP version -}
    -> m ()
messageSetHttpVersion msg version = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    let version' = (fromIntegral . fromEnum) version
    soup_message_set_http_version msg' version'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageSetHttpVersionMethodInfo
instance (signature ~ (Soup.Enums.HTTPVersion -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageSetHttpVersionMethodInfo a signature where
    overloadedMethod _ = messageSetHttpVersion

#endif

-- method Message::set_priority
-- method type : OrdinaryMethod
-- Args : [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 = "priority", argType = TInterface (Name {namespace = "Soup", name = "MessagePriority"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #SoupMessagePriority", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_set_priority" soup_message_set_priority ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    CUInt ->                                -- priority : TInterface (Name {namespace = "Soup", name = "MessagePriority"})
    IO ()

{- |
Sets the priority of a message. Note that this won\'t have any
effect unless used before the message is added to the session\'s
message processing queue.

The message will be placed just before any other previously added
message with lower priority (messages with the same priority are
processed on a FIFO basis).

Setting priorities does not currently work with 'GI.Soup.Objects.SessionSync.SessionSync'
(or with synchronous messages on a plain 'GI.Soup.Objects.Session.Session') because in
the synchronous\/blocking case, priority ends up being determined
semi-randomly by thread scheduling.

/Since: 2.44/
-}
messageSetPriority ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> Soup.Enums.MessagePriority
    {- ^ /@priority@/: the 'GI.Soup.Enums.MessagePriority' -}
    -> m ()
messageSetPriority msg priority = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    let priority' = (fromIntegral . fromEnum) priority
    soup_message_set_priority msg' priority'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageSetPriorityMethodInfo
instance (signature ~ (Soup.Enums.MessagePriority -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageSetPriorityMethodInfo a signature where
    overloadedMethod _ = messageSetPriority

#endif

-- method Message::set_redirect
-- method type : OrdinaryMethod
-- Args : [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 = "status_code", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a 3xx status code", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "redirect_uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the URI to redirect @msg to", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_set_redirect" soup_message_set_redirect ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    Word32 ->                               -- status_code : TBasicType TUInt
    CString ->                              -- redirect_uri : TBasicType TUTF8
    IO ()

{- |
Sets /@msg@/\'s status_code to /@statusCode@/ and adds a Location header
pointing to /@redirectUri@/. Use this from a 'GI.Soup.Objects.Server.Server' when you
want to redirect the client to another URI.

/@redirectUri@/ can be a relative URI, in which case it is
interpreted relative to /@msg@/\'s current URI. In particular, if
/@redirectUri@/ is just a path, it will replace the path
\<emphasis>and query\<\/emphasis> of /@msg@/\'s URI.

/Since: 2.38/
-}
messageSetRedirect ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> Word32
    {- ^ /@statusCode@/: a 3xx status code -}
    -> T.Text
    {- ^ /@redirectUri@/: the URI to redirect /@msg@/ to -}
    -> m ()
messageSetRedirect msg statusCode redirectUri = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    redirectUri' <- textToCString redirectUri
    soup_message_set_redirect msg' statusCode redirectUri'
    touchManagedPtr msg
    freeMem redirectUri'
    return ()

#if ENABLE_OVERLOADING
data MessageSetRedirectMethodInfo
instance (signature ~ (Word32 -> T.Text -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageSetRedirectMethodInfo a signature where
    overloadedMethod _ = messageSetRedirect

#endif

-- method Message::set_request
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "msg", argType = TInterface (Name {namespace = "Soup", name = "Message"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the message", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "content_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "MIME Content-Type of the body", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "req_use", argType = TInterface (Name {namespace = "Soup", name = "MemoryUse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #SoupMemoryUse describing how to handle @req_body", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "req_body", argType = TCArray False (-1) 4 (TBasicType TUInt8), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "\n  a data buffer containing the body of the message request.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "req_length", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the byte length of @req_body.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : [Arg {argCName = "req_length", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the byte length of @req_body.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_set_request" soup_message_set_request ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    CString ->                              -- content_type : TBasicType TUTF8
    CUInt ->                                -- req_use : TInterface (Name {namespace = "Soup", name = "MemoryUse"})
    Ptr Word8 ->                            -- req_body : TCArray False (-1) 4 (TBasicType TUInt8)
    Word64 ->                               -- req_length : TBasicType TUInt64
    IO ()

{- |
Convenience function to set the request body of a 'GI.Soup.Objects.Message.Message'. If
/@contentType@/ is 'Nothing', the request body must be empty as well.
-}
messageSetRequest ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: the message -}
    -> Maybe (T.Text)
    {- ^ /@contentType@/: MIME Content-Type of the body -}
    -> Soup.Enums.MemoryUse
    {- ^ /@reqUse@/: a 'GI.Soup.Enums.MemoryUse' describing how to handle /@reqBody@/ -}
    -> Maybe (ByteString)
    {- ^ /@reqBody@/: 
  a data buffer containing the body of the message request. -}
    -> m ()
messageSetRequest msg contentType reqUse reqBody = liftIO $ do
    let reqLength = case reqBody of
            Nothing -> 0
            Just jReqBody -> fromIntegral $ B.length jReqBody
    msg' <- unsafeManagedPtrCastPtr msg
    maybeContentType <- case contentType of
        Nothing -> return nullPtr
        Just jContentType -> do
            jContentType' <- textToCString jContentType
            return jContentType'
    let reqUse' = (fromIntegral . fromEnum) reqUse
    maybeReqBody <- case reqBody of
        Nothing -> return nullPtr
        Just jReqBody -> do
            jReqBody' <- packByteString jReqBody
            return jReqBody'
    soup_message_set_request msg' maybeContentType reqUse' maybeReqBody reqLength
    touchManagedPtr msg
    freeMem maybeContentType
    freeMem maybeReqBody
    return ()

#if ENABLE_OVERLOADING
data MessageSetRequestMethodInfo
instance (signature ~ (Maybe (T.Text) -> Soup.Enums.MemoryUse -> Maybe (ByteString) -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageSetRequestMethodInfo a signature where
    overloadedMethod _ = messageSetRequest

#endif

-- method Message::set_response
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "msg", argType = TInterface (Name {namespace = "Soup", name = "Message"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the message", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "content_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "MIME Content-Type of the body", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "resp_use", argType = TInterface (Name {namespace = "Soup", name = "MemoryUse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #SoupMemoryUse describing how to handle @resp_body", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "resp_body", argType = TCArray False (-1) 4 (TBasicType TUInt8), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "\n  a data buffer containing the body of the message response.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "resp_length", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the byte length of @resp_body.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : [Arg {argCName = "resp_length", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the byte length of @resp_body.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_set_response" soup_message_set_response ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    CString ->                              -- content_type : TBasicType TUTF8
    CUInt ->                                -- resp_use : TInterface (Name {namespace = "Soup", name = "MemoryUse"})
    Ptr Word8 ->                            -- resp_body : TCArray False (-1) 4 (TBasicType TUInt8)
    Word64 ->                               -- resp_length : TBasicType TUInt64
    IO ()

{- |
Convenience function to set the response body of a 'GI.Soup.Objects.Message.Message'. If
/@contentType@/ is 'Nothing', the response body must be empty as well.
-}
messageSetResponse ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: the message -}
    -> Maybe (T.Text)
    {- ^ /@contentType@/: MIME Content-Type of the body -}
    -> Soup.Enums.MemoryUse
    {- ^ /@respUse@/: a 'GI.Soup.Enums.MemoryUse' describing how to handle /@respBody@/ -}
    -> Maybe (ByteString)
    {- ^ /@respBody@/: 
  a data buffer containing the body of the message response. -}
    -> m ()
messageSetResponse msg contentType respUse respBody = liftIO $ do
    let respLength = case respBody of
            Nothing -> 0
            Just jRespBody -> fromIntegral $ B.length jRespBody
    msg' <- unsafeManagedPtrCastPtr msg
    maybeContentType <- case contentType of
        Nothing -> return nullPtr
        Just jContentType -> do
            jContentType' <- textToCString jContentType
            return jContentType'
    let respUse' = (fromIntegral . fromEnum) respUse
    maybeRespBody <- case respBody of
        Nothing -> return nullPtr
        Just jRespBody -> do
            jRespBody' <- packByteString jRespBody
            return jRespBody'
    soup_message_set_response msg' maybeContentType respUse' maybeRespBody respLength
    touchManagedPtr msg
    freeMem maybeContentType
    freeMem maybeRespBody
    return ()

#if ENABLE_OVERLOADING
data MessageSetResponseMethodInfo
instance (signature ~ (Maybe (T.Text) -> Soup.Enums.MemoryUse -> Maybe (ByteString) -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageSetResponseMethodInfo a signature where
    overloadedMethod _ = messageSetResponse

#endif

-- method Message::set_status
-- method type : OrdinaryMethod
-- Args : [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 = "status_code", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an HTTP status code", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

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

{- |
Sets /@msg@/\'s status code to /@statusCode@/. If /@statusCode@/ is a
known value, it will also set /@msg@/\'s reason_phrase.
-}
messageSetStatus ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> Word32
    {- ^ /@statusCode@/: an HTTP status code -}
    -> m ()
messageSetStatus msg statusCode = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    soup_message_set_status msg' statusCode
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageSetStatusMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageSetStatusMethodInfo a signature where
    overloadedMethod _ = messageSetStatus

#endif

-- method Message::set_status_full
-- method type : OrdinaryMethod
-- Args : [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 = "status_code", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an HTTP status code", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "reason_phrase", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a description of the status", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_set_status_full" soup_message_set_status_full ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    Word32 ->                               -- status_code : TBasicType TUInt
    CString ->                              -- reason_phrase : TBasicType TUTF8
    IO ()

{- |
Sets /@msg@/\'s status code and reason phrase.
-}
messageSetStatusFull ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> Word32
    {- ^ /@statusCode@/: an HTTP status code -}
    -> T.Text
    {- ^ /@reasonPhrase@/: a description of the status -}
    -> m ()
messageSetStatusFull msg statusCode reasonPhrase = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    reasonPhrase' <- textToCString reasonPhrase
    soup_message_set_status_full msg' statusCode reasonPhrase'
    touchManagedPtr msg
    freeMem reasonPhrase'
    return ()

#if ENABLE_OVERLOADING
data MessageSetStatusFullMethodInfo
instance (signature ~ (Word32 -> T.Text -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageSetStatusFullMethodInfo a signature where
    overloadedMethod _ = messageSetStatusFull

#endif

-- method Message::set_uri
-- method type : OrdinaryMethod
-- Args : [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 = "uri", argType = TInterface (Name {namespace = "Soup", name = "URI"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the new #SoupURI", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_set_uri" soup_message_set_uri ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    Ptr Soup.URI.URI ->                     -- uri : TInterface (Name {namespace = "Soup", name = "URI"})
    IO ()

{- |
Sets /@msg@/\'s URI to /@uri@/. If /@msg@/ has already been sent and you want
to re-send it with the new URI, you need to call
'GI.Soup.Objects.Session.sessionRequeueMessage'.
-}
messageSetUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    {- ^ /@msg@/: a 'GI.Soup.Objects.Message.Message' -}
    -> Soup.URI.URI
    {- ^ /@uri@/: the new 'GI.Soup.Structs.URI.URI' -}
    -> m ()
messageSetUri msg uri = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    uri' <- unsafeManagedPtrGetPtr uri
    soup_message_set_uri msg' uri'
    touchManagedPtr msg
    touchManagedPtr uri
    return ()

#if ENABLE_OVERLOADING
data MessageSetUriMethodInfo
instance (signature ~ (Soup.URI.URI -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageSetUriMethodInfo a signature where
    overloadedMethod _ = messageSetUri

#endif

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

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

{- |
/No description available in the introspection data./
-}
messageStarting ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> m ()
messageStarting msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    soup_message_starting msg'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageStartingMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageStartingMethodInfo a signature where
    overloadedMethod _ = messageStarting

#endif

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

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

{- |
/No description available in the introspection data./
-}
messageWroteBody ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> m ()
messageWroteBody msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    soup_message_wrote_body msg'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageWroteBodyMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageWroteBodyMethodInfo a signature where
    overloadedMethod _ = messageWroteBody

#endif

-- method Message::wrote_body_data
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "msg", argType = TInterface (Name {namespace = "Soup", name = "Message"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "chunk", argType = TInterface (Name {namespace = "Soup", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "soup_message_wrote_body_data" soup_message_wrote_body_data ::
    Ptr Message ->                          -- msg : TInterface (Name {namespace = "Soup", name = "Message"})
    Ptr Soup.Buffer.Buffer ->               -- chunk : TInterface (Name {namespace = "Soup", name = "Buffer"})
    IO ()

{- |
/No description available in the introspection data./
-}
messageWroteBodyData ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> Soup.Buffer.Buffer
    -> m ()
messageWroteBodyData msg chunk = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    chunk' <- unsafeManagedPtrGetPtr chunk
    soup_message_wrote_body_data msg' chunk'
    touchManagedPtr msg
    touchManagedPtr chunk
    return ()

#if ENABLE_OVERLOADING
data MessageWroteBodyDataMethodInfo
instance (signature ~ (Soup.Buffer.Buffer -> m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageWroteBodyDataMethodInfo a signature where
    overloadedMethod _ = messageWroteBodyData

#endif

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

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

{- |
/No description available in the introspection data./
-}
messageWroteChunk ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> m ()
messageWroteChunk msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    soup_message_wrote_chunk msg'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageWroteChunkMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageWroteChunkMethodInfo a signature where
    overloadedMethod _ = messageWroteChunk

#endif

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

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

{- |
/No description available in the introspection data./
-}
messageWroteHeaders ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> m ()
messageWroteHeaders msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    soup_message_wrote_headers msg'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageWroteHeadersMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageWroteHeadersMethodInfo a signature where
    overloadedMethod _ = messageWroteHeaders

#endif

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

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

{- |
/No description available in the introspection data./
-}
messageWroteInformational ::
    (B.CallStack.HasCallStack, MonadIO m, IsMessage a) =>
    a
    -> m ()
messageWroteInformational msg = liftIO $ do
    msg' <- unsafeManagedPtrCastPtr msg
    soup_message_wrote_informational msg'
    touchManagedPtr msg
    return ()

#if ENABLE_OVERLOADING
data MessageWroteInformationalMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMessage a) => O.MethodInfo MessageWroteInformationalMethodInfo a signature where
    overloadedMethod _ = messageWroteInformational

#endif