{-# 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.AuditManager.Types.AssessmentControl
-- 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.AuditManager.Types.AssessmentControl where

import Amazonka.AuditManager.Types.ControlComment
import Amazonka.AuditManager.Types.ControlResponse
import Amazonka.AuditManager.Types.ControlStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The control entity that represents a standard or custom control used in
-- an Audit Manager assessment.
--
-- /See:/ 'newAssessmentControl' smart constructor.
data AssessmentControl = AssessmentControl'
  { -- | The status of the specified control.
    AssessmentControl -> Maybe ControlStatus
status :: Prelude.Maybe ControlStatus,
    -- | The amount of evidence generated for the control.
    AssessmentControl -> Maybe Int
evidenceCount :: Prelude.Maybe Prelude.Int,
    -- | The response of the specified control.
    AssessmentControl -> Maybe ControlResponse
response :: Prelude.Maybe ControlResponse,
    -- | The name of the specified control.
    AssessmentControl -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the specified control.
    AssessmentControl -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The list of data sources for the specified evidence.
    AssessmentControl -> Maybe [Text]
evidenceSources :: Prelude.Maybe [Prelude.Text],
    -- | The list of comments attached to the specified control.
    AssessmentControl -> Maybe [ControlComment]
comments :: Prelude.Maybe [ControlComment],
    -- | The amount of evidence in the assessment report.
    AssessmentControl -> Maybe Int
assessmentReportEvidenceCount :: Prelude.Maybe Prelude.Int,
    -- | The description of the specified control.
    AssessmentControl -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (AssessmentControl -> AssessmentControl -> Bool
(AssessmentControl -> AssessmentControl -> Bool)
-> (AssessmentControl -> AssessmentControl -> Bool)
-> Eq AssessmentControl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssessmentControl -> AssessmentControl -> Bool
$c/= :: AssessmentControl -> AssessmentControl -> Bool
== :: AssessmentControl -> AssessmentControl -> Bool
$c== :: AssessmentControl -> AssessmentControl -> Bool
Prelude.Eq, ReadPrec [AssessmentControl]
ReadPrec AssessmentControl
Int -> ReadS AssessmentControl
ReadS [AssessmentControl]
(Int -> ReadS AssessmentControl)
-> ReadS [AssessmentControl]
-> ReadPrec AssessmentControl
-> ReadPrec [AssessmentControl]
-> Read AssessmentControl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssessmentControl]
$creadListPrec :: ReadPrec [AssessmentControl]
readPrec :: ReadPrec AssessmentControl
$creadPrec :: ReadPrec AssessmentControl
readList :: ReadS [AssessmentControl]
$creadList :: ReadS [AssessmentControl]
readsPrec :: Int -> ReadS AssessmentControl
$creadsPrec :: Int -> ReadS AssessmentControl
Prelude.Read, Int -> AssessmentControl -> ShowS
[AssessmentControl] -> ShowS
AssessmentControl -> String
(Int -> AssessmentControl -> ShowS)
-> (AssessmentControl -> String)
-> ([AssessmentControl] -> ShowS)
-> Show AssessmentControl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssessmentControl] -> ShowS
$cshowList :: [AssessmentControl] -> ShowS
show :: AssessmentControl -> String
$cshow :: AssessmentControl -> String
showsPrec :: Int -> AssessmentControl -> ShowS
$cshowsPrec :: Int -> AssessmentControl -> ShowS
Prelude.Show, (forall x. AssessmentControl -> Rep AssessmentControl x)
-> (forall x. Rep AssessmentControl x -> AssessmentControl)
-> Generic AssessmentControl
forall x. Rep AssessmentControl x -> AssessmentControl
forall x. AssessmentControl -> Rep AssessmentControl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssessmentControl x -> AssessmentControl
$cfrom :: forall x. AssessmentControl -> Rep AssessmentControl x
Prelude.Generic)

-- |
-- Create a value of 'AssessmentControl' 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:
--
-- 'status', 'assessmentControl_status' - The status of the specified control.
--
-- 'evidenceCount', 'assessmentControl_evidenceCount' - The amount of evidence generated for the control.
--
-- 'response', 'assessmentControl_response' - The response of the specified control.
--
-- 'name', 'assessmentControl_name' - The name of the specified control.
--
-- 'id', 'assessmentControl_id' - The identifier for the specified control.
--
-- 'evidenceSources', 'assessmentControl_evidenceSources' - The list of data sources for the specified evidence.
--
-- 'comments', 'assessmentControl_comments' - The list of comments attached to the specified control.
--
-- 'assessmentReportEvidenceCount', 'assessmentControl_assessmentReportEvidenceCount' - The amount of evidence in the assessment report.
--
-- 'description', 'assessmentControl_description' - The description of the specified control.
newAssessmentControl ::
  AssessmentControl
newAssessmentControl :: AssessmentControl
newAssessmentControl =
  AssessmentControl' :: Maybe ControlStatus
-> Maybe Int
-> Maybe ControlResponse
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [ControlComment]
-> Maybe Int
-> Maybe Text
-> AssessmentControl
AssessmentControl'
    { $sel:status:AssessmentControl' :: Maybe ControlStatus
status = Maybe ControlStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:evidenceCount:AssessmentControl' :: Maybe Int
evidenceCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:response:AssessmentControl' :: Maybe ControlResponse
response = Maybe ControlResponse
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AssessmentControl' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:AssessmentControl' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:evidenceSources:AssessmentControl' :: Maybe [Text]
evidenceSources = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:comments:AssessmentControl' :: Maybe [ControlComment]
comments = Maybe [ControlComment]
forall a. Maybe a
Prelude.Nothing,
      $sel:assessmentReportEvidenceCount:AssessmentControl' :: Maybe Int
assessmentReportEvidenceCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:description:AssessmentControl' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the specified control.
assessmentControl_status :: Lens.Lens' AssessmentControl (Prelude.Maybe ControlStatus)
assessmentControl_status :: (Maybe ControlStatus -> f (Maybe ControlStatus))
-> AssessmentControl -> f AssessmentControl
assessmentControl_status = (AssessmentControl -> Maybe ControlStatus)
-> (AssessmentControl -> Maybe ControlStatus -> AssessmentControl)
-> Lens
     AssessmentControl
     AssessmentControl
     (Maybe ControlStatus)
     (Maybe ControlStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentControl' {Maybe ControlStatus
status :: Maybe ControlStatus
$sel:status:AssessmentControl' :: AssessmentControl -> Maybe ControlStatus
status} -> Maybe ControlStatus
status) (\s :: AssessmentControl
s@AssessmentControl' {} Maybe ControlStatus
a -> AssessmentControl
s {$sel:status:AssessmentControl' :: Maybe ControlStatus
status = Maybe ControlStatus
a} :: AssessmentControl)

-- | The amount of evidence generated for the control.
assessmentControl_evidenceCount :: Lens.Lens' AssessmentControl (Prelude.Maybe Prelude.Int)
assessmentControl_evidenceCount :: (Maybe Int -> f (Maybe Int))
-> AssessmentControl -> f AssessmentControl
assessmentControl_evidenceCount = (AssessmentControl -> Maybe Int)
-> (AssessmentControl -> Maybe Int -> AssessmentControl)
-> Lens AssessmentControl AssessmentControl (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentControl' {Maybe Int
evidenceCount :: Maybe Int
$sel:evidenceCount:AssessmentControl' :: AssessmentControl -> Maybe Int
evidenceCount} -> Maybe Int
evidenceCount) (\s :: AssessmentControl
s@AssessmentControl' {} Maybe Int
a -> AssessmentControl
s {$sel:evidenceCount:AssessmentControl' :: Maybe Int
evidenceCount = Maybe Int
a} :: AssessmentControl)

-- | The response of the specified control.
assessmentControl_response :: Lens.Lens' AssessmentControl (Prelude.Maybe ControlResponse)
assessmentControl_response :: (Maybe ControlResponse -> f (Maybe ControlResponse))
-> AssessmentControl -> f AssessmentControl
assessmentControl_response = (AssessmentControl -> Maybe ControlResponse)
-> (AssessmentControl
    -> Maybe ControlResponse -> AssessmentControl)
-> Lens
     AssessmentControl
     AssessmentControl
     (Maybe ControlResponse)
     (Maybe ControlResponse)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentControl' {Maybe ControlResponse
response :: Maybe ControlResponse
$sel:response:AssessmentControl' :: AssessmentControl -> Maybe ControlResponse
response} -> Maybe ControlResponse
response) (\s :: AssessmentControl
s@AssessmentControl' {} Maybe ControlResponse
a -> AssessmentControl
s {$sel:response:AssessmentControl' :: Maybe ControlResponse
response = Maybe ControlResponse
a} :: AssessmentControl)

-- | The name of the specified control.
assessmentControl_name :: Lens.Lens' AssessmentControl (Prelude.Maybe Prelude.Text)
assessmentControl_name :: (Maybe Text -> f (Maybe Text))
-> AssessmentControl -> f AssessmentControl
assessmentControl_name = (AssessmentControl -> Maybe Text)
-> (AssessmentControl -> Maybe Text -> AssessmentControl)
-> Lens
     AssessmentControl AssessmentControl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentControl' {Maybe Text
name :: Maybe Text
$sel:name:AssessmentControl' :: AssessmentControl -> Maybe Text
name} -> Maybe Text
name) (\s :: AssessmentControl
s@AssessmentControl' {} Maybe Text
a -> AssessmentControl
s {$sel:name:AssessmentControl' :: Maybe Text
name = Maybe Text
a} :: AssessmentControl)

-- | The identifier for the specified control.
assessmentControl_id :: Lens.Lens' AssessmentControl (Prelude.Maybe Prelude.Text)
assessmentControl_id :: (Maybe Text -> f (Maybe Text))
-> AssessmentControl -> f AssessmentControl
assessmentControl_id = (AssessmentControl -> Maybe Text)
-> (AssessmentControl -> Maybe Text -> AssessmentControl)
-> Lens
     AssessmentControl AssessmentControl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentControl' {Maybe Text
id :: Maybe Text
$sel:id:AssessmentControl' :: AssessmentControl -> Maybe Text
id} -> Maybe Text
id) (\s :: AssessmentControl
s@AssessmentControl' {} Maybe Text
a -> AssessmentControl
s {$sel:id:AssessmentControl' :: Maybe Text
id = Maybe Text
a} :: AssessmentControl)

-- | The list of data sources for the specified evidence.
assessmentControl_evidenceSources :: Lens.Lens' AssessmentControl (Prelude.Maybe [Prelude.Text])
assessmentControl_evidenceSources :: (Maybe [Text] -> f (Maybe [Text]))
-> AssessmentControl -> f AssessmentControl
assessmentControl_evidenceSources = (AssessmentControl -> Maybe [Text])
-> (AssessmentControl -> Maybe [Text] -> AssessmentControl)
-> Lens
     AssessmentControl AssessmentControl (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentControl' {Maybe [Text]
evidenceSources :: Maybe [Text]
$sel:evidenceSources:AssessmentControl' :: AssessmentControl -> Maybe [Text]
evidenceSources} -> Maybe [Text]
evidenceSources) (\s :: AssessmentControl
s@AssessmentControl' {} Maybe [Text]
a -> AssessmentControl
s {$sel:evidenceSources:AssessmentControl' :: Maybe [Text]
evidenceSources = Maybe [Text]
a} :: AssessmentControl) ((Maybe [Text] -> f (Maybe [Text]))
 -> AssessmentControl -> f AssessmentControl)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AssessmentControl
-> f AssessmentControl
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The list of comments attached to the specified control.
assessmentControl_comments :: Lens.Lens' AssessmentControl (Prelude.Maybe [ControlComment])
assessmentControl_comments :: (Maybe [ControlComment] -> f (Maybe [ControlComment]))
-> AssessmentControl -> f AssessmentControl
assessmentControl_comments = (AssessmentControl -> Maybe [ControlComment])
-> (AssessmentControl
    -> Maybe [ControlComment] -> AssessmentControl)
-> Lens
     AssessmentControl
     AssessmentControl
     (Maybe [ControlComment])
     (Maybe [ControlComment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentControl' {Maybe [ControlComment]
comments :: Maybe [ControlComment]
$sel:comments:AssessmentControl' :: AssessmentControl -> Maybe [ControlComment]
comments} -> Maybe [ControlComment]
comments) (\s :: AssessmentControl
s@AssessmentControl' {} Maybe [ControlComment]
a -> AssessmentControl
s {$sel:comments:AssessmentControl' :: Maybe [ControlComment]
comments = Maybe [ControlComment]
a} :: AssessmentControl) ((Maybe [ControlComment] -> f (Maybe [ControlComment]))
 -> AssessmentControl -> f AssessmentControl)
-> ((Maybe [ControlComment] -> f (Maybe [ControlComment]))
    -> Maybe [ControlComment] -> f (Maybe [ControlComment]))
-> (Maybe [ControlComment] -> f (Maybe [ControlComment]))
-> AssessmentControl
-> f AssessmentControl
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ControlComment] [ControlComment] [ControlComment] [ControlComment]
-> Iso
     (Maybe [ControlComment])
     (Maybe [ControlComment])
     (Maybe [ControlComment])
     (Maybe [ControlComment])
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
  [ControlComment] [ControlComment] [ControlComment] [ControlComment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The amount of evidence in the assessment report.
assessmentControl_assessmentReportEvidenceCount :: Lens.Lens' AssessmentControl (Prelude.Maybe Prelude.Int)
assessmentControl_assessmentReportEvidenceCount :: (Maybe Int -> f (Maybe Int))
-> AssessmentControl -> f AssessmentControl
assessmentControl_assessmentReportEvidenceCount = (AssessmentControl -> Maybe Int)
-> (AssessmentControl -> Maybe Int -> AssessmentControl)
-> Lens AssessmentControl AssessmentControl (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentControl' {Maybe Int
assessmentReportEvidenceCount :: Maybe Int
$sel:assessmentReportEvidenceCount:AssessmentControl' :: AssessmentControl -> Maybe Int
assessmentReportEvidenceCount} -> Maybe Int
assessmentReportEvidenceCount) (\s :: AssessmentControl
s@AssessmentControl' {} Maybe Int
a -> AssessmentControl
s {$sel:assessmentReportEvidenceCount:AssessmentControl' :: Maybe Int
assessmentReportEvidenceCount = Maybe Int
a} :: AssessmentControl)

-- | The description of the specified control.
assessmentControl_description :: Lens.Lens' AssessmentControl (Prelude.Maybe Prelude.Text)
assessmentControl_description :: (Maybe Text -> f (Maybe Text))
-> AssessmentControl -> f AssessmentControl
assessmentControl_description = (AssessmentControl -> Maybe Text)
-> (AssessmentControl -> Maybe Text -> AssessmentControl)
-> Lens
     AssessmentControl AssessmentControl (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentControl' {Maybe Text
description :: Maybe Text
$sel:description:AssessmentControl' :: AssessmentControl -> Maybe Text
description} -> Maybe Text
description) (\s :: AssessmentControl
s@AssessmentControl' {} Maybe Text
a -> AssessmentControl
s {$sel:description:AssessmentControl' :: Maybe Text
description = Maybe Text
a} :: AssessmentControl)

instance Core.FromJSON AssessmentControl where
  parseJSON :: Value -> Parser AssessmentControl
parseJSON =
    String
-> (Object -> Parser AssessmentControl)
-> Value
-> Parser AssessmentControl
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AssessmentControl"
      ( \Object
x ->
          Maybe ControlStatus
-> Maybe Int
-> Maybe ControlResponse
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [ControlComment]
-> Maybe Int
-> Maybe Text
-> AssessmentControl
AssessmentControl'
            (Maybe ControlStatus
 -> Maybe Int
 -> Maybe ControlResponse
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe [ControlComment]
 -> Maybe Int
 -> Maybe Text
 -> AssessmentControl)
-> Parser (Maybe ControlStatus)
-> Parser
     (Maybe Int
      -> Maybe ControlResponse
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe [ControlComment]
      -> Maybe Int
      -> Maybe Text
      -> AssessmentControl)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ControlStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Int
   -> Maybe ControlResponse
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe [ControlComment]
   -> Maybe Int
   -> Maybe Text
   -> AssessmentControl)
-> Parser (Maybe Int)
-> Parser
     (Maybe ControlResponse
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe [ControlComment]
      -> Maybe Int
      -> Maybe Text
      -> AssessmentControl)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"evidenceCount")
            Parser
  (Maybe ControlResponse
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe [ControlComment]
   -> Maybe Int
   -> Maybe Text
   -> AssessmentControl)
-> Parser (Maybe ControlResponse)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe [ControlComment]
      -> Maybe Int
      -> Maybe Text
      -> AssessmentControl)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ControlResponse)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"response")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe [ControlComment]
   -> Maybe Int
   -> Maybe Text
   -> AssessmentControl)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe [ControlComment]
      -> Maybe Int
      -> Maybe Text
      -> AssessmentControl)
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
"name")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe [ControlComment]
   -> Maybe Int
   -> Maybe Text
   -> AssessmentControl)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe [ControlComment]
      -> Maybe Int
      -> Maybe Text
      -> AssessmentControl)
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
"id")
            Parser
  (Maybe [Text]
   -> Maybe [ControlComment]
   -> Maybe Int
   -> Maybe Text
   -> AssessmentControl)
-> Parser (Maybe [Text])
-> Parser
     (Maybe [ControlComment]
      -> Maybe Int -> Maybe Text -> AssessmentControl)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"evidenceSources"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [ControlComment]
   -> Maybe Int -> Maybe Text -> AssessmentControl)
-> Parser (Maybe [ControlComment])
-> Parser (Maybe Int -> Maybe Text -> AssessmentControl)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ControlComment]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"comments" Parser (Maybe (Maybe [ControlComment]))
-> Maybe [ControlComment] -> Parser (Maybe [ControlComment])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ControlComment]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe Int -> Maybe Text -> AssessmentControl)
-> Parser (Maybe Int) -> Parser (Maybe Text -> AssessmentControl)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"assessmentReportEvidenceCount")
            Parser (Maybe Text -> AssessmentControl)
-> Parser (Maybe Text) -> Parser AssessmentControl
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
"description")
      )

instance Prelude.Hashable AssessmentControl

instance Prelude.NFData AssessmentControl