{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.DescribeAuditTask
-- 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)
--
-- Gets information about a Device Defender audit.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions DescribeAuditTask>
-- action.
module Amazonka.IoT.DescribeAuditTask
  ( -- * Creating a Request
    DescribeAuditTask (..),
    newDescribeAuditTask,

    -- * Request Lenses
    describeAuditTask_taskId,

    -- * Destructuring the Response
    DescribeAuditTaskResponse (..),
    newDescribeAuditTaskResponse,

    -- * Response Lenses
    describeAuditTaskResponse_auditDetails,
    describeAuditTaskResponse_taskType,
    describeAuditTaskResponse_taskStartTime,
    describeAuditTaskResponse_taskStatistics,
    describeAuditTaskResponse_scheduledAuditName,
    describeAuditTaskResponse_taskStatus,
    describeAuditTaskResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeAuditTask' smart constructor.
data DescribeAuditTask = DescribeAuditTask'
  { -- | The ID of the audit whose information you want to get.
    DescribeAuditTask -> Text
taskId :: Prelude.Text
  }
  deriving (DescribeAuditTask -> DescribeAuditTask -> Bool
(DescribeAuditTask -> DescribeAuditTask -> Bool)
-> (DescribeAuditTask -> DescribeAuditTask -> Bool)
-> Eq DescribeAuditTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAuditTask -> DescribeAuditTask -> Bool
$c/= :: DescribeAuditTask -> DescribeAuditTask -> Bool
== :: DescribeAuditTask -> DescribeAuditTask -> Bool
$c== :: DescribeAuditTask -> DescribeAuditTask -> Bool
Prelude.Eq, ReadPrec [DescribeAuditTask]
ReadPrec DescribeAuditTask
Int -> ReadS DescribeAuditTask
ReadS [DescribeAuditTask]
(Int -> ReadS DescribeAuditTask)
-> ReadS [DescribeAuditTask]
-> ReadPrec DescribeAuditTask
-> ReadPrec [DescribeAuditTask]
-> Read DescribeAuditTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAuditTask]
$creadListPrec :: ReadPrec [DescribeAuditTask]
readPrec :: ReadPrec DescribeAuditTask
$creadPrec :: ReadPrec DescribeAuditTask
readList :: ReadS [DescribeAuditTask]
$creadList :: ReadS [DescribeAuditTask]
readsPrec :: Int -> ReadS DescribeAuditTask
$creadsPrec :: Int -> ReadS DescribeAuditTask
Prelude.Read, Int -> DescribeAuditTask -> ShowS
[DescribeAuditTask] -> ShowS
DescribeAuditTask -> String
(Int -> DescribeAuditTask -> ShowS)
-> (DescribeAuditTask -> String)
-> ([DescribeAuditTask] -> ShowS)
-> Show DescribeAuditTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAuditTask] -> ShowS
$cshowList :: [DescribeAuditTask] -> ShowS
show :: DescribeAuditTask -> String
$cshow :: DescribeAuditTask -> String
showsPrec :: Int -> DescribeAuditTask -> ShowS
$cshowsPrec :: Int -> DescribeAuditTask -> ShowS
Prelude.Show, (forall x. DescribeAuditTask -> Rep DescribeAuditTask x)
-> (forall x. Rep DescribeAuditTask x -> DescribeAuditTask)
-> Generic DescribeAuditTask
forall x. Rep DescribeAuditTask x -> DescribeAuditTask
forall x. DescribeAuditTask -> Rep DescribeAuditTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAuditTask x -> DescribeAuditTask
$cfrom :: forall x. DescribeAuditTask -> Rep DescribeAuditTask x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAuditTask' 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:
--
-- 'taskId', 'describeAuditTask_taskId' - The ID of the audit whose information you want to get.
newDescribeAuditTask ::
  -- | 'taskId'
  Prelude.Text ->
  DescribeAuditTask
newDescribeAuditTask :: Text -> DescribeAuditTask
newDescribeAuditTask Text
pTaskId_ =
  DescribeAuditTask' :: Text -> DescribeAuditTask
DescribeAuditTask' {$sel:taskId:DescribeAuditTask' :: Text
taskId = Text
pTaskId_}

-- | The ID of the audit whose information you want to get.
describeAuditTask_taskId :: Lens.Lens' DescribeAuditTask Prelude.Text
describeAuditTask_taskId :: (Text -> f Text) -> DescribeAuditTask -> f DescribeAuditTask
describeAuditTask_taskId = (DescribeAuditTask -> Text)
-> (DescribeAuditTask -> Text -> DescribeAuditTask)
-> Lens DescribeAuditTask DescribeAuditTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditTask' {Text
taskId :: Text
$sel:taskId:DescribeAuditTask' :: DescribeAuditTask -> Text
taskId} -> Text
taskId) (\s :: DescribeAuditTask
s@DescribeAuditTask' {} Text
a -> DescribeAuditTask
s {$sel:taskId:DescribeAuditTask' :: Text
taskId = Text
a} :: DescribeAuditTask)

instance Core.AWSRequest DescribeAuditTask where
  type
    AWSResponse DescribeAuditTask =
      DescribeAuditTaskResponse
  request :: DescribeAuditTask -> Request DescribeAuditTask
request = Service -> DescribeAuditTask -> Request DescribeAuditTask
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeAuditTask
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAuditTask)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeAuditTask))
-> Logger
-> Service
-> Proxy DescribeAuditTask
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAuditTask)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (HashMap Text AuditCheckDetails)
-> Maybe AuditTaskType
-> Maybe POSIX
-> Maybe TaskStatistics
-> Maybe Text
-> Maybe AuditTaskStatus
-> Int
-> DescribeAuditTaskResponse
DescribeAuditTaskResponse'
            (Maybe (HashMap Text AuditCheckDetails)
 -> Maybe AuditTaskType
 -> Maybe POSIX
 -> Maybe TaskStatistics
 -> Maybe Text
 -> Maybe AuditTaskStatus
 -> Int
 -> DescribeAuditTaskResponse)
-> Either String (Maybe (HashMap Text AuditCheckDetails))
-> Either
     String
     (Maybe AuditTaskType
      -> Maybe POSIX
      -> Maybe TaskStatistics
      -> Maybe Text
      -> Maybe AuditTaskStatus
      -> Int
      -> DescribeAuditTaskResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either String (Maybe (Maybe (HashMap Text AuditCheckDetails)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"auditDetails" Either String (Maybe (Maybe (HashMap Text AuditCheckDetails)))
-> Maybe (HashMap Text AuditCheckDetails)
-> Either String (Maybe (HashMap Text AuditCheckDetails))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text AuditCheckDetails)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe AuditTaskType
   -> Maybe POSIX
   -> Maybe TaskStatistics
   -> Maybe Text
   -> Maybe AuditTaskStatus
   -> Int
   -> DescribeAuditTaskResponse)
-> Either String (Maybe AuditTaskType)
-> Either
     String
     (Maybe POSIX
      -> Maybe TaskStatistics
      -> Maybe Text
      -> Maybe AuditTaskStatus
      -> Int
      -> DescribeAuditTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AuditTaskType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"taskType")
            Either
  String
  (Maybe POSIX
   -> Maybe TaskStatistics
   -> Maybe Text
   -> Maybe AuditTaskStatus
   -> Int
   -> DescribeAuditTaskResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe TaskStatistics
      -> Maybe Text
      -> Maybe AuditTaskStatus
      -> Int
      -> DescribeAuditTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"taskStartTime")
            Either
  String
  (Maybe TaskStatistics
   -> Maybe Text
   -> Maybe AuditTaskStatus
   -> Int
   -> DescribeAuditTaskResponse)
-> Either String (Maybe TaskStatistics)
-> Either
     String
     (Maybe Text
      -> Maybe AuditTaskStatus -> Int -> DescribeAuditTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe TaskStatistics)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"taskStatistics")
            Either
  String
  (Maybe Text
   -> Maybe AuditTaskStatus -> Int -> DescribeAuditTaskResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe AuditTaskStatus -> Int -> DescribeAuditTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"scheduledAuditName")
            Either
  String (Maybe AuditTaskStatus -> Int -> DescribeAuditTaskResponse)
-> Either String (Maybe AuditTaskStatus)
-> Either String (Int -> DescribeAuditTaskResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AuditTaskStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"taskStatus")
            Either String (Int -> DescribeAuditTaskResponse)
-> Either String Int -> Either String DescribeAuditTaskResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeAuditTask

instance Prelude.NFData DescribeAuditTask

instance Core.ToHeaders DescribeAuditTask where
  toHeaders :: DescribeAuditTask -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeAuditTask -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DescribeAuditTask where
  toPath :: DescribeAuditTask -> ByteString
toPath DescribeAuditTask' {Text
taskId :: Text
$sel:taskId:DescribeAuditTask' :: DescribeAuditTask -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/audit/tasks/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
taskId]

instance Core.ToQuery DescribeAuditTask where
  toQuery :: DescribeAuditTask -> QueryString
toQuery = QueryString -> DescribeAuditTask -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeAuditTaskResponse' smart constructor.
data DescribeAuditTaskResponse = DescribeAuditTaskResponse'
  { -- | Detailed information about each check performed during this audit.
    DescribeAuditTaskResponse -> Maybe (HashMap Text AuditCheckDetails)
auditDetails :: Prelude.Maybe (Prelude.HashMap Prelude.Text AuditCheckDetails),
    -- | The type of audit: \"ON_DEMAND_AUDIT_TASK\" or \"SCHEDULED_AUDIT_TASK\".
    DescribeAuditTaskResponse -> Maybe AuditTaskType
taskType :: Prelude.Maybe AuditTaskType,
    -- | The time the audit started.
    DescribeAuditTaskResponse -> Maybe POSIX
taskStartTime :: Prelude.Maybe Core.POSIX,
    -- | Statistical information about the audit.
    DescribeAuditTaskResponse -> Maybe TaskStatistics
taskStatistics :: Prelude.Maybe TaskStatistics,
    -- | The name of the scheduled audit (only if the audit was a scheduled
    -- audit).
    DescribeAuditTaskResponse -> Maybe Text
scheduledAuditName :: Prelude.Maybe Prelude.Text,
    -- | The status of the audit: one of \"IN_PROGRESS\", \"COMPLETED\",
    -- \"FAILED\", or \"CANCELED\".
    DescribeAuditTaskResponse -> Maybe AuditTaskStatus
taskStatus :: Prelude.Maybe AuditTaskStatus,
    -- | The response's http status code.
    DescribeAuditTaskResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAuditTaskResponse -> DescribeAuditTaskResponse -> Bool
(DescribeAuditTaskResponse -> DescribeAuditTaskResponse -> Bool)
-> (DescribeAuditTaskResponse -> DescribeAuditTaskResponse -> Bool)
-> Eq DescribeAuditTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAuditTaskResponse -> DescribeAuditTaskResponse -> Bool
$c/= :: DescribeAuditTaskResponse -> DescribeAuditTaskResponse -> Bool
== :: DescribeAuditTaskResponse -> DescribeAuditTaskResponse -> Bool
$c== :: DescribeAuditTaskResponse -> DescribeAuditTaskResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAuditTaskResponse]
ReadPrec DescribeAuditTaskResponse
Int -> ReadS DescribeAuditTaskResponse
ReadS [DescribeAuditTaskResponse]
(Int -> ReadS DescribeAuditTaskResponse)
-> ReadS [DescribeAuditTaskResponse]
-> ReadPrec DescribeAuditTaskResponse
-> ReadPrec [DescribeAuditTaskResponse]
-> Read DescribeAuditTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAuditTaskResponse]
$creadListPrec :: ReadPrec [DescribeAuditTaskResponse]
readPrec :: ReadPrec DescribeAuditTaskResponse
$creadPrec :: ReadPrec DescribeAuditTaskResponse
readList :: ReadS [DescribeAuditTaskResponse]
$creadList :: ReadS [DescribeAuditTaskResponse]
readsPrec :: Int -> ReadS DescribeAuditTaskResponse
$creadsPrec :: Int -> ReadS DescribeAuditTaskResponse
Prelude.Read, Int -> DescribeAuditTaskResponse -> ShowS
[DescribeAuditTaskResponse] -> ShowS
DescribeAuditTaskResponse -> String
(Int -> DescribeAuditTaskResponse -> ShowS)
-> (DescribeAuditTaskResponse -> String)
-> ([DescribeAuditTaskResponse] -> ShowS)
-> Show DescribeAuditTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAuditTaskResponse] -> ShowS
$cshowList :: [DescribeAuditTaskResponse] -> ShowS
show :: DescribeAuditTaskResponse -> String
$cshow :: DescribeAuditTaskResponse -> String
showsPrec :: Int -> DescribeAuditTaskResponse -> ShowS
$cshowsPrec :: Int -> DescribeAuditTaskResponse -> ShowS
Prelude.Show, (forall x.
 DescribeAuditTaskResponse -> Rep DescribeAuditTaskResponse x)
-> (forall x.
    Rep DescribeAuditTaskResponse x -> DescribeAuditTaskResponse)
-> Generic DescribeAuditTaskResponse
forall x.
Rep DescribeAuditTaskResponse x -> DescribeAuditTaskResponse
forall x.
DescribeAuditTaskResponse -> Rep DescribeAuditTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAuditTaskResponse x -> DescribeAuditTaskResponse
$cfrom :: forall x.
DescribeAuditTaskResponse -> Rep DescribeAuditTaskResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAuditTaskResponse' 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:
--
-- 'auditDetails', 'describeAuditTaskResponse_auditDetails' - Detailed information about each check performed during this audit.
--
-- 'taskType', 'describeAuditTaskResponse_taskType' - The type of audit: \"ON_DEMAND_AUDIT_TASK\" or \"SCHEDULED_AUDIT_TASK\".
--
-- 'taskStartTime', 'describeAuditTaskResponse_taskStartTime' - The time the audit started.
--
-- 'taskStatistics', 'describeAuditTaskResponse_taskStatistics' - Statistical information about the audit.
--
-- 'scheduledAuditName', 'describeAuditTaskResponse_scheduledAuditName' - The name of the scheduled audit (only if the audit was a scheduled
-- audit).
--
-- 'taskStatus', 'describeAuditTaskResponse_taskStatus' - The status of the audit: one of \"IN_PROGRESS\", \"COMPLETED\",
-- \"FAILED\", or \"CANCELED\".
--
-- 'httpStatus', 'describeAuditTaskResponse_httpStatus' - The response's http status code.
newDescribeAuditTaskResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAuditTaskResponse
newDescribeAuditTaskResponse :: Int -> DescribeAuditTaskResponse
newDescribeAuditTaskResponse Int
pHttpStatus_ =
  DescribeAuditTaskResponse' :: Maybe (HashMap Text AuditCheckDetails)
-> Maybe AuditTaskType
-> Maybe POSIX
-> Maybe TaskStatistics
-> Maybe Text
-> Maybe AuditTaskStatus
-> Int
-> DescribeAuditTaskResponse
DescribeAuditTaskResponse'
    { $sel:auditDetails:DescribeAuditTaskResponse' :: Maybe (HashMap Text AuditCheckDetails)
auditDetails =
        Maybe (HashMap Text AuditCheckDetails)
forall a. Maybe a
Prelude.Nothing,
      $sel:taskType:DescribeAuditTaskResponse' :: Maybe AuditTaskType
taskType = Maybe AuditTaskType
forall a. Maybe a
Prelude.Nothing,
      $sel:taskStartTime:DescribeAuditTaskResponse' :: Maybe POSIX
taskStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:taskStatistics:DescribeAuditTaskResponse' :: Maybe TaskStatistics
taskStatistics = Maybe TaskStatistics
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduledAuditName:DescribeAuditTaskResponse' :: Maybe Text
scheduledAuditName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskStatus:DescribeAuditTaskResponse' :: Maybe AuditTaskStatus
taskStatus = Maybe AuditTaskStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAuditTaskResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Detailed information about each check performed during this audit.
describeAuditTaskResponse_auditDetails :: Lens.Lens' DescribeAuditTaskResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text AuditCheckDetails))
describeAuditTaskResponse_auditDetails :: (Maybe (HashMap Text AuditCheckDetails)
 -> f (Maybe (HashMap Text AuditCheckDetails)))
-> DescribeAuditTaskResponse -> f DescribeAuditTaskResponse
describeAuditTaskResponse_auditDetails = (DescribeAuditTaskResponse
 -> Maybe (HashMap Text AuditCheckDetails))
-> (DescribeAuditTaskResponse
    -> Maybe (HashMap Text AuditCheckDetails)
    -> DescribeAuditTaskResponse)
-> Lens
     DescribeAuditTaskResponse
     DescribeAuditTaskResponse
     (Maybe (HashMap Text AuditCheckDetails))
     (Maybe (HashMap Text AuditCheckDetails))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditTaskResponse' {Maybe (HashMap Text AuditCheckDetails)
auditDetails :: Maybe (HashMap Text AuditCheckDetails)
$sel:auditDetails:DescribeAuditTaskResponse' :: DescribeAuditTaskResponse -> Maybe (HashMap Text AuditCheckDetails)
auditDetails} -> Maybe (HashMap Text AuditCheckDetails)
auditDetails) (\s :: DescribeAuditTaskResponse
s@DescribeAuditTaskResponse' {} Maybe (HashMap Text AuditCheckDetails)
a -> DescribeAuditTaskResponse
s {$sel:auditDetails:DescribeAuditTaskResponse' :: Maybe (HashMap Text AuditCheckDetails)
auditDetails = Maybe (HashMap Text AuditCheckDetails)
a} :: DescribeAuditTaskResponse) ((Maybe (HashMap Text AuditCheckDetails)
  -> f (Maybe (HashMap Text AuditCheckDetails)))
 -> DescribeAuditTaskResponse -> f DescribeAuditTaskResponse)
-> ((Maybe (HashMap Text AuditCheckDetails)
     -> f (Maybe (HashMap Text AuditCheckDetails)))
    -> Maybe (HashMap Text AuditCheckDetails)
    -> f (Maybe (HashMap Text AuditCheckDetails)))
-> (Maybe (HashMap Text AuditCheckDetails)
    -> f (Maybe (HashMap Text AuditCheckDetails)))
-> DescribeAuditTaskResponse
-> f DescribeAuditTaskResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text AuditCheckDetails)
  (HashMap Text AuditCheckDetails)
  (HashMap Text AuditCheckDetails)
  (HashMap Text AuditCheckDetails)
-> Iso
     (Maybe (HashMap Text AuditCheckDetails))
     (Maybe (HashMap Text AuditCheckDetails))
     (Maybe (HashMap Text AuditCheckDetails))
     (Maybe (HashMap Text AuditCheckDetails))
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
  (HashMap Text AuditCheckDetails)
  (HashMap Text AuditCheckDetails)
  (HashMap Text AuditCheckDetails)
  (HashMap Text AuditCheckDetails)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of audit: \"ON_DEMAND_AUDIT_TASK\" or \"SCHEDULED_AUDIT_TASK\".
describeAuditTaskResponse_taskType :: Lens.Lens' DescribeAuditTaskResponse (Prelude.Maybe AuditTaskType)
describeAuditTaskResponse_taskType :: (Maybe AuditTaskType -> f (Maybe AuditTaskType))
-> DescribeAuditTaskResponse -> f DescribeAuditTaskResponse
describeAuditTaskResponse_taskType = (DescribeAuditTaskResponse -> Maybe AuditTaskType)
-> (DescribeAuditTaskResponse
    -> Maybe AuditTaskType -> DescribeAuditTaskResponse)
-> Lens
     DescribeAuditTaskResponse
     DescribeAuditTaskResponse
     (Maybe AuditTaskType)
     (Maybe AuditTaskType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditTaskResponse' {Maybe AuditTaskType
taskType :: Maybe AuditTaskType
$sel:taskType:DescribeAuditTaskResponse' :: DescribeAuditTaskResponse -> Maybe AuditTaskType
taskType} -> Maybe AuditTaskType
taskType) (\s :: DescribeAuditTaskResponse
s@DescribeAuditTaskResponse' {} Maybe AuditTaskType
a -> DescribeAuditTaskResponse
s {$sel:taskType:DescribeAuditTaskResponse' :: Maybe AuditTaskType
taskType = Maybe AuditTaskType
a} :: DescribeAuditTaskResponse)

-- | The time the audit started.
describeAuditTaskResponse_taskStartTime :: Lens.Lens' DescribeAuditTaskResponse (Prelude.Maybe Prelude.UTCTime)
describeAuditTaskResponse_taskStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAuditTaskResponse -> f DescribeAuditTaskResponse
describeAuditTaskResponse_taskStartTime = (DescribeAuditTaskResponse -> Maybe POSIX)
-> (DescribeAuditTaskResponse
    -> Maybe POSIX -> DescribeAuditTaskResponse)
-> Lens
     DescribeAuditTaskResponse
     DescribeAuditTaskResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditTaskResponse' {Maybe POSIX
taskStartTime :: Maybe POSIX
$sel:taskStartTime:DescribeAuditTaskResponse' :: DescribeAuditTaskResponse -> Maybe POSIX
taskStartTime} -> Maybe POSIX
taskStartTime) (\s :: DescribeAuditTaskResponse
s@DescribeAuditTaskResponse' {} Maybe POSIX
a -> DescribeAuditTaskResponse
s {$sel:taskStartTime:DescribeAuditTaskResponse' :: Maybe POSIX
taskStartTime = Maybe POSIX
a} :: DescribeAuditTaskResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeAuditTaskResponse -> f DescribeAuditTaskResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeAuditTaskResponse
-> f DescribeAuditTaskResponse
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

-- | Statistical information about the audit.
describeAuditTaskResponse_taskStatistics :: Lens.Lens' DescribeAuditTaskResponse (Prelude.Maybe TaskStatistics)
describeAuditTaskResponse_taskStatistics :: (Maybe TaskStatistics -> f (Maybe TaskStatistics))
-> DescribeAuditTaskResponse -> f DescribeAuditTaskResponse
describeAuditTaskResponse_taskStatistics = (DescribeAuditTaskResponse -> Maybe TaskStatistics)
-> (DescribeAuditTaskResponse
    -> Maybe TaskStatistics -> DescribeAuditTaskResponse)
-> Lens
     DescribeAuditTaskResponse
     DescribeAuditTaskResponse
     (Maybe TaskStatistics)
     (Maybe TaskStatistics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditTaskResponse' {Maybe TaskStatistics
taskStatistics :: Maybe TaskStatistics
$sel:taskStatistics:DescribeAuditTaskResponse' :: DescribeAuditTaskResponse -> Maybe TaskStatistics
taskStatistics} -> Maybe TaskStatistics
taskStatistics) (\s :: DescribeAuditTaskResponse
s@DescribeAuditTaskResponse' {} Maybe TaskStatistics
a -> DescribeAuditTaskResponse
s {$sel:taskStatistics:DescribeAuditTaskResponse' :: Maybe TaskStatistics
taskStatistics = Maybe TaskStatistics
a} :: DescribeAuditTaskResponse)

-- | The name of the scheduled audit (only if the audit was a scheduled
-- audit).
describeAuditTaskResponse_scheduledAuditName :: Lens.Lens' DescribeAuditTaskResponse (Prelude.Maybe Prelude.Text)
describeAuditTaskResponse_scheduledAuditName :: (Maybe Text -> f (Maybe Text))
-> DescribeAuditTaskResponse -> f DescribeAuditTaskResponse
describeAuditTaskResponse_scheduledAuditName = (DescribeAuditTaskResponse -> Maybe Text)
-> (DescribeAuditTaskResponse
    -> Maybe Text -> DescribeAuditTaskResponse)
-> Lens
     DescribeAuditTaskResponse
     DescribeAuditTaskResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditTaskResponse' {Maybe Text
scheduledAuditName :: Maybe Text
$sel:scheduledAuditName:DescribeAuditTaskResponse' :: DescribeAuditTaskResponse -> Maybe Text
scheduledAuditName} -> Maybe Text
scheduledAuditName) (\s :: DescribeAuditTaskResponse
s@DescribeAuditTaskResponse' {} Maybe Text
a -> DescribeAuditTaskResponse
s {$sel:scheduledAuditName:DescribeAuditTaskResponse' :: Maybe Text
scheduledAuditName = Maybe Text
a} :: DescribeAuditTaskResponse)

-- | The status of the audit: one of \"IN_PROGRESS\", \"COMPLETED\",
-- \"FAILED\", or \"CANCELED\".
describeAuditTaskResponse_taskStatus :: Lens.Lens' DescribeAuditTaskResponse (Prelude.Maybe AuditTaskStatus)
describeAuditTaskResponse_taskStatus :: (Maybe AuditTaskStatus -> f (Maybe AuditTaskStatus))
-> DescribeAuditTaskResponse -> f DescribeAuditTaskResponse
describeAuditTaskResponse_taskStatus = (DescribeAuditTaskResponse -> Maybe AuditTaskStatus)
-> (DescribeAuditTaskResponse
    -> Maybe AuditTaskStatus -> DescribeAuditTaskResponse)
-> Lens
     DescribeAuditTaskResponse
     DescribeAuditTaskResponse
     (Maybe AuditTaskStatus)
     (Maybe AuditTaskStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditTaskResponse' {Maybe AuditTaskStatus
taskStatus :: Maybe AuditTaskStatus
$sel:taskStatus:DescribeAuditTaskResponse' :: DescribeAuditTaskResponse -> Maybe AuditTaskStatus
taskStatus} -> Maybe AuditTaskStatus
taskStatus) (\s :: DescribeAuditTaskResponse
s@DescribeAuditTaskResponse' {} Maybe AuditTaskStatus
a -> DescribeAuditTaskResponse
s {$sel:taskStatus:DescribeAuditTaskResponse' :: Maybe AuditTaskStatus
taskStatus = Maybe AuditTaskStatus
a} :: DescribeAuditTaskResponse)

-- | The response's http status code.
describeAuditTaskResponse_httpStatus :: Lens.Lens' DescribeAuditTaskResponse Prelude.Int
describeAuditTaskResponse_httpStatus :: (Int -> f Int)
-> DescribeAuditTaskResponse -> f DescribeAuditTaskResponse
describeAuditTaskResponse_httpStatus = (DescribeAuditTaskResponse -> Int)
-> (DescribeAuditTaskResponse -> Int -> DescribeAuditTaskResponse)
-> Lens DescribeAuditTaskResponse DescribeAuditTaskResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAuditTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeAuditTaskResponse' :: DescribeAuditTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeAuditTaskResponse
s@DescribeAuditTaskResponse' {} Int
a -> DescribeAuditTaskResponse
s {$sel:httpStatus:DescribeAuditTaskResponse' :: Int
httpStatus = Int
a} :: DescribeAuditTaskResponse)

instance Prelude.NFData DescribeAuditTaskResponse