{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- @GDateTime@ is an opaque structure whose members
-- cannot be accessed directly.
-- 
-- /Since: 2.26/

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

module GI.GLib.Structs.DateTime
    ( 

-- * Exported types
    DateTime(..)                            ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveDateTimeMethod                   ,
#endif


-- ** add #method:add#

#if defined(ENABLE_OVERLOADING)
    DateTimeAddMethodInfo                   ,
#endif
    dateTimeAdd                             ,


-- ** addDays #method:addDays#

#if defined(ENABLE_OVERLOADING)
    DateTimeAddDaysMethodInfo               ,
#endif
    dateTimeAddDays                         ,


-- ** addFull #method:addFull#

#if defined(ENABLE_OVERLOADING)
    DateTimeAddFullMethodInfo               ,
#endif
    dateTimeAddFull                         ,


-- ** addHours #method:addHours#

#if defined(ENABLE_OVERLOADING)
    DateTimeAddHoursMethodInfo              ,
#endif
    dateTimeAddHours                        ,


-- ** addMinutes #method:addMinutes#

#if defined(ENABLE_OVERLOADING)
    DateTimeAddMinutesMethodInfo            ,
#endif
    dateTimeAddMinutes                      ,


-- ** addMonths #method:addMonths#

#if defined(ENABLE_OVERLOADING)
    DateTimeAddMonthsMethodInfo             ,
#endif
    dateTimeAddMonths                       ,


-- ** addSeconds #method:addSeconds#

#if defined(ENABLE_OVERLOADING)
    DateTimeAddSecondsMethodInfo            ,
#endif
    dateTimeAddSeconds                      ,


-- ** addWeeks #method:addWeeks#

#if defined(ENABLE_OVERLOADING)
    DateTimeAddWeeksMethodInfo              ,
#endif
    dateTimeAddWeeks                        ,


-- ** addYears #method:addYears#

#if defined(ENABLE_OVERLOADING)
    DateTimeAddYearsMethodInfo              ,
#endif
    dateTimeAddYears                        ,


-- ** compare #method:compare#

    dateTimeCompare                         ,


-- ** difference #method:difference#

#if defined(ENABLE_OVERLOADING)
    DateTimeDifferenceMethodInfo            ,
#endif
    dateTimeDifference                      ,


-- ** equal #method:equal#

    dateTimeEqual                           ,


-- ** format #method:format#

#if defined(ENABLE_OVERLOADING)
    DateTimeFormatMethodInfo                ,
#endif
    dateTimeFormat                          ,


-- ** formatIso8601 #method:formatIso8601#

#if defined(ENABLE_OVERLOADING)
    DateTimeFormatIso8601MethodInfo         ,
#endif
    dateTimeFormatIso8601                   ,


-- ** getDayOfMonth #method:getDayOfMonth#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetDayOfMonthMethodInfo         ,
#endif
    dateTimeGetDayOfMonth                   ,


-- ** getDayOfWeek #method:getDayOfWeek#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetDayOfWeekMethodInfo          ,
#endif
    dateTimeGetDayOfWeek                    ,


-- ** getDayOfYear #method:getDayOfYear#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetDayOfYearMethodInfo          ,
#endif
    dateTimeGetDayOfYear                    ,


-- ** getHour #method:getHour#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetHourMethodInfo               ,
#endif
    dateTimeGetHour                         ,


-- ** getMicrosecond #method:getMicrosecond#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetMicrosecondMethodInfo        ,
#endif
    dateTimeGetMicrosecond                  ,


-- ** getMinute #method:getMinute#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetMinuteMethodInfo             ,
#endif
    dateTimeGetMinute                       ,


-- ** getMonth #method:getMonth#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetMonthMethodInfo              ,
#endif
    dateTimeGetMonth                        ,


-- ** getSecond #method:getSecond#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetSecondMethodInfo             ,
#endif
    dateTimeGetSecond                       ,


-- ** getSeconds #method:getSeconds#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetSecondsMethodInfo            ,
#endif
    dateTimeGetSeconds                      ,


-- ** getTimezone #method:getTimezone#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetTimezoneMethodInfo           ,
#endif
    dateTimeGetTimezone                     ,


-- ** getTimezoneAbbreviation #method:getTimezoneAbbreviation#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetTimezoneAbbreviationMethodInfo,
#endif
    dateTimeGetTimezoneAbbreviation         ,


-- ** getUtcOffset #method:getUtcOffset#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetUtcOffsetMethodInfo          ,
#endif
    dateTimeGetUtcOffset                    ,


-- ** getWeekNumberingYear #method:getWeekNumberingYear#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetWeekNumberingYearMethodInfo  ,
#endif
    dateTimeGetWeekNumberingYear            ,


-- ** getWeekOfYear #method:getWeekOfYear#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetWeekOfYearMethodInfo         ,
#endif
    dateTimeGetWeekOfYear                   ,


-- ** getYear #method:getYear#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetYearMethodInfo               ,
#endif
    dateTimeGetYear                         ,


-- ** getYmd #method:getYmd#

#if defined(ENABLE_OVERLOADING)
    DateTimeGetYmdMethodInfo                ,
#endif
    dateTimeGetYmd                          ,


-- ** hash #method:hash#

    dateTimeHash                            ,


-- ** isDaylightSavings #method:isDaylightSavings#

#if defined(ENABLE_OVERLOADING)
    DateTimeIsDaylightSavingsMethodInfo     ,
#endif
    dateTimeIsDaylightSavings               ,


-- ** new #method:new#

    dateTimeNew                             ,


-- ** newFromIso8601 #method:newFromIso8601#

    dateTimeNewFromIso8601                  ,


-- ** newFromTimevalLocal #method:newFromTimevalLocal#

    dateTimeNewFromTimevalLocal             ,


-- ** newFromTimevalUtc #method:newFromTimevalUtc#

    dateTimeNewFromTimevalUtc               ,


-- ** newFromUnixLocal #method:newFromUnixLocal#

    dateTimeNewFromUnixLocal                ,


-- ** newFromUnixUtc #method:newFromUnixUtc#

    dateTimeNewFromUnixUtc                  ,


-- ** newLocal #method:newLocal#

    dateTimeNewLocal                        ,


-- ** newNow #method:newNow#

    dateTimeNewNow                          ,


-- ** newNowLocal #method:newNowLocal#

    dateTimeNewNowLocal                     ,


-- ** newNowUtc #method:newNowUtc#

    dateTimeNewNowUtc                       ,


-- ** newUtc #method:newUtc#

    dateTimeNewUtc                          ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    DateTimeRefMethodInfo                   ,
#endif
    dateTimeRef                             ,


-- ** toLocal #method:toLocal#

#if defined(ENABLE_OVERLOADING)
    DateTimeToLocalMethodInfo               ,
#endif
    dateTimeToLocal                         ,


-- ** toTimeval #method:toTimeval#

#if defined(ENABLE_OVERLOADING)
    DateTimeToTimevalMethodInfo             ,
#endif
    dateTimeToTimeval                       ,


-- ** toTimezone #method:toTimezone#

#if defined(ENABLE_OVERLOADING)
    DateTimeToTimezoneMethodInfo            ,
#endif
    dateTimeToTimezone                      ,


-- ** toUnix #method:toUnix#

#if defined(ENABLE_OVERLOADING)
    DateTimeToUnixMethodInfo                ,
#endif
    dateTimeToUnix                          ,


-- ** toUtc #method:toUtc#

#if defined(ENABLE_OVERLOADING)
    DateTimeToUtcMethodInfo                 ,
#endif
    dateTimeToUtc                           ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    DateTimeUnrefMethodInfo                 ,
#endif
    dateTimeUnref                           ,




    ) 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.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 Control.Monad.IO.Class as MIO
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 {-# SOURCE #-} qualified GI.GLib.Structs.TimeVal as GLib.TimeVal
import {-# SOURCE #-} qualified GI.GLib.Structs.TimeZone as GLib.TimeZone

-- | Memory-managed wrapper type.
newtype DateTime = DateTime (SP.ManagedPtr DateTime)
    deriving (DateTime -> DateTime -> Bool
(DateTime -> DateTime -> Bool)
-> (DateTime -> DateTime -> Bool) -> Eq DateTime
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DateTime -> DateTime -> Bool
$c/= :: DateTime -> DateTime -> Bool
== :: DateTime -> DateTime -> Bool
$c== :: DateTime -> DateTime -> Bool
Eq)

instance SP.ManagedPtrNewtype DateTime where
    toManagedPtr :: DateTime -> ManagedPtr DateTime
toManagedPtr (DateTime ManagedPtr DateTime
p) = ManagedPtr DateTime
p

foreign import ccall "g_date_time_get_type" c_g_date_time_get_type :: 
    IO GType

type instance O.ParentTypes DateTime = '[]
instance O.HasParentTypes DateTime

instance B.Types.TypedObject DateTime where
    glibType :: IO GType
glibType = IO GType
c_g_date_time_get_type

instance B.Types.GBoxed DateTime

-- | Convert 'DateTime' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue DateTime where
    toGValue :: DateTime -> IO GValue
toGValue DateTime
o = do
        GType
gtype <- IO GType
c_g_date_time_get_type
        DateTime -> (Ptr DateTime -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DateTime
o (GType
-> (GValue -> Ptr DateTime -> IO ()) -> Ptr DateTime -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr DateTime -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
        
    fromGValue :: GValue -> IO DateTime
fromGValue GValue
gv = do
        Ptr DateTime
ptr <- GValue -> IO (Ptr DateTime)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr DateTime)
        (ManagedPtr DateTime -> DateTime) -> Ptr DateTime -> IO DateTime
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr DateTime -> DateTime
DateTime Ptr DateTime
ptr
        
    


#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DateTime
type instance O.AttributeList DateTime = DateTimeAttributeList
type DateTimeAttributeList = ('[ ] :: [(Symbol, *)])
#endif

-- method DateTime::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "tz"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "TimeZone" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GTimeZone" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "year"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the year component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "month"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the month component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "day"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the day component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "hour"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the hour component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "minute"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the minute component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "seconds"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of seconds past the minute"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_new" g_date_time_new :: 
    Ptr GLib.TimeZone.TimeZone ->           -- tz : TInterface (Name {namespace = "GLib", name = "TimeZone"})
    Int32 ->                                -- year : TBasicType TInt
    Int32 ->                                -- month : TBasicType TInt
    Int32 ->                                -- day : TBasicType TInt
    Int32 ->                                -- hour : TBasicType TInt
    Int32 ->                                -- minute : TBasicType TInt
    CDouble ->                              -- seconds : TBasicType TDouble
    IO (Ptr DateTime)

-- | Creates a new t'GI.GLib.Structs.DateTime.DateTime' corresponding to the given date and time in
-- the time zone /@tz@/.
-- 
-- The /@year@/ must be between 1 and 9999, /@month@/ between 1 and 12 and /@day@/
-- between 1 and 28, 29, 30 or 31 depending on the month and the year.
-- 
-- /@hour@/ must be between 0 and 23 and /@minute@/ must be between 0 and 59.
-- 
-- /@seconds@/ must be at least 0.0 and must be strictly less than 60.0.
-- It will be rounded down to the nearest microsecond.
-- 
-- If the given time is not representable in the given time zone (for
-- example, 02:30 on March 14th 2010 in Toronto, due to daylight savings
-- time) then the time will be rounded up to the nearest existing time
-- (in this case, 03:00).  If this matters to you then you should verify
-- the return value for containing the same as the numbers you gave.
-- 
-- In the case that the given time is ambiguous in the given time zone
-- (for example, 01:30 on November 7th 2010 in Toronto, due to daylight
-- savings time) then the time falling within standard (ie:
-- non-daylight) time is taken.
-- 
-- It not considered a programmer error for the values to this function
-- to be out of range, but in the case that they are, the function will
-- return 'P.Nothing'.
-- 
-- You should release the return value by calling 'GI.GLib.Structs.DateTime.dateTimeUnref'
-- when you are done with it.
-- 
-- /Since: 2.26/
dateTimeNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GLib.TimeZone.TimeZone
    -- ^ /@tz@/: a t'GI.GLib.Structs.TimeZone.TimeZone'
    -> Int32
    -- ^ /@year@/: the year component of the date
    -> Int32
    -- ^ /@month@/: the month component of the date
    -> Int32
    -- ^ /@day@/: the day component of the date
    -> Int32
    -- ^ /@hour@/: the hour component of the date
    -> Int32
    -- ^ /@minute@/: the minute component of the date
    -> Double
    -- ^ /@seconds@/: the number of seconds past the minute
    -> m DateTime
    -- ^ __Returns:__ a new t'GI.GLib.Structs.DateTime.DateTime', or 'P.Nothing'
dateTimeNew :: TimeZone
-> Int32
-> Int32
-> Int32
-> Int32
-> Int32
-> Double
-> m DateTime
dateTimeNew TimeZone
tz Int32
year Int32
month Int32
day Int32
hour Int32
minute Double
seconds = IO DateTime -> m DateTime
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 TimeZone
tz' <- TimeZone -> IO (Ptr TimeZone)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TimeZone
tz
    let seconds' :: CDouble
seconds' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
seconds
    Ptr DateTime
result <- Ptr TimeZone
-> Int32
-> Int32
-> Int32
-> Int32
-> Int32
-> CDouble
-> IO (Ptr DateTime)
g_date_time_new Ptr TimeZone
tz' Int32
year Int32
month Int32
day Int32
hour Int32
minute CDouble
seconds'
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeNew" 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
DateTime) Ptr DateTime
result
    TimeZone -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TimeZone
tz
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::new_from_iso8601
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "text"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an ISO 8601 formatted time string."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "default_tz"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "TimeZone" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a #GTimeZone to use if the text doesn't contain a\n                         timezone, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_new_from_iso8601" g_date_time_new_from_iso8601 :: 
    CString ->                              -- text : TBasicType TUTF8
    Ptr GLib.TimeZone.TimeZone ->           -- default_tz : TInterface (Name {namespace = "GLib", name = "TimeZone"})
    IO (Ptr DateTime)

-- | Creates a t'GI.GLib.Structs.DateTime.DateTime' corresponding to the given
-- <https://en.wikipedia.org/wiki/ISO_8601 ISO 8601 formatted string>
-- /@text@/. ISO 8601 strings of the form \<date>\<sep>\<time>\<tz> are supported, with
-- some extensions from <https://tools.ietf.org/html/rfc3339 RFC 3339> as
-- mentioned below.
-- 
-- Note that as t'GI.GLib.Structs.DateTime.DateTime' \"is oblivious to leap seconds\", leap seconds information
-- in an ISO-8601 string will be ignored, so a @23:59:60@ time would be parsed as
-- @23:59:59@.
-- 
-- \<sep> is the separator and can be either \'T\', \'t\' or \' \'. The latter two
-- separators are an extension from
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339>.
-- 
-- \<date> is in the form:
-- 
-- * @YYYY-MM-DD@ - Year\/month\/day, e.g. 2016-08-24.
-- * @YYYYMMDD@ - Same as above without dividers.
-- * @YYYY-DDD@ - Ordinal day where DDD is from 001 to 366, e.g. 2016-237.
-- * @YYYYDDD@ - Same as above without dividers.
-- * @YYYY-Www-D@ - Week day where ww is from 01 to 52 and D from 1-7,
-- e.g. 2016-W34-3.
-- * @YYYYWwwD@ - Same as above without dividers.
-- 
-- 
-- \<time> is in the form:
-- 
-- * @hh:mm:ss(.sss)@ - Hours, minutes, seconds (subseconds), e.g. 22:10:42.123.
-- * @hhmmss(.sss)@ - Same as above without dividers.
-- 
-- 
-- \<tz> is an optional timezone suffix of the form:
-- 
-- * @Z@ - UTC.
-- * @+hh:mm@ or @-hh:mm@ - Offset from UTC in hours and minutes, e.g. +12:00.
-- * @+hh@ or @-hh@ - Offset from UTC in hours, e.g. +12.
-- 
-- 
-- If the timezone is not provided in /@text@/ it must be provided in /@defaultTz@/
-- (this field is otherwise ignored).
-- 
-- This call can fail (returning 'P.Nothing') if /@text@/ is not a valid ISO 8601
-- formatted string.
-- 
-- You should release the return value by calling 'GI.GLib.Structs.DateTime.dateTimeUnref'
-- when you are done with it.
-- 
-- /Since: 2.56/
dateTimeNewFromIso8601 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@text@/: an ISO 8601 formatted time string.
    -> Maybe (GLib.TimeZone.TimeZone)
    -- ^ /@defaultTz@/: a t'GI.GLib.Structs.TimeZone.TimeZone' to use if the text doesn\'t contain a
    --                          timezone, or 'P.Nothing'.
    -> m (Maybe DateTime)
    -- ^ __Returns:__ a new t'GI.GLib.Structs.DateTime.DateTime', or 'P.Nothing'
dateTimeNewFromIso8601 :: Text -> Maybe TimeZone -> m (Maybe DateTime)
dateTimeNewFromIso8601 Text
text Maybe TimeZone
defaultTz = IO (Maybe DateTime) -> m (Maybe DateTime)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe DateTime) -> m (Maybe DateTime))
-> IO (Maybe DateTime) -> m (Maybe DateTime)
forall a b. (a -> b) -> a -> b
$ do
    CString
text' <- Text -> IO CString
textToCString Text
text
    Ptr TimeZone
maybeDefaultTz <- case Maybe TimeZone
defaultTz of
        Maybe TimeZone
Nothing -> Ptr TimeZone -> IO (Ptr TimeZone)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TimeZone
forall a. Ptr a
nullPtr
        Just TimeZone
jDefaultTz -> do
            Ptr TimeZone
jDefaultTz' <- TimeZone -> IO (Ptr TimeZone)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TimeZone
jDefaultTz
            Ptr TimeZone -> IO (Ptr TimeZone)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TimeZone
jDefaultTz'
    Ptr DateTime
result <- CString -> Ptr TimeZone -> IO (Ptr DateTime)
g_date_time_new_from_iso8601 CString
text' Ptr TimeZone
maybeDefaultTz
    Maybe DateTime
maybeResult <- Ptr DateTime
-> (Ptr DateTime -> IO DateTime) -> IO (Maybe DateTime)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr DateTime
result ((Ptr DateTime -> IO DateTime) -> IO (Maybe DateTime))
-> (Ptr DateTime -> IO DateTime) -> IO (Maybe DateTime)
forall a b. (a -> b) -> a -> b
$ \Ptr DateTime
result' -> do
        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
DateTime) Ptr DateTime
result'
        DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result''
    Maybe TimeZone -> (TimeZone -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe TimeZone
defaultTz TimeZone -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
text'
    Maybe DateTime -> IO (Maybe DateTime)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe DateTime
maybeResult

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::new_from_timeval_local
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "tv"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "TimeVal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GTimeVal" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_new_from_timeval_local" g_date_time_new_from_timeval_local :: 
    Ptr GLib.TimeVal.TimeVal ->             -- tv : TInterface (Name {namespace = "GLib", name = "TimeVal"})
    IO (Ptr DateTime)

{-# DEPRECATED dateTimeNewFromTimevalLocal ["(Since version 2.62)","t'GI.GLib.Structs.TimeVal.TimeVal' is not year-2038-safe. Use","   'GI.GLib.Structs.DateTime.dateTimeNewFromUnixLocal' instead."] #-}
-- | Creates a t'GI.GLib.Structs.DateTime.DateTime' corresponding to the given t'GI.GLib.Structs.TimeVal.TimeVal' /@tv@/ in the
-- local time zone.
-- 
-- The time contained in a t'GI.GLib.Structs.TimeVal.TimeVal' is always stored in the form of
-- seconds elapsed since 1970-01-01 00:00:00 UTC, regardless of the
-- local time offset.
-- 
-- This call can fail (returning 'P.Nothing') if /@tv@/ represents a time outside
-- of the supported range of t'GI.GLib.Structs.DateTime.DateTime'.
-- 
-- You should release the return value by calling 'GI.GLib.Structs.DateTime.dateTimeUnref'
-- when you are done with it.
-- 
-- /Since: 2.26/
dateTimeNewFromTimevalLocal ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GLib.TimeVal.TimeVal
    -- ^ /@tv@/: a t'GI.GLib.Structs.TimeVal.TimeVal'
    -> m DateTime
    -- ^ __Returns:__ a new t'GI.GLib.Structs.DateTime.DateTime', or 'P.Nothing'
dateTimeNewFromTimevalLocal :: TimeVal -> m DateTime
dateTimeNewFromTimevalLocal TimeVal
tv = IO DateTime -> m DateTime
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 TimeVal
tv' <- TimeVal -> IO (Ptr TimeVal)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TimeVal
tv
    Ptr DateTime
result <- Ptr TimeVal -> IO (Ptr DateTime)
g_date_time_new_from_timeval_local Ptr TimeVal
tv'
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeNewFromTimevalLocal" 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
DateTime) Ptr DateTime
result
    TimeVal -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TimeVal
tv
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::new_from_timeval_utc
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "tv"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "TimeVal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GTimeVal" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_new_from_timeval_utc" g_date_time_new_from_timeval_utc :: 
    Ptr GLib.TimeVal.TimeVal ->             -- tv : TInterface (Name {namespace = "GLib", name = "TimeVal"})
    IO (Ptr DateTime)

{-# DEPRECATED dateTimeNewFromTimevalUtc ["(Since version 2.62)","t'GI.GLib.Structs.TimeVal.TimeVal' is not year-2038-safe. Use","   'GI.GLib.Structs.DateTime.dateTimeNewFromUnixUtc' instead."] #-}
-- | Creates a t'GI.GLib.Structs.DateTime.DateTime' corresponding to the given t'GI.GLib.Structs.TimeVal.TimeVal' /@tv@/ in UTC.
-- 
-- The time contained in a t'GI.GLib.Structs.TimeVal.TimeVal' is always stored in the form of
-- seconds elapsed since 1970-01-01 00:00:00 UTC.
-- 
-- This call can fail (returning 'P.Nothing') if /@tv@/ represents a time outside
-- of the supported range of t'GI.GLib.Structs.DateTime.DateTime'.
-- 
-- You should release the return value by calling 'GI.GLib.Structs.DateTime.dateTimeUnref'
-- when you are done with it.
-- 
-- /Since: 2.26/
dateTimeNewFromTimevalUtc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GLib.TimeVal.TimeVal
    -- ^ /@tv@/: a t'GI.GLib.Structs.TimeVal.TimeVal'
    -> m DateTime
    -- ^ __Returns:__ a new t'GI.GLib.Structs.DateTime.DateTime', or 'P.Nothing'
dateTimeNewFromTimevalUtc :: TimeVal -> m DateTime
dateTimeNewFromTimevalUtc TimeVal
tv = IO DateTime -> m DateTime
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 TimeVal
tv' <- TimeVal -> IO (Ptr TimeVal)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TimeVal
tv
    Ptr DateTime
result <- Ptr TimeVal -> IO (Ptr DateTime)
g_date_time_new_from_timeval_utc Ptr TimeVal
tv'
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeNewFromTimevalUtc" 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
DateTime) Ptr DateTime
result
    TimeVal -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TimeVal
tv
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::new_from_unix_local
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "t"
--           , argType = TBasicType TInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the Unix time" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_new_from_unix_local" g_date_time_new_from_unix_local :: 
    Int64 ->                                -- t : TBasicType TInt64
    IO (Ptr DateTime)

-- | Creates a t'GI.GLib.Structs.DateTime.DateTime' corresponding to the given Unix time /@t@/ in the
-- local time zone.
-- 
-- Unix time is the number of seconds that have elapsed since 1970-01-01
-- 00:00:00 UTC, regardless of the local time offset.
-- 
-- This call can fail (returning 'P.Nothing') if /@t@/ represents a time outside
-- of the supported range of t'GI.GLib.Structs.DateTime.DateTime'.
-- 
-- You should release the return value by calling 'GI.GLib.Structs.DateTime.dateTimeUnref'
-- when you are done with it.
-- 
-- /Since: 2.26/
dateTimeNewFromUnixLocal ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Int64
    -- ^ /@t@/: the Unix time
    -> m DateTime
    -- ^ __Returns:__ a new t'GI.GLib.Structs.DateTime.DateTime', or 'P.Nothing'
dateTimeNewFromUnixLocal :: Int64 -> m DateTime
dateTimeNewFromUnixLocal Int64
t = IO DateTime -> m DateTime
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 DateTime
result <- Int64 -> IO (Ptr DateTime)
g_date_time_new_from_unix_local Int64
t
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeNewFromUnixLocal" 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
DateTime) Ptr DateTime
result
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::new_from_unix_utc
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "t"
--           , argType = TBasicType TInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the Unix time" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_new_from_unix_utc" g_date_time_new_from_unix_utc :: 
    Int64 ->                                -- t : TBasicType TInt64
    IO (Ptr DateTime)

-- | Creates a t'GI.GLib.Structs.DateTime.DateTime' corresponding to the given Unix time /@t@/ in UTC.
-- 
-- Unix time is the number of seconds that have elapsed since 1970-01-01
-- 00:00:00 UTC.
-- 
-- This call can fail (returning 'P.Nothing') if /@t@/ represents a time outside
-- of the supported range of t'GI.GLib.Structs.DateTime.DateTime'.
-- 
-- You should release the return value by calling 'GI.GLib.Structs.DateTime.dateTimeUnref'
-- when you are done with it.
-- 
-- /Since: 2.26/
dateTimeNewFromUnixUtc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Int64
    -- ^ /@t@/: the Unix time
    -> m DateTime
    -- ^ __Returns:__ a new t'GI.GLib.Structs.DateTime.DateTime', or 'P.Nothing'
dateTimeNewFromUnixUtc :: Int64 -> m DateTime
dateTimeNewFromUnixUtc Int64
t = IO DateTime -> m DateTime
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 DateTime
result <- Int64 -> IO (Ptr DateTime)
g_date_time_new_from_unix_utc Int64
t
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeNewFromUnixUtc" 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
DateTime) Ptr DateTime
result
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::new_local
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "year"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the year component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "month"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the month component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "day"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the day component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "hour"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the hour component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "minute"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the minute component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "seconds"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of seconds past the minute"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_new_local" g_date_time_new_local :: 
    Int32 ->                                -- year : TBasicType TInt
    Int32 ->                                -- month : TBasicType TInt
    Int32 ->                                -- day : TBasicType TInt
    Int32 ->                                -- hour : TBasicType TInt
    Int32 ->                                -- minute : TBasicType TInt
    CDouble ->                              -- seconds : TBasicType TDouble
    IO (Ptr DateTime)

-- | Creates a new t'GI.GLib.Structs.DateTime.DateTime' corresponding to the given date and time in
-- the local time zone.
-- 
-- This call is equivalent to calling 'GI.GLib.Structs.DateTime.dateTimeNew' with the time
-- zone returned by 'GI.GLib.Structs.TimeZone.timeZoneNewLocal'.
-- 
-- /Since: 2.26/
dateTimeNewLocal ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Int32
    -- ^ /@year@/: the year component of the date
    -> Int32
    -- ^ /@month@/: the month component of the date
    -> Int32
    -- ^ /@day@/: the day component of the date
    -> Int32
    -- ^ /@hour@/: the hour component of the date
    -> Int32
    -- ^ /@minute@/: the minute component of the date
    -> Double
    -- ^ /@seconds@/: the number of seconds past the minute
    -> m DateTime
    -- ^ __Returns:__ a t'GI.GLib.Structs.DateTime.DateTime', or 'P.Nothing'
dateTimeNewLocal :: Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Double -> m DateTime
dateTimeNewLocal Int32
year Int32
month Int32
day Int32
hour Int32
minute Double
seconds = IO DateTime -> m DateTime
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
    let seconds' :: CDouble
seconds' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
seconds
    Ptr DateTime
result <- Int32
-> Int32 -> Int32 -> Int32 -> Int32 -> CDouble -> IO (Ptr DateTime)
g_date_time_new_local Int32
year Int32
month Int32
day Int32
hour Int32
minute CDouble
seconds'
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeNewLocal" 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
DateTime) Ptr DateTime
result
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::new_now
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "tz"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "TimeZone" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GTimeZone" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_new_now" g_date_time_new_now :: 
    Ptr GLib.TimeZone.TimeZone ->           -- tz : TInterface (Name {namespace = "GLib", name = "TimeZone"})
    IO (Ptr DateTime)

-- | Creates a t'GI.GLib.Structs.DateTime.DateTime' corresponding to this exact instant in the given
-- time zone /@tz@/.  The time is as accurate as the system allows, to a
-- maximum accuracy of 1 microsecond.
-- 
-- This function will always succeed unless the system clock is set to
-- truly insane values (or unless GLib is still being used after the
-- year 9999).
-- 
-- You should release the return value by calling 'GI.GLib.Structs.DateTime.dateTimeUnref'
-- when you are done with it.
-- 
-- /Since: 2.26/
dateTimeNewNow ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GLib.TimeZone.TimeZone
    -- ^ /@tz@/: a t'GI.GLib.Structs.TimeZone.TimeZone'
    -> m DateTime
    -- ^ __Returns:__ a new t'GI.GLib.Structs.DateTime.DateTime', or 'P.Nothing'
dateTimeNewNow :: TimeZone -> m DateTime
dateTimeNewNow TimeZone
tz = IO DateTime -> m DateTime
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 TimeZone
tz' <- TimeZone -> IO (Ptr TimeZone)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TimeZone
tz
    Ptr DateTime
result <- Ptr TimeZone -> IO (Ptr DateTime)
g_date_time_new_now Ptr TimeZone
tz'
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeNewNow" 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
DateTime) Ptr DateTime
result
    TimeZone -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TimeZone
tz
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::new_now_local
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_new_now_local" g_date_time_new_now_local :: 
    IO (Ptr DateTime)

-- | Creates a t'GI.GLib.Structs.DateTime.DateTime' corresponding to this exact instant in the local
-- time zone.
-- 
-- This is equivalent to calling 'GI.GLib.Structs.DateTime.dateTimeNewNow' with the time
-- zone returned by 'GI.GLib.Structs.TimeZone.timeZoneNewLocal'.
-- 
-- /Since: 2.26/
dateTimeNewNowLocal ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m DateTime
    -- ^ __Returns:__ a new t'GI.GLib.Structs.DateTime.DateTime', or 'P.Nothing'
dateTimeNewNowLocal :: m DateTime
dateTimeNewNowLocal  = IO DateTime -> m DateTime
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 DateTime
result <- IO (Ptr DateTime)
g_date_time_new_now_local
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeNewNowLocal" 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
DateTime) Ptr DateTime
result
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::new_now_utc
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_new_now_utc" g_date_time_new_now_utc :: 
    IO (Ptr DateTime)

-- | Creates a t'GI.GLib.Structs.DateTime.DateTime' corresponding to this exact instant in UTC.
-- 
-- This is equivalent to calling 'GI.GLib.Structs.DateTime.dateTimeNewNow' with the time
-- zone returned by 'GI.GLib.Structs.TimeZone.timeZoneNewUtc'.
-- 
-- /Since: 2.26/
dateTimeNewNowUtc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m DateTime
    -- ^ __Returns:__ a new t'GI.GLib.Structs.DateTime.DateTime', or 'P.Nothing'
dateTimeNewNowUtc :: m DateTime
dateTimeNewNowUtc  = IO DateTime -> m DateTime
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 DateTime
result <- IO (Ptr DateTime)
g_date_time_new_now_utc
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeNewNowUtc" 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
DateTime) Ptr DateTime
result
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::new_utc
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "year"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the year component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "month"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the month component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "day"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the day component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "hour"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the hour component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "minute"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the minute component of the date"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "seconds"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of seconds past the minute"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_new_utc" g_date_time_new_utc :: 
    Int32 ->                                -- year : TBasicType TInt
    Int32 ->                                -- month : TBasicType TInt
    Int32 ->                                -- day : TBasicType TInt
    Int32 ->                                -- hour : TBasicType TInt
    Int32 ->                                -- minute : TBasicType TInt
    CDouble ->                              -- seconds : TBasicType TDouble
    IO (Ptr DateTime)

-- | Creates a new t'GI.GLib.Structs.DateTime.DateTime' corresponding to the given date and time in
-- UTC.
-- 
-- This call is equivalent to calling 'GI.GLib.Structs.DateTime.dateTimeNew' with the time
-- zone returned by 'GI.GLib.Structs.TimeZone.timeZoneNewUtc'.
-- 
-- /Since: 2.26/
dateTimeNewUtc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Int32
    -- ^ /@year@/: the year component of the date
    -> Int32
    -- ^ /@month@/: the month component of the date
    -> Int32
    -- ^ /@day@/: the day component of the date
    -> Int32
    -- ^ /@hour@/: the hour component of the date
    -> Int32
    -- ^ /@minute@/: the minute component of the date
    -> Double
    -- ^ /@seconds@/: the number of seconds past the minute
    -> m DateTime
    -- ^ __Returns:__ a t'GI.GLib.Structs.DateTime.DateTime', or 'P.Nothing'
dateTimeNewUtc :: Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Double -> m DateTime
dateTimeNewUtc Int32
year Int32
month Int32
day Int32
hour Int32
minute Double
seconds = IO DateTime -> m DateTime
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
    let seconds' :: CDouble
seconds' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
seconds
    Ptr DateTime
result <- Int32
-> Int32 -> Int32 -> Int32 -> Int32 -> CDouble -> IO (Ptr DateTime)
g_date_time_new_utc Int32
year Int32
month Int32
day Int32
hour Int32
minute CDouble
seconds'
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeNewUtc" 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
DateTime) Ptr DateTime
result
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::add
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timespan"
--           , argType = TBasicType TInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GTimeSpan" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_add" g_date_time_add :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    Int64 ->                                -- timespan : TBasicType TInt64
    IO (Ptr DateTime)

-- | Creates a copy of /@datetime@/ and adds the specified timespan to the copy.
-- 
-- /Since: 2.26/
dateTimeAdd ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> Int64
    -- ^ /@timespan@/: a @/GTimeSpan/@
    -> m DateTime
    -- ^ __Returns:__ the newly created t'GI.GLib.Structs.DateTime.DateTime' which should be freed with
    --   'GI.GLib.Structs.DateTime.dateTimeUnref'.
dateTimeAdd :: DateTime -> Int64 -> m DateTime
dateTimeAdd DateTime
datetime Int64
timespan = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr DateTime
result <- Ptr DateTime -> Int64 -> IO (Ptr DateTime)
g_date_time_add Ptr DateTime
datetime' Int64
timespan
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeAdd" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeAddMethodInfo
instance (signature ~ (Int64 -> m DateTime), MonadIO m) => O.MethodInfo DateTimeAddMethodInfo DateTime signature where
    overloadedMethod = dateTimeAdd

#endif

-- method DateTime::add_days
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "days"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of days" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_add_days" g_date_time_add_days :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    Int32 ->                                -- days : TBasicType TInt
    IO (Ptr DateTime)

-- | Creates a copy of /@datetime@/ and adds the specified number of days to the
-- copy. Add negative values to subtract days.
-- 
-- /Since: 2.26/
dateTimeAddDays ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> Int32
    -- ^ /@days@/: the number of days
    -> m DateTime
    -- ^ __Returns:__ the newly created t'GI.GLib.Structs.DateTime.DateTime' which should be freed with
    --   'GI.GLib.Structs.DateTime.dateTimeUnref'.
dateTimeAddDays :: DateTime -> Int32 -> m DateTime
dateTimeAddDays DateTime
datetime Int32
days = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr DateTime
result <- Ptr DateTime -> Int32 -> IO (Ptr DateTime)
g_date_time_add_days Ptr DateTime
datetime' Int32
days
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeAddDays" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeAddDaysMethodInfo
instance (signature ~ (Int32 -> m DateTime), MonadIO m) => O.MethodInfo DateTimeAddDaysMethodInfo DateTime signature where
    overloadedMethod = dateTimeAddDays

#endif

-- method DateTime::add_full
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "years"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of years to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "months"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of months to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "days"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of days to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "hours"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of hours to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "minutes"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of minutes to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "seconds"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of seconds to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_add_full" g_date_time_add_full :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    Int32 ->                                -- years : TBasicType TInt
    Int32 ->                                -- months : TBasicType TInt
    Int32 ->                                -- days : TBasicType TInt
    Int32 ->                                -- hours : TBasicType TInt
    Int32 ->                                -- minutes : TBasicType TInt
    CDouble ->                              -- seconds : TBasicType TDouble
    IO (Ptr DateTime)

-- | Creates a new t'GI.GLib.Structs.DateTime.DateTime' adding the specified values to the current date and
-- time in /@datetime@/. Add negative values to subtract.
-- 
-- /Since: 2.26/
dateTimeAddFull ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> Int32
    -- ^ /@years@/: the number of years to add
    -> Int32
    -- ^ /@months@/: the number of months to add
    -> Int32
    -- ^ /@days@/: the number of days to add
    -> Int32
    -- ^ /@hours@/: the number of hours to add
    -> Int32
    -- ^ /@minutes@/: the number of minutes to add
    -> Double
    -- ^ /@seconds@/: the number of seconds to add
    -> m DateTime
    -- ^ __Returns:__ the newly created t'GI.GLib.Structs.DateTime.DateTime' that should be freed with
    --   'GI.GLib.Structs.DateTime.dateTimeUnref'.
dateTimeAddFull :: DateTime
-> Int32
-> Int32
-> Int32
-> Int32
-> Int32
-> Double
-> m DateTime
dateTimeAddFull DateTime
datetime Int32
years Int32
months Int32
days Int32
hours Int32
minutes Double
seconds = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    let seconds' :: CDouble
seconds' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
seconds
    Ptr DateTime
result <- Ptr DateTime
-> Int32
-> Int32
-> Int32
-> Int32
-> Int32
-> CDouble
-> IO (Ptr DateTime)
g_date_time_add_full Ptr DateTime
datetime' Int32
years Int32
months Int32
days Int32
hours Int32
minutes CDouble
seconds'
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeAddFull" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeAddFullMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Double -> m DateTime), MonadIO m) => O.MethodInfo DateTimeAddFullMethodInfo DateTime signature where
    overloadedMethod = dateTimeAddFull

#endif

-- method DateTime::add_hours
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "hours"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of hours to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_add_hours" g_date_time_add_hours :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    Int32 ->                                -- hours : TBasicType TInt
    IO (Ptr DateTime)

-- | Creates a copy of /@datetime@/ and adds the specified number of hours.
-- Add negative values to subtract hours.
-- 
-- /Since: 2.26/
dateTimeAddHours ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> Int32
    -- ^ /@hours@/: the number of hours to add
    -> m DateTime
    -- ^ __Returns:__ the newly created t'GI.GLib.Structs.DateTime.DateTime' which should be freed with
    --   'GI.GLib.Structs.DateTime.dateTimeUnref'.
dateTimeAddHours :: DateTime -> Int32 -> m DateTime
dateTimeAddHours DateTime
datetime Int32
hours = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr DateTime
result <- Ptr DateTime -> Int32 -> IO (Ptr DateTime)
g_date_time_add_hours Ptr DateTime
datetime' Int32
hours
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeAddHours" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeAddHoursMethodInfo
instance (signature ~ (Int32 -> m DateTime), MonadIO m) => O.MethodInfo DateTimeAddHoursMethodInfo DateTime signature where
    overloadedMethod = dateTimeAddHours

#endif

-- method DateTime::add_minutes
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "minutes"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of minutes to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_add_minutes" g_date_time_add_minutes :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    Int32 ->                                -- minutes : TBasicType TInt
    IO (Ptr DateTime)

-- | Creates a copy of /@datetime@/ adding the specified number of minutes.
-- Add negative values to subtract minutes.
-- 
-- /Since: 2.26/
dateTimeAddMinutes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> Int32
    -- ^ /@minutes@/: the number of minutes to add
    -> m DateTime
    -- ^ __Returns:__ the newly created t'GI.GLib.Structs.DateTime.DateTime' which should be freed with
    --   'GI.GLib.Structs.DateTime.dateTimeUnref'.
dateTimeAddMinutes :: DateTime -> Int32 -> m DateTime
dateTimeAddMinutes DateTime
datetime Int32
minutes = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr DateTime
result <- Ptr DateTime -> Int32 -> IO (Ptr DateTime)
g_date_time_add_minutes Ptr DateTime
datetime' Int32
minutes
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeAddMinutes" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeAddMinutesMethodInfo
instance (signature ~ (Int32 -> m DateTime), MonadIO m) => O.MethodInfo DateTimeAddMinutesMethodInfo DateTime signature where
    overloadedMethod = dateTimeAddMinutes

#endif

-- method DateTime::add_months
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "months"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of months"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_add_months" g_date_time_add_months :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    Int32 ->                                -- months : TBasicType TInt
    IO (Ptr DateTime)

-- | Creates a copy of /@datetime@/ and adds the specified number of months to the
-- copy. Add negative values to subtract months.
-- 
-- The day of the month of the resulting t'GI.GLib.Structs.DateTime.DateTime' is clamped to the number
-- of days in the updated calendar month. For example, if adding 1 month to
-- 31st January 2018, the result would be 28th February 2018. In 2020 (a leap
-- year), the result would be 29th February.
-- 
-- /Since: 2.26/
dateTimeAddMonths ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> Int32
    -- ^ /@months@/: the number of months
    -> m DateTime
    -- ^ __Returns:__ the newly created t'GI.GLib.Structs.DateTime.DateTime' which should be freed with
    --   'GI.GLib.Structs.DateTime.dateTimeUnref'.
dateTimeAddMonths :: DateTime -> Int32 -> m DateTime
dateTimeAddMonths DateTime
datetime Int32
months = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr DateTime
result <- Ptr DateTime -> Int32 -> IO (Ptr DateTime)
g_date_time_add_months Ptr DateTime
datetime' Int32
months
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeAddMonths" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeAddMonthsMethodInfo
instance (signature ~ (Int32 -> m DateTime), MonadIO m) => O.MethodInfo DateTimeAddMonthsMethodInfo DateTime signature where
    overloadedMethod = dateTimeAddMonths

#endif

-- method DateTime::add_seconds
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "seconds"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of seconds to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_add_seconds" g_date_time_add_seconds :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    CDouble ->                              -- seconds : TBasicType TDouble
    IO (Ptr DateTime)

-- | Creates a copy of /@datetime@/ and adds the specified number of seconds.
-- Add negative values to subtract seconds.
-- 
-- /Since: 2.26/
dateTimeAddSeconds ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> Double
    -- ^ /@seconds@/: the number of seconds to add
    -> m DateTime
    -- ^ __Returns:__ the newly created t'GI.GLib.Structs.DateTime.DateTime' which should be freed with
    --   'GI.GLib.Structs.DateTime.dateTimeUnref'.
dateTimeAddSeconds :: DateTime -> Double -> m DateTime
dateTimeAddSeconds DateTime
datetime Double
seconds = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    let seconds' :: CDouble
seconds' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
seconds
    Ptr DateTime
result <- Ptr DateTime -> CDouble -> IO (Ptr DateTime)
g_date_time_add_seconds Ptr DateTime
datetime' CDouble
seconds'
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeAddSeconds" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeAddSecondsMethodInfo
instance (signature ~ (Double -> m DateTime), MonadIO m) => O.MethodInfo DateTimeAddSecondsMethodInfo DateTime signature where
    overloadedMethod = dateTimeAddSeconds

#endif

-- method DateTime::add_weeks
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "weeks"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of weeks"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_add_weeks" g_date_time_add_weeks :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    Int32 ->                                -- weeks : TBasicType TInt
    IO (Ptr DateTime)

-- | Creates a copy of /@datetime@/ and adds the specified number of weeks to the
-- copy. Add negative values to subtract weeks.
-- 
-- /Since: 2.26/
dateTimeAddWeeks ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> Int32
    -- ^ /@weeks@/: the number of weeks
    -> m DateTime
    -- ^ __Returns:__ the newly created t'GI.GLib.Structs.DateTime.DateTime' which should be freed with
    --   'GI.GLib.Structs.DateTime.dateTimeUnref'.
dateTimeAddWeeks :: DateTime -> Int32 -> m DateTime
dateTimeAddWeeks DateTime
datetime Int32
weeks = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr DateTime
result <- Ptr DateTime -> Int32 -> IO (Ptr DateTime)
g_date_time_add_weeks Ptr DateTime
datetime' Int32
weeks
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeAddWeeks" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeAddWeeksMethodInfo
instance (signature ~ (Int32 -> m DateTime), MonadIO m) => O.MethodInfo DateTimeAddWeeksMethodInfo DateTime signature where
    overloadedMethod = dateTimeAddWeeks

#endif

-- method DateTime::add_years
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "years"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of years"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_add_years" g_date_time_add_years :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    Int32 ->                                -- years : TBasicType TInt
    IO (Ptr DateTime)

-- | Creates a copy of /@datetime@/ and adds the specified number of years to the
-- copy. Add negative values to subtract years.
-- 
-- As with 'GI.GLib.Structs.DateTime.dateTimeAddMonths', if the resulting date would be 29th
-- February on a non-leap year, the day will be clamped to 28th February.
-- 
-- /Since: 2.26/
dateTimeAddYears ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> Int32
    -- ^ /@years@/: the number of years
    -> m DateTime
    -- ^ __Returns:__ the newly created t'GI.GLib.Structs.DateTime.DateTime' which should be freed with
    --   'GI.GLib.Structs.DateTime.dateTimeUnref'.
dateTimeAddYears :: DateTime -> Int32 -> m DateTime
dateTimeAddYears DateTime
datetime Int32
years = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr DateTime
result <- Ptr DateTime -> Int32 -> IO (Ptr DateTime)
g_date_time_add_years Ptr DateTime
datetime' Int32
years
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeAddYears" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeAddYearsMethodInfo
instance (signature ~ (Int32 -> m DateTime), MonadIO m) => O.MethodInfo DateTimeAddYearsMethodInfo DateTime signature where
    overloadedMethod = dateTimeAddYears

#endif

-- method DateTime::difference
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "end"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "begin"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt64)
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_difference" g_date_time_difference :: 
    Ptr DateTime ->                         -- end : TInterface (Name {namespace = "GLib", name = "DateTime"})
    Ptr DateTime ->                         -- begin : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int64

-- | Calculates the difference in time between /@end@/ and /@begin@/.  The
-- @/GTimeSpan/@ that is returned is effectively /@end@/ - /@begin@/ (ie:
-- positive if the first parameter is larger).
-- 
-- /Since: 2.26/
dateTimeDifference ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@end@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> DateTime
    -- ^ /@begin@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int64
    -- ^ __Returns:__ the difference between the two t'GI.GLib.Structs.DateTime.DateTime', as a time
    --   span expressed in microseconds.
dateTimeDifference :: DateTime -> DateTime -> m Int64
dateTimeDifference DateTime
end DateTime
begin = IO Int64 -> m Int64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
end' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
end
    Ptr DateTime
begin' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
begin
    Int64
result <- Ptr DateTime -> Ptr DateTime -> IO Int64
g_date_time_difference Ptr DateTime
end' Ptr DateTime
begin'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
end
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
begin
    Int64 -> IO Int64
forall (m :: * -> *) a. Monad m => a -> m a
return Int64
result

#if defined(ENABLE_OVERLOADING)
data DateTimeDifferenceMethodInfo
instance (signature ~ (DateTime -> m Int64), MonadIO m) => O.MethodInfo DateTimeDifferenceMethodInfo DateTime signature where
    overloadedMethod = dateTimeDifference

#endif

-- method DateTime::format
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "format"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a valid UTF-8 string, containing the format for the\n         #GDateTime"
--                 , 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 "g_date_time_format" g_date_time_format :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    CString ->                              -- format : TBasicType TUTF8
    IO CString

-- | Creates a newly allocated string representing the requested /@format@/.
-- 
-- The format strings understood by this function are a subset of the
-- @/strftime()/@ format language as specified by C99.  The %D, %U and %W
-- conversions are not supported, nor is the \'E\' modifier.  The GNU
-- extensions %k, %l, %s and %P are supported, however, as are the
-- \'0\', \'_\' and \'-\' modifiers.
-- 
-- In contrast to @/strftime()/@, this function always produces a UTF-8
-- string, regardless of the current locale.  Note that the rendering of
-- many formats is locale-dependent and may not match the @/strftime()/@
-- output exactly.
-- 
-- The following format specifiers are supported:
-- 
-- * %a: the abbreviated weekday name according to the current locale
-- * %A: the full weekday name according to the current locale
-- * %b: the abbreviated month name according to the current locale
-- * %B: the full month name according to the current locale
-- * %c: the preferred date and time representation for the current locale
-- * %C: the century number (year\/100) as a 2-digit integer (00-99)
-- * %d: the day of the month as a decimal number (range 01 to 31)
-- * %e: the day of the month as a decimal number (range  1 to 31)
-- * %F: equivalent to @%Y-%m-%d@ (the ISO 8601 date format)
-- * %g: the last two digits of the ISO 8601 week-based year as a
-- decimal number (00-99). This works well with %V and %u.
-- * %G: the ISO 8601 week-based year as a decimal number. This works
-- well with %V and %u.
-- * %h: equivalent to %b
-- * %H: the hour as a decimal number using a 24-hour clock (range 00 to 23)
-- * %I: the hour as a decimal number using a 12-hour clock (range 01 to 12)
-- * %j: the day of the year as a decimal number (range 001 to 366)
-- * %k: the hour (24-hour clock) as a decimal number (range 0 to 23);
-- single digits are preceded by a blank
-- * %l: the hour (12-hour clock) as a decimal number (range 1 to 12);
-- single digits are preceded by a blank
-- * %m: the month as a decimal number (range 01 to 12)
-- * %M: the minute as a decimal number (range 00 to 59)
-- * %p: either \"AM\" or \"PM\" according to the given time value, or the
-- corresponding  strings for the current locale.  Noon is treated as
-- \"PM\" and midnight as \"AM\".
-- * %P: like %p but lowercase: \"am\" or \"pm\" or a corresponding string for
-- the current locale
-- * %r: the time in a.m. or p.m. notation
-- * %R: the time in 24-hour notation (%H:%M)
-- * %s: the number of seconds since the Epoch, that is, since 1970-01-01
-- 00:00:00 UTC
-- * %S: the second as a decimal number (range 00 to 60)
-- * %t: a tab character
-- * %T: the time in 24-hour notation with seconds (%H:%M:%S)
-- * %u: the ISO 8601 standard day of the week as a decimal, range 1 to 7,
--  Monday being 1. This works well with %G and %V.
-- * %V: the ISO 8601 standard week number of the current year as a decimal
-- number, range 01 to 53, where week 1 is the first week that has at
-- least 4 days in the new year. See 'GI.GLib.Structs.DateTime.dateTimeGetWeekOfYear'.
-- This works well with %G and %u.
-- * %w: the day of the week as a decimal, range 0 to 6, Sunday being 0.
-- This is not the ISO 8601 standard format -- use %u instead.
-- * %x: the preferred date representation for the current locale without
-- the time
-- * %X: the preferred time representation for the current locale without
-- the date
-- * %y: the year as a decimal number without the century
-- * %Y: the year as a decimal number including the century
-- * %z: the time zone as an offset from UTC (+hhmm)
-- * %:z: the time zone as an offset from UTC (+hh:mm).
-- This is a gnulib @/strftime()/@ extension. Since: 2.38
-- * %[z](#g:signal:z): the time zone as an offset from UTC (+hh:mm:ss). This is a
-- gnulib @/strftime()/@ extension. Since: 2.38
-- * %:[z](#g:signal:z): the time zone as an offset from UTC, with : to necessary
-- precision (e.g., -04, +05:30). This is a gnulib @/strftime()/@ extension. Since: 2.38
-- * %Z: the time zone or name or abbreviation
-- * %%: a literal % character
-- 
-- 
-- Some conversion specifications can be modified by preceding the
-- conversion specifier by one or more modifier characters. The
-- following modifiers are supported for many of the numeric
-- conversions:
-- 
-- * O: Use alternative numeric symbols, if the current locale supports those.
-- * _: Pad a numeric result with spaces. This overrides the default padding
-- for the specifier.
-- * -: Do not pad a numeric result. This overrides the default padding
-- for the specifier.
-- * 0: Pad a numeric result with zeros. This overrides the default padding
-- for the specifier.
-- 
-- 
-- Additionally, when O is used with B, b, or h, it produces the alternative
-- form of a month name. The alternative form should be used when the month
-- name is used without a day number (e.g., standalone). It is required in
-- some languages (Baltic, Slavic, Greek, and more) due to their grammatical
-- rules. For other languages there is no difference. %OB is a GNU and BSD
-- @/strftime()/@ extension expected to be added to the future POSIX specification,
-- %Ob and %Oh are GNU @/strftime()/@ extensions. Since: 2.56
-- 
-- /Since: 2.26/
dateTimeFormat ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: A t'GI.GLib.Structs.DateTime.DateTime'
    -> T.Text
    -- ^ /@format@/: a valid UTF-8 string, containing the format for the
    --          t'GI.GLib.Structs.DateTime.DateTime'
    -> m T.Text
    -- ^ __Returns:__ a newly allocated string formatted to the requested format
    --     or 'P.Nothing' in the case that there was an error (such as a format specifier
    --     not being supported in the current locale). The string
    --     should be freed with 'GI.GLib.Functions.free'.
dateTimeFormat :: DateTime -> Text -> m Text
dateTimeFormat DateTime
datetime Text
format = IO Text -> m Text
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    CString
format' <- Text -> IO CString
textToCString Text
format
    CString
result <- Ptr DateTime -> CString -> IO CString
g_date_time_format Ptr DateTime
datetime' CString
format'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeFormat" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
format'
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeFormatMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m) => O.MethodInfo DateTimeFormatMethodInfo DateTime signature where
    overloadedMethod = dateTimeFormat

#endif

-- method DateTime::format_iso8601
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GDateTime" , 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 "g_date_time_format_iso8601" g_date_time_format_iso8601 :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO CString

-- | Format /@datetime@/ in <https://en.wikipedia.org/wiki/ISO_8601 ISO 8601 format>,
-- including the date, time and time zone, and return that as a UTF-8 encoded
-- string.
-- 
-- /Since: 2.62/
dateTimeFormatIso8601 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: A t'GI.GLib.Structs.DateTime.DateTime'
    -> m T.Text
    -- ^ __Returns:__ a newly allocated string formatted in ISO 8601 format
    --     or 'P.Nothing' in the case that there was an error. The string
    --     should be freed with 'GI.GLib.Functions.free'.
dateTimeFormatIso8601 :: DateTime -> m Text
dateTimeFormatIso8601 DateTime
datetime = IO Text -> m Text
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    CString
result <- Ptr DateTime -> IO CString
g_date_time_format_iso8601 Ptr DateTime
datetime'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeFormatIso8601" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeFormatIso8601MethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo DateTimeFormatIso8601MethodInfo DateTime signature where
    overloadedMethod = dateTimeFormatIso8601

#endif

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

foreign import ccall "g_date_time_get_day_of_month" g_date_time_get_day_of_month :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int32

-- | Retrieves the day of the month represented by /@datetime@/ in the gregorian
-- calendar.
-- 
-- /Since: 2.26/
dateTimeGetDayOfMonth ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int32
    -- ^ __Returns:__ the day of the month
dateTimeGetDayOfMonth :: DateTime -> m Int32
dateTimeGetDayOfMonth DateTime
datetime = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int32
result <- Ptr DateTime -> IO Int32
g_date_time_get_day_of_month Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DateTimeGetDayOfMonthMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo DateTimeGetDayOfMonthMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetDayOfMonth

#endif

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

foreign import ccall "g_date_time_get_day_of_week" g_date_time_get_day_of_week :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int32

-- | Retrieves the ISO 8601 day of the week on which /@datetime@/ falls (1 is
-- Monday, 2 is Tuesday... 7 is Sunday).
-- 
-- /Since: 2.26/
dateTimeGetDayOfWeek ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int32
    -- ^ __Returns:__ the day of the week
dateTimeGetDayOfWeek :: DateTime -> m Int32
dateTimeGetDayOfWeek DateTime
datetime = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int32
result <- Ptr DateTime -> IO Int32
g_date_time_get_day_of_week Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DateTimeGetDayOfWeekMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo DateTimeGetDayOfWeekMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetDayOfWeek

#endif

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

foreign import ccall "g_date_time_get_day_of_year" g_date_time_get_day_of_year :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int32

-- | Retrieves the day of the year represented by /@datetime@/ in the Gregorian
-- calendar.
-- 
-- /Since: 2.26/
dateTimeGetDayOfYear ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int32
    -- ^ __Returns:__ the day of the year
dateTimeGetDayOfYear :: DateTime -> m Int32
dateTimeGetDayOfYear DateTime
datetime = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int32
result <- Ptr DateTime -> IO Int32
g_date_time_get_day_of_year Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DateTimeGetDayOfYearMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo DateTimeGetDayOfYearMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetDayOfYear

#endif

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

foreign import ccall "g_date_time_get_hour" g_date_time_get_hour :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int32

-- | Retrieves the hour of the day represented by /@datetime@/
-- 
-- /Since: 2.26/
dateTimeGetHour ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int32
    -- ^ __Returns:__ the hour of the day
dateTimeGetHour :: DateTime -> m Int32
dateTimeGetHour DateTime
datetime = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int32
result <- Ptr DateTime -> IO Int32
g_date_time_get_hour Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DateTimeGetHourMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo DateTimeGetHourMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetHour

#endif

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

foreign import ccall "g_date_time_get_microsecond" g_date_time_get_microsecond :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int32

-- | Retrieves the microsecond of the date represented by /@datetime@/
-- 
-- /Since: 2.26/
dateTimeGetMicrosecond ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int32
    -- ^ __Returns:__ the microsecond of the second
dateTimeGetMicrosecond :: DateTime -> m Int32
dateTimeGetMicrosecond DateTime
datetime = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int32
result <- Ptr DateTime -> IO Int32
g_date_time_get_microsecond Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DateTimeGetMicrosecondMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo DateTimeGetMicrosecondMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetMicrosecond

#endif

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

foreign import ccall "g_date_time_get_minute" g_date_time_get_minute :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int32

-- | Retrieves the minute of the hour represented by /@datetime@/
-- 
-- /Since: 2.26/
dateTimeGetMinute ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int32
    -- ^ __Returns:__ the minute of the hour
dateTimeGetMinute :: DateTime -> m Int32
dateTimeGetMinute DateTime
datetime = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int32
result <- Ptr DateTime -> IO Int32
g_date_time_get_minute Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DateTimeGetMinuteMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo DateTimeGetMinuteMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetMinute

#endif

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

foreign import ccall "g_date_time_get_month" g_date_time_get_month :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int32

-- | Retrieves the month of the year represented by /@datetime@/ in the Gregorian
-- calendar.
-- 
-- /Since: 2.26/
dateTimeGetMonth ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int32
    -- ^ __Returns:__ the month represented by /@datetime@/
dateTimeGetMonth :: DateTime -> m Int32
dateTimeGetMonth DateTime
datetime = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int32
result <- Ptr DateTime -> IO Int32
g_date_time_get_month Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DateTimeGetMonthMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo DateTimeGetMonthMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetMonth

#endif

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

foreign import ccall "g_date_time_get_second" g_date_time_get_second :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int32

-- | Retrieves the second of the minute represented by /@datetime@/
-- 
-- /Since: 2.26/
dateTimeGetSecond ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int32
    -- ^ __Returns:__ the second represented by /@datetime@/
dateTimeGetSecond :: DateTime -> m Int32
dateTimeGetSecond DateTime
datetime = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int32
result <- Ptr DateTime -> IO Int32
g_date_time_get_second Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DateTimeGetSecondMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo DateTimeGetSecondMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetSecond

#endif

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

foreign import ccall "g_date_time_get_seconds" g_date_time_get_seconds :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO CDouble

-- | Retrieves the number of seconds since the start of the last minute,
-- including the fractional part.
-- 
-- /Since: 2.26/
dateTimeGetSeconds ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Double
    -- ^ __Returns:__ the number of seconds
dateTimeGetSeconds :: DateTime -> m Double
dateTimeGetSeconds DateTime
datetime = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    CDouble
result <- Ptr DateTime -> IO CDouble
g_date_time_get_seconds Ptr DateTime
datetime'
    let result' :: Double
result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeGetSecondsMethodInfo
instance (signature ~ (m Double), MonadIO m) => O.MethodInfo DateTimeGetSecondsMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetSeconds

#endif

-- method DateTime::get_timezone
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "TimeZone" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_get_timezone" g_date_time_get_timezone :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO (Ptr GLib.TimeZone.TimeZone)

-- | Get the time zone for this /@datetime@/.
-- 
-- /Since: 2.58/
dateTimeGetTimezone ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m GLib.TimeZone.TimeZone
    -- ^ __Returns:__ the time zone
dateTimeGetTimezone :: DateTime -> m TimeZone
dateTimeGetTimezone DateTime
datetime = IO TimeZone -> m TimeZone
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TimeZone -> m TimeZone) -> IO TimeZone -> m TimeZone
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr TimeZone
result <- Ptr DateTime -> IO (Ptr TimeZone)
g_date_time_get_timezone Ptr DateTime
datetime'
    Text -> Ptr TimeZone -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeGetTimezone" Ptr TimeZone
result
    TimeZone
result' <- ((ManagedPtr TimeZone -> TimeZone) -> Ptr TimeZone -> IO TimeZone
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr TimeZone -> TimeZone
GLib.TimeZone.TimeZone) Ptr TimeZone
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    TimeZone -> IO TimeZone
forall (m :: * -> *) a. Monad m => a -> m a
return TimeZone
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeGetTimezoneMethodInfo
instance (signature ~ (m GLib.TimeZone.TimeZone), MonadIO m) => O.MethodInfo DateTimeGetTimezoneMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetTimezone

#endif

-- method DateTime::get_timezone_abbreviation
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , 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 "g_date_time_get_timezone_abbreviation" g_date_time_get_timezone_abbreviation :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO CString

-- | Determines the time zone abbreviation to be used at the time and in
-- the time zone of /@datetime@/.
-- 
-- For example, in Toronto this is currently \"EST\" during the winter
-- months and \"EDT\" during the summer months when daylight savings
-- time is in effect.
-- 
-- /Since: 2.26/
dateTimeGetTimezoneAbbreviation ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m T.Text
    -- ^ __Returns:__ the time zone abbreviation. The returned
    --          string is owned by the t'GI.GLib.Structs.DateTime.DateTime' and it should not be
    --          modified or freed
dateTimeGetTimezoneAbbreviation :: DateTime -> m Text
dateTimeGetTimezoneAbbreviation DateTime
datetime = IO Text -> m Text
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    CString
result <- Ptr DateTime -> IO CString
g_date_time_get_timezone_abbreviation Ptr DateTime
datetime'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeGetTimezoneAbbreviation" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeGetTimezoneAbbreviationMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo DateTimeGetTimezoneAbbreviationMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetTimezoneAbbreviation

#endif

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

foreign import ccall "g_date_time_get_utc_offset" g_date_time_get_utc_offset :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int64

-- | Determines the offset to UTC in effect at the time and in the time
-- zone of /@datetime@/.
-- 
-- The offset is the number of microseconds that you add to UTC time to
-- arrive at local time for the time zone (ie: negative numbers for time
-- zones west of GMT, positive numbers for east).
-- 
-- If /@datetime@/ represents UTC time, then the offset is always zero.
-- 
-- /Since: 2.26/
dateTimeGetUtcOffset ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int64
    -- ^ __Returns:__ the number of microseconds that should be added to UTC to
    --          get the local time
dateTimeGetUtcOffset :: DateTime -> m Int64
dateTimeGetUtcOffset DateTime
datetime = IO Int64 -> m Int64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int64
result <- Ptr DateTime -> IO Int64
g_date_time_get_utc_offset Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int64 -> IO Int64
forall (m :: * -> *) a. Monad m => a -> m a
return Int64
result

#if defined(ENABLE_OVERLOADING)
data DateTimeGetUtcOffsetMethodInfo
instance (signature ~ (m Int64), MonadIO m) => O.MethodInfo DateTimeGetUtcOffsetMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetUtcOffset

#endif

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

foreign import ccall "g_date_time_get_week_numbering_year" g_date_time_get_week_numbering_year :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int32

-- | Returns the ISO 8601 week-numbering year in which the week containing
-- /@datetime@/ falls.
-- 
-- This function, taken together with 'GI.GLib.Structs.DateTime.dateTimeGetWeekOfYear' and
-- 'GI.GLib.Structs.DateTime.dateTimeGetDayOfWeek' can be used to determine the full ISO
-- week date on which /@datetime@/ falls.
-- 
-- This is usually equal to the normal Gregorian year (as returned by
-- 'GI.GLib.Structs.DateTime.dateTimeGetYear'), except as detailed below:
-- 
-- For Thursday, the week-numbering year is always equal to the usual
-- calendar year.  For other days, the number is such that every day
-- within a complete week (Monday to Sunday) is contained within the
-- same week-numbering year.
-- 
-- For Monday, Tuesday and Wednesday occurring near the end of the year,
-- this may mean that the week-numbering year is one greater than the
-- calendar year (so that these days have the same week-numbering year
-- as the Thursday occurring early in the next year).
-- 
-- For Friday, Saturday and Sunday occurring near the start of the year,
-- this may mean that the week-numbering year is one less than the
-- calendar year (so that these days have the same week-numbering year
-- as the Thursday occurring late in the previous year).
-- 
-- An equivalent description is that the week-numbering year is equal to
-- the calendar year containing the majority of the days in the current
-- week (Monday to Sunday).
-- 
-- Note that January 1 0001 in the proleptic Gregorian calendar is a
-- Monday, so this function never returns 0.
-- 
-- /Since: 2.26/
dateTimeGetWeekNumberingYear ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int32
    -- ^ __Returns:__ the ISO 8601 week-numbering year for /@datetime@/
dateTimeGetWeekNumberingYear :: DateTime -> m Int32
dateTimeGetWeekNumberingYear DateTime
datetime = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int32
result <- Ptr DateTime -> IO Int32
g_date_time_get_week_numbering_year Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DateTimeGetWeekNumberingYearMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo DateTimeGetWeekNumberingYearMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetWeekNumberingYear

#endif

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

foreign import ccall "g_date_time_get_week_of_year" g_date_time_get_week_of_year :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int32

-- | Returns the ISO 8601 week number for the week containing /@datetime@/.
-- The ISO 8601 week number is the same for every day of the week (from
-- Moday through Sunday).  That can produce some unusual results
-- (described below).
-- 
-- The first week of the year is week 1.  This is the week that contains
-- the first Thursday of the year.  Equivalently, this is the first week
-- that has more than 4 of its days falling within the calendar year.
-- 
-- The value 0 is never returned by this function.  Days contained
-- within a year but occurring before the first ISO 8601 week of that
-- year are considered as being contained in the last week of the
-- previous year.  Similarly, the final days of a calendar year may be
-- considered as being part of the first ISO 8601 week of the next year
-- if 4 or more days of that week are contained within the new year.
-- 
-- /Since: 2.26/
dateTimeGetWeekOfYear ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int32
    -- ^ __Returns:__ the ISO 8601 week number for /@datetime@/.
dateTimeGetWeekOfYear :: DateTime -> m Int32
dateTimeGetWeekOfYear DateTime
datetime = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int32
result <- Ptr DateTime -> IO Int32
g_date_time_get_week_of_year Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DateTimeGetWeekOfYearMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo DateTimeGetWeekOfYearMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetWeekOfYear

#endif

-- method DateTime::get_year
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_get_year" g_date_time_get_year :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int32

-- | Retrieves the year represented by /@datetime@/ in the Gregorian calendar.
-- 
-- /Since: 2.26/
dateTimeGetYear ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: A t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int32
    -- ^ __Returns:__ the year represented by /@datetime@/
dateTimeGetYear :: DateTime -> m Int32
dateTimeGetYear DateTime
datetime = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int32
result <- Ptr DateTime -> IO Int32
g_date_time_get_year Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
data DateTimeGetYearMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo DateTimeGetYearMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetYear

#endif

-- method DateTime::get_ymd
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "year"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the return location for the gregorian year, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "month"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the return location for the month of the year, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "day"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the return location for the day of the month, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_get_ymd" g_date_time_get_ymd :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    Ptr Int32 ->                            -- year : TBasicType TInt
    Ptr Int32 ->                            -- month : TBasicType TInt
    Ptr Int32 ->                            -- day : TBasicType TInt
    IO ()

-- | Retrieves the Gregorian day, month, and year of a given t'GI.GLib.Structs.DateTime.DateTime'.
-- 
-- /Since: 2.26/
dateTimeGetYmd ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'.
    -> m ((Int32, Int32, Int32))
dateTimeGetYmd :: DateTime -> m (Int32, Int32, Int32)
dateTimeGetYmd DateTime
datetime = IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32))
-> IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr Int32
year <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
month <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
day <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr DateTime -> Ptr Int32 -> Ptr Int32 -> Ptr Int32 -> IO ()
g_date_time_get_ymd Ptr DateTime
datetime' Ptr Int32
year Ptr Int32
month Ptr Int32
day
    Int32
year' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
year
    Int32
month' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
month
    Int32
day' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
day
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
year
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
month
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
day
    (Int32, Int32, Int32) -> IO (Int32, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
year', Int32
month', Int32
day')

#if defined(ENABLE_OVERLOADING)
data DateTimeGetYmdMethodInfo
instance (signature ~ (m ((Int32, Int32, Int32))), MonadIO m) => O.MethodInfo DateTimeGetYmdMethodInfo DateTime signature where
    overloadedMethod = dateTimeGetYmd

#endif

-- method DateTime::is_daylight_savings
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , 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 "g_date_time_is_daylight_savings" g_date_time_is_daylight_savings :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO CInt

-- | Determines if daylight savings time is in effect at the time and in
-- the time zone of /@datetime@/.
-- 
-- /Since: 2.26/
dateTimeIsDaylightSavings ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if daylight savings time is in effect
dateTimeIsDaylightSavings :: DateTime -> m Bool
dateTimeIsDaylightSavings DateTime
datetime = IO Bool -> m Bool
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    CInt
result <- Ptr DateTime -> IO CInt
g_date_time_is_daylight_savings Ptr DateTime
datetime'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeIsDaylightSavingsMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo DateTimeIsDaylightSavingsMethodInfo DateTime signature where
    overloadedMethod = dateTimeIsDaylightSavings

#endif

-- method DateTime::ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_ref" g_date_time_ref :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO (Ptr DateTime)

-- | Atomically increments the reference count of /@datetime@/ by one.
-- 
-- /Since: 2.26/
dateTimeRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m DateTime
    -- ^ __Returns:__ the t'GI.GLib.Structs.DateTime.DateTime' with the reference count increased
dateTimeRef :: DateTime -> m DateTime
dateTimeRef DateTime
datetime = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr DateTime
result <- Ptr DateTime -> IO (Ptr DateTime)
g_date_time_ref Ptr DateTime
datetime'
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeRef" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeRefMethodInfo
instance (signature ~ (m DateTime), MonadIO m) => O.MethodInfo DateTimeRefMethodInfo DateTime signature where
    overloadedMethod = dateTimeRef

#endif

-- method DateTime::to_local
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_to_local" g_date_time_to_local :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO (Ptr DateTime)

-- | Creates a new t'GI.GLib.Structs.DateTime.DateTime' corresponding to the same instant in time as
-- /@datetime@/, but in the local time zone.
-- 
-- This call is equivalent to calling 'GI.GLib.Structs.DateTime.dateTimeToTimezone' with the
-- time zone returned by 'GI.GLib.Structs.TimeZone.timeZoneNewLocal'.
-- 
-- /Since: 2.26/
dateTimeToLocal ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m DateTime
    -- ^ __Returns:__ the newly created t'GI.GLib.Structs.DateTime.DateTime'
dateTimeToLocal :: DateTime -> m DateTime
dateTimeToLocal DateTime
datetime = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr DateTime
result <- Ptr DateTime -> IO (Ptr DateTime)
g_date_time_to_local Ptr DateTime
datetime'
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeToLocal" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeToLocalMethodInfo
instance (signature ~ (m DateTime), MonadIO m) => O.MethodInfo DateTimeToLocalMethodInfo DateTime signature where
    overloadedMethod = dateTimeToLocal

#endif

-- method DateTime::to_timeval
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tv"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "TimeVal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GTimeVal to modify"
--                 , 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 "g_date_time_to_timeval" g_date_time_to_timeval :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    Ptr GLib.TimeVal.TimeVal ->             -- tv : TInterface (Name {namespace = "GLib", name = "TimeVal"})
    IO CInt

{-# DEPRECATED dateTimeToTimeval ["(Since version 2.62)","t'GI.GLib.Structs.TimeVal.TimeVal' is not year-2038-safe. Use","   'GI.GLib.Structs.DateTime.dateTimeToUnix' instead."] #-}
-- | Stores the instant in time that /@datetime@/ represents into /@tv@/.
-- 
-- The time contained in a t'GI.GLib.Structs.TimeVal.TimeVal' is always stored in the form of
-- seconds elapsed since 1970-01-01 00:00:00 UTC, regardless of the time
-- zone associated with /@datetime@/.
-- 
-- On systems where \'long\' is 32bit (ie: all 32bit systems and all
-- Windows systems), a t'GI.GLib.Structs.TimeVal.TimeVal' is incapable of storing the entire
-- range of values that t'GI.GLib.Structs.DateTime.DateTime' is capable of expressing.  On those
-- systems, this function returns 'P.False' to indicate that the time is
-- out of range.
-- 
-- On systems where \'long\' is 64bit, this function never fails.
-- 
-- /Since: 2.26/
dateTimeToTimeval ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> GLib.TimeVal.TimeVal
    -- ^ /@tv@/: a t'GI.GLib.Structs.TimeVal.TimeVal' to modify
    -> m Bool
    -- ^ __Returns:__ 'P.True' if successful, else 'P.False'
dateTimeToTimeval :: DateTime -> TimeVal -> m Bool
dateTimeToTimeval DateTime
datetime TimeVal
tv = IO Bool -> m Bool
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr TimeVal
tv' <- TimeVal -> IO (Ptr TimeVal)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TimeVal
tv
    CInt
result <- Ptr DateTime -> Ptr TimeVal -> IO CInt
g_date_time_to_timeval Ptr DateTime
datetime' Ptr TimeVal
tv'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    TimeVal -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TimeVal
tv
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeToTimevalMethodInfo
instance (signature ~ (GLib.TimeVal.TimeVal -> m Bool), MonadIO m) => O.MethodInfo DateTimeToTimevalMethodInfo DateTime signature where
    overloadedMethod = dateTimeToTimeval

#endif

-- method DateTime::to_timezone
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tz"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "TimeZone" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the new #GTimeZone" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_to_timezone" g_date_time_to_timezone :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    Ptr GLib.TimeZone.TimeZone ->           -- tz : TInterface (Name {namespace = "GLib", name = "TimeZone"})
    IO (Ptr DateTime)

-- | Create a new t'GI.GLib.Structs.DateTime.DateTime' corresponding to the same instant in time as
-- /@datetime@/, but in the time zone /@tz@/.
-- 
-- This call can fail in the case that the time goes out of bounds.  For
-- example, converting 0001-01-01 00:00:00 UTC to a time zone west of
-- Greenwich will fail (due to the year 0 being out of range).
-- 
-- You should release the return value by calling 'GI.GLib.Structs.DateTime.dateTimeUnref'
-- when you are done with it.
-- 
-- /Since: 2.26/
dateTimeToTimezone ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> GLib.TimeZone.TimeZone
    -- ^ /@tz@/: the new t'GI.GLib.Structs.TimeZone.TimeZone'
    -> m DateTime
    -- ^ __Returns:__ a new t'GI.GLib.Structs.DateTime.DateTime', or 'P.Nothing'
dateTimeToTimezone :: DateTime -> TimeZone -> m DateTime
dateTimeToTimezone DateTime
datetime TimeZone
tz = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr TimeZone
tz' <- TimeZone -> IO (Ptr TimeZone)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TimeZone
tz
    Ptr DateTime
result <- Ptr DateTime -> Ptr TimeZone -> IO (Ptr DateTime)
g_date_time_to_timezone Ptr DateTime
datetime' Ptr TimeZone
tz'
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeToTimezone" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    TimeZone -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TimeZone
tz
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeToTimezoneMethodInfo
instance (signature ~ (GLib.TimeZone.TimeZone -> m DateTime), MonadIO m) => O.MethodInfo DateTimeToTimezoneMethodInfo DateTime signature where
    overloadedMethod = dateTimeToTimezone

#endif

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

foreign import ccall "g_date_time_to_unix" g_date_time_to_unix :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO Int64

-- | Gives the Unix time corresponding to /@datetime@/, rounding down to the
-- nearest second.
-- 
-- Unix time is the number of seconds that have elapsed since 1970-01-01
-- 00:00:00 UTC, regardless of the time zone associated with /@datetime@/.
-- 
-- /Since: 2.26/
dateTimeToUnix ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Int64
    -- ^ __Returns:__ the Unix time corresponding to /@datetime@/
dateTimeToUnix :: DateTime -> m Int64
dateTimeToUnix DateTime
datetime = IO Int64 -> m Int64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Int64
result <- Ptr DateTime -> IO Int64
g_date_time_to_unix Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    Int64 -> IO Int64
forall (m :: * -> *) a. Monad m => a -> m a
return Int64
result

#if defined(ENABLE_OVERLOADING)
data DateTimeToUnixMethodInfo
instance (signature ~ (m Int64), MonadIO m) => O.MethodInfo DateTimeToUnixMethodInfo DateTime signature where
    overloadedMethod = dateTimeToUnix

#endif

-- method DateTime::to_utc
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "DateTime" })
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_to_utc" g_date_time_to_utc :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO (Ptr DateTime)

-- | Creates a new t'GI.GLib.Structs.DateTime.DateTime' corresponding to the same instant in time as
-- /@datetime@/, but in UTC.
-- 
-- This call is equivalent to calling 'GI.GLib.Structs.DateTime.dateTimeToTimezone' with the
-- time zone returned by 'GI.GLib.Structs.TimeZone.timeZoneNewUtc'.
-- 
-- /Since: 2.26/
dateTimeToUtc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m DateTime
    -- ^ __Returns:__ the newly created t'GI.GLib.Structs.DateTime.DateTime'
dateTimeToUtc :: DateTime -> m DateTime
dateTimeToUtc DateTime
datetime = IO DateTime -> m DateTime
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 DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr DateTime
result <- Ptr DateTime -> IO (Ptr DateTime)
g_date_time_to_utc Ptr DateTime
datetime'
    Text -> Ptr DateTime -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dateTimeToUtc" 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
DateTime) Ptr DateTime
result
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    DateTime -> IO DateTime
forall (m :: * -> *) a. Monad m => a -> m a
return DateTime
result'

#if defined(ENABLE_OVERLOADING)
data DateTimeToUtcMethodInfo
instance (signature ~ (m DateTime), MonadIO m) => O.MethodInfo DateTimeToUtcMethodInfo DateTime signature where
    overloadedMethod = dateTimeToUtc

#endif

-- method DateTime::unref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DateTime" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_unref" g_date_time_unref :: 
    Ptr DateTime ->                         -- datetime : TInterface (Name {namespace = "GLib", name = "DateTime"})
    IO ()

-- | Atomically decrements the reference count of /@datetime@/ by one.
-- 
-- When the reference count reaches zero, the resources allocated by
-- /@datetime@/ are freed
-- 
-- /Since: 2.26/
dateTimeUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    DateTime
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m ()
dateTimeUnref :: DateTime -> m ()
dateTimeUnref DateTime
datetime = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DateTime
datetime' <- DateTime -> IO (Ptr DateTime)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DateTime
datetime
    Ptr DateTime -> IO ()
g_date_time_unref Ptr DateTime
datetime'
    DateTime -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DateTime
datetime
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data DateTimeUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo DateTimeUnrefMethodInfo DateTime signature where
    overloadedMethod = dateTimeUnref

#endif

-- method DateTime::compare
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "dt1"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "first #GDateTime to compare"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dt2"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "second #GDateTime to compare"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "g_date_time_compare" g_date_time_compare :: 
    Ptr () ->                               -- dt1 : TBasicType TPtr
    Ptr () ->                               -- dt2 : TBasicType TPtr
    IO Int32

-- | A comparison function for @/GDateTimes/@ that is suitable
-- as a t'GI.GLib.Callbacks.CompareFunc'. Both @/GDateTimes/@ must be non-'P.Nothing'.
-- 
-- /Since: 2.26/
dateTimeCompare ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Ptr ()
    -- ^ /@dt1@/: first t'GI.GLib.Structs.DateTime.DateTime' to compare
    -> Ptr ()
    -- ^ /@dt2@/: second t'GI.GLib.Structs.DateTime.DateTime' to compare
    -> m Int32
    -- ^ __Returns:__ -1, 0 or 1 if /@dt1@/ is less than, equal to or greater
    --   than /@dt2@/.
dateTimeCompare :: Ptr () -> Ptr () -> m Int32
dateTimeCompare Ptr ()
dt1 Ptr ()
dt2 = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Int32
result <- Ptr () -> Ptr () -> IO Int32
g_date_time_compare Ptr ()
dt1 Ptr ()
dt2
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::equal
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "dt1"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dt2"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , 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 "g_date_time_equal" g_date_time_equal :: 
    Ptr () ->                               -- dt1 : TBasicType TPtr
    Ptr () ->                               -- dt2 : TBasicType TPtr
    IO CInt

-- | Checks to see if /@dt1@/ and /@dt2@/ are equal.
-- 
-- Equal here means that they represent the same moment after converting
-- them to the same time zone.
-- 
-- /Since: 2.26/
dateTimeEqual ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Ptr ()
    -- ^ /@dt1@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> Ptr ()
    -- ^ /@dt2@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if /@dt1@/ and /@dt2@/ are equal
dateTimeEqual :: Ptr () -> Ptr () -> m Bool
dateTimeEqual Ptr ()
dt1 Ptr ()
dt2 = IO Bool -> m Bool
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
    CInt
result <- Ptr () -> Ptr () -> IO CInt
g_date_time_equal Ptr ()
dt1 Ptr ()
dt2
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method DateTime::hash
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "datetime"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GDateTime" , 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 "g_date_time_hash" g_date_time_hash :: 
    Ptr () ->                               -- datetime : TBasicType TPtr
    IO Word32

-- | Hashes /@datetime@/ into a @/guint/@, suitable for use within t'GI.GLib.Structs.HashTable.HashTable'.
-- 
-- /Since: 2.26/
dateTimeHash ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Ptr ()
    -- ^ /@datetime@/: a t'GI.GLib.Structs.DateTime.DateTime'
    -> m Word32
    -- ^ __Returns:__ a @/guint/@ containing the hash
dateTimeHash :: Ptr () -> m Word32
dateTimeHash Ptr ()
datetime = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- Ptr () -> IO Word32
g_date_time_hash Ptr ()
datetime
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveDateTimeMethod (t :: Symbol) (o :: *) :: * where
    ResolveDateTimeMethod "add" o = DateTimeAddMethodInfo
    ResolveDateTimeMethod "addDays" o = DateTimeAddDaysMethodInfo
    ResolveDateTimeMethod "addFull" o = DateTimeAddFullMethodInfo
    ResolveDateTimeMethod "addHours" o = DateTimeAddHoursMethodInfo
    ResolveDateTimeMethod "addMinutes" o = DateTimeAddMinutesMethodInfo
    ResolveDateTimeMethod "addMonths" o = DateTimeAddMonthsMethodInfo
    ResolveDateTimeMethod "addSeconds" o = DateTimeAddSecondsMethodInfo
    ResolveDateTimeMethod "addWeeks" o = DateTimeAddWeeksMethodInfo
    ResolveDateTimeMethod "addYears" o = DateTimeAddYearsMethodInfo
    ResolveDateTimeMethod "difference" o = DateTimeDifferenceMethodInfo
    ResolveDateTimeMethod "format" o = DateTimeFormatMethodInfo
    ResolveDateTimeMethod "formatIso8601" o = DateTimeFormatIso8601MethodInfo
    ResolveDateTimeMethod "isDaylightSavings" o = DateTimeIsDaylightSavingsMethodInfo
    ResolveDateTimeMethod "ref" o = DateTimeRefMethodInfo
    ResolveDateTimeMethod "toLocal" o = DateTimeToLocalMethodInfo
    ResolveDateTimeMethod "toTimeval" o = DateTimeToTimevalMethodInfo
    ResolveDateTimeMethod "toTimezone" o = DateTimeToTimezoneMethodInfo
    ResolveDateTimeMethod "toUnix" o = DateTimeToUnixMethodInfo
    ResolveDateTimeMethod "toUtc" o = DateTimeToUtcMethodInfo
    ResolveDateTimeMethod "unref" o = DateTimeUnrefMethodInfo
    ResolveDateTimeMethod "getDayOfMonth" o = DateTimeGetDayOfMonthMethodInfo
    ResolveDateTimeMethod "getDayOfWeek" o = DateTimeGetDayOfWeekMethodInfo
    ResolveDateTimeMethod "getDayOfYear" o = DateTimeGetDayOfYearMethodInfo
    ResolveDateTimeMethod "getHour" o = DateTimeGetHourMethodInfo
    ResolveDateTimeMethod "getMicrosecond" o = DateTimeGetMicrosecondMethodInfo
    ResolveDateTimeMethod "getMinute" o = DateTimeGetMinuteMethodInfo
    ResolveDateTimeMethod "getMonth" o = DateTimeGetMonthMethodInfo
    ResolveDateTimeMethod "getSecond" o = DateTimeGetSecondMethodInfo
    ResolveDateTimeMethod "getSeconds" o = DateTimeGetSecondsMethodInfo
    ResolveDateTimeMethod "getTimezone" o = DateTimeGetTimezoneMethodInfo
    ResolveDateTimeMethod "getTimezoneAbbreviation" o = DateTimeGetTimezoneAbbreviationMethodInfo
    ResolveDateTimeMethod "getUtcOffset" o = DateTimeGetUtcOffsetMethodInfo
    ResolveDateTimeMethod "getWeekNumberingYear" o = DateTimeGetWeekNumberingYearMethodInfo
    ResolveDateTimeMethod "getWeekOfYear" o = DateTimeGetWeekOfYearMethodInfo
    ResolveDateTimeMethod "getYear" o = DateTimeGetYearMethodInfo
    ResolveDateTimeMethod "getYmd" o = DateTimeGetYmdMethodInfo
    ResolveDateTimeMethod l o = O.MethodResolutionFailed l o

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

#endif