{-# 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.Config.Types.ConfigRuleEvaluationStatus
-- 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.Config.Types.ConfigRuleEvaluationStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Status information for your Config managed rules. The status includes
-- information such as the last time the rule ran, the last time it failed,
-- and the related error for the last failure.
--
-- This action does not return status information about custom Config
-- rules.
--
-- /See:/ 'newConfigRuleEvaluationStatus' smart constructor.
data ConfigRuleEvaluationStatus = ConfigRuleEvaluationStatus'
  { -- | The error code that Config returned when the rule last failed.
    ConfigRuleEvaluationStatus -> Maybe Text
lastErrorCode :: Prelude.Maybe Prelude.Text,
    -- | The time that Config last failed to evaluate your Amazon Web Services
    -- resources against the rule.
    ConfigRuleEvaluationStatus -> Maybe POSIX
lastFailedEvaluationTime :: Prelude.Maybe Core.POSIX,
    -- | The time that you first activated the Config rule.
    ConfigRuleEvaluationStatus -> Maybe POSIX
firstActivatedTime :: Prelude.Maybe Core.POSIX,
    -- | The time that Config last successfully evaluated your Amazon Web
    -- Services resources against the rule.
    ConfigRuleEvaluationStatus -> Maybe POSIX
lastSuccessfulEvaluationTime :: Prelude.Maybe Core.POSIX,
    -- | The time that you last turned off the Config rule.
    ConfigRuleEvaluationStatus -> Maybe POSIX
lastDeactivatedTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the Config rule.
    ConfigRuleEvaluationStatus -> Maybe Text
configRuleName :: Prelude.Maybe Prelude.Text,
    -- | The error message that Config returned when the rule last failed.
    ConfigRuleEvaluationStatus -> Maybe Text
lastErrorMessage :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Config rule.
    ConfigRuleEvaluationStatus -> Maybe Text
configRuleId :: Prelude.Maybe Prelude.Text,
    -- | The time that Config last failed to invoke the Config rule to evaluate
    -- your Amazon Web Services resources.
    ConfigRuleEvaluationStatus -> Maybe POSIX
lastFailedInvocationTime :: Prelude.Maybe Core.POSIX,
    -- | Indicates whether Config has evaluated your resources against the rule
    -- at least once.
    --
    -- -   @true@ - Config has evaluated your Amazon Web Services resources
    --     against the rule at least once.
    --
    -- -   @false@ - Config has not once finished evaluating your Amazon Web
    --     Services resources against the rule.
    ConfigRuleEvaluationStatus -> Maybe Bool
firstEvaluationStarted :: Prelude.Maybe Prelude.Bool,
    -- | The time that Config last successfully invoked the Config rule to
    -- evaluate your Amazon Web Services resources.
    ConfigRuleEvaluationStatus -> Maybe POSIX
lastSuccessfulInvocationTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the Config rule.
    ConfigRuleEvaluationStatus -> Maybe Text
configRuleArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ConfigRuleEvaluationStatus -> ConfigRuleEvaluationStatus -> Bool
(ConfigRuleEvaluationStatus -> ConfigRuleEvaluationStatus -> Bool)
-> (ConfigRuleEvaluationStatus
    -> ConfigRuleEvaluationStatus -> Bool)
-> Eq ConfigRuleEvaluationStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigRuleEvaluationStatus -> ConfigRuleEvaluationStatus -> Bool
$c/= :: ConfigRuleEvaluationStatus -> ConfigRuleEvaluationStatus -> Bool
== :: ConfigRuleEvaluationStatus -> ConfigRuleEvaluationStatus -> Bool
$c== :: ConfigRuleEvaluationStatus -> ConfigRuleEvaluationStatus -> Bool
Prelude.Eq, ReadPrec [ConfigRuleEvaluationStatus]
ReadPrec ConfigRuleEvaluationStatus
Int -> ReadS ConfigRuleEvaluationStatus
ReadS [ConfigRuleEvaluationStatus]
(Int -> ReadS ConfigRuleEvaluationStatus)
-> ReadS [ConfigRuleEvaluationStatus]
-> ReadPrec ConfigRuleEvaluationStatus
-> ReadPrec [ConfigRuleEvaluationStatus]
-> Read ConfigRuleEvaluationStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfigRuleEvaluationStatus]
$creadListPrec :: ReadPrec [ConfigRuleEvaluationStatus]
readPrec :: ReadPrec ConfigRuleEvaluationStatus
$creadPrec :: ReadPrec ConfigRuleEvaluationStatus
readList :: ReadS [ConfigRuleEvaluationStatus]
$creadList :: ReadS [ConfigRuleEvaluationStatus]
readsPrec :: Int -> ReadS ConfigRuleEvaluationStatus
$creadsPrec :: Int -> ReadS ConfigRuleEvaluationStatus
Prelude.Read, Int -> ConfigRuleEvaluationStatus -> ShowS
[ConfigRuleEvaluationStatus] -> ShowS
ConfigRuleEvaluationStatus -> String
(Int -> ConfigRuleEvaluationStatus -> ShowS)
-> (ConfigRuleEvaluationStatus -> String)
-> ([ConfigRuleEvaluationStatus] -> ShowS)
-> Show ConfigRuleEvaluationStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigRuleEvaluationStatus] -> ShowS
$cshowList :: [ConfigRuleEvaluationStatus] -> ShowS
show :: ConfigRuleEvaluationStatus -> String
$cshow :: ConfigRuleEvaluationStatus -> String
showsPrec :: Int -> ConfigRuleEvaluationStatus -> ShowS
$cshowsPrec :: Int -> ConfigRuleEvaluationStatus -> ShowS
Prelude.Show, (forall x.
 ConfigRuleEvaluationStatus -> Rep ConfigRuleEvaluationStatus x)
-> (forall x.
    Rep ConfigRuleEvaluationStatus x -> ConfigRuleEvaluationStatus)
-> Generic ConfigRuleEvaluationStatus
forall x.
Rep ConfigRuleEvaluationStatus x -> ConfigRuleEvaluationStatus
forall x.
ConfigRuleEvaluationStatus -> Rep ConfigRuleEvaluationStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ConfigRuleEvaluationStatus x -> ConfigRuleEvaluationStatus
$cfrom :: forall x.
ConfigRuleEvaluationStatus -> Rep ConfigRuleEvaluationStatus x
Prelude.Generic)

-- |
-- Create a value of 'ConfigRuleEvaluationStatus' 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:
--
-- 'lastErrorCode', 'configRuleEvaluationStatus_lastErrorCode' - The error code that Config returned when the rule last failed.
--
-- 'lastFailedEvaluationTime', 'configRuleEvaluationStatus_lastFailedEvaluationTime' - The time that Config last failed to evaluate your Amazon Web Services
-- resources against the rule.
--
-- 'firstActivatedTime', 'configRuleEvaluationStatus_firstActivatedTime' - The time that you first activated the Config rule.
--
-- 'lastSuccessfulEvaluationTime', 'configRuleEvaluationStatus_lastSuccessfulEvaluationTime' - The time that Config last successfully evaluated your Amazon Web
-- Services resources against the rule.
--
-- 'lastDeactivatedTime', 'configRuleEvaluationStatus_lastDeactivatedTime' - The time that you last turned off the Config rule.
--
-- 'configRuleName', 'configRuleEvaluationStatus_configRuleName' - The name of the Config rule.
--
-- 'lastErrorMessage', 'configRuleEvaluationStatus_lastErrorMessage' - The error message that Config returned when the rule last failed.
--
-- 'configRuleId', 'configRuleEvaluationStatus_configRuleId' - The ID of the Config rule.
--
-- 'lastFailedInvocationTime', 'configRuleEvaluationStatus_lastFailedInvocationTime' - The time that Config last failed to invoke the Config rule to evaluate
-- your Amazon Web Services resources.
--
-- 'firstEvaluationStarted', 'configRuleEvaluationStatus_firstEvaluationStarted' - Indicates whether Config has evaluated your resources against the rule
-- at least once.
--
-- -   @true@ - Config has evaluated your Amazon Web Services resources
--     against the rule at least once.
--
-- -   @false@ - Config has not once finished evaluating your Amazon Web
--     Services resources against the rule.
--
-- 'lastSuccessfulInvocationTime', 'configRuleEvaluationStatus_lastSuccessfulInvocationTime' - The time that Config last successfully invoked the Config rule to
-- evaluate your Amazon Web Services resources.
--
-- 'configRuleArn', 'configRuleEvaluationStatus_configRuleArn' - The Amazon Resource Name (ARN) of the Config rule.
newConfigRuleEvaluationStatus ::
  ConfigRuleEvaluationStatus
newConfigRuleEvaluationStatus :: ConfigRuleEvaluationStatus
newConfigRuleEvaluationStatus =
  ConfigRuleEvaluationStatus' :: Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe POSIX
-> Maybe Text
-> ConfigRuleEvaluationStatus
ConfigRuleEvaluationStatus'
    { $sel:lastErrorCode:ConfigRuleEvaluationStatus' :: Maybe Text
lastErrorCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastFailedEvaluationTime:ConfigRuleEvaluationStatus' :: Maybe POSIX
lastFailedEvaluationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:firstActivatedTime:ConfigRuleEvaluationStatus' :: Maybe POSIX
firstActivatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastSuccessfulEvaluationTime:ConfigRuleEvaluationStatus' :: Maybe POSIX
lastSuccessfulEvaluationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastDeactivatedTime:ConfigRuleEvaluationStatus' :: Maybe POSIX
lastDeactivatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:configRuleName:ConfigRuleEvaluationStatus' :: Maybe Text
configRuleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastErrorMessage:ConfigRuleEvaluationStatus' :: Maybe Text
lastErrorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:configRuleId:ConfigRuleEvaluationStatus' :: Maybe Text
configRuleId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastFailedInvocationTime:ConfigRuleEvaluationStatus' :: Maybe POSIX
lastFailedInvocationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:firstEvaluationStarted:ConfigRuleEvaluationStatus' :: Maybe Bool
firstEvaluationStarted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:lastSuccessfulInvocationTime:ConfigRuleEvaluationStatus' :: Maybe POSIX
lastSuccessfulInvocationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:configRuleArn:ConfigRuleEvaluationStatus' :: Maybe Text
configRuleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The error code that Config returned when the rule last failed.
configRuleEvaluationStatus_lastErrorCode :: Lens.Lens' ConfigRuleEvaluationStatus (Prelude.Maybe Prelude.Text)
configRuleEvaluationStatus_lastErrorCode :: (Maybe Text -> f (Maybe Text))
-> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus
configRuleEvaluationStatus_lastErrorCode = (ConfigRuleEvaluationStatus -> Maybe Text)
-> (ConfigRuleEvaluationStatus
    -> Maybe Text -> ConfigRuleEvaluationStatus)
-> Lens
     ConfigRuleEvaluationStatus
     ConfigRuleEvaluationStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigRuleEvaluationStatus' {Maybe Text
lastErrorCode :: Maybe Text
$sel:lastErrorCode:ConfigRuleEvaluationStatus' :: ConfigRuleEvaluationStatus -> Maybe Text
lastErrorCode} -> Maybe Text
lastErrorCode) (\s :: ConfigRuleEvaluationStatus
s@ConfigRuleEvaluationStatus' {} Maybe Text
a -> ConfigRuleEvaluationStatus
s {$sel:lastErrorCode:ConfigRuleEvaluationStatus' :: Maybe Text
lastErrorCode = Maybe Text
a} :: ConfigRuleEvaluationStatus)

-- | The time that Config last failed to evaluate your Amazon Web Services
-- resources against the rule.
configRuleEvaluationStatus_lastFailedEvaluationTime :: Lens.Lens' ConfigRuleEvaluationStatus (Prelude.Maybe Prelude.UTCTime)
configRuleEvaluationStatus_lastFailedEvaluationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus
configRuleEvaluationStatus_lastFailedEvaluationTime = (ConfigRuleEvaluationStatus -> Maybe POSIX)
-> (ConfigRuleEvaluationStatus
    -> Maybe POSIX -> ConfigRuleEvaluationStatus)
-> Lens
     ConfigRuleEvaluationStatus
     ConfigRuleEvaluationStatus
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigRuleEvaluationStatus' {Maybe POSIX
lastFailedEvaluationTime :: Maybe POSIX
$sel:lastFailedEvaluationTime:ConfigRuleEvaluationStatus' :: ConfigRuleEvaluationStatus -> Maybe POSIX
lastFailedEvaluationTime} -> Maybe POSIX
lastFailedEvaluationTime) (\s :: ConfigRuleEvaluationStatus
s@ConfigRuleEvaluationStatus' {} Maybe POSIX
a -> ConfigRuleEvaluationStatus
s {$sel:lastFailedEvaluationTime:ConfigRuleEvaluationStatus' :: Maybe POSIX
lastFailedEvaluationTime = Maybe POSIX
a} :: ConfigRuleEvaluationStatus) ((Maybe POSIX -> f (Maybe POSIX))
 -> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ConfigRuleEvaluationStatus
-> f ConfigRuleEvaluationStatus
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

-- | The time that you first activated the Config rule.
configRuleEvaluationStatus_firstActivatedTime :: Lens.Lens' ConfigRuleEvaluationStatus (Prelude.Maybe Prelude.UTCTime)
configRuleEvaluationStatus_firstActivatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus
configRuleEvaluationStatus_firstActivatedTime = (ConfigRuleEvaluationStatus -> Maybe POSIX)
-> (ConfigRuleEvaluationStatus
    -> Maybe POSIX -> ConfigRuleEvaluationStatus)
-> Lens
     ConfigRuleEvaluationStatus
     ConfigRuleEvaluationStatus
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigRuleEvaluationStatus' {Maybe POSIX
firstActivatedTime :: Maybe POSIX
$sel:firstActivatedTime:ConfigRuleEvaluationStatus' :: ConfigRuleEvaluationStatus -> Maybe POSIX
firstActivatedTime} -> Maybe POSIX
firstActivatedTime) (\s :: ConfigRuleEvaluationStatus
s@ConfigRuleEvaluationStatus' {} Maybe POSIX
a -> ConfigRuleEvaluationStatus
s {$sel:firstActivatedTime:ConfigRuleEvaluationStatus' :: Maybe POSIX
firstActivatedTime = Maybe POSIX
a} :: ConfigRuleEvaluationStatus) ((Maybe POSIX -> f (Maybe POSIX))
 -> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ConfigRuleEvaluationStatus
-> f ConfigRuleEvaluationStatus
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

-- | The time that Config last successfully evaluated your Amazon Web
-- Services resources against the rule.
configRuleEvaluationStatus_lastSuccessfulEvaluationTime :: Lens.Lens' ConfigRuleEvaluationStatus (Prelude.Maybe Prelude.UTCTime)
configRuleEvaluationStatus_lastSuccessfulEvaluationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus
configRuleEvaluationStatus_lastSuccessfulEvaluationTime = (ConfigRuleEvaluationStatus -> Maybe POSIX)
-> (ConfigRuleEvaluationStatus
    -> Maybe POSIX -> ConfigRuleEvaluationStatus)
-> Lens
     ConfigRuleEvaluationStatus
     ConfigRuleEvaluationStatus
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigRuleEvaluationStatus' {Maybe POSIX
lastSuccessfulEvaluationTime :: Maybe POSIX
$sel:lastSuccessfulEvaluationTime:ConfigRuleEvaluationStatus' :: ConfigRuleEvaluationStatus -> Maybe POSIX
lastSuccessfulEvaluationTime} -> Maybe POSIX
lastSuccessfulEvaluationTime) (\s :: ConfigRuleEvaluationStatus
s@ConfigRuleEvaluationStatus' {} Maybe POSIX
a -> ConfigRuleEvaluationStatus
s {$sel:lastSuccessfulEvaluationTime:ConfigRuleEvaluationStatus' :: Maybe POSIX
lastSuccessfulEvaluationTime = Maybe POSIX
a} :: ConfigRuleEvaluationStatus) ((Maybe POSIX -> f (Maybe POSIX))
 -> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ConfigRuleEvaluationStatus
-> f ConfigRuleEvaluationStatus
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

-- | The time that you last turned off the Config rule.
configRuleEvaluationStatus_lastDeactivatedTime :: Lens.Lens' ConfigRuleEvaluationStatus (Prelude.Maybe Prelude.UTCTime)
configRuleEvaluationStatus_lastDeactivatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus
configRuleEvaluationStatus_lastDeactivatedTime = (ConfigRuleEvaluationStatus -> Maybe POSIX)
-> (ConfigRuleEvaluationStatus
    -> Maybe POSIX -> ConfigRuleEvaluationStatus)
-> Lens
     ConfigRuleEvaluationStatus
     ConfigRuleEvaluationStatus
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigRuleEvaluationStatus' {Maybe POSIX
lastDeactivatedTime :: Maybe POSIX
$sel:lastDeactivatedTime:ConfigRuleEvaluationStatus' :: ConfigRuleEvaluationStatus -> Maybe POSIX
lastDeactivatedTime} -> Maybe POSIX
lastDeactivatedTime) (\s :: ConfigRuleEvaluationStatus
s@ConfigRuleEvaluationStatus' {} Maybe POSIX
a -> ConfigRuleEvaluationStatus
s {$sel:lastDeactivatedTime:ConfigRuleEvaluationStatus' :: Maybe POSIX
lastDeactivatedTime = Maybe POSIX
a} :: ConfigRuleEvaluationStatus) ((Maybe POSIX -> f (Maybe POSIX))
 -> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ConfigRuleEvaluationStatus
-> f ConfigRuleEvaluationStatus
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

-- | The name of the Config rule.
configRuleEvaluationStatus_configRuleName :: Lens.Lens' ConfigRuleEvaluationStatus (Prelude.Maybe Prelude.Text)
configRuleEvaluationStatus_configRuleName :: (Maybe Text -> f (Maybe Text))
-> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus
configRuleEvaluationStatus_configRuleName = (ConfigRuleEvaluationStatus -> Maybe Text)
-> (ConfigRuleEvaluationStatus
    -> Maybe Text -> ConfigRuleEvaluationStatus)
-> Lens
     ConfigRuleEvaluationStatus
     ConfigRuleEvaluationStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigRuleEvaluationStatus' {Maybe Text
configRuleName :: Maybe Text
$sel:configRuleName:ConfigRuleEvaluationStatus' :: ConfigRuleEvaluationStatus -> Maybe Text
configRuleName} -> Maybe Text
configRuleName) (\s :: ConfigRuleEvaluationStatus
s@ConfigRuleEvaluationStatus' {} Maybe Text
a -> ConfigRuleEvaluationStatus
s {$sel:configRuleName:ConfigRuleEvaluationStatus' :: Maybe Text
configRuleName = Maybe Text
a} :: ConfigRuleEvaluationStatus)

-- | The error message that Config returned when the rule last failed.
configRuleEvaluationStatus_lastErrorMessage :: Lens.Lens' ConfigRuleEvaluationStatus (Prelude.Maybe Prelude.Text)
configRuleEvaluationStatus_lastErrorMessage :: (Maybe Text -> f (Maybe Text))
-> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus
configRuleEvaluationStatus_lastErrorMessage = (ConfigRuleEvaluationStatus -> Maybe Text)
-> (ConfigRuleEvaluationStatus
    -> Maybe Text -> ConfigRuleEvaluationStatus)
-> Lens
     ConfigRuleEvaluationStatus
     ConfigRuleEvaluationStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigRuleEvaluationStatus' {Maybe Text
lastErrorMessage :: Maybe Text
$sel:lastErrorMessage:ConfigRuleEvaluationStatus' :: ConfigRuleEvaluationStatus -> Maybe Text
lastErrorMessage} -> Maybe Text
lastErrorMessage) (\s :: ConfigRuleEvaluationStatus
s@ConfigRuleEvaluationStatus' {} Maybe Text
a -> ConfigRuleEvaluationStatus
s {$sel:lastErrorMessage:ConfigRuleEvaluationStatus' :: Maybe Text
lastErrorMessage = Maybe Text
a} :: ConfigRuleEvaluationStatus)

-- | The ID of the Config rule.
configRuleEvaluationStatus_configRuleId :: Lens.Lens' ConfigRuleEvaluationStatus (Prelude.Maybe Prelude.Text)
configRuleEvaluationStatus_configRuleId :: (Maybe Text -> f (Maybe Text))
-> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus
configRuleEvaluationStatus_configRuleId = (ConfigRuleEvaluationStatus -> Maybe Text)
-> (ConfigRuleEvaluationStatus
    -> Maybe Text -> ConfigRuleEvaluationStatus)
-> Lens
     ConfigRuleEvaluationStatus
     ConfigRuleEvaluationStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigRuleEvaluationStatus' {Maybe Text
configRuleId :: Maybe Text
$sel:configRuleId:ConfigRuleEvaluationStatus' :: ConfigRuleEvaluationStatus -> Maybe Text
configRuleId} -> Maybe Text
configRuleId) (\s :: ConfigRuleEvaluationStatus
s@ConfigRuleEvaluationStatus' {} Maybe Text
a -> ConfigRuleEvaluationStatus
s {$sel:configRuleId:ConfigRuleEvaluationStatus' :: Maybe Text
configRuleId = Maybe Text
a} :: ConfigRuleEvaluationStatus)

-- | The time that Config last failed to invoke the Config rule to evaluate
-- your Amazon Web Services resources.
configRuleEvaluationStatus_lastFailedInvocationTime :: Lens.Lens' ConfigRuleEvaluationStatus (Prelude.Maybe Prelude.UTCTime)
configRuleEvaluationStatus_lastFailedInvocationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus
configRuleEvaluationStatus_lastFailedInvocationTime = (ConfigRuleEvaluationStatus -> Maybe POSIX)
-> (ConfigRuleEvaluationStatus
    -> Maybe POSIX -> ConfigRuleEvaluationStatus)
-> Lens
     ConfigRuleEvaluationStatus
     ConfigRuleEvaluationStatus
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigRuleEvaluationStatus' {Maybe POSIX
lastFailedInvocationTime :: Maybe POSIX
$sel:lastFailedInvocationTime:ConfigRuleEvaluationStatus' :: ConfigRuleEvaluationStatus -> Maybe POSIX
lastFailedInvocationTime} -> Maybe POSIX
lastFailedInvocationTime) (\s :: ConfigRuleEvaluationStatus
s@ConfigRuleEvaluationStatus' {} Maybe POSIX
a -> ConfigRuleEvaluationStatus
s {$sel:lastFailedInvocationTime:ConfigRuleEvaluationStatus' :: Maybe POSIX
lastFailedInvocationTime = Maybe POSIX
a} :: ConfigRuleEvaluationStatus) ((Maybe POSIX -> f (Maybe POSIX))
 -> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ConfigRuleEvaluationStatus
-> f ConfigRuleEvaluationStatus
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

-- | Indicates whether Config has evaluated your resources against the rule
-- at least once.
--
-- -   @true@ - Config has evaluated your Amazon Web Services resources
--     against the rule at least once.
--
-- -   @false@ - Config has not once finished evaluating your Amazon Web
--     Services resources against the rule.
configRuleEvaluationStatus_firstEvaluationStarted :: Lens.Lens' ConfigRuleEvaluationStatus (Prelude.Maybe Prelude.Bool)
configRuleEvaluationStatus_firstEvaluationStarted :: (Maybe Bool -> f (Maybe Bool))
-> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus
configRuleEvaluationStatus_firstEvaluationStarted = (ConfigRuleEvaluationStatus -> Maybe Bool)
-> (ConfigRuleEvaluationStatus
    -> Maybe Bool -> ConfigRuleEvaluationStatus)
-> Lens
     ConfigRuleEvaluationStatus
     ConfigRuleEvaluationStatus
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigRuleEvaluationStatus' {Maybe Bool
firstEvaluationStarted :: Maybe Bool
$sel:firstEvaluationStarted:ConfigRuleEvaluationStatus' :: ConfigRuleEvaluationStatus -> Maybe Bool
firstEvaluationStarted} -> Maybe Bool
firstEvaluationStarted) (\s :: ConfigRuleEvaluationStatus
s@ConfigRuleEvaluationStatus' {} Maybe Bool
a -> ConfigRuleEvaluationStatus
s {$sel:firstEvaluationStarted:ConfigRuleEvaluationStatus' :: Maybe Bool
firstEvaluationStarted = Maybe Bool
a} :: ConfigRuleEvaluationStatus)

-- | The time that Config last successfully invoked the Config rule to
-- evaluate your Amazon Web Services resources.
configRuleEvaluationStatus_lastSuccessfulInvocationTime :: Lens.Lens' ConfigRuleEvaluationStatus (Prelude.Maybe Prelude.UTCTime)
configRuleEvaluationStatus_lastSuccessfulInvocationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus
configRuleEvaluationStatus_lastSuccessfulInvocationTime = (ConfigRuleEvaluationStatus -> Maybe POSIX)
-> (ConfigRuleEvaluationStatus
    -> Maybe POSIX -> ConfigRuleEvaluationStatus)
-> Lens
     ConfigRuleEvaluationStatus
     ConfigRuleEvaluationStatus
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigRuleEvaluationStatus' {Maybe POSIX
lastSuccessfulInvocationTime :: Maybe POSIX
$sel:lastSuccessfulInvocationTime:ConfigRuleEvaluationStatus' :: ConfigRuleEvaluationStatus -> Maybe POSIX
lastSuccessfulInvocationTime} -> Maybe POSIX
lastSuccessfulInvocationTime) (\s :: ConfigRuleEvaluationStatus
s@ConfigRuleEvaluationStatus' {} Maybe POSIX
a -> ConfigRuleEvaluationStatus
s {$sel:lastSuccessfulInvocationTime:ConfigRuleEvaluationStatus' :: Maybe POSIX
lastSuccessfulInvocationTime = Maybe POSIX
a} :: ConfigRuleEvaluationStatus) ((Maybe POSIX -> f (Maybe POSIX))
 -> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ConfigRuleEvaluationStatus
-> f ConfigRuleEvaluationStatus
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

-- | The Amazon Resource Name (ARN) of the Config rule.
configRuleEvaluationStatus_configRuleArn :: Lens.Lens' ConfigRuleEvaluationStatus (Prelude.Maybe Prelude.Text)
configRuleEvaluationStatus_configRuleArn :: (Maybe Text -> f (Maybe Text))
-> ConfigRuleEvaluationStatus -> f ConfigRuleEvaluationStatus
configRuleEvaluationStatus_configRuleArn = (ConfigRuleEvaluationStatus -> Maybe Text)
-> (ConfigRuleEvaluationStatus
    -> Maybe Text -> ConfigRuleEvaluationStatus)
-> Lens
     ConfigRuleEvaluationStatus
     ConfigRuleEvaluationStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigRuleEvaluationStatus' {Maybe Text
configRuleArn :: Maybe Text
$sel:configRuleArn:ConfigRuleEvaluationStatus' :: ConfigRuleEvaluationStatus -> Maybe Text
configRuleArn} -> Maybe Text
configRuleArn) (\s :: ConfigRuleEvaluationStatus
s@ConfigRuleEvaluationStatus' {} Maybe Text
a -> ConfigRuleEvaluationStatus
s {$sel:configRuleArn:ConfigRuleEvaluationStatus' :: Maybe Text
configRuleArn = Maybe Text
a} :: ConfigRuleEvaluationStatus)

instance Core.FromJSON ConfigRuleEvaluationStatus where
  parseJSON :: Value -> Parser ConfigRuleEvaluationStatus
parseJSON =
    String
-> (Object -> Parser ConfigRuleEvaluationStatus)
-> Value
-> Parser ConfigRuleEvaluationStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ConfigRuleEvaluationStatus"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe POSIX
-> Maybe Text
-> ConfigRuleEvaluationStatus
ConfigRuleEvaluationStatus'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Bool
 -> Maybe POSIX
 -> Maybe Text
 -> ConfigRuleEvaluationStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> ConfigRuleEvaluationStatus)
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
"LastErrorCode")
            Parser
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> ConfigRuleEvaluationStatus)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> ConfigRuleEvaluationStatus)
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
"LastFailedEvaluationTime")
            Parser
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> ConfigRuleEvaluationStatus)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> ConfigRuleEvaluationStatus)
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
"FirstActivatedTime")
            Parser
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> ConfigRuleEvaluationStatus)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> ConfigRuleEvaluationStatus)
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
"LastSuccessfulEvaluationTime")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> ConfigRuleEvaluationStatus)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> ConfigRuleEvaluationStatus)
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
"LastDeactivatedTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> ConfigRuleEvaluationStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> ConfigRuleEvaluationStatus)
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
"ConfigRuleName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> ConfigRuleEvaluationStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> ConfigRuleEvaluationStatus)
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
"LastErrorMessage")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> ConfigRuleEvaluationStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Bool
      -> Maybe POSIX
      -> Maybe Text
      -> ConfigRuleEvaluationStatus)
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
"ConfigRuleId")
            Parser
  (Maybe POSIX
   -> Maybe Bool
   -> Maybe POSIX
   -> Maybe Text
   -> ConfigRuleEvaluationStatus)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Bool
      -> Maybe POSIX -> Maybe Text -> ConfigRuleEvaluationStatus)
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
"LastFailedInvocationTime")
            Parser
  (Maybe Bool
   -> Maybe POSIX -> Maybe Text -> ConfigRuleEvaluationStatus)
-> Parser (Maybe Bool)
-> Parser (Maybe POSIX -> Maybe Text -> ConfigRuleEvaluationStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FirstEvaluationStarted")
            Parser (Maybe POSIX -> Maybe Text -> ConfigRuleEvaluationStatus)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> ConfigRuleEvaluationStatus)
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
"LastSuccessfulInvocationTime")
            Parser (Maybe Text -> ConfigRuleEvaluationStatus)
-> Parser (Maybe Text) -> Parser ConfigRuleEvaluationStatus
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
"ConfigRuleArn")
      )

instance Prelude.Hashable ConfigRuleEvaluationStatus

instance Prelude.NFData ConfigRuleEvaluationStatus