{-# 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.SeverityUpdate 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 SeverityUpdate = SeverityUpdate'
{
SeverityUpdate -> Maybe Double
product :: Prelude.Maybe Prelude.Double,
SeverityUpdate -> Maybe SeverityLabel
label :: Prelude.Maybe SeverityLabel,
SeverityUpdate -> Maybe Natural
normalized :: Prelude.Maybe Prelude.Natural
}
deriving (SeverityUpdate -> SeverityUpdate -> Bool
(SeverityUpdate -> SeverityUpdate -> Bool)
-> (SeverityUpdate -> SeverityUpdate -> Bool) -> Eq SeverityUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SeverityUpdate -> SeverityUpdate -> Bool
$c/= :: SeverityUpdate -> SeverityUpdate -> Bool
== :: SeverityUpdate -> SeverityUpdate -> Bool
$c== :: SeverityUpdate -> SeverityUpdate -> Bool
Prelude.Eq, ReadPrec [SeverityUpdate]
ReadPrec SeverityUpdate
Int -> ReadS SeverityUpdate
ReadS [SeverityUpdate]
(Int -> ReadS SeverityUpdate)
-> ReadS [SeverityUpdate]
-> ReadPrec SeverityUpdate
-> ReadPrec [SeverityUpdate]
-> Read SeverityUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SeverityUpdate]
$creadListPrec :: ReadPrec [SeverityUpdate]
readPrec :: ReadPrec SeverityUpdate
$creadPrec :: ReadPrec SeverityUpdate
readList :: ReadS [SeverityUpdate]
$creadList :: ReadS [SeverityUpdate]
readsPrec :: Int -> ReadS SeverityUpdate
$creadsPrec :: Int -> ReadS SeverityUpdate
Prelude.Read, Int -> SeverityUpdate -> ShowS
[SeverityUpdate] -> ShowS
SeverityUpdate -> String
(Int -> SeverityUpdate -> ShowS)
-> (SeverityUpdate -> String)
-> ([SeverityUpdate] -> ShowS)
-> Show SeverityUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SeverityUpdate] -> ShowS
$cshowList :: [SeverityUpdate] -> ShowS
show :: SeverityUpdate -> String
$cshow :: SeverityUpdate -> String
showsPrec :: Int -> SeverityUpdate -> ShowS
$cshowsPrec :: Int -> SeverityUpdate -> ShowS
Prelude.Show, (forall x. SeverityUpdate -> Rep SeverityUpdate x)
-> (forall x. Rep SeverityUpdate x -> SeverityUpdate)
-> Generic SeverityUpdate
forall x. Rep SeverityUpdate x -> SeverityUpdate
forall x. SeverityUpdate -> Rep SeverityUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SeverityUpdate x -> SeverityUpdate
$cfrom :: forall x. SeverityUpdate -> Rep SeverityUpdate x
Prelude.Generic)
newSeverityUpdate ::
SeverityUpdate
newSeverityUpdate :: SeverityUpdate
newSeverityUpdate =
SeverityUpdate' :: Maybe Double
-> Maybe SeverityLabel -> Maybe Natural -> SeverityUpdate
SeverityUpdate'
{ $sel:product:SeverityUpdate' :: Maybe Double
product = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:label:SeverityUpdate' :: Maybe SeverityLabel
label = Maybe SeverityLabel
forall a. Maybe a
Prelude.Nothing,
$sel:normalized:SeverityUpdate' :: Maybe Natural
normalized = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
severityUpdate_product :: Lens.Lens' SeverityUpdate (Prelude.Maybe Prelude.Double)
severityUpdate_product :: (Maybe Double -> f (Maybe Double))
-> SeverityUpdate -> f SeverityUpdate
severityUpdate_product = (SeverityUpdate -> Maybe Double)
-> (SeverityUpdate -> Maybe Double -> SeverityUpdate)
-> Lens SeverityUpdate SeverityUpdate (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SeverityUpdate' {Maybe Double
product :: Maybe Double
$sel:product:SeverityUpdate' :: SeverityUpdate -> Maybe Double
product} -> Maybe Double
product) (\s :: SeverityUpdate
s@SeverityUpdate' {} Maybe Double
a -> SeverityUpdate
s {$sel:product:SeverityUpdate' :: Maybe Double
product = Maybe Double
a} :: SeverityUpdate)
severityUpdate_label :: Lens.Lens' SeverityUpdate (Prelude.Maybe SeverityLabel)
severityUpdate_label :: (Maybe SeverityLabel -> f (Maybe SeverityLabel))
-> SeverityUpdate -> f SeverityUpdate
severityUpdate_label = (SeverityUpdate -> Maybe SeverityLabel)
-> (SeverityUpdate -> Maybe SeverityLabel -> SeverityUpdate)
-> Lens
SeverityUpdate
SeverityUpdate
(Maybe SeverityLabel)
(Maybe SeverityLabel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SeverityUpdate' {Maybe SeverityLabel
label :: Maybe SeverityLabel
$sel:label:SeverityUpdate' :: SeverityUpdate -> Maybe SeverityLabel
label} -> Maybe SeverityLabel
label) (\s :: SeverityUpdate
s@SeverityUpdate' {} Maybe SeverityLabel
a -> SeverityUpdate
s {$sel:label:SeverityUpdate' :: Maybe SeverityLabel
label = Maybe SeverityLabel
a} :: SeverityUpdate)
severityUpdate_normalized :: Lens.Lens' SeverityUpdate (Prelude.Maybe Prelude.Natural)
severityUpdate_normalized :: (Maybe Natural -> f (Maybe Natural))
-> SeverityUpdate -> f SeverityUpdate
severityUpdate_normalized = (SeverityUpdate -> Maybe Natural)
-> (SeverityUpdate -> Maybe Natural -> SeverityUpdate)
-> Lens
SeverityUpdate SeverityUpdate (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SeverityUpdate' {Maybe Natural
normalized :: Maybe Natural
$sel:normalized:SeverityUpdate' :: SeverityUpdate -> Maybe Natural
normalized} -> Maybe Natural
normalized) (\s :: SeverityUpdate
s@SeverityUpdate' {} Maybe Natural
a -> SeverityUpdate
s {$sel:normalized:SeverityUpdate' :: Maybe Natural
normalized = Maybe Natural
a} :: SeverityUpdate)
instance Prelude.Hashable SeverityUpdate
instance Prelude.NFData SeverityUpdate
instance Core.ToJSON SeverityUpdate where
toJSON :: SeverityUpdate -> Value
toJSON SeverityUpdate' {Maybe Double
Maybe Natural
Maybe SeverityLabel
normalized :: Maybe Natural
label :: Maybe SeverityLabel
product :: Maybe Double
$sel:normalized:SeverityUpdate' :: SeverityUpdate -> Maybe Natural
$sel:label:SeverityUpdate' :: SeverityUpdate -> Maybe SeverityLabel
$sel:product:SeverityUpdate' :: SeverityUpdate -> Maybe Double
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Product" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
product,
(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
"Normalized" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
normalized
]
)