module GI.Ggit.Structs.FetchOptions
(
FetchOptions(..) ,
noFetchOptions ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
FetchOptionsCopyMethodInfo ,
#endif
fetchOptionsCopy ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
FetchOptionsFreeMethodInfo ,
#endif
fetchOptionsFree ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
FetchOptionsGetDownloadTagsMethodInfo ,
#endif
fetchOptionsGetDownloadTags ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
FetchOptionsGetRemoteCallbacksMethodInfo,
#endif
fetchOptionsGetRemoteCallbacks ,
fetchOptionsNew ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
FetchOptionsSetDownloadTagsMethodInfo ,
#endif
fetchOptionsSetDownloadTags ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
FetchOptionsSetRemoteCallbacksMethodInfo,
#endif
fetchOptionsSetRemoteCallbacks ,
) 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.Ggit.Enums as Ggit.Enums
import qualified GI.Ggit.Objects.RemoteCallbacks as Ggit.RemoteCallbacks
newtype FetchOptions = FetchOptions (ManagedPtr FetchOptions)
foreign import ccall "ggit_fetch_options_get_type" c_ggit_fetch_options_get_type ::
IO GType
instance BoxedObject FetchOptions where
boxedType _ = c_ggit_fetch_options_get_type
noFetchOptions :: Maybe FetchOptions
noFetchOptions = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList FetchOptions
type instance O.AttributeList FetchOptions = FetchOptionsAttributeList
type FetchOptionsAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_fetch_options_new" ggit_fetch_options_new ::
IO (Ptr FetchOptions)
fetchOptionsNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m FetchOptions
fetchOptionsNew = liftIO $ do
result <- ggit_fetch_options_new
checkUnexpectedReturnNULL "fetchOptionsNew" result
result' <- (wrapBoxed FetchOptions) result
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif
foreign import ccall "ggit_fetch_options_copy" ggit_fetch_options_copy ::
Ptr FetchOptions ->
IO (Ptr FetchOptions)
fetchOptionsCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
FetchOptions
-> m FetchOptions
fetchOptionsCopy fetchOptions = liftIO $ do
fetchOptions' <- unsafeManagedPtrGetPtr fetchOptions
result <- ggit_fetch_options_copy fetchOptions'
checkUnexpectedReturnNULL "fetchOptionsCopy" result
result' <- (wrapBoxed FetchOptions) result
touchManagedPtr fetchOptions
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FetchOptionsCopyMethodInfo
instance (signature ~ (m FetchOptions), MonadIO m) => O.MethodInfo FetchOptionsCopyMethodInfo FetchOptions signature where
overloadedMethod _ = fetchOptionsCopy
#endif
foreign import ccall "ggit_fetch_options_free" ggit_fetch_options_free ::
Ptr FetchOptions ->
IO ()
fetchOptionsFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
FetchOptions
-> m ()
fetchOptionsFree fetchOptions = liftIO $ do
fetchOptions' <- unsafeManagedPtrGetPtr fetchOptions
ggit_fetch_options_free fetchOptions'
touchManagedPtr fetchOptions
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FetchOptionsFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo FetchOptionsFreeMethodInfo FetchOptions signature where
overloadedMethod _ = fetchOptionsFree
#endif
foreign import ccall "ggit_fetch_options_get_download_tags" ggit_fetch_options_get_download_tags ::
Ptr FetchOptions ->
IO CUInt
fetchOptionsGetDownloadTags ::
(B.CallStack.HasCallStack, MonadIO m) =>
FetchOptions
-> m Ggit.Enums.RemoteDownloadTagsType
fetchOptionsGetDownloadTags options = liftIO $ do
options' <- unsafeManagedPtrGetPtr options
result <- ggit_fetch_options_get_download_tags options'
let result' = (toEnum . fromIntegral) result
touchManagedPtr options
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FetchOptionsGetDownloadTagsMethodInfo
instance (signature ~ (m Ggit.Enums.RemoteDownloadTagsType), MonadIO m) => O.MethodInfo FetchOptionsGetDownloadTagsMethodInfo FetchOptions signature where
overloadedMethod _ = fetchOptionsGetDownloadTags
#endif
foreign import ccall "ggit_fetch_options_get_remote_callbacks" ggit_fetch_options_get_remote_callbacks ::
Ptr FetchOptions ->
IO (Ptr Ggit.RemoteCallbacks.RemoteCallbacks)
fetchOptionsGetRemoteCallbacks ::
(B.CallStack.HasCallStack, MonadIO m) =>
FetchOptions
-> m Ggit.RemoteCallbacks.RemoteCallbacks
fetchOptionsGetRemoteCallbacks options = liftIO $ do
options' <- unsafeManagedPtrGetPtr options
result <- ggit_fetch_options_get_remote_callbacks options'
checkUnexpectedReturnNULL "fetchOptionsGetRemoteCallbacks" result
result' <- (newObject Ggit.RemoteCallbacks.RemoteCallbacks) result
touchManagedPtr options
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FetchOptionsGetRemoteCallbacksMethodInfo
instance (signature ~ (m Ggit.RemoteCallbacks.RemoteCallbacks), MonadIO m) => O.MethodInfo FetchOptionsGetRemoteCallbacksMethodInfo FetchOptions signature where
overloadedMethod _ = fetchOptionsGetRemoteCallbacks
#endif
foreign import ccall "ggit_fetch_options_set_download_tags" ggit_fetch_options_set_download_tags ::
Ptr FetchOptions ->
CUInt ->
IO ()
fetchOptionsSetDownloadTags ::
(B.CallStack.HasCallStack, MonadIO m) =>
FetchOptions
-> Ggit.Enums.RemoteDownloadTagsType
-> m ()
fetchOptionsSetDownloadTags options downloadTags = liftIO $ do
options' <- unsafeManagedPtrGetPtr options
let downloadTags' = (fromIntegral . fromEnum) downloadTags
ggit_fetch_options_set_download_tags options' downloadTags'
touchManagedPtr options
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FetchOptionsSetDownloadTagsMethodInfo
instance (signature ~ (Ggit.Enums.RemoteDownloadTagsType -> m ()), MonadIO m) => O.MethodInfo FetchOptionsSetDownloadTagsMethodInfo FetchOptions signature where
overloadedMethod _ = fetchOptionsSetDownloadTags
#endif
foreign import ccall "ggit_fetch_options_set_remote_callbacks" ggit_fetch_options_set_remote_callbacks ::
Ptr FetchOptions ->
Ptr Ggit.RemoteCallbacks.RemoteCallbacks ->
IO ()
fetchOptionsSetRemoteCallbacks ::
(B.CallStack.HasCallStack, MonadIO m, Ggit.RemoteCallbacks.IsRemoteCallbacks a) =>
FetchOptions
-> Maybe (a)
-> m ()
fetchOptionsSetRemoteCallbacks options callbacks = liftIO $ do
options' <- unsafeManagedPtrGetPtr options
maybeCallbacks <- case callbacks of
Nothing -> return nullPtr
Just jCallbacks -> do
jCallbacks' <- unsafeManagedPtrCastPtr jCallbacks
return jCallbacks'
ggit_fetch_options_set_remote_callbacks options' maybeCallbacks
touchManagedPtr options
whenJust callbacks touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data FetchOptionsSetRemoteCallbacksMethodInfo
instance (signature ~ (Maybe (a) -> m ()), MonadIO m, Ggit.RemoteCallbacks.IsRemoteCallbacks a) => O.MethodInfo FetchOptionsSetRemoteCallbacksMethodInfo FetchOptions signature where
overloadedMethod _ = fetchOptionsSetRemoteCallbacks
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveFetchOptionsMethod (t :: Symbol) (o :: *) :: * where
ResolveFetchOptionsMethod "copy" o = FetchOptionsCopyMethodInfo
ResolveFetchOptionsMethod "free" o = FetchOptionsFreeMethodInfo
ResolveFetchOptionsMethod "getDownloadTags" o = FetchOptionsGetDownloadTagsMethodInfo
ResolveFetchOptionsMethod "getRemoteCallbacks" o = FetchOptionsGetRemoteCallbacksMethodInfo
ResolveFetchOptionsMethod "setDownloadTags" o = FetchOptionsSetDownloadTagsMethodInfo
ResolveFetchOptionsMethod "setRemoteCallbacks" o = FetchOptionsSetRemoteCallbacksMethodInfo
ResolveFetchOptionsMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFetchOptionsMethod t FetchOptions, O.MethodInfo info FetchOptions p) => O.IsLabelProxy t (FetchOptions -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveFetchOptionsMethod t FetchOptions, O.MethodInfo info FetchOptions p) => O.IsLabel t (FetchOptions -> 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
#endif