{-# 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.SecurityHub.Types.FindingProviderSeverity where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.SeverityLabel
data FindingProviderSeverity = FindingProviderSeverity'
{
FindingProviderSeverity -> Maybe SeverityLabel
label :: Prelude.Maybe SeverityLabel,
FindingProviderSeverity -> Maybe Text
original :: Prelude.Maybe Prelude.Text
}
deriving (FindingProviderSeverity -> FindingProviderSeverity -> Bool
(FindingProviderSeverity -> FindingProviderSeverity -> Bool)
-> (FindingProviderSeverity -> FindingProviderSeverity -> Bool)
-> Eq FindingProviderSeverity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FindingProviderSeverity -> FindingProviderSeverity -> Bool
$c/= :: FindingProviderSeverity -> FindingProviderSeverity -> Bool
== :: FindingProviderSeverity -> FindingProviderSeverity -> Bool
$c== :: FindingProviderSeverity -> FindingProviderSeverity -> Bool
Prelude.Eq, ReadPrec [FindingProviderSeverity]
ReadPrec FindingProviderSeverity
Int -> ReadS FindingProviderSeverity
ReadS [FindingProviderSeverity]
(Int -> ReadS FindingProviderSeverity)
-> ReadS [FindingProviderSeverity]
-> ReadPrec FindingProviderSeverity
-> ReadPrec [FindingProviderSeverity]
-> Read FindingProviderSeverity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FindingProviderSeverity]
$creadListPrec :: ReadPrec [FindingProviderSeverity]
readPrec :: ReadPrec FindingProviderSeverity
$creadPrec :: ReadPrec FindingProviderSeverity
readList :: ReadS [FindingProviderSeverity]
$creadList :: ReadS [FindingProviderSeverity]
readsPrec :: Int -> ReadS FindingProviderSeverity
$creadsPrec :: Int -> ReadS FindingProviderSeverity
Prelude.Read, Int -> FindingProviderSeverity -> ShowS
[FindingProviderSeverity] -> ShowS
FindingProviderSeverity -> String
(Int -> FindingProviderSeverity -> ShowS)
-> (FindingProviderSeverity -> String)
-> ([FindingProviderSeverity] -> ShowS)
-> Show FindingProviderSeverity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FindingProviderSeverity] -> ShowS
$cshowList :: [FindingProviderSeverity] -> ShowS
show :: FindingProviderSeverity -> String
$cshow :: FindingProviderSeverity -> String
showsPrec :: Int -> FindingProviderSeverity -> ShowS
$cshowsPrec :: Int -> FindingProviderSeverity -> ShowS
Prelude.Show, (forall x.
FindingProviderSeverity -> Rep FindingProviderSeverity x)
-> (forall x.
Rep FindingProviderSeverity x -> FindingProviderSeverity)
-> Generic FindingProviderSeverity
forall x. Rep FindingProviderSeverity x -> FindingProviderSeverity
forall x. FindingProviderSeverity -> Rep FindingProviderSeverity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FindingProviderSeverity x -> FindingProviderSeverity
$cfrom :: forall x. FindingProviderSeverity -> Rep FindingProviderSeverity x
Prelude.Generic)
newFindingProviderSeverity ::
FindingProviderSeverity
newFindingProviderSeverity :: FindingProviderSeverity
newFindingProviderSeverity =
FindingProviderSeverity' :: Maybe SeverityLabel -> Maybe Text -> FindingProviderSeverity
FindingProviderSeverity'
{ $sel:label:FindingProviderSeverity' :: Maybe SeverityLabel
label = Maybe SeverityLabel
forall a. Maybe a
Prelude.Nothing,
$sel:original:FindingProviderSeverity' :: Maybe Text
original = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
findingProviderSeverity_label :: Lens.Lens' FindingProviderSeverity (Prelude.Maybe SeverityLabel)
findingProviderSeverity_label :: (Maybe SeverityLabel -> f (Maybe SeverityLabel))
-> FindingProviderSeverity -> f FindingProviderSeverity
findingProviderSeverity_label = (FindingProviderSeverity -> Maybe SeverityLabel)
-> (FindingProviderSeverity
-> Maybe SeverityLabel -> FindingProviderSeverity)
-> Lens
FindingProviderSeverity
FindingProviderSeverity
(Maybe SeverityLabel)
(Maybe SeverityLabel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingProviderSeverity' {Maybe SeverityLabel
label :: Maybe SeverityLabel
$sel:label:FindingProviderSeverity' :: FindingProviderSeverity -> Maybe SeverityLabel
label} -> Maybe SeverityLabel
label) (\s :: FindingProviderSeverity
s@FindingProviderSeverity' {} Maybe SeverityLabel
a -> FindingProviderSeverity
s {$sel:label:FindingProviderSeverity' :: Maybe SeverityLabel
label = Maybe SeverityLabel
a} :: FindingProviderSeverity)
findingProviderSeverity_original :: Lens.Lens' FindingProviderSeverity (Prelude.Maybe Prelude.Text)
findingProviderSeverity_original :: (Maybe Text -> f (Maybe Text))
-> FindingProviderSeverity -> f FindingProviderSeverity
findingProviderSeverity_original = (FindingProviderSeverity -> Maybe Text)
-> (FindingProviderSeverity
-> Maybe Text -> FindingProviderSeverity)
-> Lens
FindingProviderSeverity
FindingProviderSeverity
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingProviderSeverity' {Maybe Text
original :: Maybe Text
$sel:original:FindingProviderSeverity' :: FindingProviderSeverity -> Maybe Text
original} -> Maybe Text
original) (\s :: FindingProviderSeverity
s@FindingProviderSeverity' {} Maybe Text
a -> FindingProviderSeverity
s {$sel:original:FindingProviderSeverity' :: Maybe Text
original = Maybe Text
a} :: FindingProviderSeverity)
instance Core.FromJSON FindingProviderSeverity where
parseJSON :: Value -> Parser FindingProviderSeverity
parseJSON =
String
-> (Object -> Parser FindingProviderSeverity)
-> Value
-> Parser FindingProviderSeverity
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FindingProviderSeverity"
( \Object
x ->
Maybe SeverityLabel -> Maybe Text -> FindingProviderSeverity
FindingProviderSeverity'
(Maybe SeverityLabel -> Maybe Text -> FindingProviderSeverity)
-> Parser (Maybe SeverityLabel)
-> Parser (Maybe Text -> FindingProviderSeverity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SeverityLabel)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Label")
Parser (Maybe Text -> FindingProviderSeverity)
-> Parser (Maybe Text) -> Parser FindingProviderSeverity
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
"Original")
)
instance Prelude.Hashable FindingProviderSeverity
instance Prelude.NFData FindingProviderSeverity
instance Core.ToJSON FindingProviderSeverity where
toJSON :: FindingProviderSeverity -> Value
toJSON FindingProviderSeverity' {Maybe Text
Maybe SeverityLabel
original :: Maybe Text
label :: Maybe SeverityLabel
$sel:original:FindingProviderSeverity' :: FindingProviderSeverity -> Maybe Text
$sel:label:FindingProviderSeverity' :: FindingProviderSeverity -> Maybe SeverityLabel
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Label" Text -> SeverityLabel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SeverityLabel -> Pair) -> Maybe SeverityLabel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SeverityLabel
label,
(Text
"Original" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
original
]
)