{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.WebKit2.Objects.URIResponse
    ( 

-- * Exported types
    URIResponse(..)                         ,
    IsURIResponse                           ,
    toURIResponse                           ,
    noURIResponse                           ,


 -- * Methods
-- ** getContentLength #method:getContentLength#
    URIResponseGetContentLengthMethodInfo   ,
    uRIResponseGetContentLength             ,


-- ** getHttpHeaders #method:getHttpHeaders#
    URIResponseGetHttpHeadersMethodInfo     ,
    uRIResponseGetHttpHeaders               ,


-- ** getMimeType #method:getMimeType#
    URIResponseGetMimeTypeMethodInfo        ,
    uRIResponseGetMimeType                  ,


-- ** getStatusCode #method:getStatusCode#
    URIResponseGetStatusCodeMethodInfo      ,
    uRIResponseGetStatusCode                ,


-- ** getSuggestedFilename #method:getSuggestedFilename#
    URIResponseGetSuggestedFilenameMethodInfo,
    uRIResponseGetSuggestedFilename         ,


-- ** getUri #method:getUri#
    URIResponseGetUriMethodInfo             ,
    uRIResponseGetUri                       ,




 -- * Properties
-- ** contentLength #attr:contentLength#
    URIResponseContentLengthPropertyInfo    ,
    getURIResponseContentLength             ,
    uRIResponseContentLength                ,


-- ** httpHeaders #attr:httpHeaders#
    URIResponseHttpHeadersPropertyInfo      ,
    getURIResponseHttpHeaders               ,
    uRIResponseHttpHeaders                  ,


-- ** mimeType #attr:mimeType#
    URIResponseMimeTypePropertyInfo         ,
    getURIResponseMimeType                  ,
    uRIResponseMimeType                     ,


-- ** statusCode #attr:statusCode#
    URIResponseStatusCodePropertyInfo       ,
    getURIResponseStatusCode                ,
    uRIResponseStatusCode                   ,


-- ** suggestedFilename #attr:suggestedFilename#
    URIResponseSuggestedFilenamePropertyInfo,
    getURIResponseSuggestedFilename         ,
    uRIResponseSuggestedFilename            ,


-- ** uri #attr:uri#
    URIResponseUriPropertyInfo              ,
    getURIResponseUri                       ,
    uRIResponseUri                          ,




    ) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
import qualified GI.Soup.Structs.MessageHeaders as Soup.MessageHeaders

newtype URIResponse = URIResponse (ManagedPtr URIResponse)
foreign import ccall "webkit_uri_response_get_type"
    c_webkit_uri_response_get_type :: IO GType

instance GObject URIResponse where
    gobjectType _ = c_webkit_uri_response_get_type
    

class GObject o => IsURIResponse o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError URIResponse a) =>
    IsURIResponse a
#endif
instance IsURIResponse URIResponse
instance GObject.Object.IsObject URIResponse

toURIResponse :: IsURIResponse o => o -> IO URIResponse
toURIResponse = unsafeCastTo URIResponse

noURIResponse :: Maybe URIResponse
noURIResponse = Nothing

type family ResolveURIResponseMethod (t :: Symbol) (o :: *) :: * where
    ResolveURIResponseMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveURIResponseMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveURIResponseMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveURIResponseMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveURIResponseMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveURIResponseMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveURIResponseMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveURIResponseMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveURIResponseMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveURIResponseMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveURIResponseMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveURIResponseMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveURIResponseMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveURIResponseMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveURIResponseMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveURIResponseMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveURIResponseMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveURIResponseMethod "getContentLength" o = URIResponseGetContentLengthMethodInfo
    ResolveURIResponseMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveURIResponseMethod "getHttpHeaders" o = URIResponseGetHttpHeadersMethodInfo
    ResolveURIResponseMethod "getMimeType" o = URIResponseGetMimeTypeMethodInfo
    ResolveURIResponseMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveURIResponseMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveURIResponseMethod "getStatusCode" o = URIResponseGetStatusCodeMethodInfo
    ResolveURIResponseMethod "getSuggestedFilename" o = URIResponseGetSuggestedFilenameMethodInfo
    ResolveURIResponseMethod "getUri" o = URIResponseGetUriMethodInfo
    ResolveURIResponseMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveURIResponseMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveURIResponseMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveURIResponseMethod t URIResponse, O.MethodInfo info URIResponse p) => O.IsLabelProxy t (URIResponse -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveURIResponseMethod t URIResponse, O.MethodInfo info URIResponse p) => O.IsLabel t (URIResponse -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- VVV Prop "content-length"
   -- Type: TBasicType TUInt64
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getURIResponseContentLength :: (MonadIO m, IsURIResponse o) => o -> m Word64
getURIResponseContentLength obj = liftIO $ getObjectPropertyUInt64 obj "content-length"

data URIResponseContentLengthPropertyInfo
instance AttrInfo URIResponseContentLengthPropertyInfo where
    type AttrAllowedOps URIResponseContentLengthPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint URIResponseContentLengthPropertyInfo = (~) ()
    type AttrBaseTypeConstraint URIResponseContentLengthPropertyInfo = IsURIResponse
    type AttrGetType URIResponseContentLengthPropertyInfo = Word64
    type AttrLabel URIResponseContentLengthPropertyInfo = "content-length"
    type AttrOrigin URIResponseContentLengthPropertyInfo = URIResponse
    attrGet _ = getURIResponseContentLength
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

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

getURIResponseHttpHeaders :: (MonadIO m, IsURIResponse o) => o -> m Soup.MessageHeaders.MessageHeaders
getURIResponseHttpHeaders obj = liftIO $ checkUnexpectedNothing "getURIResponseHttpHeaders" $ getObjectPropertyBoxed obj "http-headers" Soup.MessageHeaders.MessageHeaders

data URIResponseHttpHeadersPropertyInfo
instance AttrInfo URIResponseHttpHeadersPropertyInfo where
    type AttrAllowedOps URIResponseHttpHeadersPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint URIResponseHttpHeadersPropertyInfo = (~) ()
    type AttrBaseTypeConstraint URIResponseHttpHeadersPropertyInfo = IsURIResponse
    type AttrGetType URIResponseHttpHeadersPropertyInfo = Soup.MessageHeaders.MessageHeaders
    type AttrLabel URIResponseHttpHeadersPropertyInfo = "http-headers"
    type AttrOrigin URIResponseHttpHeadersPropertyInfo = URIResponse
    attrGet _ = getURIResponseHttpHeaders
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "mime-type"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getURIResponseMimeType :: (MonadIO m, IsURIResponse o) => o -> m T.Text
getURIResponseMimeType obj = liftIO $ checkUnexpectedNothing "getURIResponseMimeType" $ getObjectPropertyString obj "mime-type"

data URIResponseMimeTypePropertyInfo
instance AttrInfo URIResponseMimeTypePropertyInfo where
    type AttrAllowedOps URIResponseMimeTypePropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint URIResponseMimeTypePropertyInfo = (~) ()
    type AttrBaseTypeConstraint URIResponseMimeTypePropertyInfo = IsURIResponse
    type AttrGetType URIResponseMimeTypePropertyInfo = T.Text
    type AttrLabel URIResponseMimeTypePropertyInfo = "mime-type"
    type AttrOrigin URIResponseMimeTypePropertyInfo = URIResponse
    attrGet _ = getURIResponseMimeType
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

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

getURIResponseStatusCode :: (MonadIO m, IsURIResponse o) => o -> m Word32
getURIResponseStatusCode obj = liftIO $ getObjectPropertyUInt32 obj "status-code"

data URIResponseStatusCodePropertyInfo
instance AttrInfo URIResponseStatusCodePropertyInfo where
    type AttrAllowedOps URIResponseStatusCodePropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint URIResponseStatusCodePropertyInfo = (~) ()
    type AttrBaseTypeConstraint URIResponseStatusCodePropertyInfo = IsURIResponse
    type AttrGetType URIResponseStatusCodePropertyInfo = Word32
    type AttrLabel URIResponseStatusCodePropertyInfo = "status-code"
    type AttrOrigin URIResponseStatusCodePropertyInfo = URIResponse
    attrGet _ = getURIResponseStatusCode
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "suggested-filename"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getURIResponseSuggestedFilename :: (MonadIO m, IsURIResponse o) => o -> m T.Text
getURIResponseSuggestedFilename obj = liftIO $ checkUnexpectedNothing "getURIResponseSuggestedFilename" $ getObjectPropertyString obj "suggested-filename"

data URIResponseSuggestedFilenamePropertyInfo
instance AttrInfo URIResponseSuggestedFilenamePropertyInfo where
    type AttrAllowedOps URIResponseSuggestedFilenamePropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint URIResponseSuggestedFilenamePropertyInfo = (~) ()
    type AttrBaseTypeConstraint URIResponseSuggestedFilenamePropertyInfo = IsURIResponse
    type AttrGetType URIResponseSuggestedFilenamePropertyInfo = T.Text
    type AttrLabel URIResponseSuggestedFilenamePropertyInfo = "suggested-filename"
    type AttrOrigin URIResponseSuggestedFilenamePropertyInfo = URIResponse
    attrGet _ = getURIResponseSuggestedFilename
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

-- VVV Prop "uri"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

getURIResponseUri :: (MonadIO m, IsURIResponse o) => o -> m T.Text
getURIResponseUri obj = liftIO $ checkUnexpectedNothing "getURIResponseUri" $ getObjectPropertyString obj "uri"

data URIResponseUriPropertyInfo
instance AttrInfo URIResponseUriPropertyInfo where
    type AttrAllowedOps URIResponseUriPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint URIResponseUriPropertyInfo = (~) ()
    type AttrBaseTypeConstraint URIResponseUriPropertyInfo = IsURIResponse
    type AttrGetType URIResponseUriPropertyInfo = T.Text
    type AttrLabel URIResponseUriPropertyInfo = "uri"
    type AttrOrigin URIResponseUriPropertyInfo = URIResponse
    attrGet _ = getURIResponseUri
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

instance O.HasAttributeList URIResponse
type instance O.AttributeList URIResponse = URIResponseAttributeList
type URIResponseAttributeList = ('[ '("contentLength", URIResponseContentLengthPropertyInfo), '("httpHeaders", URIResponseHttpHeadersPropertyInfo), '("mimeType", URIResponseMimeTypePropertyInfo), '("statusCode", URIResponseStatusCodePropertyInfo), '("suggestedFilename", URIResponseSuggestedFilenamePropertyInfo), '("uri", URIResponseUriPropertyInfo)] :: [(Symbol, *)])

uRIResponseContentLength :: AttrLabelProxy "contentLength"
uRIResponseContentLength = AttrLabelProxy

uRIResponseHttpHeaders :: AttrLabelProxy "httpHeaders"
uRIResponseHttpHeaders = AttrLabelProxy

uRIResponseMimeType :: AttrLabelProxy "mimeType"
uRIResponseMimeType = AttrLabelProxy

uRIResponseStatusCode :: AttrLabelProxy "statusCode"
uRIResponseStatusCode = AttrLabelProxy

uRIResponseSuggestedFilename :: AttrLabelProxy "suggestedFilename"
uRIResponseSuggestedFilename = AttrLabelProxy

uRIResponseUri :: AttrLabelProxy "uri"
uRIResponseUri = AttrLabelProxy

type instance O.SignalList URIResponse = URIResponseSignalList
type URIResponseSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method URIResponse::get_content_length
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "response", argType = TInterface (Name {namespace = "WebKit2", name = "URIResponse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitURIResponse", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_uri_response_get_content_length" webkit_uri_response_get_content_length :: 
    Ptr URIResponse ->                      -- response : TInterface (Name {namespace = "WebKit2", name = "URIResponse"})
    IO Word64

{- |
Get the expected content length of the 'GI.WebKit2.Objects.URIResponse.URIResponse'. It can
be 0 if the server provided an incorrect or missing Content-Length.
-}
uRIResponseGetContentLength ::
    (B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
    a
    {- ^ /@response@/: a 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
    -> m Word64
    {- ^ __Returns:__ the expected content length of /@response@/. -}
uRIResponseGetContentLength response = liftIO $ do
    response' <- unsafeManagedPtrCastPtr response
    result <- webkit_uri_response_get_content_length response'
    touchManagedPtr response
    return result

data URIResponseGetContentLengthMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsURIResponse a) => O.MethodInfo URIResponseGetContentLengthMethodInfo a signature where
    overloadedMethod _ = uRIResponseGetContentLength

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

foreign import ccall "webkit_uri_response_get_http_headers" webkit_uri_response_get_http_headers :: 
    Ptr URIResponse ->                      -- response : TInterface (Name {namespace = "WebKit2", name = "URIResponse"})
    IO (Ptr Soup.MessageHeaders.MessageHeaders)

{- |
Get the HTTP headers of a 'GI.WebKit2.Objects.URIResponse.URIResponse' as a 'GI.Soup.Structs.MessageHeaders.MessageHeaders'.

@since 2.6
-}
uRIResponseGetHttpHeaders ::
    (B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
    a
    {- ^ /@response@/: a 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
    -> m Soup.MessageHeaders.MessageHeaders
    {- ^ __Returns:__ a 'GI.Soup.Structs.MessageHeaders.MessageHeaders' with the HTTP headers of /@response@/
   or 'Nothing' if /@response@/ is not an HTTP response. -}
uRIResponseGetHttpHeaders response = liftIO $ do
    response' <- unsafeManagedPtrCastPtr response
    result <- webkit_uri_response_get_http_headers response'
    checkUnexpectedReturnNULL "uRIResponseGetHttpHeaders" result
    result' <- (newBoxed Soup.MessageHeaders.MessageHeaders) result
    touchManagedPtr response
    return result'

data URIResponseGetHttpHeadersMethodInfo
instance (signature ~ (m Soup.MessageHeaders.MessageHeaders), MonadIO m, IsURIResponse a) => O.MethodInfo URIResponseGetHttpHeadersMethodInfo a signature where
    overloadedMethod _ = uRIResponseGetHttpHeaders

-- method URIResponse::get_mime_type
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "response", argType = TInterface (Name {namespace = "WebKit2", name = "URIResponse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitURIResponse", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_uri_response_get_mime_type" webkit_uri_response_get_mime_type :: 
    Ptr URIResponse ->                      -- response : TInterface (Name {namespace = "WebKit2", name = "URIResponse"})
    IO CString

{- |
/No description available in the introspection data./
-}
uRIResponseGetMimeType ::
    (B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
    a
    {- ^ /@response@/: a 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
    -> m T.Text
    {- ^ __Returns:__ the MIME type of the 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
uRIResponseGetMimeType response = liftIO $ do
    response' <- unsafeManagedPtrCastPtr response
    result <- webkit_uri_response_get_mime_type response'
    checkUnexpectedReturnNULL "uRIResponseGetMimeType" result
    result' <- cstringToText result
    touchManagedPtr response
    return result'

data URIResponseGetMimeTypeMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsURIResponse a) => O.MethodInfo URIResponseGetMimeTypeMethodInfo a signature where
    overloadedMethod _ = uRIResponseGetMimeType

-- method URIResponse::get_status_code
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "response", argType = TInterface (Name {namespace = "WebKit2", name = "URIResponse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitURIResponse", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_uri_response_get_status_code" webkit_uri_response_get_status_code :: 
    Ptr URIResponse ->                      -- response : TInterface (Name {namespace = "WebKit2", name = "URIResponse"})
    IO Word32

{- |
Get the status code of the 'GI.WebKit2.Objects.URIResponse.URIResponse' as returned by
the server. It will normally be a 'GI.Soup.Enums.KnownStatusCode', for
example 'GI.Soup.Enums.StatusOk', though the server can respond with any
unsigned integer.
-}
uRIResponseGetStatusCode ::
    (B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
    a
    {- ^ /@response@/: a 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
    -> m Word32
    {- ^ __Returns:__ the status code of /@response@/ -}
uRIResponseGetStatusCode response = liftIO $ do
    response' <- unsafeManagedPtrCastPtr response
    result <- webkit_uri_response_get_status_code response'
    touchManagedPtr response
    return result

data URIResponseGetStatusCodeMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsURIResponse a) => O.MethodInfo URIResponseGetStatusCodeMethodInfo a signature where
    overloadedMethod _ = uRIResponseGetStatusCode

-- method URIResponse::get_suggested_filename
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "response", argType = TInterface (Name {namespace = "WebKit2", name = "URIResponse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitURIResponse", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_uri_response_get_suggested_filename" webkit_uri_response_get_suggested_filename :: 
    Ptr URIResponse ->                      -- response : TInterface (Name {namespace = "WebKit2", name = "URIResponse"})
    IO CString

{- |
Get the suggested filename for /@response@/, as specified by
the \'Content-Disposition\' HTTP header, or 'Nothing' if it\'s not
present.
-}
uRIResponseGetSuggestedFilename ::
    (B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
    a
    {- ^ /@response@/: a 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
    -> m T.Text
    {- ^ __Returns:__ the suggested filename or 'Nothing' if
   the \'Content-Disposition\' HTTP header is not present. -}
uRIResponseGetSuggestedFilename response = liftIO $ do
    response' <- unsafeManagedPtrCastPtr response
    result <- webkit_uri_response_get_suggested_filename response'
    checkUnexpectedReturnNULL "uRIResponseGetSuggestedFilename" result
    result' <- cstringToText result
    touchManagedPtr response
    return result'

data URIResponseGetSuggestedFilenameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsURIResponse a) => O.MethodInfo URIResponseGetSuggestedFilenameMethodInfo a signature where
    overloadedMethod _ = uRIResponseGetSuggestedFilename

-- method URIResponse::get_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "response", argType = TInterface (Name {namespace = "WebKit2", name = "URIResponse"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitURIResponse", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_uri_response_get_uri" webkit_uri_response_get_uri :: 
    Ptr URIResponse ->                      -- response : TInterface (Name {namespace = "WebKit2", name = "URIResponse"})
    IO CString

{- |
/No description available in the introspection data./
-}
uRIResponseGetUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsURIResponse a) =>
    a
    {- ^ /@response@/: a 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
    -> m T.Text
    {- ^ __Returns:__ the uri of the 'GI.WebKit2.Objects.URIResponse.URIResponse' -}
uRIResponseGetUri response = liftIO $ do
    response' <- unsafeManagedPtrCastPtr response
    result <- webkit_uri_response_get_uri response'
    checkUnexpectedReturnNULL "uRIResponseGetUri" result
    result' <- cstringToText result
    touchManagedPtr response
    return result'

data URIResponseGetUriMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsURIResponse a) => O.MethodInfo URIResponseGetUriMethodInfo a signature where
    overloadedMethod _ = uRIResponseGetUri