{-# 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.AssessmentTemplate where
import qualified Amazonka.Core as Core
import Amazonka.Inspector.Types.Attribute
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssessmentTemplate = AssessmentTemplate'
{
AssessmentTemplate -> Maybe Text
lastAssessmentRunArn :: Prelude.Maybe Prelude.Text,
AssessmentTemplate -> Text
arn :: Prelude.Text,
AssessmentTemplate -> Text
name :: Prelude.Text,
AssessmentTemplate -> Text
assessmentTargetArn :: Prelude.Text,
AssessmentTemplate -> Natural
durationInSeconds :: Prelude.Natural,
AssessmentTemplate -> [Text]
rulesPackageArns :: [Prelude.Text],
AssessmentTemplate -> [Attribute]
userAttributesForFindings :: [Attribute],
AssessmentTemplate -> Int
assessmentRunCount :: Prelude.Int,
AssessmentTemplate -> POSIX
createdAt :: Core.POSIX
}
deriving (AssessmentTemplate -> AssessmentTemplate -> Bool
(AssessmentTemplate -> AssessmentTemplate -> Bool)
-> (AssessmentTemplate -> AssessmentTemplate -> Bool)
-> Eq AssessmentTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssessmentTemplate -> AssessmentTemplate -> Bool
$c/= :: AssessmentTemplate -> AssessmentTemplate -> Bool
== :: AssessmentTemplate -> AssessmentTemplate -> Bool
$c== :: AssessmentTemplate -> AssessmentTemplate -> Bool
Prelude.Eq, ReadPrec [AssessmentTemplate]
ReadPrec AssessmentTemplate
Int -> ReadS AssessmentTemplate
ReadS [AssessmentTemplate]
(Int -> ReadS AssessmentTemplate)
-> ReadS [AssessmentTemplate]
-> ReadPrec AssessmentTemplate
-> ReadPrec [AssessmentTemplate]
-> Read AssessmentTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssessmentTemplate]
$creadListPrec :: ReadPrec [AssessmentTemplate]
readPrec :: ReadPrec AssessmentTemplate
$creadPrec :: ReadPrec AssessmentTemplate
readList :: ReadS [AssessmentTemplate]
$creadList :: ReadS [AssessmentTemplate]
readsPrec :: Int -> ReadS AssessmentTemplate
$creadsPrec :: Int -> ReadS AssessmentTemplate
Prelude.Read, Int -> AssessmentTemplate -> ShowS
[AssessmentTemplate] -> ShowS
AssessmentTemplate -> String
(Int -> AssessmentTemplate -> ShowS)
-> (AssessmentTemplate -> String)
-> ([AssessmentTemplate] -> ShowS)
-> Show AssessmentTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssessmentTemplate] -> ShowS
$cshowList :: [AssessmentTemplate] -> ShowS
show :: AssessmentTemplate -> String
$cshow :: AssessmentTemplate -> String
showsPrec :: Int -> AssessmentTemplate -> ShowS
$cshowsPrec :: Int -> AssessmentTemplate -> ShowS
Prelude.Show, (forall x. AssessmentTemplate -> Rep AssessmentTemplate x)
-> (forall x. Rep AssessmentTemplate x -> AssessmentTemplate)
-> Generic AssessmentTemplate
forall x. Rep AssessmentTemplate x -> AssessmentTemplate
forall x. AssessmentTemplate -> Rep AssessmentTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssessmentTemplate x -> AssessmentTemplate
$cfrom :: forall x. AssessmentTemplate -> Rep AssessmentTemplate x
Prelude.Generic)
newAssessmentTemplate ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Natural ->
Prelude.Int ->
Prelude.UTCTime ->
AssessmentTemplate
newAssessmentTemplate :: Text
-> Text -> Text -> Natural -> Int -> UTCTime -> AssessmentTemplate
newAssessmentTemplate
Text
pArn_
Text
pName_
Text
pAssessmentTargetArn_
Natural
pDurationInSeconds_
Int
pAssessmentRunCount_
UTCTime
pCreatedAt_ =
AssessmentTemplate' :: Maybe Text
-> Text
-> Text
-> Text
-> Natural
-> [Text]
-> [Attribute]
-> Int
-> POSIX
-> AssessmentTemplate
AssessmentTemplate'
{ $sel:lastAssessmentRunArn:AssessmentTemplate' :: Maybe Text
lastAssessmentRunArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:AssessmentTemplate' :: Text
arn = Text
pArn_,
$sel:name:AssessmentTemplate' :: Text
name = Text
pName_,
$sel:assessmentTargetArn:AssessmentTemplate' :: Text
assessmentTargetArn = Text
pAssessmentTargetArn_,
$sel:durationInSeconds:AssessmentTemplate' :: Natural
durationInSeconds = Natural
pDurationInSeconds_,
$sel:rulesPackageArns:AssessmentTemplate' :: [Text]
rulesPackageArns = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:userAttributesForFindings:AssessmentTemplate' :: [Attribute]
userAttributesForFindings = [Attribute]
forall a. Monoid a => a
Prelude.mempty,
$sel:assessmentRunCount:AssessmentTemplate' :: Int
assessmentRunCount = Int
pAssessmentRunCount_,
$sel:createdAt:AssessmentTemplate' :: 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_
}
assessmentTemplate_lastAssessmentRunArn :: Lens.Lens' AssessmentTemplate (Prelude.Maybe Prelude.Text)
assessmentTemplate_lastAssessmentRunArn :: (Maybe Text -> f (Maybe Text))
-> AssessmentTemplate -> f AssessmentTemplate
assessmentTemplate_lastAssessmentRunArn = (AssessmentTemplate -> Maybe Text)
-> (AssessmentTemplate -> Maybe Text -> AssessmentTemplate)
-> Lens
AssessmentTemplate AssessmentTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTemplate' {Maybe Text
lastAssessmentRunArn :: Maybe Text
$sel:lastAssessmentRunArn:AssessmentTemplate' :: AssessmentTemplate -> Maybe Text
lastAssessmentRunArn} -> Maybe Text
lastAssessmentRunArn) (\s :: AssessmentTemplate
s@AssessmentTemplate' {} Maybe Text
a -> AssessmentTemplate
s {$sel:lastAssessmentRunArn:AssessmentTemplate' :: Maybe Text
lastAssessmentRunArn = Maybe Text
a} :: AssessmentTemplate)
assessmentTemplate_arn :: Lens.Lens' AssessmentTemplate Prelude.Text
assessmentTemplate_arn :: (Text -> f Text) -> AssessmentTemplate -> f AssessmentTemplate
assessmentTemplate_arn = (AssessmentTemplate -> Text)
-> (AssessmentTemplate -> Text -> AssessmentTemplate)
-> Lens AssessmentTemplate AssessmentTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTemplate' {Text
arn :: Text
$sel:arn:AssessmentTemplate' :: AssessmentTemplate -> Text
arn} -> Text
arn) (\s :: AssessmentTemplate
s@AssessmentTemplate' {} Text
a -> AssessmentTemplate
s {$sel:arn:AssessmentTemplate' :: Text
arn = Text
a} :: AssessmentTemplate)
assessmentTemplate_name :: Lens.Lens' AssessmentTemplate Prelude.Text
assessmentTemplate_name :: (Text -> f Text) -> AssessmentTemplate -> f AssessmentTemplate
assessmentTemplate_name = (AssessmentTemplate -> Text)
-> (AssessmentTemplate -> Text -> AssessmentTemplate)
-> Lens AssessmentTemplate AssessmentTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTemplate' {Text
name :: Text
$sel:name:AssessmentTemplate' :: AssessmentTemplate -> Text
name} -> Text
name) (\s :: AssessmentTemplate
s@AssessmentTemplate' {} Text
a -> AssessmentTemplate
s {$sel:name:AssessmentTemplate' :: Text
name = Text
a} :: AssessmentTemplate)
assessmentTemplate_assessmentTargetArn :: Lens.Lens' AssessmentTemplate Prelude.Text
assessmentTemplate_assessmentTargetArn :: (Text -> f Text) -> AssessmentTemplate -> f AssessmentTemplate
assessmentTemplate_assessmentTargetArn = (AssessmentTemplate -> Text)
-> (AssessmentTemplate -> Text -> AssessmentTemplate)
-> Lens AssessmentTemplate AssessmentTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTemplate' {Text
assessmentTargetArn :: Text
$sel:assessmentTargetArn:AssessmentTemplate' :: AssessmentTemplate -> Text
assessmentTargetArn} -> Text
assessmentTargetArn) (\s :: AssessmentTemplate
s@AssessmentTemplate' {} Text
a -> AssessmentTemplate
s {$sel:assessmentTargetArn:AssessmentTemplate' :: Text
assessmentTargetArn = Text
a} :: AssessmentTemplate)
assessmentTemplate_durationInSeconds :: Lens.Lens' AssessmentTemplate Prelude.Natural
assessmentTemplate_durationInSeconds :: (Natural -> f Natural)
-> AssessmentTemplate -> f AssessmentTemplate
assessmentTemplate_durationInSeconds = (AssessmentTemplate -> Natural)
-> (AssessmentTemplate -> Natural -> AssessmentTemplate)
-> Lens AssessmentTemplate AssessmentTemplate Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTemplate' {Natural
durationInSeconds :: Natural
$sel:durationInSeconds:AssessmentTemplate' :: AssessmentTemplate -> Natural
durationInSeconds} -> Natural
durationInSeconds) (\s :: AssessmentTemplate
s@AssessmentTemplate' {} Natural
a -> AssessmentTemplate
s {$sel:durationInSeconds:AssessmentTemplate' :: Natural
durationInSeconds = Natural
a} :: AssessmentTemplate)
assessmentTemplate_rulesPackageArns :: Lens.Lens' AssessmentTemplate [Prelude.Text]
assessmentTemplate_rulesPackageArns :: ([Text] -> f [Text]) -> AssessmentTemplate -> f AssessmentTemplate
assessmentTemplate_rulesPackageArns = (AssessmentTemplate -> [Text])
-> (AssessmentTemplate -> [Text] -> AssessmentTemplate)
-> Lens AssessmentTemplate AssessmentTemplate [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTemplate' {[Text]
rulesPackageArns :: [Text]
$sel:rulesPackageArns:AssessmentTemplate' :: AssessmentTemplate -> [Text]
rulesPackageArns} -> [Text]
rulesPackageArns) (\s :: AssessmentTemplate
s@AssessmentTemplate' {} [Text]
a -> AssessmentTemplate
s {$sel:rulesPackageArns:AssessmentTemplate' :: [Text]
rulesPackageArns = [Text]
a} :: AssessmentTemplate) (([Text] -> f [Text])
-> AssessmentTemplate -> f AssessmentTemplate)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> AssessmentTemplate
-> f AssessmentTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
assessmentTemplate_userAttributesForFindings :: Lens.Lens' AssessmentTemplate [Attribute]
assessmentTemplate_userAttributesForFindings :: ([Attribute] -> f [Attribute])
-> AssessmentTemplate -> f AssessmentTemplate
assessmentTemplate_userAttributesForFindings = (AssessmentTemplate -> [Attribute])
-> (AssessmentTemplate -> [Attribute] -> AssessmentTemplate)
-> Lens
AssessmentTemplate AssessmentTemplate [Attribute] [Attribute]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTemplate' {[Attribute]
userAttributesForFindings :: [Attribute]
$sel:userAttributesForFindings:AssessmentTemplate' :: AssessmentTemplate -> [Attribute]
userAttributesForFindings} -> [Attribute]
userAttributesForFindings) (\s :: AssessmentTemplate
s@AssessmentTemplate' {} [Attribute]
a -> AssessmentTemplate
s {$sel:userAttributesForFindings:AssessmentTemplate' :: [Attribute]
userAttributesForFindings = [Attribute]
a} :: AssessmentTemplate) (([Attribute] -> f [Attribute])
-> AssessmentTemplate -> f AssessmentTemplate)
-> (([Attribute] -> f [Attribute]) -> [Attribute] -> f [Attribute])
-> ([Attribute] -> f [Attribute])
-> AssessmentTemplate
-> f AssessmentTemplate
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
assessmentTemplate_assessmentRunCount :: Lens.Lens' AssessmentTemplate Prelude.Int
assessmentTemplate_assessmentRunCount :: (Int -> f Int) -> AssessmentTemplate -> f AssessmentTemplate
assessmentTemplate_assessmentRunCount = (AssessmentTemplate -> Int)
-> (AssessmentTemplate -> Int -> AssessmentTemplate)
-> Lens AssessmentTemplate AssessmentTemplate Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTemplate' {Int
assessmentRunCount :: Int
$sel:assessmentRunCount:AssessmentTemplate' :: AssessmentTemplate -> Int
assessmentRunCount} -> Int
assessmentRunCount) (\s :: AssessmentTemplate
s@AssessmentTemplate' {} Int
a -> AssessmentTemplate
s {$sel:assessmentRunCount:AssessmentTemplate' :: Int
assessmentRunCount = Int
a} :: AssessmentTemplate)
assessmentTemplate_createdAt :: Lens.Lens' AssessmentTemplate Prelude.UTCTime
assessmentTemplate_createdAt :: (UTCTime -> f UTCTime)
-> AssessmentTemplate -> f AssessmentTemplate
assessmentTemplate_createdAt = (AssessmentTemplate -> POSIX)
-> (AssessmentTemplate -> POSIX -> AssessmentTemplate)
-> Lens AssessmentTemplate AssessmentTemplate POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTemplate' {POSIX
createdAt :: POSIX
$sel:createdAt:AssessmentTemplate' :: AssessmentTemplate -> POSIX
createdAt} -> POSIX
createdAt) (\s :: AssessmentTemplate
s@AssessmentTemplate' {} POSIX
a -> AssessmentTemplate
s {$sel:createdAt:AssessmentTemplate' :: POSIX
createdAt = POSIX
a} :: AssessmentTemplate) ((POSIX -> f POSIX) -> AssessmentTemplate -> f AssessmentTemplate)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssessmentTemplate
-> f AssessmentTemplate
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
instance Core.FromJSON AssessmentTemplate where
parseJSON :: Value -> Parser AssessmentTemplate
parseJSON =
String
-> (Object -> Parser AssessmentTemplate)
-> Value
-> Parser AssessmentTemplate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AssessmentTemplate"
( \Object
x ->
Maybe Text
-> Text
-> Text
-> Text
-> Natural
-> [Text]
-> [Attribute]
-> Int
-> POSIX
-> AssessmentTemplate
AssessmentTemplate'
(Maybe Text
-> Text
-> Text
-> Text
-> Natural
-> [Text]
-> [Attribute]
-> Int
-> POSIX
-> AssessmentTemplate)
-> Parser (Maybe Text)
-> Parser
(Text
-> Text
-> Text
-> Natural
-> [Text]
-> [Attribute]
-> Int
-> POSIX
-> AssessmentTemplate)
forall (f :: * -> *) a b. Functor 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
"lastAssessmentRunArn")
Parser
(Text
-> Text
-> Text
-> Natural
-> [Text]
-> [Attribute]
-> Int
-> POSIX
-> AssessmentTemplate)
-> Parser Text
-> Parser
(Text
-> Text
-> Natural
-> [Text]
-> [Attribute]
-> Int
-> POSIX
-> AssessmentTemplate)
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
-> Natural
-> [Text]
-> [Attribute]
-> Int
-> POSIX
-> AssessmentTemplate)
-> Parser Text
-> Parser
(Text
-> Natural
-> [Text]
-> [Attribute]
-> Int
-> POSIX
-> AssessmentTemplate)
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
-> Natural
-> [Text]
-> [Attribute]
-> Int
-> POSIX
-> AssessmentTemplate)
-> Parser Text
-> Parser
(Natural
-> [Text] -> [Attribute] -> Int -> POSIX -> AssessmentTemplate)
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
"assessmentTargetArn")
Parser
(Natural
-> [Text] -> [Attribute] -> Int -> POSIX -> AssessmentTemplate)
-> Parser Natural
-> Parser
([Text] -> [Attribute] -> Int -> POSIX -> AssessmentTemplate)
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
([Text] -> [Attribute] -> Int -> POSIX -> AssessmentTemplate)
-> Parser [Text]
-> Parser ([Attribute] -> Int -> POSIX -> AssessmentTemplate)
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
"rulesPackageArns"
Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser ([Attribute] -> Int -> POSIX -> AssessmentTemplate)
-> Parser [Attribute]
-> Parser (Int -> POSIX -> AssessmentTemplate)
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 (Int -> POSIX -> AssessmentTemplate)
-> Parser Int -> Parser (POSIX -> AssessmentTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"assessmentRunCount")
Parser (POSIX -> AssessmentTemplate)
-> Parser POSIX -> Parser AssessmentTemplate
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")
)
instance Prelude.Hashable AssessmentTemplate
instance Prelude.NFData AssessmentTemplate