{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Structs.HSTSPolicy
(
HSTSPolicy(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveHSTSPolicyMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
HSTSPolicyCopyMethodInfo ,
#endif
hSTSPolicyCopy ,
#if defined(ENABLE_OVERLOADING)
HSTSPolicyEqualMethodInfo ,
#endif
hSTSPolicyEqual ,
#if defined(ENABLE_OVERLOADING)
HSTSPolicyFreeMethodInfo ,
#endif
hSTSPolicyFree ,
#if defined(ENABLE_OVERLOADING)
HSTSPolicyGetDomainMethodInfo ,
#endif
hSTSPolicyGetDomain ,
#if defined(ENABLE_OVERLOADING)
HSTSPolicyGetExpiresMethodInfo ,
#endif
hSTSPolicyGetExpires ,
#if defined(ENABLE_OVERLOADING)
HSTSPolicyGetMaxAgeMethodInfo ,
#endif
hSTSPolicyGetMaxAge ,
#if defined(ENABLE_OVERLOADING)
HSTSPolicyIncludesSubdomainsMethodInfo ,
#endif
hSTSPolicyIncludesSubdomains ,
#if defined(ENABLE_OVERLOADING)
HSTSPolicyIsExpiredMethodInfo ,
#endif
hSTSPolicyIsExpired ,
#if defined(ENABLE_OVERLOADING)
HSTSPolicyIsSessionPolicyMethodInfo ,
#endif
hSTSPolicyIsSessionPolicy ,
hSTSPolicyNew ,
hSTSPolicyNewFromResponse ,
hSTSPolicyNewFull ,
hSTSPolicyNewSessionPolicy ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified GI.GLib.Structs.DateTime as GLib.DateTime
import {-# SOURCE #-} qualified GI.Soup.Objects.Message as Soup.Message
newtype HSTSPolicy = HSTSPolicy (SP.ManagedPtr HSTSPolicy)
deriving (HSTSPolicy -> HSTSPolicy -> Bool
(HSTSPolicy -> HSTSPolicy -> Bool)
-> (HSTSPolicy -> HSTSPolicy -> Bool) -> Eq HSTSPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HSTSPolicy -> HSTSPolicy -> Bool
== :: HSTSPolicy -> HSTSPolicy -> Bool
$c/= :: HSTSPolicy -> HSTSPolicy -> Bool
/= :: HSTSPolicy -> HSTSPolicy -> Bool
Eq)
instance SP.ManagedPtrNewtype HSTSPolicy where
toManagedPtr :: HSTSPolicy -> ManagedPtr HSTSPolicy
toManagedPtr (HSTSPolicy ManagedPtr HSTSPolicy
p) = ManagedPtr HSTSPolicy
p
foreign import ccall "soup_hsts_policy_get_type" c_soup_hsts_policy_get_type ::
IO GType
type instance O.ParentTypes HSTSPolicy = '[]
instance O.HasParentTypes HSTSPolicy
instance B.Types.TypedObject HSTSPolicy where
glibType :: IO GType
glibType = IO GType
c_soup_hsts_policy_get_type
instance B.Types.GBoxed HSTSPolicy
instance B.GValue.IsGValue (Maybe HSTSPolicy) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_soup_hsts_policy_get_type
gvalueSet_ :: Ptr GValue -> Maybe HSTSPolicy -> IO ()
gvalueSet_ Ptr GValue
gv Maybe HSTSPolicy
P.Nothing = Ptr GValue -> Ptr HSTSPolicy -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr HSTSPolicy
forall a. Ptr a
FP.nullPtr :: FP.Ptr HSTSPolicy)
gvalueSet_ Ptr GValue
gv (P.Just HSTSPolicy
obj) = HSTSPolicy -> (Ptr HSTSPolicy -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr HSTSPolicy
obj (Ptr GValue -> Ptr HSTSPolicy -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe HSTSPolicy)
gvalueGet_ Ptr GValue
gv = do
Ptr HSTSPolicy
ptr <- Ptr GValue -> IO (Ptr HSTSPolicy)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr HSTSPolicy)
if Ptr HSTSPolicy
ptr Ptr HSTSPolicy -> Ptr HSTSPolicy -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr HSTSPolicy
forall a. Ptr a
FP.nullPtr
then HSTSPolicy -> Maybe HSTSPolicy
forall a. a -> Maybe a
P.Just (HSTSPolicy -> Maybe HSTSPolicy)
-> IO HSTSPolicy -> IO (Maybe HSTSPolicy)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr HSTSPolicy -> HSTSPolicy)
-> Ptr HSTSPolicy -> IO HSTSPolicy
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr HSTSPolicy -> HSTSPolicy
HSTSPolicy Ptr HSTSPolicy
ptr
else Maybe HSTSPolicy -> IO (Maybe HSTSPolicy)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe HSTSPolicy
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList HSTSPolicy
type instance O.AttributeList HSTSPolicy = HSTSPolicyAttributeList
type HSTSPolicyAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "soup_hsts_policy_new" soup_hsts_policy_new ::
CString ->
CULong ->
CInt ->
IO (Ptr HSTSPolicy)
hSTSPolicyNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> CULong
-> Bool
-> m HSTSPolicy
hSTSPolicyNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> CULong -> Bool -> m HSTSPolicy
hSTSPolicyNew Text
domain CULong
maxAge Bool
includeSubdomains = IO HSTSPolicy -> m HSTSPolicy
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO HSTSPolicy -> m HSTSPolicy) -> IO HSTSPolicy -> m HSTSPolicy
forall a b. (a -> b) -> a -> b
$ do
CString
domain' <- Text -> IO CString
textToCString Text
domain
let includeSubdomains' :: CInt
includeSubdomains' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
includeSubdomains
Ptr HSTSPolicy
result <- CString -> CULong -> CInt -> IO (Ptr HSTSPolicy)
soup_hsts_policy_new CString
domain' CULong
maxAge CInt
includeSubdomains'
Text -> Ptr HSTSPolicy -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hSTSPolicyNew" Ptr HSTSPolicy
result
HSTSPolicy
result' <- ((ManagedPtr HSTSPolicy -> HSTSPolicy)
-> Ptr HSTSPolicy -> IO HSTSPolicy
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr HSTSPolicy -> HSTSPolicy
HSTSPolicy) Ptr HSTSPolicy
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
domain'
HSTSPolicy -> IO HSTSPolicy
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return HSTSPolicy
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "soup_hsts_policy_new_from_response" soup_hsts_policy_new_from_response ::
Ptr Soup.Message.Message ->
IO (Ptr HSTSPolicy)
hSTSPolicyNewFromResponse ::
(B.CallStack.HasCallStack, MonadIO m, Soup.Message.IsMessage a) =>
a
-> m (Maybe HSTSPolicy)
hSTSPolicyNewFromResponse :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMessage a) =>
a -> m (Maybe HSTSPolicy)
hSTSPolicyNewFromResponse a
msg = IO (Maybe HSTSPolicy) -> m (Maybe HSTSPolicy)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe HSTSPolicy) -> m (Maybe HSTSPolicy))
-> IO (Maybe HSTSPolicy) -> m (Maybe HSTSPolicy)
forall a b. (a -> b) -> a -> b
$ do
Ptr Message
msg' <- a -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
msg
Ptr HSTSPolicy
result <- Ptr Message -> IO (Ptr HSTSPolicy)
soup_hsts_policy_new_from_response Ptr Message
msg'
Maybe HSTSPolicy
maybeResult <- Ptr HSTSPolicy
-> (Ptr HSTSPolicy -> IO HSTSPolicy) -> IO (Maybe HSTSPolicy)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr HSTSPolicy
result ((Ptr HSTSPolicy -> IO HSTSPolicy) -> IO (Maybe HSTSPolicy))
-> (Ptr HSTSPolicy -> IO HSTSPolicy) -> IO (Maybe HSTSPolicy)
forall a b. (a -> b) -> a -> b
$ \Ptr HSTSPolicy
result' -> do
HSTSPolicy
result'' <- ((ManagedPtr HSTSPolicy -> HSTSPolicy)
-> Ptr HSTSPolicy -> IO HSTSPolicy
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr HSTSPolicy -> HSTSPolicy
HSTSPolicy) Ptr HSTSPolicy
result'
HSTSPolicy -> IO HSTSPolicy
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return HSTSPolicy
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
msg
Maybe HSTSPolicy -> IO (Maybe HSTSPolicy)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe HSTSPolicy
maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "soup_hsts_policy_new_full" soup_hsts_policy_new_full ::
CString ->
CULong ->
Ptr GLib.DateTime.DateTime ->
CInt ->
IO (Ptr HSTSPolicy)
hSTSPolicyNewFull ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> CULong
-> GLib.DateTime.DateTime
-> Bool
-> m HSTSPolicy
hSTSPolicyNewFull :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> CULong -> DateTime -> Bool -> m HSTSPolicy
hSTSPolicyNewFull Text
domain CULong
maxAge DateTime
expires Bool
includeSubdomains = IO HSTSPolicy -> m HSTSPolicy
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO HSTSPolicy -> m HSTSPolicy) -> IO HSTSPolicy -> m HSTSPolicy
forall a b. (a -> b) -> a -> b
$ do
CString
domain' <- Text -> IO CString
textToCString Text
domain
Ptr DateTime
expires' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
expires
let includeSubdomains' :: CInt
includeSubdomains' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
includeSubdomains
Ptr HSTSPolicy
result <- CString -> CULong -> Ptr DateTime -> CInt -> IO (Ptr HSTSPolicy)
soup_hsts_policy_new_full CString
domain' CULong
maxAge Ptr DateTime
expires' CInt
includeSubdomains'
Text -> Ptr HSTSPolicy -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hSTSPolicyNewFull" Ptr HSTSPolicy
result
HSTSPolicy
result' <- ((ManagedPtr HSTSPolicy -> HSTSPolicy)
-> Ptr HSTSPolicy -> IO HSTSPolicy
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr HSTSPolicy -> HSTSPolicy
HSTSPolicy) Ptr HSTSPolicy
result
DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
expires
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
domain'
HSTSPolicy -> IO HSTSPolicy
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return HSTSPolicy
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "soup_hsts_policy_new_session_policy" soup_hsts_policy_new_session_policy ::
CString ->
CInt ->
IO (Ptr HSTSPolicy)
hSTSPolicyNewSessionPolicy ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Bool
-> m HSTSPolicy
hSTSPolicyNewSessionPolicy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Bool -> m HSTSPolicy
hSTSPolicyNewSessionPolicy Text
domain Bool
includeSubdomains = IO HSTSPolicy -> m HSTSPolicy
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO HSTSPolicy -> m HSTSPolicy) -> IO HSTSPolicy -> m HSTSPolicy
forall a b. (a -> b) -> a -> b
$ do
CString
domain' <- Text -> IO CString
textToCString Text
domain
let includeSubdomains' :: CInt
includeSubdomains' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
includeSubdomains
Ptr HSTSPolicy
result <- CString -> CInt -> IO (Ptr HSTSPolicy)
soup_hsts_policy_new_session_policy CString
domain' CInt
includeSubdomains'
Text -> Ptr HSTSPolicy -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hSTSPolicyNewSessionPolicy" Ptr HSTSPolicy
result
HSTSPolicy
result' <- ((ManagedPtr HSTSPolicy -> HSTSPolicy)
-> Ptr HSTSPolicy -> IO HSTSPolicy
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr HSTSPolicy -> HSTSPolicy
HSTSPolicy) Ptr HSTSPolicy
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
domain'
HSTSPolicy -> IO HSTSPolicy
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return HSTSPolicy
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "soup_hsts_policy_copy" soup_hsts_policy_copy ::
Ptr HSTSPolicy ->
IO (Ptr HSTSPolicy)
hSTSPolicyCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
HSTSPolicy
-> m HSTSPolicy
hSTSPolicyCopy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
HSTSPolicy -> m HSTSPolicy
hSTSPolicyCopy HSTSPolicy
policy = IO HSTSPolicy -> m HSTSPolicy
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO HSTSPolicy -> m HSTSPolicy) -> IO HSTSPolicy -> m HSTSPolicy
forall a b. (a -> b) -> a -> b
$ do
Ptr HSTSPolicy
policy' <- HSTSPolicy -> IO (Ptr HSTSPolicy)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HSTSPolicy
policy
Ptr HSTSPolicy
result <- Ptr HSTSPolicy -> IO (Ptr HSTSPolicy)
soup_hsts_policy_copy Ptr HSTSPolicy
policy'
Text -> Ptr HSTSPolicy -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hSTSPolicyCopy" Ptr HSTSPolicy
result
HSTSPolicy
result' <- ((ManagedPtr HSTSPolicy -> HSTSPolicy)
-> Ptr HSTSPolicy -> IO HSTSPolicy
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr HSTSPolicy -> HSTSPolicy
HSTSPolicy) Ptr HSTSPolicy
result
HSTSPolicy -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HSTSPolicy
policy
HSTSPolicy -> IO HSTSPolicy
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return HSTSPolicy
result'
#if defined(ENABLE_OVERLOADING)
data HSTSPolicyCopyMethodInfo
instance (signature ~ (m HSTSPolicy), MonadIO m) => O.OverloadedMethod HSTSPolicyCopyMethodInfo HSTSPolicy signature where
overloadedMethod = hSTSPolicyCopy
instance O.OverloadedMethodInfo HSTSPolicyCopyMethodInfo HSTSPolicy where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.HSTSPolicy.hSTSPolicyCopy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Structs-HSTSPolicy.html#v:hSTSPolicyCopy"
})
#endif
foreign import ccall "soup_hsts_policy_equal" soup_hsts_policy_equal ::
Ptr HSTSPolicy ->
Ptr HSTSPolicy ->
IO CInt
hSTSPolicyEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
HSTSPolicy
-> HSTSPolicy
-> m Bool
hSTSPolicyEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
HSTSPolicy -> HSTSPolicy -> m Bool
hSTSPolicyEqual HSTSPolicy
policy1 HSTSPolicy
policy2 = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr HSTSPolicy
policy1' <- HSTSPolicy -> IO (Ptr HSTSPolicy)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HSTSPolicy
policy1
Ptr HSTSPolicy
policy2' <- HSTSPolicy -> IO (Ptr HSTSPolicy)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HSTSPolicy
policy2
CInt
result <- Ptr HSTSPolicy -> Ptr HSTSPolicy -> IO CInt
soup_hsts_policy_equal Ptr HSTSPolicy
policy1' Ptr HSTSPolicy
policy2'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
HSTSPolicy -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HSTSPolicy
policy1
HSTSPolicy -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HSTSPolicy
policy2
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data HSTSPolicyEqualMethodInfo
instance (signature ~ (HSTSPolicy -> m Bool), MonadIO m) => O.OverloadedMethod HSTSPolicyEqualMethodInfo HSTSPolicy signature where
overloadedMethod = hSTSPolicyEqual
instance O.OverloadedMethodInfo HSTSPolicyEqualMethodInfo HSTSPolicy where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.HSTSPolicy.hSTSPolicyEqual",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Structs-HSTSPolicy.html#v:hSTSPolicyEqual"
})
#endif
foreign import ccall "soup_hsts_policy_free" soup_hsts_policy_free ::
Ptr HSTSPolicy ->
IO ()
hSTSPolicyFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
HSTSPolicy
-> m ()
hSTSPolicyFree :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
HSTSPolicy -> m ()
hSTSPolicyFree HSTSPolicy
policy = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr HSTSPolicy
policy' <- HSTSPolicy -> IO (Ptr HSTSPolicy)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed HSTSPolicy
policy
Ptr HSTSPolicy -> IO ()
soup_hsts_policy_free Ptr HSTSPolicy
policy'
HSTSPolicy -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HSTSPolicy
policy
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data HSTSPolicyFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod HSTSPolicyFreeMethodInfo HSTSPolicy signature where
overloadedMethod = hSTSPolicyFree
instance O.OverloadedMethodInfo HSTSPolicyFreeMethodInfo HSTSPolicy where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.HSTSPolicy.hSTSPolicyFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Structs-HSTSPolicy.html#v:hSTSPolicyFree"
})
#endif
foreign import ccall "soup_hsts_policy_get_domain" soup_hsts_policy_get_domain ::
Ptr HSTSPolicy ->
IO CString
hSTSPolicyGetDomain ::
(B.CallStack.HasCallStack, MonadIO m) =>
HSTSPolicy
-> m T.Text
hSTSPolicyGetDomain :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
HSTSPolicy -> m Text
hSTSPolicyGetDomain HSTSPolicy
policy = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr HSTSPolicy
policy' <- HSTSPolicy -> IO (Ptr HSTSPolicy)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HSTSPolicy
policy
CString
result <- Ptr HSTSPolicy -> IO CString
soup_hsts_policy_get_domain Ptr HSTSPolicy
policy'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hSTSPolicyGetDomain" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
HSTSPolicy -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HSTSPolicy
policy
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data HSTSPolicyGetDomainMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod HSTSPolicyGetDomainMethodInfo HSTSPolicy signature where
overloadedMethod = hSTSPolicyGetDomain
instance O.OverloadedMethodInfo HSTSPolicyGetDomainMethodInfo HSTSPolicy where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.HSTSPolicy.hSTSPolicyGetDomain",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Structs-HSTSPolicy.html#v:hSTSPolicyGetDomain"
})
#endif
foreign import ccall "soup_hsts_policy_get_expires" soup_hsts_policy_get_expires ::
Ptr HSTSPolicy ->
IO (Ptr GLib.DateTime.DateTime)
hSTSPolicyGetExpires ::
(B.CallStack.HasCallStack, MonadIO m) =>
HSTSPolicy
-> m GLib.DateTime.DateTime
hSTSPolicyGetExpires :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
HSTSPolicy -> m DateTime
hSTSPolicyGetExpires HSTSPolicy
policy = IO DateTime -> m DateTime
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DateTime -> m DateTime) -> IO DateTime -> m DateTime
forall a b. (a -> b) -> a -> b
$ do
Ptr HSTSPolicy
policy' <- HSTSPolicy -> IO (Ptr HSTSPolicy)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HSTSPolicy
policy
Ptr DateTime
result <- Ptr HSTSPolicy -> IO (Ptr DateTime)
soup_hsts_policy_get_expires Ptr HSTSPolicy
policy'
Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hSTSPolicyGetExpires" Ptr DateTime
result
DateTime
result' <- ((ManagedPtr DateTime -> DateTime) -> Ptr DateTime -> IO DateTime
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr DateTime -> DateTime
GLib.DateTime.DateTime) Ptr DateTime
result
HSTSPolicy -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HSTSPolicy
policy
DateTime -> IO DateTime
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'
#if defined(ENABLE_OVERLOADING)
data HSTSPolicyGetExpiresMethodInfo
instance (signature ~ (m GLib.DateTime.DateTime), MonadIO m) => O.OverloadedMethod HSTSPolicyGetExpiresMethodInfo HSTSPolicy signature where
overloadedMethod = hSTSPolicyGetExpires
instance O.OverloadedMethodInfo HSTSPolicyGetExpiresMethodInfo HSTSPolicy where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.HSTSPolicy.hSTSPolicyGetExpires",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Structs-HSTSPolicy.html#v:hSTSPolicyGetExpires"
})
#endif
foreign import ccall "soup_hsts_policy_get_max_age" soup_hsts_policy_get_max_age ::
Ptr HSTSPolicy ->
IO CULong
hSTSPolicyGetMaxAge ::
(B.CallStack.HasCallStack, MonadIO m) =>
HSTSPolicy
-> m CULong
hSTSPolicyGetMaxAge :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
HSTSPolicy -> m CULong
hSTSPolicyGetMaxAge HSTSPolicy
policy = IO CULong -> m CULong
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CULong -> m CULong) -> IO CULong -> m CULong
forall a b. (a -> b) -> a -> b
$ do
Ptr HSTSPolicy
policy' <- HSTSPolicy -> IO (Ptr HSTSPolicy)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HSTSPolicy
policy
CULong
result <- Ptr HSTSPolicy -> IO CULong
soup_hsts_policy_get_max_age Ptr HSTSPolicy
policy'
HSTSPolicy -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HSTSPolicy
policy
CULong -> IO CULong
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CULong
result
#if defined(ENABLE_OVERLOADING)
data HSTSPolicyGetMaxAgeMethodInfo
instance (signature ~ (m CULong), MonadIO m) => O.OverloadedMethod HSTSPolicyGetMaxAgeMethodInfo HSTSPolicy signature where
overloadedMethod = hSTSPolicyGetMaxAge
instance O.OverloadedMethodInfo HSTSPolicyGetMaxAgeMethodInfo HSTSPolicy where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.HSTSPolicy.hSTSPolicyGetMaxAge",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Structs-HSTSPolicy.html#v:hSTSPolicyGetMaxAge"
})
#endif
foreign import ccall "soup_hsts_policy_includes_subdomains" soup_hsts_policy_includes_subdomains ::
Ptr HSTSPolicy ->
IO CInt
hSTSPolicyIncludesSubdomains ::
(B.CallStack.HasCallStack, MonadIO m) =>
HSTSPolicy
-> m Bool
hSTSPolicyIncludesSubdomains :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
HSTSPolicy -> m Bool
hSTSPolicyIncludesSubdomains HSTSPolicy
policy = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr HSTSPolicy
policy' <- HSTSPolicy -> IO (Ptr HSTSPolicy)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HSTSPolicy
policy
CInt
result <- Ptr HSTSPolicy -> IO CInt
soup_hsts_policy_includes_subdomains Ptr HSTSPolicy
policy'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
HSTSPolicy -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HSTSPolicy
policy
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data HSTSPolicyIncludesSubdomainsMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod HSTSPolicyIncludesSubdomainsMethodInfo HSTSPolicy signature where
overloadedMethod = hSTSPolicyIncludesSubdomains
instance O.OverloadedMethodInfo HSTSPolicyIncludesSubdomainsMethodInfo HSTSPolicy where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.HSTSPolicy.hSTSPolicyIncludesSubdomains",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Structs-HSTSPolicy.html#v:hSTSPolicyIncludesSubdomains"
})
#endif
foreign import ccall "soup_hsts_policy_is_expired" soup_hsts_policy_is_expired ::
Ptr HSTSPolicy ->
IO CInt
hSTSPolicyIsExpired ::
(B.CallStack.HasCallStack, MonadIO m) =>
HSTSPolicy
-> m Bool
hSTSPolicyIsExpired :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
HSTSPolicy -> m Bool
hSTSPolicyIsExpired HSTSPolicy
policy = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr HSTSPolicy
policy' <- HSTSPolicy -> IO (Ptr HSTSPolicy)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HSTSPolicy
policy
CInt
result <- Ptr HSTSPolicy -> IO CInt
soup_hsts_policy_is_expired Ptr HSTSPolicy
policy'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
HSTSPolicy -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HSTSPolicy
policy
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data HSTSPolicyIsExpiredMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod HSTSPolicyIsExpiredMethodInfo HSTSPolicy signature where
overloadedMethod = hSTSPolicyIsExpired
instance O.OverloadedMethodInfo HSTSPolicyIsExpiredMethodInfo HSTSPolicy where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.HSTSPolicy.hSTSPolicyIsExpired",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Structs-HSTSPolicy.html#v:hSTSPolicyIsExpired"
})
#endif
foreign import ccall "soup_hsts_policy_is_session_policy" soup_hsts_policy_is_session_policy ::
Ptr HSTSPolicy ->
IO CInt
hSTSPolicyIsSessionPolicy ::
(B.CallStack.HasCallStack, MonadIO m) =>
HSTSPolicy
-> m Bool
hSTSPolicyIsSessionPolicy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
HSTSPolicy -> m Bool
hSTSPolicyIsSessionPolicy HSTSPolicy
policy = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr HSTSPolicy
policy' <- HSTSPolicy -> IO (Ptr HSTSPolicy)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr HSTSPolicy
policy
CInt
result <- Ptr HSTSPolicy -> IO CInt
soup_hsts_policy_is_session_policy Ptr HSTSPolicy
policy'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
HSTSPolicy -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr HSTSPolicy
policy
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data HSTSPolicyIsSessionPolicyMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod HSTSPolicyIsSessionPolicyMethodInfo HSTSPolicy signature where
overloadedMethod = hSTSPolicyIsSessionPolicy
instance O.OverloadedMethodInfo HSTSPolicyIsSessionPolicyMethodInfo HSTSPolicy where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Structs.HSTSPolicy.hSTSPolicyIsSessionPolicy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Structs-HSTSPolicy.html#v:hSTSPolicyIsSessionPolicy"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveHSTSPolicyMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveHSTSPolicyMethod "copy" o = HSTSPolicyCopyMethodInfo
ResolveHSTSPolicyMethod "equal" o = HSTSPolicyEqualMethodInfo
ResolveHSTSPolicyMethod "free" o = HSTSPolicyFreeMethodInfo
ResolveHSTSPolicyMethod "includesSubdomains" o = HSTSPolicyIncludesSubdomainsMethodInfo
ResolveHSTSPolicyMethod "isExpired" o = HSTSPolicyIsExpiredMethodInfo
ResolveHSTSPolicyMethod "isSessionPolicy" o = HSTSPolicyIsSessionPolicyMethodInfo
ResolveHSTSPolicyMethod "getDomain" o = HSTSPolicyGetDomainMethodInfo
ResolveHSTSPolicyMethod "getExpires" o = HSTSPolicyGetExpiresMethodInfo
ResolveHSTSPolicyMethod "getMaxAge" o = HSTSPolicyGetMaxAgeMethodInfo
ResolveHSTSPolicyMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveHSTSPolicyMethod t HSTSPolicy, O.OverloadedMethod info HSTSPolicy p) => OL.IsLabel t (HSTSPolicy -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveHSTSPolicyMethod t HSTSPolicy, O.OverloadedMethod info HSTSPolicy p, R.HasField t HSTSPolicy p) => R.HasField t HSTSPolicy p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveHSTSPolicyMethod t HSTSPolicy, O.OverloadedMethodInfo info HSTSPolicy) => OL.IsLabel t (O.MethodProxy info HSTSPolicy) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif