{-# 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.CloudTrail.GetTrailStatus
-- 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)
--
-- Returns a JSON-formatted list of information about the specified trail.
-- Fields include information on delivery errors, Amazon SNS and Amazon S3
-- errors, and start and stop logging times for each trail. This operation
-- returns trail status from a single region. To return trail status from
-- all regions, you must call the operation on each region.
module Amazonka.CloudTrail.GetTrailStatus
  ( -- * Creating a Request
    GetTrailStatus (..),
    newGetTrailStatus,

    -- * Request Lenses
    getTrailStatus_name,

    -- * Destructuring the Response
    GetTrailStatusResponse (..),
    newGetTrailStatusResponse,

    -- * Response Lenses
    getTrailStatusResponse_timeLoggingStopped,
    getTrailStatusResponse_latestDeliveryError,
    getTrailStatusResponse_latestDigestDeliveryTime,
    getTrailStatusResponse_latestNotificationAttemptSucceeded,
    getTrailStatusResponse_startLoggingTime,
    getTrailStatusResponse_latestNotificationError,
    getTrailStatusResponse_latestDeliveryAttemptSucceeded,
    getTrailStatusResponse_isLogging,
    getTrailStatusResponse_timeLoggingStarted,
    getTrailStatusResponse_latestDigestDeliveryError,
    getTrailStatusResponse_latestDeliveryAttemptTime,
    getTrailStatusResponse_latestDeliveryTime,
    getTrailStatusResponse_latestCloudWatchLogsDeliveryTime,
    getTrailStatusResponse_latestCloudWatchLogsDeliveryError,
    getTrailStatusResponse_latestNotificationTime,
    getTrailStatusResponse_latestNotificationAttemptTime,
    getTrailStatusResponse_stopLoggingTime,
    getTrailStatusResponse_httpStatus,
  )
where

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

-- | The name of a trail about which you want the current status.
--
-- /See:/ 'newGetTrailStatus' smart constructor.
data GetTrailStatus = GetTrailStatus'
  { -- | Specifies the name or the CloudTrail ARN of the trail for which you are
    -- requesting status. To get the status of a shadow trail (a replication of
    -- the trail in another region), you must specify its ARN. The following is
    -- the format of a trail ARN.
    --
    -- @arn:aws:cloudtrail:us-east-2:123456789012:trail\/MyTrail@
    GetTrailStatus -> Text
name :: Prelude.Text
  }
  deriving (GetTrailStatus -> GetTrailStatus -> Bool
(GetTrailStatus -> GetTrailStatus -> Bool)
-> (GetTrailStatus -> GetTrailStatus -> Bool) -> Eq GetTrailStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTrailStatus -> GetTrailStatus -> Bool
$c/= :: GetTrailStatus -> GetTrailStatus -> Bool
== :: GetTrailStatus -> GetTrailStatus -> Bool
$c== :: GetTrailStatus -> GetTrailStatus -> Bool
Prelude.Eq, ReadPrec [GetTrailStatus]
ReadPrec GetTrailStatus
Int -> ReadS GetTrailStatus
ReadS [GetTrailStatus]
(Int -> ReadS GetTrailStatus)
-> ReadS [GetTrailStatus]
-> ReadPrec GetTrailStatus
-> ReadPrec [GetTrailStatus]
-> Read GetTrailStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTrailStatus]
$creadListPrec :: ReadPrec [GetTrailStatus]
readPrec :: ReadPrec GetTrailStatus
$creadPrec :: ReadPrec GetTrailStatus
readList :: ReadS [GetTrailStatus]
$creadList :: ReadS [GetTrailStatus]
readsPrec :: Int -> ReadS GetTrailStatus
$creadsPrec :: Int -> ReadS GetTrailStatus
Prelude.Read, Int -> GetTrailStatus -> ShowS
[GetTrailStatus] -> ShowS
GetTrailStatus -> String
(Int -> GetTrailStatus -> ShowS)
-> (GetTrailStatus -> String)
-> ([GetTrailStatus] -> ShowS)
-> Show GetTrailStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTrailStatus] -> ShowS
$cshowList :: [GetTrailStatus] -> ShowS
show :: GetTrailStatus -> String
$cshow :: GetTrailStatus -> String
showsPrec :: Int -> GetTrailStatus -> ShowS
$cshowsPrec :: Int -> GetTrailStatus -> ShowS
Prelude.Show, (forall x. GetTrailStatus -> Rep GetTrailStatus x)
-> (forall x. Rep GetTrailStatus x -> GetTrailStatus)
-> Generic GetTrailStatus
forall x. Rep GetTrailStatus x -> GetTrailStatus
forall x. GetTrailStatus -> Rep GetTrailStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetTrailStatus x -> GetTrailStatus
$cfrom :: forall x. GetTrailStatus -> Rep GetTrailStatus x
Prelude.Generic)

-- |
-- Create a value of 'GetTrailStatus' 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:
--
-- 'name', 'getTrailStatus_name' - Specifies the name or the CloudTrail ARN of the trail for which you are
-- requesting status. To get the status of a shadow trail (a replication of
-- the trail in another region), you must specify its ARN. The following is
-- the format of a trail ARN.
--
-- @arn:aws:cloudtrail:us-east-2:123456789012:trail\/MyTrail@
newGetTrailStatus ::
  -- | 'name'
  Prelude.Text ->
  GetTrailStatus
newGetTrailStatus :: Text -> GetTrailStatus
newGetTrailStatus Text
pName_ =
  GetTrailStatus' :: Text -> GetTrailStatus
GetTrailStatus' {$sel:name:GetTrailStatus' :: Text
name = Text
pName_}

-- | Specifies the name or the CloudTrail ARN of the trail for which you are
-- requesting status. To get the status of a shadow trail (a replication of
-- the trail in another region), you must specify its ARN. The following is
-- the format of a trail ARN.
--
-- @arn:aws:cloudtrail:us-east-2:123456789012:trail\/MyTrail@
getTrailStatus_name :: Lens.Lens' GetTrailStatus Prelude.Text
getTrailStatus_name :: (Text -> f Text) -> GetTrailStatus -> f GetTrailStatus
getTrailStatus_name = (GetTrailStatus -> Text)
-> (GetTrailStatus -> Text -> GetTrailStatus)
-> Lens GetTrailStatus GetTrailStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatus' {Text
name :: Text
$sel:name:GetTrailStatus' :: GetTrailStatus -> Text
name} -> Text
name) (\s :: GetTrailStatus
s@GetTrailStatus' {} Text
a -> GetTrailStatus
s {$sel:name:GetTrailStatus' :: Text
name = Text
a} :: GetTrailStatus)

instance Core.AWSRequest GetTrailStatus where
  type
    AWSResponse GetTrailStatus =
      GetTrailStatusResponse
  request :: GetTrailStatus -> Request GetTrailStatus
request = Service -> GetTrailStatus -> Request GetTrailStatus
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetTrailStatus
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetTrailStatus)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetTrailStatus))
-> Logger
-> Service
-> Proxy GetTrailStatus
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetTrailStatus)))
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 Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Int
-> GetTrailStatusResponse
GetTrailStatusResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Int
 -> GetTrailStatusResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
forall (f :: * -> *) a b. Functor 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
"TimeLoggingStopped")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
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
"LatestDeliveryError")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
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
"LatestDigestDeliveryTime")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
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
"LatestNotificationAttemptSucceeded")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
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
"StartLoggingTime")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
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
"LatestNotificationError")
            Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
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
"LatestDeliveryAttemptSucceeded")
            Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"IsLogging")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
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
"TimeLoggingStarted")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
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
"LatestDigestDeliveryError")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
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
"LatestDeliveryAttemptTime")
            Either
  String
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
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
"LatestDeliveryTime")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Int
      -> GetTrailStatusResponse)
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
"LatestCloudWatchLogsDeliveryTime")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Int
   -> GetTrailStatusResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text -> Maybe POSIX -> Int -> GetTrailStatusResponse)
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
"LatestCloudWatchLogsDeliveryError")
            Either
  String
  (Maybe POSIX
   -> Maybe Text -> Maybe POSIX -> Int -> GetTrailStatusResponse)
-> Either String (Maybe POSIX)
-> Either
     String (Maybe Text -> Maybe POSIX -> Int -> GetTrailStatusResponse)
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
"LatestNotificationTime")
            Either
  String (Maybe Text -> Maybe POSIX -> Int -> GetTrailStatusResponse)
-> Either String (Maybe Text)
-> Either String (Maybe POSIX -> Int -> GetTrailStatusResponse)
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
"LatestNotificationAttemptTime")
            Either String (Maybe POSIX -> Int -> GetTrailStatusResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> GetTrailStatusResponse)
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
"StopLoggingTime")
            Either String (Int -> GetTrailStatusResponse)
-> Either String Int -> Either String GetTrailStatusResponse
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 GetTrailStatus

instance Prelude.NFData GetTrailStatus

instance Core.ToHeaders GetTrailStatus where
  toHeaders :: GetTrailStatus -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetTrailStatus -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.GetTrailStatus" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetTrailStatus where
  toJSON :: GetTrailStatus -> Value
toJSON GetTrailStatus' {Text
name :: Text
$sel:name:GetTrailStatus' :: GetTrailStatus -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
      )

instance Core.ToPath GetTrailStatus where
  toPath :: GetTrailStatus -> ByteString
toPath = ByteString -> GetTrailStatus -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | Returns the objects or data listed below if successful. Otherwise,
-- returns an error.
--
-- /See:/ 'newGetTrailStatusResponse' smart constructor.
data GetTrailStatusResponse = GetTrailStatusResponse'
  { -- | This field is no longer in use.
    GetTrailStatusResponse -> Maybe Text
timeLoggingStopped :: Prelude.Maybe Prelude.Text,
    -- | Displays any Amazon S3 error that CloudTrail encountered when attempting
    -- to deliver log files to the designated bucket. For more information, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html Error Responses>
    -- in the Amazon S3 API Reference.
    --
    -- This error occurs only when there is a problem with the destination S3
    -- bucket, and does not occur for requests that time out. To resolve the
    -- issue, create a new bucket, and then call @UpdateTrail@ to specify the
    -- new bucket; or fix the existing objects so that CloudTrail can again
    -- write to the bucket.
    GetTrailStatusResponse -> Maybe Text
latestDeliveryError :: Prelude.Maybe Prelude.Text,
    -- | Specifies the date and time that CloudTrail last delivered a digest file
    -- to an account\'s Amazon S3 bucket.
    GetTrailStatusResponse -> Maybe POSIX
latestDigestDeliveryTime :: Prelude.Maybe Core.POSIX,
    -- | This field is no longer in use.
    GetTrailStatusResponse -> Maybe Text
latestNotificationAttemptSucceeded :: Prelude.Maybe Prelude.Text,
    -- | Specifies the most recent date and time when CloudTrail started
    -- recording API calls for an Amazon Web Services account.
    GetTrailStatusResponse -> Maybe POSIX
startLoggingTime :: Prelude.Maybe Core.POSIX,
    -- | Displays any Amazon SNS error that CloudTrail encountered when
    -- attempting to send a notification. For more information about Amazon SNS
    -- errors, see the
    -- <https://docs.aws.amazon.com/sns/latest/dg/welcome.html Amazon SNS Developer Guide>.
    GetTrailStatusResponse -> Maybe Text
latestNotificationError :: Prelude.Maybe Prelude.Text,
    -- | This field is no longer in use.
    GetTrailStatusResponse -> Maybe Text
latestDeliveryAttemptSucceeded :: Prelude.Maybe Prelude.Text,
    -- | Whether the CloudTrail trail is currently logging Amazon Web Services
    -- API calls.
    GetTrailStatusResponse -> Maybe Bool
isLogging :: Prelude.Maybe Prelude.Bool,
    -- | This field is no longer in use.
    GetTrailStatusResponse -> Maybe Text
timeLoggingStarted :: Prelude.Maybe Prelude.Text,
    -- | Displays any Amazon S3 error that CloudTrail encountered when attempting
    -- to deliver a digest file to the designated bucket. For more information,
    -- see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html Error Responses>
    -- in the Amazon S3 API Reference.
    --
    -- This error occurs only when there is a problem with the destination S3
    -- bucket, and does not occur for requests that time out. To resolve the
    -- issue, create a new bucket, and then call @UpdateTrail@ to specify the
    -- new bucket; or fix the existing objects so that CloudTrail can again
    -- write to the bucket.
    GetTrailStatusResponse -> Maybe Text
latestDigestDeliveryError :: Prelude.Maybe Prelude.Text,
    -- | This field is no longer in use.
    GetTrailStatusResponse -> Maybe Text
latestDeliveryAttemptTime :: Prelude.Maybe Prelude.Text,
    -- | Specifies the date and time that CloudTrail last delivered log files to
    -- an account\'s Amazon S3 bucket.
    GetTrailStatusResponse -> Maybe POSIX
latestDeliveryTime :: Prelude.Maybe Core.POSIX,
    -- | Displays the most recent date and time when CloudTrail delivered logs to
    -- CloudWatch Logs.
    GetTrailStatusResponse -> Maybe POSIX
latestCloudWatchLogsDeliveryTime :: Prelude.Maybe Core.POSIX,
    -- | Displays any CloudWatch Logs error that CloudTrail encountered when
    -- attempting to deliver logs to CloudWatch Logs.
    GetTrailStatusResponse -> Maybe Text
latestCloudWatchLogsDeliveryError :: Prelude.Maybe Prelude.Text,
    -- | Specifies the date and time of the most recent Amazon SNS notification
    -- that CloudTrail has written a new log file to an account\'s Amazon S3
    -- bucket.
    GetTrailStatusResponse -> Maybe POSIX
latestNotificationTime :: Prelude.Maybe Core.POSIX,
    -- | This field is no longer in use.
    GetTrailStatusResponse -> Maybe Text
latestNotificationAttemptTime :: Prelude.Maybe Prelude.Text,
    -- | Specifies the most recent date and time when CloudTrail stopped
    -- recording API calls for an Amazon Web Services account.
    GetTrailStatusResponse -> Maybe POSIX
stopLoggingTime :: Prelude.Maybe Core.POSIX,
    -- | The response's http status code.
    GetTrailStatusResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetTrailStatusResponse -> GetTrailStatusResponse -> Bool
(GetTrailStatusResponse -> GetTrailStatusResponse -> Bool)
-> (GetTrailStatusResponse -> GetTrailStatusResponse -> Bool)
-> Eq GetTrailStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTrailStatusResponse -> GetTrailStatusResponse -> Bool
$c/= :: GetTrailStatusResponse -> GetTrailStatusResponse -> Bool
== :: GetTrailStatusResponse -> GetTrailStatusResponse -> Bool
$c== :: GetTrailStatusResponse -> GetTrailStatusResponse -> Bool
Prelude.Eq, ReadPrec [GetTrailStatusResponse]
ReadPrec GetTrailStatusResponse
Int -> ReadS GetTrailStatusResponse
ReadS [GetTrailStatusResponse]
(Int -> ReadS GetTrailStatusResponse)
-> ReadS [GetTrailStatusResponse]
-> ReadPrec GetTrailStatusResponse
-> ReadPrec [GetTrailStatusResponse]
-> Read GetTrailStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTrailStatusResponse]
$creadListPrec :: ReadPrec [GetTrailStatusResponse]
readPrec :: ReadPrec GetTrailStatusResponse
$creadPrec :: ReadPrec GetTrailStatusResponse
readList :: ReadS [GetTrailStatusResponse]
$creadList :: ReadS [GetTrailStatusResponse]
readsPrec :: Int -> ReadS GetTrailStatusResponse
$creadsPrec :: Int -> ReadS GetTrailStatusResponse
Prelude.Read, Int -> GetTrailStatusResponse -> ShowS
[GetTrailStatusResponse] -> ShowS
GetTrailStatusResponse -> String
(Int -> GetTrailStatusResponse -> ShowS)
-> (GetTrailStatusResponse -> String)
-> ([GetTrailStatusResponse] -> ShowS)
-> Show GetTrailStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTrailStatusResponse] -> ShowS
$cshowList :: [GetTrailStatusResponse] -> ShowS
show :: GetTrailStatusResponse -> String
$cshow :: GetTrailStatusResponse -> String
showsPrec :: Int -> GetTrailStatusResponse -> ShowS
$cshowsPrec :: Int -> GetTrailStatusResponse -> ShowS
Prelude.Show, (forall x. GetTrailStatusResponse -> Rep GetTrailStatusResponse x)
-> (forall x.
    Rep GetTrailStatusResponse x -> GetTrailStatusResponse)
-> Generic GetTrailStatusResponse
forall x. Rep GetTrailStatusResponse x -> GetTrailStatusResponse
forall x. GetTrailStatusResponse -> Rep GetTrailStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetTrailStatusResponse x -> GetTrailStatusResponse
$cfrom :: forall x. GetTrailStatusResponse -> Rep GetTrailStatusResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetTrailStatusResponse' 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:
--
-- 'timeLoggingStopped', 'getTrailStatusResponse_timeLoggingStopped' - This field is no longer in use.
--
-- 'latestDeliveryError', 'getTrailStatusResponse_latestDeliveryError' - Displays any Amazon S3 error that CloudTrail encountered when attempting
-- to deliver log files to the designated bucket. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html Error Responses>
-- in the Amazon S3 API Reference.
--
-- This error occurs only when there is a problem with the destination S3
-- bucket, and does not occur for requests that time out. To resolve the
-- issue, create a new bucket, and then call @UpdateTrail@ to specify the
-- new bucket; or fix the existing objects so that CloudTrail can again
-- write to the bucket.
--
-- 'latestDigestDeliveryTime', 'getTrailStatusResponse_latestDigestDeliveryTime' - Specifies the date and time that CloudTrail last delivered a digest file
-- to an account\'s Amazon S3 bucket.
--
-- 'latestNotificationAttemptSucceeded', 'getTrailStatusResponse_latestNotificationAttemptSucceeded' - This field is no longer in use.
--
-- 'startLoggingTime', 'getTrailStatusResponse_startLoggingTime' - Specifies the most recent date and time when CloudTrail started
-- recording API calls for an Amazon Web Services account.
--
-- 'latestNotificationError', 'getTrailStatusResponse_latestNotificationError' - Displays any Amazon SNS error that CloudTrail encountered when
-- attempting to send a notification. For more information about Amazon SNS
-- errors, see the
-- <https://docs.aws.amazon.com/sns/latest/dg/welcome.html Amazon SNS Developer Guide>.
--
-- 'latestDeliveryAttemptSucceeded', 'getTrailStatusResponse_latestDeliveryAttemptSucceeded' - This field is no longer in use.
--
-- 'isLogging', 'getTrailStatusResponse_isLogging' - Whether the CloudTrail trail is currently logging Amazon Web Services
-- API calls.
--
-- 'timeLoggingStarted', 'getTrailStatusResponse_timeLoggingStarted' - This field is no longer in use.
--
-- 'latestDigestDeliveryError', 'getTrailStatusResponse_latestDigestDeliveryError' - Displays any Amazon S3 error that CloudTrail encountered when attempting
-- to deliver a digest file to the designated bucket. For more information,
-- see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html Error Responses>
-- in the Amazon S3 API Reference.
--
-- This error occurs only when there is a problem with the destination S3
-- bucket, and does not occur for requests that time out. To resolve the
-- issue, create a new bucket, and then call @UpdateTrail@ to specify the
-- new bucket; or fix the existing objects so that CloudTrail can again
-- write to the bucket.
--
-- 'latestDeliveryAttemptTime', 'getTrailStatusResponse_latestDeliveryAttemptTime' - This field is no longer in use.
--
-- 'latestDeliveryTime', 'getTrailStatusResponse_latestDeliveryTime' - Specifies the date and time that CloudTrail last delivered log files to
-- an account\'s Amazon S3 bucket.
--
-- 'latestCloudWatchLogsDeliveryTime', 'getTrailStatusResponse_latestCloudWatchLogsDeliveryTime' - Displays the most recent date and time when CloudTrail delivered logs to
-- CloudWatch Logs.
--
-- 'latestCloudWatchLogsDeliveryError', 'getTrailStatusResponse_latestCloudWatchLogsDeliveryError' - Displays any CloudWatch Logs error that CloudTrail encountered when
-- attempting to deliver logs to CloudWatch Logs.
--
-- 'latestNotificationTime', 'getTrailStatusResponse_latestNotificationTime' - Specifies the date and time of the most recent Amazon SNS notification
-- that CloudTrail has written a new log file to an account\'s Amazon S3
-- bucket.
--
-- 'latestNotificationAttemptTime', 'getTrailStatusResponse_latestNotificationAttemptTime' - This field is no longer in use.
--
-- 'stopLoggingTime', 'getTrailStatusResponse_stopLoggingTime' - Specifies the most recent date and time when CloudTrail stopped
-- recording API calls for an Amazon Web Services account.
--
-- 'httpStatus', 'getTrailStatusResponse_httpStatus' - The response's http status code.
newGetTrailStatusResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetTrailStatusResponse
newGetTrailStatusResponse :: Int -> GetTrailStatusResponse
newGetTrailStatusResponse Int
pHttpStatus_ =
  GetTrailStatusResponse' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Int
-> GetTrailStatusResponse
GetTrailStatusResponse'
    { $sel:timeLoggingStopped:GetTrailStatusResponse' :: Maybe Text
timeLoggingStopped =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestDeliveryError:GetTrailStatusResponse' :: Maybe Text
latestDeliveryError = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestDigestDeliveryTime:GetTrailStatusResponse' :: Maybe POSIX
latestDigestDeliveryTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:latestNotificationAttemptSucceeded:GetTrailStatusResponse' :: Maybe Text
latestNotificationAttemptSucceeded =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startLoggingTime:GetTrailStatusResponse' :: Maybe POSIX
startLoggingTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:latestNotificationError:GetTrailStatusResponse' :: Maybe Text
latestNotificationError = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestDeliveryAttemptSucceeded:GetTrailStatusResponse' :: Maybe Text
latestDeliveryAttemptSucceeded = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isLogging:GetTrailStatusResponse' :: Maybe Bool
isLogging = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:timeLoggingStarted:GetTrailStatusResponse' :: Maybe Text
timeLoggingStarted = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestDigestDeliveryError:GetTrailStatusResponse' :: Maybe Text
latestDigestDeliveryError = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestDeliveryAttemptTime:GetTrailStatusResponse' :: Maybe Text
latestDeliveryAttemptTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestDeliveryTime:GetTrailStatusResponse' :: Maybe POSIX
latestDeliveryTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:latestCloudWatchLogsDeliveryTime:GetTrailStatusResponse' :: Maybe POSIX
latestCloudWatchLogsDeliveryTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:latestCloudWatchLogsDeliveryError:GetTrailStatusResponse' :: Maybe Text
latestCloudWatchLogsDeliveryError = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestNotificationTime:GetTrailStatusResponse' :: Maybe POSIX
latestNotificationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:latestNotificationAttemptTime:GetTrailStatusResponse' :: Maybe Text
latestNotificationAttemptTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stopLoggingTime:GetTrailStatusResponse' :: Maybe POSIX
stopLoggingTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetTrailStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | This field is no longer in use.
getTrailStatusResponse_timeLoggingStopped :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.Text)
getTrailStatusResponse_timeLoggingStopped :: (Maybe Text -> f (Maybe Text))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_timeLoggingStopped = (GetTrailStatusResponse -> Maybe Text)
-> (GetTrailStatusResponse -> Maybe Text -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe Text
timeLoggingStopped :: Maybe Text
$sel:timeLoggingStopped:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe Text
timeLoggingStopped} -> Maybe Text
timeLoggingStopped) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe Text
a -> GetTrailStatusResponse
s {$sel:timeLoggingStopped:GetTrailStatusResponse' :: Maybe Text
timeLoggingStopped = Maybe Text
a} :: GetTrailStatusResponse)

-- | Displays any Amazon S3 error that CloudTrail encountered when attempting
-- to deliver log files to the designated bucket. For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html Error Responses>
-- in the Amazon S3 API Reference.
--
-- This error occurs only when there is a problem with the destination S3
-- bucket, and does not occur for requests that time out. To resolve the
-- issue, create a new bucket, and then call @UpdateTrail@ to specify the
-- new bucket; or fix the existing objects so that CloudTrail can again
-- write to the bucket.
getTrailStatusResponse_latestDeliveryError :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.Text)
getTrailStatusResponse_latestDeliveryError :: (Maybe Text -> f (Maybe Text))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_latestDeliveryError = (GetTrailStatusResponse -> Maybe Text)
-> (GetTrailStatusResponse -> Maybe Text -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe Text
latestDeliveryError :: Maybe Text
$sel:latestDeliveryError:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe Text
latestDeliveryError} -> Maybe Text
latestDeliveryError) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe Text
a -> GetTrailStatusResponse
s {$sel:latestDeliveryError:GetTrailStatusResponse' :: Maybe Text
latestDeliveryError = Maybe Text
a} :: GetTrailStatusResponse)

-- | Specifies the date and time that CloudTrail last delivered a digest file
-- to an account\'s Amazon S3 bucket.
getTrailStatusResponse_latestDigestDeliveryTime :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.UTCTime)
getTrailStatusResponse_latestDigestDeliveryTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_latestDigestDeliveryTime = (GetTrailStatusResponse -> Maybe POSIX)
-> (GetTrailStatusResponse
    -> Maybe POSIX -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe POSIX
latestDigestDeliveryTime :: Maybe POSIX
$sel:latestDigestDeliveryTime:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe POSIX
latestDigestDeliveryTime} -> Maybe POSIX
latestDigestDeliveryTime) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe POSIX
a -> GetTrailStatusResponse
s {$sel:latestDigestDeliveryTime:GetTrailStatusResponse' :: Maybe POSIX
latestDigestDeliveryTime = Maybe POSIX
a} :: GetTrailStatusResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetTrailStatusResponse -> f GetTrailStatusResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetTrailStatusResponse
-> f GetTrailStatusResponse
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

-- | This field is no longer in use.
getTrailStatusResponse_latestNotificationAttemptSucceeded :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.Text)
getTrailStatusResponse_latestNotificationAttemptSucceeded :: (Maybe Text -> f (Maybe Text))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_latestNotificationAttemptSucceeded = (GetTrailStatusResponse -> Maybe Text)
-> (GetTrailStatusResponse -> Maybe Text -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe Text
latestNotificationAttemptSucceeded :: Maybe Text
$sel:latestNotificationAttemptSucceeded:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe Text
latestNotificationAttemptSucceeded} -> Maybe Text
latestNotificationAttemptSucceeded) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe Text
a -> GetTrailStatusResponse
s {$sel:latestNotificationAttemptSucceeded:GetTrailStatusResponse' :: Maybe Text
latestNotificationAttemptSucceeded = Maybe Text
a} :: GetTrailStatusResponse)

-- | Specifies the most recent date and time when CloudTrail started
-- recording API calls for an Amazon Web Services account.
getTrailStatusResponse_startLoggingTime :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.UTCTime)
getTrailStatusResponse_startLoggingTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_startLoggingTime = (GetTrailStatusResponse -> Maybe POSIX)
-> (GetTrailStatusResponse
    -> Maybe POSIX -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe POSIX
startLoggingTime :: Maybe POSIX
$sel:startLoggingTime:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe POSIX
startLoggingTime} -> Maybe POSIX
startLoggingTime) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe POSIX
a -> GetTrailStatusResponse
s {$sel:startLoggingTime:GetTrailStatusResponse' :: Maybe POSIX
startLoggingTime = Maybe POSIX
a} :: GetTrailStatusResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetTrailStatusResponse -> f GetTrailStatusResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetTrailStatusResponse
-> f GetTrailStatusResponse
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

-- | Displays any Amazon SNS error that CloudTrail encountered when
-- attempting to send a notification. For more information about Amazon SNS
-- errors, see the
-- <https://docs.aws.amazon.com/sns/latest/dg/welcome.html Amazon SNS Developer Guide>.
getTrailStatusResponse_latestNotificationError :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.Text)
getTrailStatusResponse_latestNotificationError :: (Maybe Text -> f (Maybe Text))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_latestNotificationError = (GetTrailStatusResponse -> Maybe Text)
-> (GetTrailStatusResponse -> Maybe Text -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe Text
latestNotificationError :: Maybe Text
$sel:latestNotificationError:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe Text
latestNotificationError} -> Maybe Text
latestNotificationError) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe Text
a -> GetTrailStatusResponse
s {$sel:latestNotificationError:GetTrailStatusResponse' :: Maybe Text
latestNotificationError = Maybe Text
a} :: GetTrailStatusResponse)

-- | This field is no longer in use.
getTrailStatusResponse_latestDeliveryAttemptSucceeded :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.Text)
getTrailStatusResponse_latestDeliveryAttemptSucceeded :: (Maybe Text -> f (Maybe Text))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_latestDeliveryAttemptSucceeded = (GetTrailStatusResponse -> Maybe Text)
-> (GetTrailStatusResponse -> Maybe Text -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe Text
latestDeliveryAttemptSucceeded :: Maybe Text
$sel:latestDeliveryAttemptSucceeded:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe Text
latestDeliveryAttemptSucceeded} -> Maybe Text
latestDeliveryAttemptSucceeded) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe Text
a -> GetTrailStatusResponse
s {$sel:latestDeliveryAttemptSucceeded:GetTrailStatusResponse' :: Maybe Text
latestDeliveryAttemptSucceeded = Maybe Text
a} :: GetTrailStatusResponse)

-- | Whether the CloudTrail trail is currently logging Amazon Web Services
-- API calls.
getTrailStatusResponse_isLogging :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.Bool)
getTrailStatusResponse_isLogging :: (Maybe Bool -> f (Maybe Bool))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_isLogging = (GetTrailStatusResponse -> Maybe Bool)
-> (GetTrailStatusResponse -> Maybe Bool -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe Bool
isLogging :: Maybe Bool
$sel:isLogging:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe Bool
isLogging} -> Maybe Bool
isLogging) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe Bool
a -> GetTrailStatusResponse
s {$sel:isLogging:GetTrailStatusResponse' :: Maybe Bool
isLogging = Maybe Bool
a} :: GetTrailStatusResponse)

-- | This field is no longer in use.
getTrailStatusResponse_timeLoggingStarted :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.Text)
getTrailStatusResponse_timeLoggingStarted :: (Maybe Text -> f (Maybe Text))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_timeLoggingStarted = (GetTrailStatusResponse -> Maybe Text)
-> (GetTrailStatusResponse -> Maybe Text -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe Text
timeLoggingStarted :: Maybe Text
$sel:timeLoggingStarted:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe Text
timeLoggingStarted} -> Maybe Text
timeLoggingStarted) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe Text
a -> GetTrailStatusResponse
s {$sel:timeLoggingStarted:GetTrailStatusResponse' :: Maybe Text
timeLoggingStarted = Maybe Text
a} :: GetTrailStatusResponse)

-- | Displays any Amazon S3 error that CloudTrail encountered when attempting
-- to deliver a digest file to the designated bucket. For more information,
-- see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html Error Responses>
-- in the Amazon S3 API Reference.
--
-- This error occurs only when there is a problem with the destination S3
-- bucket, and does not occur for requests that time out. To resolve the
-- issue, create a new bucket, and then call @UpdateTrail@ to specify the
-- new bucket; or fix the existing objects so that CloudTrail can again
-- write to the bucket.
getTrailStatusResponse_latestDigestDeliveryError :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.Text)
getTrailStatusResponse_latestDigestDeliveryError :: (Maybe Text -> f (Maybe Text))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_latestDigestDeliveryError = (GetTrailStatusResponse -> Maybe Text)
-> (GetTrailStatusResponse -> Maybe Text -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe Text
latestDigestDeliveryError :: Maybe Text
$sel:latestDigestDeliveryError:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe Text
latestDigestDeliveryError} -> Maybe Text
latestDigestDeliveryError) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe Text
a -> GetTrailStatusResponse
s {$sel:latestDigestDeliveryError:GetTrailStatusResponse' :: Maybe Text
latestDigestDeliveryError = Maybe Text
a} :: GetTrailStatusResponse)

-- | This field is no longer in use.
getTrailStatusResponse_latestDeliveryAttemptTime :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.Text)
getTrailStatusResponse_latestDeliveryAttemptTime :: (Maybe Text -> f (Maybe Text))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_latestDeliveryAttemptTime = (GetTrailStatusResponse -> Maybe Text)
-> (GetTrailStatusResponse -> Maybe Text -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe Text
latestDeliveryAttemptTime :: Maybe Text
$sel:latestDeliveryAttemptTime:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe Text
latestDeliveryAttemptTime} -> Maybe Text
latestDeliveryAttemptTime) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe Text
a -> GetTrailStatusResponse
s {$sel:latestDeliveryAttemptTime:GetTrailStatusResponse' :: Maybe Text
latestDeliveryAttemptTime = Maybe Text
a} :: GetTrailStatusResponse)

-- | Specifies the date and time that CloudTrail last delivered log files to
-- an account\'s Amazon S3 bucket.
getTrailStatusResponse_latestDeliveryTime :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.UTCTime)
getTrailStatusResponse_latestDeliveryTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_latestDeliveryTime = (GetTrailStatusResponse -> Maybe POSIX)
-> (GetTrailStatusResponse
    -> Maybe POSIX -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe POSIX
latestDeliveryTime :: Maybe POSIX
$sel:latestDeliveryTime:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe POSIX
latestDeliveryTime} -> Maybe POSIX
latestDeliveryTime) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe POSIX
a -> GetTrailStatusResponse
s {$sel:latestDeliveryTime:GetTrailStatusResponse' :: Maybe POSIX
latestDeliveryTime = Maybe POSIX
a} :: GetTrailStatusResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetTrailStatusResponse -> f GetTrailStatusResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetTrailStatusResponse
-> f GetTrailStatusResponse
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

-- | Displays the most recent date and time when CloudTrail delivered logs to
-- CloudWatch Logs.
getTrailStatusResponse_latestCloudWatchLogsDeliveryTime :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.UTCTime)
getTrailStatusResponse_latestCloudWatchLogsDeliveryTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_latestCloudWatchLogsDeliveryTime = (GetTrailStatusResponse -> Maybe POSIX)
-> (GetTrailStatusResponse
    -> Maybe POSIX -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe POSIX
latestCloudWatchLogsDeliveryTime :: Maybe POSIX
$sel:latestCloudWatchLogsDeliveryTime:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe POSIX
latestCloudWatchLogsDeliveryTime} -> Maybe POSIX
latestCloudWatchLogsDeliveryTime) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe POSIX
a -> GetTrailStatusResponse
s {$sel:latestCloudWatchLogsDeliveryTime:GetTrailStatusResponse' :: Maybe POSIX
latestCloudWatchLogsDeliveryTime = Maybe POSIX
a} :: GetTrailStatusResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetTrailStatusResponse -> f GetTrailStatusResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetTrailStatusResponse
-> f GetTrailStatusResponse
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

-- | Displays any CloudWatch Logs error that CloudTrail encountered when
-- attempting to deliver logs to CloudWatch Logs.
getTrailStatusResponse_latestCloudWatchLogsDeliveryError :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.Text)
getTrailStatusResponse_latestCloudWatchLogsDeliveryError :: (Maybe Text -> f (Maybe Text))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_latestCloudWatchLogsDeliveryError = (GetTrailStatusResponse -> Maybe Text)
-> (GetTrailStatusResponse -> Maybe Text -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe Text
latestCloudWatchLogsDeliveryError :: Maybe Text
$sel:latestCloudWatchLogsDeliveryError:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe Text
latestCloudWatchLogsDeliveryError} -> Maybe Text
latestCloudWatchLogsDeliveryError) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe Text
a -> GetTrailStatusResponse
s {$sel:latestCloudWatchLogsDeliveryError:GetTrailStatusResponse' :: Maybe Text
latestCloudWatchLogsDeliveryError = Maybe Text
a} :: GetTrailStatusResponse)

-- | Specifies the date and time of the most recent Amazon SNS notification
-- that CloudTrail has written a new log file to an account\'s Amazon S3
-- bucket.
getTrailStatusResponse_latestNotificationTime :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.UTCTime)
getTrailStatusResponse_latestNotificationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_latestNotificationTime = (GetTrailStatusResponse -> Maybe POSIX)
-> (GetTrailStatusResponse
    -> Maybe POSIX -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe POSIX
latestNotificationTime :: Maybe POSIX
$sel:latestNotificationTime:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe POSIX
latestNotificationTime} -> Maybe POSIX
latestNotificationTime) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe POSIX
a -> GetTrailStatusResponse
s {$sel:latestNotificationTime:GetTrailStatusResponse' :: Maybe POSIX
latestNotificationTime = Maybe POSIX
a} :: GetTrailStatusResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetTrailStatusResponse -> f GetTrailStatusResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetTrailStatusResponse
-> f GetTrailStatusResponse
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

-- | This field is no longer in use.
getTrailStatusResponse_latestNotificationAttemptTime :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.Text)
getTrailStatusResponse_latestNotificationAttemptTime :: (Maybe Text -> f (Maybe Text))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_latestNotificationAttemptTime = (GetTrailStatusResponse -> Maybe Text)
-> (GetTrailStatusResponse -> Maybe Text -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe Text
latestNotificationAttemptTime :: Maybe Text
$sel:latestNotificationAttemptTime:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe Text
latestNotificationAttemptTime} -> Maybe Text
latestNotificationAttemptTime) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe Text
a -> GetTrailStatusResponse
s {$sel:latestNotificationAttemptTime:GetTrailStatusResponse' :: Maybe Text
latestNotificationAttemptTime = Maybe Text
a} :: GetTrailStatusResponse)

-- | Specifies the most recent date and time when CloudTrail stopped
-- recording API calls for an Amazon Web Services account.
getTrailStatusResponse_stopLoggingTime :: Lens.Lens' GetTrailStatusResponse (Prelude.Maybe Prelude.UTCTime)
getTrailStatusResponse_stopLoggingTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_stopLoggingTime = (GetTrailStatusResponse -> Maybe POSIX)
-> (GetTrailStatusResponse
    -> Maybe POSIX -> GetTrailStatusResponse)
-> Lens
     GetTrailStatusResponse
     GetTrailStatusResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Maybe POSIX
stopLoggingTime :: Maybe POSIX
$sel:stopLoggingTime:GetTrailStatusResponse' :: GetTrailStatusResponse -> Maybe POSIX
stopLoggingTime} -> Maybe POSIX
stopLoggingTime) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Maybe POSIX
a -> GetTrailStatusResponse
s {$sel:stopLoggingTime:GetTrailStatusResponse' :: Maybe POSIX
stopLoggingTime = Maybe POSIX
a} :: GetTrailStatusResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetTrailStatusResponse -> f GetTrailStatusResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetTrailStatusResponse
-> f GetTrailStatusResponse
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 response's http status code.
getTrailStatusResponse_httpStatus :: Lens.Lens' GetTrailStatusResponse Prelude.Int
getTrailStatusResponse_httpStatus :: (Int -> f Int)
-> GetTrailStatusResponse -> f GetTrailStatusResponse
getTrailStatusResponse_httpStatus = (GetTrailStatusResponse -> Int)
-> (GetTrailStatusResponse -> Int -> GetTrailStatusResponse)
-> Lens GetTrailStatusResponse GetTrailStatusResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTrailStatusResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetTrailStatusResponse' :: GetTrailStatusResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetTrailStatusResponse
s@GetTrailStatusResponse' {} Int
a -> GetTrailStatusResponse
s {$sel:httpStatus:GetTrailStatusResponse' :: Int
httpStatus = Int
a} :: GetTrailStatusResponse)

instance Prelude.NFData GetTrailStatusResponse