-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

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

module GI.Secret.Enums
    ( 

 -- * Enumerations
-- ** Error #enum:Error#

    Error(..)                               ,


-- ** SchemaAttributeType #enum:SchemaAttributeType#

    SchemaAttributeType(..)                 ,


-- ** SchemaType #enum:SchemaType#

    SchemaType(..)                          ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL


-- Enum SchemaType
-- | Different types of schemas for storing secrets, intended for use with
-- 'GI.Secret.Functions.getSchema'.
-- 
-- /Since: 0.18.6/
data SchemaType = 
      SchemaTypeNote
    -- ^ Personal passwords; see @/SECRET_SCHEMA_NOTE/@
    | SchemaTypeCompatNetwork
    -- ^ Network passwords from older
    --    libgnome-keyring storage; see @/SECRET_SCHEMA_COMPAT_NETWORK/@
    | AnotherSchemaType Int
    -- ^ Catch-all for unknown values
    deriving (Int -> SchemaType -> ShowS
[SchemaType] -> ShowS
SchemaType -> String
(Int -> SchemaType -> ShowS)
-> (SchemaType -> String)
-> ([SchemaType] -> ShowS)
-> Show SchemaType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SchemaType] -> ShowS
$cshowList :: [SchemaType] -> ShowS
show :: SchemaType -> String
$cshow :: SchemaType -> String
showsPrec :: Int -> SchemaType -> ShowS
$cshowsPrec :: Int -> SchemaType -> ShowS
Show, SchemaType -> SchemaType -> Bool
(SchemaType -> SchemaType -> Bool)
-> (SchemaType -> SchemaType -> Bool) -> Eq SchemaType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SchemaType -> SchemaType -> Bool
$c/= :: SchemaType -> SchemaType -> Bool
== :: SchemaType -> SchemaType -> Bool
$c== :: SchemaType -> SchemaType -> Bool
Eq)

instance P.Enum SchemaType where
    fromEnum :: SchemaType -> Int
fromEnum SchemaTypeNote = 0
    fromEnum SchemaTypeCompatNetwork = 1
    fromEnum (AnotherSchemaType k :: Int
k) = Int
k

    toEnum :: Int -> SchemaType
toEnum 0 = SchemaType
SchemaTypeNote
    toEnum 1 = SchemaType
SchemaTypeCompatNetwork
    toEnum k :: Int
k = Int -> SchemaType
AnotherSchemaType Int
k

instance P.Ord SchemaType where
    compare :: SchemaType -> SchemaType -> Ordering
compare a :: SchemaType
a b :: SchemaType
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (SchemaType -> Int
forall a. Enum a => a -> Int
P.fromEnum SchemaType
a) (SchemaType -> Int
forall a. Enum a => a -> Int
P.fromEnum SchemaType
b)

-- Enum SchemaAttributeType
-- | The type of an attribute in a t'GI.Secret.Structs.Schema.Schema'. Attributes are stored as strings
-- in the Secret Service, and the attribute types simply define standard ways
-- to store integer and boolean values as strings.
data SchemaAttributeType = 
      SchemaAttributeTypeString
    -- ^ a utf-8 string attribute
    | SchemaAttributeTypeInteger
    -- ^ an integer attribute, stored as a decimal
    | SchemaAttributeTypeBoolean
    -- ^ a boolean attribute, stored as \'true\' or \'false\'
    | AnotherSchemaAttributeType Int
    -- ^ Catch-all for unknown values
    deriving (Int -> SchemaAttributeType -> ShowS
[SchemaAttributeType] -> ShowS
SchemaAttributeType -> String
(Int -> SchemaAttributeType -> ShowS)
-> (SchemaAttributeType -> String)
-> ([SchemaAttributeType] -> ShowS)
-> Show SchemaAttributeType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SchemaAttributeType] -> ShowS
$cshowList :: [SchemaAttributeType] -> ShowS
show :: SchemaAttributeType -> String
$cshow :: SchemaAttributeType -> String
showsPrec :: Int -> SchemaAttributeType -> ShowS
$cshowsPrec :: Int -> SchemaAttributeType -> ShowS
Show, SchemaAttributeType -> SchemaAttributeType -> Bool
(SchemaAttributeType -> SchemaAttributeType -> Bool)
-> (SchemaAttributeType -> SchemaAttributeType -> Bool)
-> Eq SchemaAttributeType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SchemaAttributeType -> SchemaAttributeType -> Bool
$c/= :: SchemaAttributeType -> SchemaAttributeType -> Bool
== :: SchemaAttributeType -> SchemaAttributeType -> Bool
$c== :: SchemaAttributeType -> SchemaAttributeType -> Bool
Eq)

instance P.Enum SchemaAttributeType where
    fromEnum :: SchemaAttributeType -> Int
fromEnum SchemaAttributeTypeString = 0
    fromEnum SchemaAttributeTypeInteger = 1
    fromEnum SchemaAttributeTypeBoolean = 2
    fromEnum (AnotherSchemaAttributeType k :: Int
k) = Int
k

    toEnum :: Int -> SchemaAttributeType
toEnum 0 = SchemaAttributeType
SchemaAttributeTypeString
    toEnum 1 = SchemaAttributeType
SchemaAttributeTypeInteger
    toEnum 2 = SchemaAttributeType
SchemaAttributeTypeBoolean
    toEnum k :: Int
k = Int -> SchemaAttributeType
AnotherSchemaAttributeType Int
k

instance P.Ord SchemaAttributeType where
    compare :: SchemaAttributeType -> SchemaAttributeType -> Ordering
compare a :: SchemaAttributeType
a b :: SchemaAttributeType
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (SchemaAttributeType -> Int
forall a. Enum a => a -> Int
P.fromEnum SchemaAttributeType
a) (SchemaAttributeType -> Int
forall a. Enum a => a -> Int
P.fromEnum SchemaAttributeType
b)

-- Enum Error
-- | /No description available in the introspection data./
data Error = 
      ErrorProtocol
    -- ^ /No description available in the introspection data./
    | ErrorIsLocked
    -- ^ /No description available in the introspection data./
    | ErrorNoSuchObject
    -- ^ /No description available in the introspection data./
    | ErrorAlreadyExists
    -- ^ /No description available in the introspection data./
    | AnotherError Int
    -- ^ Catch-all for unknown values
    deriving (Int -> Error -> ShowS
[Error] -> ShowS
Error -> String
(Int -> Error -> ShowS)
-> (Error -> String) -> ([Error] -> ShowS) -> Show Error
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Error] -> ShowS
$cshowList :: [Error] -> ShowS
show :: Error -> String
$cshow :: Error -> String
showsPrec :: Int -> Error -> ShowS
$cshowsPrec :: Int -> Error -> ShowS
Show, Error -> Error -> Bool
(Error -> Error -> Bool) -> (Error -> Error -> Bool) -> Eq Error
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Error -> Error -> Bool
$c/= :: Error -> Error -> Bool
== :: Error -> Error -> Bool
$c== :: Error -> Error -> Bool
Eq)

instance P.Enum Error where
    fromEnum :: Error -> Int
fromEnum ErrorProtocol = 1
    fromEnum ErrorIsLocked = 2
    fromEnum ErrorNoSuchObject = 3
    fromEnum ErrorAlreadyExists = 4
    fromEnum (AnotherError k :: Int
k) = Int
k

    toEnum :: Int -> Error
toEnum 1 = Error
ErrorProtocol
    toEnum 2 = Error
ErrorIsLocked
    toEnum 3 = Error
ErrorNoSuchObject
    toEnum 4 = Error
ErrorAlreadyExists
    toEnum k :: Int
k = Int -> Error
AnotherError Int
k

instance P.Ord Error where
    compare :: Error -> Error -> Ordering
compare a :: Error
a b :: Error
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (Error -> Int
forall a. Enum a => a -> Int
P.fromEnum Error
a) (Error -> Int
forall a. Enum a => a -> Int
P.fromEnum Error
b)