{-# 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.FMS.Types.EvaluationResult where
import qualified Amazonka.Core as Core
import Amazonka.FMS.Types.PolicyComplianceStatusType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EvaluationResult = EvaluationResult'
{
EvaluationResult -> Maybe Natural
violatorCount :: Prelude.Maybe Prelude.Natural,
EvaluationResult -> Maybe PolicyComplianceStatusType
complianceStatus :: Prelude.Maybe PolicyComplianceStatusType,
EvaluationResult -> Maybe Bool
evaluationLimitExceeded :: Prelude.Maybe Prelude.Bool
}
deriving (EvaluationResult -> EvaluationResult -> Bool
(EvaluationResult -> EvaluationResult -> Bool)
-> (EvaluationResult -> EvaluationResult -> Bool)
-> Eq EvaluationResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EvaluationResult -> EvaluationResult -> Bool
$c/= :: EvaluationResult -> EvaluationResult -> Bool
== :: EvaluationResult -> EvaluationResult -> Bool
$c== :: EvaluationResult -> EvaluationResult -> Bool
Prelude.Eq, ReadPrec [EvaluationResult]
ReadPrec EvaluationResult
Int -> ReadS EvaluationResult
ReadS [EvaluationResult]
(Int -> ReadS EvaluationResult)
-> ReadS [EvaluationResult]
-> ReadPrec EvaluationResult
-> ReadPrec [EvaluationResult]
-> Read EvaluationResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EvaluationResult]
$creadListPrec :: ReadPrec [EvaluationResult]
readPrec :: ReadPrec EvaluationResult
$creadPrec :: ReadPrec EvaluationResult
readList :: ReadS [EvaluationResult]
$creadList :: ReadS [EvaluationResult]
readsPrec :: Int -> ReadS EvaluationResult
$creadsPrec :: Int -> ReadS EvaluationResult
Prelude.Read, Int -> EvaluationResult -> ShowS
[EvaluationResult] -> ShowS
EvaluationResult -> String
(Int -> EvaluationResult -> ShowS)
-> (EvaluationResult -> String)
-> ([EvaluationResult] -> ShowS)
-> Show EvaluationResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EvaluationResult] -> ShowS
$cshowList :: [EvaluationResult] -> ShowS
show :: EvaluationResult -> String
$cshow :: EvaluationResult -> String
showsPrec :: Int -> EvaluationResult -> ShowS
$cshowsPrec :: Int -> EvaluationResult -> ShowS
Prelude.Show, (forall x. EvaluationResult -> Rep EvaluationResult x)
-> (forall x. Rep EvaluationResult x -> EvaluationResult)
-> Generic EvaluationResult
forall x. Rep EvaluationResult x -> EvaluationResult
forall x. EvaluationResult -> Rep EvaluationResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EvaluationResult x -> EvaluationResult
$cfrom :: forall x. EvaluationResult -> Rep EvaluationResult x
Prelude.Generic)
newEvaluationResult ::
EvaluationResult
newEvaluationResult :: EvaluationResult
newEvaluationResult =
EvaluationResult' :: Maybe Natural
-> Maybe PolicyComplianceStatusType
-> Maybe Bool
-> EvaluationResult
EvaluationResult'
{ $sel:violatorCount:EvaluationResult' :: Maybe Natural
violatorCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:complianceStatus:EvaluationResult' :: Maybe PolicyComplianceStatusType
complianceStatus = Maybe PolicyComplianceStatusType
forall a. Maybe a
Prelude.Nothing,
$sel:evaluationLimitExceeded:EvaluationResult' :: Maybe Bool
evaluationLimitExceeded = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
evaluationResult_violatorCount :: Lens.Lens' EvaluationResult (Prelude.Maybe Prelude.Natural)
evaluationResult_violatorCount :: (Maybe Natural -> f (Maybe Natural))
-> EvaluationResult -> f EvaluationResult
evaluationResult_violatorCount = (EvaluationResult -> Maybe Natural)
-> (EvaluationResult -> Maybe Natural -> EvaluationResult)
-> Lens
EvaluationResult EvaluationResult (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe Natural
violatorCount :: Maybe Natural
$sel:violatorCount:EvaluationResult' :: EvaluationResult -> Maybe Natural
violatorCount} -> Maybe Natural
violatorCount) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe Natural
a -> EvaluationResult
s {$sel:violatorCount:EvaluationResult' :: Maybe Natural
violatorCount = Maybe Natural
a} :: EvaluationResult)
evaluationResult_complianceStatus :: Lens.Lens' EvaluationResult (Prelude.Maybe PolicyComplianceStatusType)
evaluationResult_complianceStatus :: (Maybe PolicyComplianceStatusType
-> f (Maybe PolicyComplianceStatusType))
-> EvaluationResult -> f EvaluationResult
evaluationResult_complianceStatus = (EvaluationResult -> Maybe PolicyComplianceStatusType)
-> (EvaluationResult
-> Maybe PolicyComplianceStatusType -> EvaluationResult)
-> Lens
EvaluationResult
EvaluationResult
(Maybe PolicyComplianceStatusType)
(Maybe PolicyComplianceStatusType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe PolicyComplianceStatusType
complianceStatus :: Maybe PolicyComplianceStatusType
$sel:complianceStatus:EvaluationResult' :: EvaluationResult -> Maybe PolicyComplianceStatusType
complianceStatus} -> Maybe PolicyComplianceStatusType
complianceStatus) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe PolicyComplianceStatusType
a -> EvaluationResult
s {$sel:complianceStatus:EvaluationResult' :: Maybe PolicyComplianceStatusType
complianceStatus = Maybe PolicyComplianceStatusType
a} :: EvaluationResult)
evaluationResult_evaluationLimitExceeded :: Lens.Lens' EvaluationResult (Prelude.Maybe Prelude.Bool)
evaluationResult_evaluationLimitExceeded :: (Maybe Bool -> f (Maybe Bool))
-> EvaluationResult -> f EvaluationResult
evaluationResult_evaluationLimitExceeded = (EvaluationResult -> Maybe Bool)
-> (EvaluationResult -> Maybe Bool -> EvaluationResult)
-> Lens EvaluationResult EvaluationResult (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe Bool
evaluationLimitExceeded :: Maybe Bool
$sel:evaluationLimitExceeded:EvaluationResult' :: EvaluationResult -> Maybe Bool
evaluationLimitExceeded} -> Maybe Bool
evaluationLimitExceeded) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe Bool
a -> EvaluationResult
s {$sel:evaluationLimitExceeded:EvaluationResult' :: Maybe Bool
evaluationLimitExceeded = Maybe Bool
a} :: EvaluationResult)
instance Core.FromJSON EvaluationResult where
parseJSON :: Value -> Parser EvaluationResult
parseJSON =
String
-> (Object -> Parser EvaluationResult)
-> Value
-> Parser EvaluationResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EvaluationResult"
( \Object
x ->
Maybe Natural
-> Maybe PolicyComplianceStatusType
-> Maybe Bool
-> EvaluationResult
EvaluationResult'
(Maybe Natural
-> Maybe PolicyComplianceStatusType
-> Maybe Bool
-> EvaluationResult)
-> Parser (Maybe Natural)
-> Parser
(Maybe PolicyComplianceStatusType
-> Maybe Bool -> EvaluationResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ViolatorCount")
Parser
(Maybe PolicyComplianceStatusType
-> Maybe Bool -> EvaluationResult)
-> Parser (Maybe PolicyComplianceStatusType)
-> Parser (Maybe Bool -> EvaluationResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PolicyComplianceStatusType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ComplianceStatus")
Parser (Maybe Bool -> EvaluationResult)
-> Parser (Maybe Bool) -> Parser EvaluationResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EvaluationLimitExceeded")
)
instance Prelude.Hashable EvaluationResult
instance Prelude.NFData EvaluationResult