{-# 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.IoT.Types.AuditMitigationActionsTaskMetadata
-- 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.IoT.Types.AuditMitigationActionsTaskMetadata where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.AuditMitigationActionsTaskStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about an audit mitigation actions task that is returned by
-- @ListAuditMitigationActionsTasks@.
--
-- /See:/ 'newAuditMitigationActionsTaskMetadata' smart constructor.
data AuditMitigationActionsTaskMetadata = AuditMitigationActionsTaskMetadata'
  { -- | The time at which the audit mitigation actions task was started.
    AuditMitigationActionsTaskMetadata -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | The unique identifier for the task.
    AuditMitigationActionsTaskMetadata -> Maybe Text
taskId :: Prelude.Maybe Prelude.Text,
    -- | The current state of the audit mitigation actions task.
    AuditMitigationActionsTaskMetadata
-> Maybe AuditMitigationActionsTaskStatus
taskStatus :: Prelude.Maybe AuditMitigationActionsTaskStatus
  }
  deriving (AuditMitigationActionsTaskMetadata
-> AuditMitigationActionsTaskMetadata -> Bool
(AuditMitigationActionsTaskMetadata
 -> AuditMitigationActionsTaskMetadata -> Bool)
-> (AuditMitigationActionsTaskMetadata
    -> AuditMitigationActionsTaskMetadata -> Bool)
-> Eq AuditMitigationActionsTaskMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuditMitigationActionsTaskMetadata
-> AuditMitigationActionsTaskMetadata -> Bool
$c/= :: AuditMitigationActionsTaskMetadata
-> AuditMitigationActionsTaskMetadata -> Bool
== :: AuditMitigationActionsTaskMetadata
-> AuditMitigationActionsTaskMetadata -> Bool
$c== :: AuditMitigationActionsTaskMetadata
-> AuditMitigationActionsTaskMetadata -> Bool
Prelude.Eq, ReadPrec [AuditMitigationActionsTaskMetadata]
ReadPrec AuditMitigationActionsTaskMetadata
Int -> ReadS AuditMitigationActionsTaskMetadata
ReadS [AuditMitigationActionsTaskMetadata]
(Int -> ReadS AuditMitigationActionsTaskMetadata)
-> ReadS [AuditMitigationActionsTaskMetadata]
-> ReadPrec AuditMitigationActionsTaskMetadata
-> ReadPrec [AuditMitigationActionsTaskMetadata]
-> Read AuditMitigationActionsTaskMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuditMitigationActionsTaskMetadata]
$creadListPrec :: ReadPrec [AuditMitigationActionsTaskMetadata]
readPrec :: ReadPrec AuditMitigationActionsTaskMetadata
$creadPrec :: ReadPrec AuditMitigationActionsTaskMetadata
readList :: ReadS [AuditMitigationActionsTaskMetadata]
$creadList :: ReadS [AuditMitigationActionsTaskMetadata]
readsPrec :: Int -> ReadS AuditMitigationActionsTaskMetadata
$creadsPrec :: Int -> ReadS AuditMitigationActionsTaskMetadata
Prelude.Read, Int -> AuditMitigationActionsTaskMetadata -> ShowS
[AuditMitigationActionsTaskMetadata] -> ShowS
AuditMitigationActionsTaskMetadata -> String
(Int -> AuditMitigationActionsTaskMetadata -> ShowS)
-> (AuditMitigationActionsTaskMetadata -> String)
-> ([AuditMitigationActionsTaskMetadata] -> ShowS)
-> Show AuditMitigationActionsTaskMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuditMitigationActionsTaskMetadata] -> ShowS
$cshowList :: [AuditMitigationActionsTaskMetadata] -> ShowS
show :: AuditMitigationActionsTaskMetadata -> String
$cshow :: AuditMitigationActionsTaskMetadata -> String
showsPrec :: Int -> AuditMitigationActionsTaskMetadata -> ShowS
$cshowsPrec :: Int -> AuditMitigationActionsTaskMetadata -> ShowS
Prelude.Show, (forall x.
 AuditMitigationActionsTaskMetadata
 -> Rep AuditMitigationActionsTaskMetadata x)
-> (forall x.
    Rep AuditMitigationActionsTaskMetadata x
    -> AuditMitigationActionsTaskMetadata)
-> Generic AuditMitigationActionsTaskMetadata
forall x.
Rep AuditMitigationActionsTaskMetadata x
-> AuditMitigationActionsTaskMetadata
forall x.
AuditMitigationActionsTaskMetadata
-> Rep AuditMitigationActionsTaskMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AuditMitigationActionsTaskMetadata x
-> AuditMitigationActionsTaskMetadata
$cfrom :: forall x.
AuditMitigationActionsTaskMetadata
-> Rep AuditMitigationActionsTaskMetadata x
Prelude.Generic)

-- |
-- Create a value of 'AuditMitigationActionsTaskMetadata' 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:
--
-- 'startTime', 'auditMitigationActionsTaskMetadata_startTime' - The time at which the audit mitigation actions task was started.
--
-- 'taskId', 'auditMitigationActionsTaskMetadata_taskId' - The unique identifier for the task.
--
-- 'taskStatus', 'auditMitigationActionsTaskMetadata_taskStatus' - The current state of the audit mitigation actions task.
newAuditMitigationActionsTaskMetadata ::
  AuditMitigationActionsTaskMetadata
newAuditMitigationActionsTaskMetadata :: AuditMitigationActionsTaskMetadata
newAuditMitigationActionsTaskMetadata =
  AuditMitigationActionsTaskMetadata' :: Maybe POSIX
-> Maybe Text
-> Maybe AuditMitigationActionsTaskStatus
-> AuditMitigationActionsTaskMetadata
AuditMitigationActionsTaskMetadata'
    { $sel:startTime:AuditMitigationActionsTaskMetadata' :: Maybe POSIX
startTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:taskId:AuditMitigationActionsTaskMetadata' :: Maybe Text
taskId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskStatus:AuditMitigationActionsTaskMetadata' :: Maybe AuditMitigationActionsTaskStatus
taskStatus = Maybe AuditMitigationActionsTaskStatus
forall a. Maybe a
Prelude.Nothing
    }

-- | The time at which the audit mitigation actions task was started.
auditMitigationActionsTaskMetadata_startTime :: Lens.Lens' AuditMitigationActionsTaskMetadata (Prelude.Maybe Prelude.UTCTime)
auditMitigationActionsTaskMetadata_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AuditMitigationActionsTaskMetadata
-> f AuditMitigationActionsTaskMetadata
auditMitigationActionsTaskMetadata_startTime = (AuditMitigationActionsTaskMetadata -> Maybe POSIX)
-> (AuditMitigationActionsTaskMetadata
    -> Maybe POSIX -> AuditMitigationActionsTaskMetadata)
-> Lens
     AuditMitigationActionsTaskMetadata
     AuditMitigationActionsTaskMetadata
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuditMitigationActionsTaskMetadata' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:AuditMitigationActionsTaskMetadata' :: AuditMitigationActionsTaskMetadata -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: AuditMitigationActionsTaskMetadata
s@AuditMitigationActionsTaskMetadata' {} Maybe POSIX
a -> AuditMitigationActionsTaskMetadata
s {$sel:startTime:AuditMitigationActionsTaskMetadata' :: Maybe POSIX
startTime = Maybe POSIX
a} :: AuditMitigationActionsTaskMetadata) ((Maybe POSIX -> f (Maybe POSIX))
 -> AuditMitigationActionsTaskMetadata
 -> f AuditMitigationActionsTaskMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AuditMitigationActionsTaskMetadata
-> f AuditMitigationActionsTaskMetadata
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 unique identifier for the task.
auditMitigationActionsTaskMetadata_taskId :: Lens.Lens' AuditMitigationActionsTaskMetadata (Prelude.Maybe Prelude.Text)
auditMitigationActionsTaskMetadata_taskId :: (Maybe Text -> f (Maybe Text))
-> AuditMitigationActionsTaskMetadata
-> f AuditMitigationActionsTaskMetadata
auditMitigationActionsTaskMetadata_taskId = (AuditMitigationActionsTaskMetadata -> Maybe Text)
-> (AuditMitigationActionsTaskMetadata
    -> Maybe Text -> AuditMitigationActionsTaskMetadata)
-> Lens
     AuditMitigationActionsTaskMetadata
     AuditMitigationActionsTaskMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuditMitigationActionsTaskMetadata' {Maybe Text
taskId :: Maybe Text
$sel:taskId:AuditMitigationActionsTaskMetadata' :: AuditMitigationActionsTaskMetadata -> Maybe Text
taskId} -> Maybe Text
taskId) (\s :: AuditMitigationActionsTaskMetadata
s@AuditMitigationActionsTaskMetadata' {} Maybe Text
a -> AuditMitigationActionsTaskMetadata
s {$sel:taskId:AuditMitigationActionsTaskMetadata' :: Maybe Text
taskId = Maybe Text
a} :: AuditMitigationActionsTaskMetadata)

-- | The current state of the audit mitigation actions task.
auditMitigationActionsTaskMetadata_taskStatus :: Lens.Lens' AuditMitigationActionsTaskMetadata (Prelude.Maybe AuditMitigationActionsTaskStatus)
auditMitigationActionsTaskMetadata_taskStatus :: (Maybe AuditMitigationActionsTaskStatus
 -> f (Maybe AuditMitigationActionsTaskStatus))
-> AuditMitigationActionsTaskMetadata
-> f AuditMitigationActionsTaskMetadata
auditMitigationActionsTaskMetadata_taskStatus = (AuditMitigationActionsTaskMetadata
 -> Maybe AuditMitigationActionsTaskStatus)
-> (AuditMitigationActionsTaskMetadata
    -> Maybe AuditMitigationActionsTaskStatus
    -> AuditMitigationActionsTaskMetadata)
-> Lens
     AuditMitigationActionsTaskMetadata
     AuditMitigationActionsTaskMetadata
     (Maybe AuditMitigationActionsTaskStatus)
     (Maybe AuditMitigationActionsTaskStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuditMitigationActionsTaskMetadata' {Maybe AuditMitigationActionsTaskStatus
taskStatus :: Maybe AuditMitigationActionsTaskStatus
$sel:taskStatus:AuditMitigationActionsTaskMetadata' :: AuditMitigationActionsTaskMetadata
-> Maybe AuditMitigationActionsTaskStatus
taskStatus} -> Maybe AuditMitigationActionsTaskStatus
taskStatus) (\s :: AuditMitigationActionsTaskMetadata
s@AuditMitigationActionsTaskMetadata' {} Maybe AuditMitigationActionsTaskStatus
a -> AuditMitigationActionsTaskMetadata
s {$sel:taskStatus:AuditMitigationActionsTaskMetadata' :: Maybe AuditMitigationActionsTaskStatus
taskStatus = Maybe AuditMitigationActionsTaskStatus
a} :: AuditMitigationActionsTaskMetadata)

instance
  Core.FromJSON
    AuditMitigationActionsTaskMetadata
  where
  parseJSON :: Value -> Parser AuditMitigationActionsTaskMetadata
parseJSON =
    String
-> (Object -> Parser AuditMitigationActionsTaskMetadata)
-> Value
-> Parser AuditMitigationActionsTaskMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AuditMitigationActionsTaskMetadata"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe AuditMitigationActionsTaskStatus
-> AuditMitigationActionsTaskMetadata
AuditMitigationActionsTaskMetadata'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe AuditMitigationActionsTaskStatus
 -> AuditMitigationActionsTaskMetadata)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe AuditMitigationActionsTaskStatus
      -> AuditMitigationActionsTaskMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"startTime")
            Parser
  (Maybe Text
   -> Maybe AuditMitigationActionsTaskStatus
   -> AuditMitigationActionsTaskMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe AuditMitigationActionsTaskStatus
      -> AuditMitigationActionsTaskMetadata)
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
"taskId")
            Parser
  (Maybe AuditMitigationActionsTaskStatus
   -> AuditMitigationActionsTaskMetadata)
-> Parser (Maybe AuditMitigationActionsTaskStatus)
-> Parser AuditMitigationActionsTaskMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AuditMitigationActionsTaskStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"taskStatus")
      )

instance
  Prelude.Hashable
    AuditMitigationActionsTaskMetadata

instance
  Prelude.NFData
    AuditMitigationActionsTaskMetadata