{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Ggit.Structs.CredSshInteractivePrompt
(
CredSshInteractivePrompt(..) ,
noCredSshInteractivePrompt ,
#if defined(ENABLE_OVERLOADING)
ResolveCredSshInteractivePromptMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
CredSshInteractivePromptGetInstructionMethodInfo,
#endif
credSshInteractivePromptGetInstruction ,
#if defined(ENABLE_OVERLOADING)
CredSshInteractivePromptGetNameMethodInfo,
#endif
credSshInteractivePromptGetName ,
#if defined(ENABLE_OVERLOADING)
CredSshInteractivePromptGetResponseMethodInfo,
#endif
credSshInteractivePromptGetResponse ,
#if defined(ENABLE_OVERLOADING)
CredSshInteractivePromptGetTextMethodInfo,
#endif
credSshInteractivePromptGetText ,
#if defined(ENABLE_OVERLOADING)
CredSshInteractivePromptIsMaskedMethodInfo,
#endif
credSshInteractivePromptIsMasked ,
credSshInteractivePromptNew ,
#if defined(ENABLE_OVERLOADING)
CredSshInteractivePromptRefMethodInfo ,
#endif
credSshInteractivePromptRef ,
#if defined(ENABLE_OVERLOADING)
CredSshInteractivePromptSetResponseMethodInfo,
#endif
credSshInteractivePromptSetResponse ,
#if defined(ENABLE_OVERLOADING)
CredSshInteractivePromptUnrefMethodInfo ,
#endif
credSshInteractivePromptUnref ,
) 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.GI.Base.Signals as B.Signals
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
newtype CredSshInteractivePrompt = CredSshInteractivePrompt (ManagedPtr CredSshInteractivePrompt)
deriving (Eq)
foreign import ccall "ggit_cred_ssh_interactive_prompt_get_type" c_ggit_cred_ssh_interactive_prompt_get_type ::
IO GType
instance BoxedObject CredSshInteractivePrompt where
boxedType _ = c_ggit_cred_ssh_interactive_prompt_get_type
instance B.GValue.IsGValue CredSshInteractivePrompt where
toGValue o = do
gtype <- c_ggit_cred_ssh_interactive_prompt_get_type
B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_boxed)
fromGValue gv = do
ptr <- B.GValue.get_boxed gv :: IO (Ptr CredSshInteractivePrompt)
B.ManagedPtr.newBoxed CredSshInteractivePrompt ptr
noCredSshInteractivePrompt :: Maybe CredSshInteractivePrompt
noCredSshInteractivePrompt = Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList CredSshInteractivePrompt
type instance O.AttributeList CredSshInteractivePrompt = CredSshInteractivePromptAttributeList
type CredSshInteractivePromptAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_cred_ssh_interactive_prompt_new" ggit_cred_ssh_interactive_prompt_new ::
CString ->
CString ->
CString ->
CInt ->
IO (Ptr CredSshInteractivePrompt)
credSshInteractivePromptNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> T.Text
-> T.Text
-> Bool
-> m CredSshInteractivePrompt
credSshInteractivePromptNew name instruction text isMasked = liftIO $ do
name' <- textToCString name
instruction' <- textToCString instruction
text' <- textToCString text
let isMasked' = (fromIntegral . fromEnum) isMasked
result <- ggit_cred_ssh_interactive_prompt_new name' instruction' text' isMasked'
checkUnexpectedReturnNULL "credSshInteractivePromptNew" result
result' <- (wrapBoxed CredSshInteractivePrompt) result
freeMem name'
freeMem instruction'
freeMem text'
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ggit_cred_ssh_interactive_prompt_get_instruction" ggit_cred_ssh_interactive_prompt_get_instruction ::
Ptr CredSshInteractivePrompt ->
IO CString
credSshInteractivePromptGetInstruction ::
(B.CallStack.HasCallStack, MonadIO m) =>
CredSshInteractivePrompt
-> m T.Text
credSshInteractivePromptGetInstruction prompt = liftIO $ do
prompt' <- unsafeManagedPtrGetPtr prompt
result <- ggit_cred_ssh_interactive_prompt_get_instruction prompt'
checkUnexpectedReturnNULL "credSshInteractivePromptGetInstruction" result
result' <- cstringToText result
touchManagedPtr prompt
return result'
#if defined(ENABLE_OVERLOADING)
data CredSshInteractivePromptGetInstructionMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo CredSshInteractivePromptGetInstructionMethodInfo CredSshInteractivePrompt signature where
overloadedMethod = credSshInteractivePromptGetInstruction
#endif
foreign import ccall "ggit_cred_ssh_interactive_prompt_get_name" ggit_cred_ssh_interactive_prompt_get_name ::
Ptr CredSshInteractivePrompt ->
IO CString
credSshInteractivePromptGetName ::
(B.CallStack.HasCallStack, MonadIO m) =>
CredSshInteractivePrompt
-> m T.Text
credSshInteractivePromptGetName prompt = liftIO $ do
prompt' <- unsafeManagedPtrGetPtr prompt
result <- ggit_cred_ssh_interactive_prompt_get_name prompt'
checkUnexpectedReturnNULL "credSshInteractivePromptGetName" result
result' <- cstringToText result
touchManagedPtr prompt
return result'
#if defined(ENABLE_OVERLOADING)
data CredSshInteractivePromptGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo CredSshInteractivePromptGetNameMethodInfo CredSshInteractivePrompt signature where
overloadedMethod = credSshInteractivePromptGetName
#endif
foreign import ccall "ggit_cred_ssh_interactive_prompt_get_response" ggit_cred_ssh_interactive_prompt_get_response ::
Ptr CredSshInteractivePrompt ->
IO CString
credSshInteractivePromptGetResponse ::
(B.CallStack.HasCallStack, MonadIO m) =>
CredSshInteractivePrompt
-> m T.Text
credSshInteractivePromptGetResponse prompt = liftIO $ do
prompt' <- unsafeManagedPtrGetPtr prompt
result <- ggit_cred_ssh_interactive_prompt_get_response prompt'
checkUnexpectedReturnNULL "credSshInteractivePromptGetResponse" result
result' <- cstringToText result
touchManagedPtr prompt
return result'
#if defined(ENABLE_OVERLOADING)
data CredSshInteractivePromptGetResponseMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo CredSshInteractivePromptGetResponseMethodInfo CredSshInteractivePrompt signature where
overloadedMethod = credSshInteractivePromptGetResponse
#endif
foreign import ccall "ggit_cred_ssh_interactive_prompt_get_text" ggit_cred_ssh_interactive_prompt_get_text ::
Ptr CredSshInteractivePrompt ->
IO CString
credSshInteractivePromptGetText ::
(B.CallStack.HasCallStack, MonadIO m) =>
CredSshInteractivePrompt
-> m T.Text
credSshInteractivePromptGetText prompt = liftIO $ do
prompt' <- unsafeManagedPtrGetPtr prompt
result <- ggit_cred_ssh_interactive_prompt_get_text prompt'
checkUnexpectedReturnNULL "credSshInteractivePromptGetText" result
result' <- cstringToText result
touchManagedPtr prompt
return result'
#if defined(ENABLE_OVERLOADING)
data CredSshInteractivePromptGetTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo CredSshInteractivePromptGetTextMethodInfo CredSshInteractivePrompt signature where
overloadedMethod = credSshInteractivePromptGetText
#endif
foreign import ccall "ggit_cred_ssh_interactive_prompt_is_masked" ggit_cred_ssh_interactive_prompt_is_masked ::
Ptr CredSshInteractivePrompt ->
IO CInt
credSshInteractivePromptIsMasked ::
(B.CallStack.HasCallStack, MonadIO m) =>
CredSshInteractivePrompt
-> m Bool
credSshInteractivePromptIsMasked prompt = liftIO $ do
prompt' <- unsafeManagedPtrGetPtr prompt
result <- ggit_cred_ssh_interactive_prompt_is_masked prompt'
let result' = (/= 0) result
touchManagedPtr prompt
return result'
#if defined(ENABLE_OVERLOADING)
data CredSshInteractivePromptIsMaskedMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo CredSshInteractivePromptIsMaskedMethodInfo CredSshInteractivePrompt signature where
overloadedMethod = credSshInteractivePromptIsMasked
#endif
foreign import ccall "ggit_cred_ssh_interactive_prompt_ref" ggit_cred_ssh_interactive_prompt_ref ::
Ptr CredSshInteractivePrompt ->
IO (Ptr CredSshInteractivePrompt)
credSshInteractivePromptRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
CredSshInteractivePrompt
-> m CredSshInteractivePrompt
credSshInteractivePromptRef prompt = liftIO $ do
prompt' <- unsafeManagedPtrGetPtr prompt
result <- ggit_cred_ssh_interactive_prompt_ref prompt'
checkUnexpectedReturnNULL "credSshInteractivePromptRef" result
result' <- (wrapBoxed CredSshInteractivePrompt) result
touchManagedPtr prompt
return result'
#if defined(ENABLE_OVERLOADING)
data CredSshInteractivePromptRefMethodInfo
instance (signature ~ (m CredSshInteractivePrompt), MonadIO m) => O.MethodInfo CredSshInteractivePromptRefMethodInfo CredSshInteractivePrompt signature where
overloadedMethod = credSshInteractivePromptRef
#endif
foreign import ccall "ggit_cred_ssh_interactive_prompt_set_response" ggit_cred_ssh_interactive_prompt_set_response ::
Ptr CredSshInteractivePrompt ->
CString ->
IO ()
credSshInteractivePromptSetResponse ::
(B.CallStack.HasCallStack, MonadIO m) =>
CredSshInteractivePrompt
-> T.Text
-> m ()
credSshInteractivePromptSetResponse prompt response = liftIO $ do
prompt' <- unsafeManagedPtrGetPtr prompt
response' <- textToCString response
ggit_cred_ssh_interactive_prompt_set_response prompt' response'
touchManagedPtr prompt
freeMem response'
return ()
#if defined(ENABLE_OVERLOADING)
data CredSshInteractivePromptSetResponseMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.MethodInfo CredSshInteractivePromptSetResponseMethodInfo CredSshInteractivePrompt signature where
overloadedMethod = credSshInteractivePromptSetResponse
#endif
foreign import ccall "ggit_cred_ssh_interactive_prompt_unref" ggit_cred_ssh_interactive_prompt_unref ::
Ptr CredSshInteractivePrompt ->
IO ()
credSshInteractivePromptUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
CredSshInteractivePrompt
-> m ()
credSshInteractivePromptUnref prompt = liftIO $ do
prompt' <- unsafeManagedPtrGetPtr prompt
ggit_cred_ssh_interactive_prompt_unref prompt'
touchManagedPtr prompt
return ()
#if defined(ENABLE_OVERLOADING)
data CredSshInteractivePromptUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo CredSshInteractivePromptUnrefMethodInfo CredSshInteractivePrompt signature where
overloadedMethod = credSshInteractivePromptUnref
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveCredSshInteractivePromptMethod (t :: Symbol) (o :: *) :: * where
ResolveCredSshInteractivePromptMethod "isMasked" o = CredSshInteractivePromptIsMaskedMethodInfo
ResolveCredSshInteractivePromptMethod "ref" o = CredSshInteractivePromptRefMethodInfo
ResolveCredSshInteractivePromptMethod "unref" o = CredSshInteractivePromptUnrefMethodInfo
ResolveCredSshInteractivePromptMethod "getInstruction" o = CredSshInteractivePromptGetInstructionMethodInfo
ResolveCredSshInteractivePromptMethod "getName" o = CredSshInteractivePromptGetNameMethodInfo
ResolveCredSshInteractivePromptMethod "getResponse" o = CredSshInteractivePromptGetResponseMethodInfo
ResolveCredSshInteractivePromptMethod "getText" o = CredSshInteractivePromptGetTextMethodInfo
ResolveCredSshInteractivePromptMethod "setResponse" o = CredSshInteractivePromptSetResponseMethodInfo
ResolveCredSshInteractivePromptMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCredSshInteractivePromptMethod t CredSshInteractivePrompt, O.MethodInfo info CredSshInteractivePrompt p) => OL.IsLabel t (CredSshInteractivePrompt -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif