module Effectful.Notify.Internal.Data.NotifyUrgency
  ( NotifyUrgency (..),
    _NotifyUrgencyLow,
    _NotifyUrgencyNormal,
    _NotifyUrgencyCritical,
  )
where

import Control.DeepSeq (NFData)
import Data.Text.Display (Display (displayBuilder))
import GHC.Generics (Generic)
import Optics.Core (Prism', prism)

-- | Notification urgency. Not supported by all notification systems.
data NotifyUrgency
  = -- | Low.
    NotifyUrgencyLow
  | -- | Normal.
    NotifyUrgencyNormal
  | -- | Critical.
    NotifyUrgencyCritical
  deriving stock (NotifyUrgency
NotifyUrgency -> NotifyUrgency -> Bounded NotifyUrgency
forall a. a -> a -> Bounded a
$cminBound :: NotifyUrgency
minBound :: NotifyUrgency
$cmaxBound :: NotifyUrgency
maxBound :: NotifyUrgency
Bounded, Int -> NotifyUrgency
NotifyUrgency -> Int
NotifyUrgency -> [NotifyUrgency]
NotifyUrgency -> NotifyUrgency
NotifyUrgency -> NotifyUrgency -> [NotifyUrgency]
NotifyUrgency -> NotifyUrgency -> NotifyUrgency -> [NotifyUrgency]
(NotifyUrgency -> NotifyUrgency)
-> (NotifyUrgency -> NotifyUrgency)
-> (Int -> NotifyUrgency)
-> (NotifyUrgency -> Int)
-> (NotifyUrgency -> [NotifyUrgency])
-> (NotifyUrgency -> NotifyUrgency -> [NotifyUrgency])
-> (NotifyUrgency -> NotifyUrgency -> [NotifyUrgency])
-> (NotifyUrgency
    -> NotifyUrgency -> NotifyUrgency -> [NotifyUrgency])
-> Enum NotifyUrgency
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: NotifyUrgency -> NotifyUrgency
succ :: NotifyUrgency -> NotifyUrgency
$cpred :: NotifyUrgency -> NotifyUrgency
pred :: NotifyUrgency -> NotifyUrgency
$ctoEnum :: Int -> NotifyUrgency
toEnum :: Int -> NotifyUrgency
$cfromEnum :: NotifyUrgency -> Int
fromEnum :: NotifyUrgency -> Int
$cenumFrom :: NotifyUrgency -> [NotifyUrgency]
enumFrom :: NotifyUrgency -> [NotifyUrgency]
$cenumFromThen :: NotifyUrgency -> NotifyUrgency -> [NotifyUrgency]
enumFromThen :: NotifyUrgency -> NotifyUrgency -> [NotifyUrgency]
$cenumFromTo :: NotifyUrgency -> NotifyUrgency -> [NotifyUrgency]
enumFromTo :: NotifyUrgency -> NotifyUrgency -> [NotifyUrgency]
$cenumFromThenTo :: NotifyUrgency -> NotifyUrgency -> NotifyUrgency -> [NotifyUrgency]
enumFromThenTo :: NotifyUrgency -> NotifyUrgency -> NotifyUrgency -> [NotifyUrgency]
Enum, NotifyUrgency -> NotifyUrgency -> Bool
(NotifyUrgency -> NotifyUrgency -> Bool)
-> (NotifyUrgency -> NotifyUrgency -> Bool) -> Eq NotifyUrgency
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NotifyUrgency -> NotifyUrgency -> Bool
== :: NotifyUrgency -> NotifyUrgency -> Bool
$c/= :: NotifyUrgency -> NotifyUrgency -> Bool
/= :: NotifyUrgency -> NotifyUrgency -> Bool
Eq, (forall x. NotifyUrgency -> Rep NotifyUrgency x)
-> (forall x. Rep NotifyUrgency x -> NotifyUrgency)
-> Generic NotifyUrgency
forall x. Rep NotifyUrgency x -> NotifyUrgency
forall x. NotifyUrgency -> Rep NotifyUrgency x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NotifyUrgency -> Rep NotifyUrgency x
from :: forall x. NotifyUrgency -> Rep NotifyUrgency x
$cto :: forall x. Rep NotifyUrgency x -> NotifyUrgency
to :: forall x. Rep NotifyUrgency x -> NotifyUrgency
Generic, Eq NotifyUrgency
Eq NotifyUrgency =>
(NotifyUrgency -> NotifyUrgency -> Ordering)
-> (NotifyUrgency -> NotifyUrgency -> Bool)
-> (NotifyUrgency -> NotifyUrgency -> Bool)
-> (NotifyUrgency -> NotifyUrgency -> Bool)
-> (NotifyUrgency -> NotifyUrgency -> Bool)
-> (NotifyUrgency -> NotifyUrgency -> NotifyUrgency)
-> (NotifyUrgency -> NotifyUrgency -> NotifyUrgency)
-> Ord NotifyUrgency
NotifyUrgency -> NotifyUrgency -> Bool
NotifyUrgency -> NotifyUrgency -> Ordering
NotifyUrgency -> NotifyUrgency -> NotifyUrgency
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: NotifyUrgency -> NotifyUrgency -> Ordering
compare :: NotifyUrgency -> NotifyUrgency -> Ordering
$c< :: NotifyUrgency -> NotifyUrgency -> Bool
< :: NotifyUrgency -> NotifyUrgency -> Bool
$c<= :: NotifyUrgency -> NotifyUrgency -> Bool
<= :: NotifyUrgency -> NotifyUrgency -> Bool
$c> :: NotifyUrgency -> NotifyUrgency -> Bool
> :: NotifyUrgency -> NotifyUrgency -> Bool
$c>= :: NotifyUrgency -> NotifyUrgency -> Bool
>= :: NotifyUrgency -> NotifyUrgency -> Bool
$cmax :: NotifyUrgency -> NotifyUrgency -> NotifyUrgency
max :: NotifyUrgency -> NotifyUrgency -> NotifyUrgency
$cmin :: NotifyUrgency -> NotifyUrgency -> NotifyUrgency
min :: NotifyUrgency -> NotifyUrgency -> NotifyUrgency
Ord, Int -> NotifyUrgency -> ShowS
[NotifyUrgency] -> ShowS
NotifyUrgency -> String
(Int -> NotifyUrgency -> ShowS)
-> (NotifyUrgency -> String)
-> ([NotifyUrgency] -> ShowS)
-> Show NotifyUrgency
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NotifyUrgency -> ShowS
showsPrec :: Int -> NotifyUrgency -> ShowS
$cshow :: NotifyUrgency -> String
show :: NotifyUrgency -> String
$cshowList :: [NotifyUrgency] -> ShowS
showList :: [NotifyUrgency] -> ShowS
Show)
  deriving anyclass (NotifyUrgency -> ()
(NotifyUrgency -> ()) -> NFData NotifyUrgency
forall a. (a -> ()) -> NFData a
$crnf :: NotifyUrgency -> ()
rnf :: NotifyUrgency -> ()
NFData)

-- | @since 0.1
instance Display NotifyUrgency where
  displayBuilder :: NotifyUrgency -> Builder
displayBuilder = \case
    NotifyUrgency
NotifyUrgencyLow -> Builder
"low"
    NotifyUrgency
NotifyUrgencyNormal -> Builder
"normal"
    NotifyUrgency
NotifyUrgencyCritical -> Builder
"critical"

-- | @since 0.1
_NotifyUrgencyLow :: Prism' NotifyUrgency ()
_NotifyUrgencyLow :: Prism' NotifyUrgency ()
_NotifyUrgencyLow =
  (() -> NotifyUrgency)
-> (NotifyUrgency -> Either NotifyUrgency ())
-> Prism' NotifyUrgency ()
forall b t s a. (b -> t) -> (s -> Either t a) -> Prism s t a b
prism
    (NotifyUrgency -> () -> NotifyUrgency
forall a b. a -> b -> a
const NotifyUrgency
NotifyUrgencyLow)
    ( \case
        NotifyUrgency
NotifyUrgencyLow -> () -> Either NotifyUrgency ()
forall a b. b -> Either a b
Right ()
        NotifyUrgency
x -> NotifyUrgency -> Either NotifyUrgency ()
forall a b. a -> Either a b
Left NotifyUrgency
x
    )
{-# INLINE _NotifyUrgencyLow #-}

-- | @since 0.1
_NotifyUrgencyNormal :: Prism' NotifyUrgency ()
_NotifyUrgencyNormal :: Prism' NotifyUrgency ()
_NotifyUrgencyNormal =
  (() -> NotifyUrgency)
-> (NotifyUrgency -> Either NotifyUrgency ())
-> Prism' NotifyUrgency ()
forall b t s a. (b -> t) -> (s -> Either t a) -> Prism s t a b
prism
    (NotifyUrgency -> () -> NotifyUrgency
forall a b. a -> b -> a
const NotifyUrgency
NotifyUrgencyNormal)
    ( \case
        NotifyUrgency
NotifyUrgencyNormal -> () -> Either NotifyUrgency ()
forall a b. b -> Either a b
Right ()
        NotifyUrgency
x -> NotifyUrgency -> Either NotifyUrgency ()
forall a b. a -> Either a b
Left NotifyUrgency
x
    )
{-# INLINE _NotifyUrgencyNormal #-}

-- | @since 0.1
_NotifyUrgencyCritical :: Prism' NotifyUrgency ()
_NotifyUrgencyCritical :: Prism' NotifyUrgency ()
_NotifyUrgencyCritical =
  (() -> NotifyUrgency)
-> (NotifyUrgency -> Either NotifyUrgency ())
-> Prism' NotifyUrgency ()
forall b t s a. (b -> t) -> (s -> Either t a) -> Prism s t a b
prism
    (NotifyUrgency -> () -> NotifyUrgency
forall a b. a -> b -> a
const NotifyUrgency
NotifyUrgencyCritical)
    ( \case
        NotifyUrgency
NotifyUrgencyCritical -> () -> Either NotifyUrgency ()
forall a b. b -> Either a b
Right ()
        NotifyUrgency
x -> NotifyUrgency -> Either NotifyUrgency ()
forall a b. a -> Either a b
Left NotifyUrgency
x
    )
{-# INLINE _NotifyUrgencyCritical #-}