{-# 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.Inspector.Types.AssessmentRun where
import qualified Amazonka.Core as Core
import Amazonka.Inspector.Types.AssessmentRunNotification
import Amazonka.Inspector.Types.AssessmentRunState
import Amazonka.Inspector.Types.AssessmentRunStateChange
import Amazonka.Inspector.Types.Attribute
import Amazonka.Inspector.Types.Severity
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssessmentRun = AssessmentRun'
{
AssessmentRun -> Maybe POSIX
startedAt :: Prelude.Maybe Core.POSIX,
AssessmentRun -> Maybe POSIX
completedAt :: Prelude.Maybe Core.POSIX,
AssessmentRun -> Text
arn :: Prelude.Text,
AssessmentRun -> Text
name :: Prelude.Text,
AssessmentRun -> Text
assessmentTemplateArn :: Prelude.Text,
AssessmentRun -> AssessmentRunState
state :: AssessmentRunState,
AssessmentRun -> Natural
durationInSeconds :: Prelude.Natural,
AssessmentRun -> NonEmpty Text
rulesPackageArns :: Prelude.NonEmpty Prelude.Text,
AssessmentRun -> [Attribute]
userAttributesForFindings :: [Attribute],
AssessmentRun -> POSIX
createdAt :: Core.POSIX,
AssessmentRun -> POSIX
stateChangedAt :: Core.POSIX,
AssessmentRun -> Bool
dataCollected :: Prelude.Bool,
AssessmentRun -> [AssessmentRunStateChange]
stateChanges :: [AssessmentRunStateChange],
AssessmentRun -> [AssessmentRunNotification]
notifications :: [AssessmentRunNotification],
AssessmentRun -> HashMap Severity Int
findingCounts :: Prelude.HashMap Severity Prelude.Int
}
deriving (AssessmentRun -> AssessmentRun -> Bool
(AssessmentRun -> AssessmentRun -> Bool)
-> (AssessmentRun -> AssessmentRun -> Bool) -> Eq AssessmentRun
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssessmentRun -> AssessmentRun -> Bool
$c/= :: AssessmentRun -> AssessmentRun -> Bool
== :: AssessmentRun -> AssessmentRun -> Bool
$c== :: AssessmentRun -> AssessmentRun -> Bool
Prelude.Eq, ReadPrec [AssessmentRun]
ReadPrec AssessmentRun
Int -> ReadS AssessmentRun
ReadS [AssessmentRun]
(Int -> ReadS AssessmentRun)
-> ReadS [AssessmentRun]
-> ReadPrec AssessmentRun
-> ReadPrec [AssessmentRun]
-> Read AssessmentRun
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssessmentRun]
$creadListPrec :: ReadPrec [AssessmentRun]
readPrec :: ReadPrec AssessmentRun
$creadPrec :: ReadPrec AssessmentRun
readList :: ReadS [AssessmentRun]
$creadList :: ReadS [AssessmentRun]
readsPrec :: Int -> ReadS AssessmentRun
$creadsPrec :: Int -> ReadS AssessmentRun
Prelude.Read, Int -> AssessmentRun -> ShowS
[AssessmentRun] -> ShowS
AssessmentRun -> String
(Int -> AssessmentRun -> ShowS)
-> (AssessmentRun -> String)
-> ([AssessmentRun] -> ShowS)
-> Show AssessmentRun
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssessmentRun] -> ShowS
$cshowList :: [AssessmentRun] -> ShowS
show :: AssessmentRun -> String
$cshow :: AssessmentRun -> String
showsPrec :: Int -> AssessmentRun -> ShowS
$cshowsPrec :: Int -> AssessmentRun -> ShowS
Prelude.Show, (forall x. AssessmentRun -> Rep AssessmentRun x)
-> (forall x. Rep AssessmentRun x -> AssessmentRun)
-> Generic AssessmentRun
forall x. Rep AssessmentRun x -> AssessmentRun
forall x. AssessmentRun -> Rep AssessmentRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssessmentRun x -> AssessmentRun
$cfrom :: forall x. AssessmentRun -> Rep AssessmentRun x
Prelude.Generic)
newAssessmentRun ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
AssessmentRunState ->
Prelude.Natural ->
Prelude.NonEmpty Prelude.Text ->
Prelude.UTCTime ->
Prelude.UTCTime ->
Prelude.Bool ->
AssessmentRun
newAssessmentRun :: Text
-> Text
-> Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> UTCTime
-> UTCTime
-> Bool
-> AssessmentRun
newAssessmentRun
Text
pArn_
Text
pName_
Text
pAssessmentTemplateArn_
AssessmentRunState
pState_
Natural
pDurationInSeconds_
NonEmpty Text
pRulesPackageArns_
UTCTime
pCreatedAt_
UTCTime
pStateChangedAt_
Bool
pDataCollected_ =
AssessmentRun' :: Maybe POSIX
-> Maybe POSIX
-> Text
-> Text
-> Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun
AssessmentRun'
{ $sel:startedAt:AssessmentRun' :: Maybe POSIX
startedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:completedAt:AssessmentRun' :: Maybe POSIX
completedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:arn:AssessmentRun' :: Text
arn = Text
pArn_,
$sel:name:AssessmentRun' :: Text
name = Text
pName_,
$sel:assessmentTemplateArn:AssessmentRun' :: Text
assessmentTemplateArn = Text
pAssessmentTemplateArn_,
$sel:state:AssessmentRun' :: AssessmentRunState
state = AssessmentRunState
pState_,
$sel:durationInSeconds:AssessmentRun' :: Natural
durationInSeconds = Natural
pDurationInSeconds_,
$sel:rulesPackageArns:AssessmentRun' :: NonEmpty Text
rulesPackageArns =
Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pRulesPackageArns_,
$sel:userAttributesForFindings:AssessmentRun' :: [Attribute]
userAttributesForFindings = [Attribute]
forall a. Monoid a => a
Prelude.mempty,
$sel:createdAt:AssessmentRun' :: POSIX
createdAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
$sel:stateChangedAt:AssessmentRun' :: POSIX
stateChangedAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStateChangedAt_,
$sel:dataCollected:AssessmentRun' :: Bool
dataCollected = Bool
pDataCollected_,
$sel:stateChanges:AssessmentRun' :: [AssessmentRunStateChange]
stateChanges = [AssessmentRunStateChange]
forall a. Monoid a => a
Prelude.mempty,
$sel:notifications:AssessmentRun' :: [AssessmentRunNotification]
notifications = [AssessmentRunNotification]
forall a. Monoid a => a
Prelude.mempty,
$sel:findingCounts:AssessmentRun' :: HashMap Severity Int
findingCounts = HashMap Severity Int
forall a. Monoid a => a
Prelude.mempty
}
assessmentRun_startedAt :: Lens.Lens' AssessmentRun (Prelude.Maybe Prelude.UTCTime)
assessmentRun_startedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AssessmentRun -> f AssessmentRun
assessmentRun_startedAt = (AssessmentRun -> Maybe POSIX)
-> (AssessmentRun -> Maybe POSIX -> AssessmentRun)
-> Lens AssessmentRun AssessmentRun (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {Maybe POSIX
startedAt :: Maybe POSIX
$sel:startedAt:AssessmentRun' :: AssessmentRun -> Maybe POSIX
startedAt} -> Maybe POSIX
startedAt) (\s :: AssessmentRun
s@AssessmentRun' {} Maybe POSIX
a -> AssessmentRun
s {$sel:startedAt:AssessmentRun' :: Maybe POSIX
startedAt = Maybe POSIX
a} :: AssessmentRun) ((Maybe POSIX -> f (Maybe POSIX))
-> AssessmentRun -> f AssessmentRun)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AssessmentRun
-> f AssessmentRun
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
assessmentRun_completedAt :: Lens.Lens' AssessmentRun (Prelude.Maybe Prelude.UTCTime)
assessmentRun_completedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AssessmentRun -> f AssessmentRun
assessmentRun_completedAt = (AssessmentRun -> Maybe POSIX)
-> (AssessmentRun -> Maybe POSIX -> AssessmentRun)
-> Lens AssessmentRun AssessmentRun (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {Maybe POSIX
completedAt :: Maybe POSIX
$sel:completedAt:AssessmentRun' :: AssessmentRun -> Maybe POSIX
completedAt} -> Maybe POSIX
completedAt) (\s :: AssessmentRun
s@AssessmentRun' {} Maybe POSIX
a -> AssessmentRun
s {$sel:completedAt:AssessmentRun' :: Maybe POSIX
completedAt = Maybe POSIX
a} :: AssessmentRun) ((Maybe POSIX -> f (Maybe POSIX))
-> AssessmentRun -> f AssessmentRun)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AssessmentRun
-> f AssessmentRun
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
assessmentRun_arn :: Lens.Lens' AssessmentRun Prelude.Text
assessmentRun_arn :: (Text -> f Text) -> AssessmentRun -> f AssessmentRun
assessmentRun_arn = (AssessmentRun -> Text)
-> (AssessmentRun -> Text -> AssessmentRun)
-> Lens AssessmentRun AssessmentRun Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {Text
arn :: Text
$sel:arn:AssessmentRun' :: AssessmentRun -> Text
arn} -> Text
arn) (\s :: AssessmentRun
s@AssessmentRun' {} Text
a -> AssessmentRun
s {$sel:arn:AssessmentRun' :: Text
arn = Text
a} :: AssessmentRun)
assessmentRun_name :: Lens.Lens' AssessmentRun Prelude.Text
assessmentRun_name :: (Text -> f Text) -> AssessmentRun -> f AssessmentRun
assessmentRun_name = (AssessmentRun -> Text)
-> (AssessmentRun -> Text -> AssessmentRun)
-> Lens AssessmentRun AssessmentRun Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {Text
name :: Text
$sel:name:AssessmentRun' :: AssessmentRun -> Text
name} -> Text
name) (\s :: AssessmentRun
s@AssessmentRun' {} Text
a -> AssessmentRun
s {$sel:name:AssessmentRun' :: Text
name = Text
a} :: AssessmentRun)
assessmentRun_assessmentTemplateArn :: Lens.Lens' AssessmentRun Prelude.Text
assessmentRun_assessmentTemplateArn :: (Text -> f Text) -> AssessmentRun -> f AssessmentRun
assessmentRun_assessmentTemplateArn = (AssessmentRun -> Text)
-> (AssessmentRun -> Text -> AssessmentRun)
-> Lens AssessmentRun AssessmentRun Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {Text
assessmentTemplateArn :: Text
$sel:assessmentTemplateArn:AssessmentRun' :: AssessmentRun -> Text
assessmentTemplateArn} -> Text
assessmentTemplateArn) (\s :: AssessmentRun
s@AssessmentRun' {} Text
a -> AssessmentRun
s {$sel:assessmentTemplateArn:AssessmentRun' :: Text
assessmentTemplateArn = Text
a} :: AssessmentRun)
assessmentRun_state :: Lens.Lens' AssessmentRun AssessmentRunState
assessmentRun_state :: (AssessmentRunState -> f AssessmentRunState)
-> AssessmentRun -> f AssessmentRun
assessmentRun_state = (AssessmentRun -> AssessmentRunState)
-> (AssessmentRun -> AssessmentRunState -> AssessmentRun)
-> Lens
AssessmentRun AssessmentRun AssessmentRunState AssessmentRunState
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {AssessmentRunState
state :: AssessmentRunState
$sel:state:AssessmentRun' :: AssessmentRun -> AssessmentRunState
state} -> AssessmentRunState
state) (\s :: AssessmentRun
s@AssessmentRun' {} AssessmentRunState
a -> AssessmentRun
s {$sel:state:AssessmentRun' :: AssessmentRunState
state = AssessmentRunState
a} :: AssessmentRun)
assessmentRun_durationInSeconds :: Lens.Lens' AssessmentRun Prelude.Natural
assessmentRun_durationInSeconds :: (Natural -> f Natural) -> AssessmentRun -> f AssessmentRun
assessmentRun_durationInSeconds = (AssessmentRun -> Natural)
-> (AssessmentRun -> Natural -> AssessmentRun)
-> Lens AssessmentRun AssessmentRun Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {Natural
durationInSeconds :: Natural
$sel:durationInSeconds:AssessmentRun' :: AssessmentRun -> Natural
durationInSeconds} -> Natural
durationInSeconds) (\s :: AssessmentRun
s@AssessmentRun' {} Natural
a -> AssessmentRun
s {$sel:durationInSeconds:AssessmentRun' :: Natural
durationInSeconds = Natural
a} :: AssessmentRun)
assessmentRun_rulesPackageArns :: Lens.Lens' AssessmentRun (Prelude.NonEmpty Prelude.Text)
assessmentRun_rulesPackageArns :: (NonEmpty Text -> f (NonEmpty Text))
-> AssessmentRun -> f AssessmentRun
assessmentRun_rulesPackageArns = (AssessmentRun -> NonEmpty Text)
-> (AssessmentRun -> NonEmpty Text -> AssessmentRun)
-> Lens AssessmentRun AssessmentRun (NonEmpty Text) (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {NonEmpty Text
rulesPackageArns :: NonEmpty Text
$sel:rulesPackageArns:AssessmentRun' :: AssessmentRun -> NonEmpty Text
rulesPackageArns} -> NonEmpty Text
rulesPackageArns) (\s :: AssessmentRun
s@AssessmentRun' {} NonEmpty Text
a -> AssessmentRun
s {$sel:rulesPackageArns:AssessmentRun' :: NonEmpty Text
rulesPackageArns = NonEmpty Text
a} :: AssessmentRun) ((NonEmpty Text -> f (NonEmpty Text))
-> AssessmentRun -> f AssessmentRun)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> AssessmentRun
-> f AssessmentRun
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
assessmentRun_userAttributesForFindings :: Lens.Lens' AssessmentRun [Attribute]
assessmentRun_userAttributesForFindings :: ([Attribute] -> f [Attribute]) -> AssessmentRun -> f AssessmentRun
assessmentRun_userAttributesForFindings = (AssessmentRun -> [Attribute])
-> (AssessmentRun -> [Attribute] -> AssessmentRun)
-> Lens AssessmentRun AssessmentRun [Attribute] [Attribute]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {[Attribute]
userAttributesForFindings :: [Attribute]
$sel:userAttributesForFindings:AssessmentRun' :: AssessmentRun -> [Attribute]
userAttributesForFindings} -> [Attribute]
userAttributesForFindings) (\s :: AssessmentRun
s@AssessmentRun' {} [Attribute]
a -> AssessmentRun
s {$sel:userAttributesForFindings:AssessmentRun' :: [Attribute]
userAttributesForFindings = [Attribute]
a} :: AssessmentRun) (([Attribute] -> f [Attribute])
-> AssessmentRun -> f AssessmentRun)
-> (([Attribute] -> f [Attribute]) -> [Attribute] -> f [Attribute])
-> ([Attribute] -> f [Attribute])
-> AssessmentRun
-> f AssessmentRun
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Attribute] -> f [Attribute]) -> [Attribute] -> f [Attribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
assessmentRun_createdAt :: Lens.Lens' AssessmentRun Prelude.UTCTime
assessmentRun_createdAt :: (UTCTime -> f UTCTime) -> AssessmentRun -> f AssessmentRun
assessmentRun_createdAt = (AssessmentRun -> POSIX)
-> (AssessmentRun -> POSIX -> AssessmentRun)
-> Lens AssessmentRun AssessmentRun POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {POSIX
createdAt :: POSIX
$sel:createdAt:AssessmentRun' :: AssessmentRun -> POSIX
createdAt} -> POSIX
createdAt) (\s :: AssessmentRun
s@AssessmentRun' {} POSIX
a -> AssessmentRun
s {$sel:createdAt:AssessmentRun' :: POSIX
createdAt = POSIX
a} :: AssessmentRun) ((POSIX -> f POSIX) -> AssessmentRun -> f AssessmentRun)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssessmentRun
-> f AssessmentRun
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
assessmentRun_stateChangedAt :: Lens.Lens' AssessmentRun Prelude.UTCTime
assessmentRun_stateChangedAt :: (UTCTime -> f UTCTime) -> AssessmentRun -> f AssessmentRun
assessmentRun_stateChangedAt = (AssessmentRun -> POSIX)
-> (AssessmentRun -> POSIX -> AssessmentRun)
-> Lens AssessmentRun AssessmentRun POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {POSIX
stateChangedAt :: POSIX
$sel:stateChangedAt:AssessmentRun' :: AssessmentRun -> POSIX
stateChangedAt} -> POSIX
stateChangedAt) (\s :: AssessmentRun
s@AssessmentRun' {} POSIX
a -> AssessmentRun
s {$sel:stateChangedAt:AssessmentRun' :: POSIX
stateChangedAt = POSIX
a} :: AssessmentRun) ((POSIX -> f POSIX) -> AssessmentRun -> f AssessmentRun)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssessmentRun
-> f AssessmentRun
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
assessmentRun_dataCollected :: Lens.Lens' AssessmentRun Prelude.Bool
assessmentRun_dataCollected :: (Bool -> f Bool) -> AssessmentRun -> f AssessmentRun
assessmentRun_dataCollected = (AssessmentRun -> Bool)
-> (AssessmentRun -> Bool -> AssessmentRun)
-> Lens AssessmentRun AssessmentRun Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {Bool
dataCollected :: Bool
$sel:dataCollected:AssessmentRun' :: AssessmentRun -> Bool
dataCollected} -> Bool
dataCollected) (\s :: AssessmentRun
s@AssessmentRun' {} Bool
a -> AssessmentRun
s {$sel:dataCollected:AssessmentRun' :: Bool
dataCollected = Bool
a} :: AssessmentRun)
assessmentRun_stateChanges :: Lens.Lens' AssessmentRun [AssessmentRunStateChange]
assessmentRun_stateChanges :: ([AssessmentRunStateChange] -> f [AssessmentRunStateChange])
-> AssessmentRun -> f AssessmentRun
assessmentRun_stateChanges = (AssessmentRun -> [AssessmentRunStateChange])
-> (AssessmentRun -> [AssessmentRunStateChange] -> AssessmentRun)
-> Lens
AssessmentRun
AssessmentRun
[AssessmentRunStateChange]
[AssessmentRunStateChange]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {[AssessmentRunStateChange]
stateChanges :: [AssessmentRunStateChange]
$sel:stateChanges:AssessmentRun' :: AssessmentRun -> [AssessmentRunStateChange]
stateChanges} -> [AssessmentRunStateChange]
stateChanges) (\s :: AssessmentRun
s@AssessmentRun' {} [AssessmentRunStateChange]
a -> AssessmentRun
s {$sel:stateChanges:AssessmentRun' :: [AssessmentRunStateChange]
stateChanges = [AssessmentRunStateChange]
a} :: AssessmentRun) (([AssessmentRunStateChange] -> f [AssessmentRunStateChange])
-> AssessmentRun -> f AssessmentRun)
-> (([AssessmentRunStateChange] -> f [AssessmentRunStateChange])
-> [AssessmentRunStateChange] -> f [AssessmentRunStateChange])
-> ([AssessmentRunStateChange] -> f [AssessmentRunStateChange])
-> AssessmentRun
-> f AssessmentRun
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssessmentRunStateChange] -> f [AssessmentRunStateChange])
-> [AssessmentRunStateChange] -> f [AssessmentRunStateChange]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
assessmentRun_notifications :: Lens.Lens' AssessmentRun [AssessmentRunNotification]
assessmentRun_notifications :: ([AssessmentRunNotification] -> f [AssessmentRunNotification])
-> AssessmentRun -> f AssessmentRun
assessmentRun_notifications = (AssessmentRun -> [AssessmentRunNotification])
-> (AssessmentRun -> [AssessmentRunNotification] -> AssessmentRun)
-> Lens
AssessmentRun
AssessmentRun
[AssessmentRunNotification]
[AssessmentRunNotification]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {[AssessmentRunNotification]
notifications :: [AssessmentRunNotification]
$sel:notifications:AssessmentRun' :: AssessmentRun -> [AssessmentRunNotification]
notifications} -> [AssessmentRunNotification]
notifications) (\s :: AssessmentRun
s@AssessmentRun' {} [AssessmentRunNotification]
a -> AssessmentRun
s {$sel:notifications:AssessmentRun' :: [AssessmentRunNotification]
notifications = [AssessmentRunNotification]
a} :: AssessmentRun) (([AssessmentRunNotification] -> f [AssessmentRunNotification])
-> AssessmentRun -> f AssessmentRun)
-> (([AssessmentRunNotification] -> f [AssessmentRunNotification])
-> [AssessmentRunNotification] -> f [AssessmentRunNotification])
-> ([AssessmentRunNotification] -> f [AssessmentRunNotification])
-> AssessmentRun
-> f AssessmentRun
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssessmentRunNotification] -> f [AssessmentRunNotification])
-> [AssessmentRunNotification] -> f [AssessmentRunNotification]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
assessmentRun_findingCounts :: Lens.Lens' AssessmentRun (Prelude.HashMap Severity Prelude.Int)
assessmentRun_findingCounts :: (HashMap Severity Int -> f (HashMap Severity Int))
-> AssessmentRun -> f AssessmentRun
assessmentRun_findingCounts = (AssessmentRun -> HashMap Severity Int)
-> (AssessmentRun -> HashMap Severity Int -> AssessmentRun)
-> Lens
AssessmentRun
AssessmentRun
(HashMap Severity Int)
(HashMap Severity Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRun' {HashMap Severity Int
findingCounts :: HashMap Severity Int
$sel:findingCounts:AssessmentRun' :: AssessmentRun -> HashMap Severity Int
findingCounts} -> HashMap Severity Int
findingCounts) (\s :: AssessmentRun
s@AssessmentRun' {} HashMap Severity Int
a -> AssessmentRun
s {$sel:findingCounts:AssessmentRun' :: HashMap Severity Int
findingCounts = HashMap Severity Int
a} :: AssessmentRun) ((HashMap Severity Int -> f (HashMap Severity Int))
-> AssessmentRun -> f AssessmentRun)
-> ((HashMap Severity Int -> f (HashMap Severity Int))
-> HashMap Severity Int -> f (HashMap Severity Int))
-> (HashMap Severity Int -> f (HashMap Severity Int))
-> AssessmentRun
-> f AssessmentRun
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Severity Int -> f (HashMap Severity Int))
-> HashMap Severity Int -> f (HashMap Severity Int)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON AssessmentRun where
parseJSON :: Value -> Parser AssessmentRun
parseJSON =
String
-> (Object -> Parser AssessmentRun)
-> Value
-> Parser AssessmentRun
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AssessmentRun"
( \Object
x ->
Maybe POSIX
-> Maybe POSIX
-> Text
-> Text
-> Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun
AssessmentRun'
(Maybe POSIX
-> Maybe POSIX
-> Text
-> Text
-> Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Text
-> Text
-> Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"startedAt")
Parser
(Maybe POSIX
-> Text
-> Text
-> Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser (Maybe POSIX)
-> Parser
(Text
-> Text
-> Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"completedAt")
Parser
(Text
-> Text
-> Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser Text
-> Parser
(Text
-> Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"arn")
Parser
(Text
-> Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser Text
-> Parser
(Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
Parser
(Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser Text
-> Parser
(AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"assessmentTemplateArn")
Parser
(AssessmentRunState
-> Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser AssessmentRunState
-> Parser
(Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AssessmentRunState
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"state")
Parser
(Natural
-> NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser Natural
-> Parser
(NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"durationInSeconds")
Parser
(NonEmpty Text
-> [Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser (NonEmpty Text)
-> Parser
([Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (NonEmpty Text)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"rulesPackageArns")
Parser
([Attribute]
-> POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser [Attribute]
-> Parser
(POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [Attribute])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"userAttributesForFindings"
Parser (Maybe [Attribute]) -> [Attribute] -> Parser [Attribute]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Attribute]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(POSIX
-> POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser POSIX
-> Parser
(POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"createdAt")
Parser
(POSIX
-> Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser POSIX
-> Parser
(Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"stateChangedAt")
Parser
(Bool
-> [AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser Bool
-> Parser
([AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"dataCollected")
Parser
([AssessmentRunStateChange]
-> [AssessmentRunNotification]
-> HashMap Severity Int
-> AssessmentRun)
-> Parser [AssessmentRunStateChange]
-> Parser
([AssessmentRunNotification]
-> HashMap Severity Int -> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [AssessmentRunStateChange])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"stateChanges" Parser (Maybe [AssessmentRunStateChange])
-> [AssessmentRunStateChange] -> Parser [AssessmentRunStateChange]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [AssessmentRunStateChange]
forall a. Monoid a => a
Prelude.mempty)
Parser
([AssessmentRunNotification]
-> HashMap Severity Int -> AssessmentRun)
-> Parser [AssessmentRunNotification]
-> Parser (HashMap Severity Int -> AssessmentRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [AssessmentRunNotification])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"notifications" Parser (Maybe [AssessmentRunNotification])
-> [AssessmentRunNotification]
-> Parser [AssessmentRunNotification]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [AssessmentRunNotification]
forall a. Monoid a => a
Prelude.mempty)
Parser (HashMap Severity Int -> AssessmentRun)
-> Parser (HashMap Severity Int) -> Parser AssessmentRun
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (HashMap Severity Int))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"findingCounts" Parser (Maybe (HashMap Severity Int))
-> HashMap Severity Int -> Parser (HashMap Severity Int)
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= HashMap Severity Int
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable AssessmentRun
instance Prelude.NFData AssessmentRun