{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Support.Types.SeverityLevel where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SeverityLevel = SeverityLevel'
{
SeverityLevel -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
SeverityLevel -> Maybe Text
code :: Prelude.Maybe Prelude.Text
}
deriving (SeverityLevel -> SeverityLevel -> Bool
(SeverityLevel -> SeverityLevel -> Bool)
-> (SeverityLevel -> SeverityLevel -> Bool) -> Eq SeverityLevel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SeverityLevel -> SeverityLevel -> Bool
$c/= :: SeverityLevel -> SeverityLevel -> Bool
== :: SeverityLevel -> SeverityLevel -> Bool
$c== :: SeverityLevel -> SeverityLevel -> Bool
Prelude.Eq, ReadPrec [SeverityLevel]
ReadPrec SeverityLevel
Int -> ReadS SeverityLevel
ReadS [SeverityLevel]
(Int -> ReadS SeverityLevel)
-> ReadS [SeverityLevel]
-> ReadPrec SeverityLevel
-> ReadPrec [SeverityLevel]
-> Read SeverityLevel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SeverityLevel]
$creadListPrec :: ReadPrec [SeverityLevel]
readPrec :: ReadPrec SeverityLevel
$creadPrec :: ReadPrec SeverityLevel
readList :: ReadS [SeverityLevel]
$creadList :: ReadS [SeverityLevel]
readsPrec :: Int -> ReadS SeverityLevel
$creadsPrec :: Int -> ReadS SeverityLevel
Prelude.Read, Int -> SeverityLevel -> ShowS
[SeverityLevel] -> ShowS
SeverityLevel -> String
(Int -> SeverityLevel -> ShowS)
-> (SeverityLevel -> String)
-> ([SeverityLevel] -> ShowS)
-> Show SeverityLevel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SeverityLevel] -> ShowS
$cshowList :: [SeverityLevel] -> ShowS
show :: SeverityLevel -> String
$cshow :: SeverityLevel -> String
showsPrec :: Int -> SeverityLevel -> ShowS
$cshowsPrec :: Int -> SeverityLevel -> ShowS
Prelude.Show, (forall x. SeverityLevel -> Rep SeverityLevel x)
-> (forall x. Rep SeverityLevel x -> SeverityLevel)
-> Generic SeverityLevel
forall x. Rep SeverityLevel x -> SeverityLevel
forall x. SeverityLevel -> Rep SeverityLevel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SeverityLevel x -> SeverityLevel
$cfrom :: forall x. SeverityLevel -> Rep SeverityLevel x
Prelude.Generic)
newSeverityLevel ::
SeverityLevel
newSeverityLevel :: SeverityLevel
newSeverityLevel =
SeverityLevel' :: Maybe Text -> Maybe Text -> SeverityLevel
SeverityLevel'
{ $sel:name:SeverityLevel' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:code:SeverityLevel' :: Maybe Text
code = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
severityLevel_name :: Lens.Lens' SeverityLevel (Prelude.Maybe Prelude.Text)
severityLevel_name :: (Maybe Text -> f (Maybe Text)) -> SeverityLevel -> f SeverityLevel
severityLevel_name = (SeverityLevel -> Maybe Text)
-> (SeverityLevel -> Maybe Text -> SeverityLevel)
-> Lens SeverityLevel SeverityLevel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SeverityLevel' {Maybe Text
name :: Maybe Text
$sel:name:SeverityLevel' :: SeverityLevel -> Maybe Text
name} -> Maybe Text
name) (\s :: SeverityLevel
s@SeverityLevel' {} Maybe Text
a -> SeverityLevel
s {$sel:name:SeverityLevel' :: Maybe Text
name = Maybe Text
a} :: SeverityLevel)
severityLevel_code :: Lens.Lens' SeverityLevel (Prelude.Maybe Prelude.Text)
severityLevel_code :: (Maybe Text -> f (Maybe Text)) -> SeverityLevel -> f SeverityLevel
severityLevel_code = (SeverityLevel -> Maybe Text)
-> (SeverityLevel -> Maybe Text -> SeverityLevel)
-> Lens SeverityLevel SeverityLevel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SeverityLevel' {Maybe Text
code :: Maybe Text
$sel:code:SeverityLevel' :: SeverityLevel -> Maybe Text
code} -> Maybe Text
code) (\s :: SeverityLevel
s@SeverityLevel' {} Maybe Text
a -> SeverityLevel
s {$sel:code:SeverityLevel' :: Maybe Text
code = Maybe Text
a} :: SeverityLevel)
instance Core.FromJSON SeverityLevel where
parseJSON :: Value -> Parser SeverityLevel
parseJSON =
String
-> (Object -> Parser SeverityLevel)
-> Value
-> Parser SeverityLevel
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SeverityLevel"
( \Object
x ->
Maybe Text -> Maybe Text -> SeverityLevel
SeverityLevel'
(Maybe Text -> Maybe Text -> SeverityLevel)
-> Parser (Maybe Text) -> Parser (Maybe Text -> SeverityLevel)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name") Parser (Maybe Text -> SeverityLevel)
-> Parser (Maybe Text) -> Parser SeverityLevel
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"code")
)
instance Prelude.Hashable SeverityLevel
instance Prelude.NFData SeverityLevel