{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Inspector.Types.AssessmentTemplate
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Contains information about an Amazon Inspector assessment template. This
-- data type is used as the response element in the
-- DescribeAssessmentTemplates action.
--
-- /See:/ 'newAssessmentTemplate' smart constructor.
data AssessmentTemplate = AssessmentTemplate'
  { -- | The Amazon Resource Name (ARN) of the most recent assessment run
    -- associated with this assessment template. This value exists only when
    -- the value of assessmentRunCount is greaterpa than zero.
    AssessmentTemplate -> Maybe Text
lastAssessmentRunArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the assessment template.
    AssessmentTemplate -> Text
arn :: Prelude.Text,
    -- | The name of the assessment template.
    AssessmentTemplate -> Text
name :: Prelude.Text,
    -- | The ARN of the assessment target that corresponds to this assessment
    -- template.
    AssessmentTemplate -> Text
assessmentTargetArn :: Prelude.Text,
    -- | The duration in seconds specified for this assessment template. The
    -- default value is 3600 seconds (one hour). The maximum value is 86400
    -- seconds (one day).
    AssessmentTemplate -> Natural
durationInSeconds :: Prelude.Natural,
    -- | The rules packages that are specified for this assessment template.
    AssessmentTemplate -> [Text]
rulesPackageArns :: [Prelude.Text],
    -- | The user-defined attributes that are assigned to every generated finding
    -- from the assessment run that uses this assessment template.
    AssessmentTemplate -> [Attribute]
userAttributesForFindings :: [Attribute],
    -- | The number of existing assessment runs associated with this assessment
    -- template. This value can be zero or a positive integer.
    AssessmentTemplate -> Int
assessmentRunCount :: Prelude.Int,
    -- | The time at which the assessment template is created.
    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)

-- |
-- Create a value of 'AssessmentTemplate' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'lastAssessmentRunArn', 'assessmentTemplate_lastAssessmentRunArn' - The Amazon Resource Name (ARN) of the most recent assessment run
-- associated with this assessment template. This value exists only when
-- the value of assessmentRunCount is greaterpa than zero.
--
-- 'arn', 'assessmentTemplate_arn' - The ARN of the assessment template.
--
-- 'name', 'assessmentTemplate_name' - The name of the assessment template.
--
-- 'assessmentTargetArn', 'assessmentTemplate_assessmentTargetArn' - The ARN of the assessment target that corresponds to this assessment
-- template.
--
-- 'durationInSeconds', 'assessmentTemplate_durationInSeconds' - The duration in seconds specified for this assessment template. The
-- default value is 3600 seconds (one hour). The maximum value is 86400
-- seconds (one day).
--
-- 'rulesPackageArns', 'assessmentTemplate_rulesPackageArns' - The rules packages that are specified for this assessment template.
--
-- 'userAttributesForFindings', 'assessmentTemplate_userAttributesForFindings' - The user-defined attributes that are assigned to every generated finding
-- from the assessment run that uses this assessment template.
--
-- 'assessmentRunCount', 'assessmentTemplate_assessmentRunCount' - The number of existing assessment runs associated with this assessment
-- template. This value can be zero or a positive integer.
--
-- 'createdAt', 'assessmentTemplate_createdAt' - The time at which the assessment template is created.
newAssessmentTemplate ::
  -- | 'arn'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'assessmentTargetArn'
  Prelude.Text ->
  -- | 'durationInSeconds'
  Prelude.Natural ->
  -- | 'assessmentRunCount'
  Prelude.Int ->
  -- | 'createdAt'
  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_
      }

-- | The Amazon Resource Name (ARN) of the most recent assessment run
-- associated with this assessment template. This value exists only when
-- the value of assessmentRunCount is greaterpa than zero.
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)

-- | The ARN of the assessment template.
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)

-- | The name of the assessment template.
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)

-- | The ARN of the assessment target that corresponds to this assessment
-- template.
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)

-- | The duration in seconds specified for this assessment template. The
-- default value is 3600 seconds (one hour). The maximum value is 86400
-- seconds (one day).
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)

-- | The rules packages that are specified for this assessment template.
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

-- | The user-defined attributes that are assigned to every generated finding
-- from the assessment run that uses this assessment template.
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

-- | The number of existing assessment runs associated with this assessment
-- template. This value can be zero or a positive integer.
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)

-- | The time at which the assessment template is created.
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