{-# 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.Inspector2.Types.CvssScoreAdjustment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data CvssScoreAdjustment = CvssScoreAdjustment'
{
CvssScoreAdjustment -> Text
metric :: Prelude.Text,
CvssScoreAdjustment -> Text
reason :: Prelude.Text
}
deriving (CvssScoreAdjustment -> CvssScoreAdjustment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CvssScoreAdjustment -> CvssScoreAdjustment -> Bool
$c/= :: CvssScoreAdjustment -> CvssScoreAdjustment -> Bool
== :: CvssScoreAdjustment -> CvssScoreAdjustment -> Bool
$c== :: CvssScoreAdjustment -> CvssScoreAdjustment -> Bool
Prelude.Eq, ReadPrec [CvssScoreAdjustment]
ReadPrec CvssScoreAdjustment
Int -> ReadS CvssScoreAdjustment
ReadS [CvssScoreAdjustment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CvssScoreAdjustment]
$creadListPrec :: ReadPrec [CvssScoreAdjustment]
readPrec :: ReadPrec CvssScoreAdjustment
$creadPrec :: ReadPrec CvssScoreAdjustment
readList :: ReadS [CvssScoreAdjustment]
$creadList :: ReadS [CvssScoreAdjustment]
readsPrec :: Int -> ReadS CvssScoreAdjustment
$creadsPrec :: Int -> ReadS CvssScoreAdjustment
Prelude.Read, Int -> CvssScoreAdjustment -> ShowS
[CvssScoreAdjustment] -> ShowS
CvssScoreAdjustment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CvssScoreAdjustment] -> ShowS
$cshowList :: [CvssScoreAdjustment] -> ShowS
show :: CvssScoreAdjustment -> String
$cshow :: CvssScoreAdjustment -> String
showsPrec :: Int -> CvssScoreAdjustment -> ShowS
$cshowsPrec :: Int -> CvssScoreAdjustment -> ShowS
Prelude.Show, forall x. Rep CvssScoreAdjustment x -> CvssScoreAdjustment
forall x. CvssScoreAdjustment -> Rep CvssScoreAdjustment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CvssScoreAdjustment x -> CvssScoreAdjustment
$cfrom :: forall x. CvssScoreAdjustment -> Rep CvssScoreAdjustment x
Prelude.Generic)
newCvssScoreAdjustment ::
Prelude.Text ->
Prelude.Text ->
CvssScoreAdjustment
newCvssScoreAdjustment :: Text -> Text -> CvssScoreAdjustment
newCvssScoreAdjustment Text
pMetric_ Text
pReason_ =
CvssScoreAdjustment'
{ $sel:metric:CvssScoreAdjustment' :: Text
metric = Text
pMetric_,
$sel:reason:CvssScoreAdjustment' :: Text
reason = Text
pReason_
}
cvssScoreAdjustment_metric :: Lens.Lens' CvssScoreAdjustment Prelude.Text
cvssScoreAdjustment_metric :: Lens' CvssScoreAdjustment Text
cvssScoreAdjustment_metric = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CvssScoreAdjustment' {Text
metric :: Text
$sel:metric:CvssScoreAdjustment' :: CvssScoreAdjustment -> Text
metric} -> Text
metric) (\s :: CvssScoreAdjustment
s@CvssScoreAdjustment' {} Text
a -> CvssScoreAdjustment
s {$sel:metric:CvssScoreAdjustment' :: Text
metric = Text
a} :: CvssScoreAdjustment)
cvssScoreAdjustment_reason :: Lens.Lens' CvssScoreAdjustment Prelude.Text
cvssScoreAdjustment_reason :: Lens' CvssScoreAdjustment Text
cvssScoreAdjustment_reason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CvssScoreAdjustment' {Text
reason :: Text
$sel:reason:CvssScoreAdjustment' :: CvssScoreAdjustment -> Text
reason} -> Text
reason) (\s :: CvssScoreAdjustment
s@CvssScoreAdjustment' {} Text
a -> CvssScoreAdjustment
s {$sel:reason:CvssScoreAdjustment' :: Text
reason = Text
a} :: CvssScoreAdjustment)
instance Data.FromJSON CvssScoreAdjustment where
parseJSON :: Value -> Parser CvssScoreAdjustment
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CvssScoreAdjustment"
( \Object
x ->
Text -> Text -> CvssScoreAdjustment
CvssScoreAdjustment'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"metric")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"reason")
)
instance Prelude.Hashable CvssScoreAdjustment where
hashWithSalt :: Int -> CvssScoreAdjustment -> Int
hashWithSalt Int
_salt CvssScoreAdjustment' {Text
reason :: Text
metric :: Text
$sel:reason:CvssScoreAdjustment' :: CvssScoreAdjustment -> Text
$sel:metric:CvssScoreAdjustment' :: CvssScoreAdjustment -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
metric
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
reason
instance Prelude.NFData CvssScoreAdjustment where
rnf :: CvssScoreAdjustment -> ()
rnf CvssScoreAdjustment' {Text
reason :: Text
metric :: Text
$sel:reason:CvssScoreAdjustment' :: CvssScoreAdjustment -> Text
$sel:metric:CvssScoreAdjustment' :: CvssScoreAdjustment -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
metric seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
reason