{-# 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.CloudWatchLogs.Types.ExportTaskExecutionInfo
-- 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.CloudWatchLogs.Types.ExportTaskExecutionInfo where

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

-- | Represents the status of an export task.
--
-- /See:/ 'newExportTaskExecutionInfo' smart constructor.
data ExportTaskExecutionInfo = ExportTaskExecutionInfo'
  { -- | The creation time of the export task, expressed as the number of
    -- milliseconds after Jan 1, 1970 00:00:00 UTC.
    ExportTaskExecutionInfo -> Maybe Natural
creationTime :: Prelude.Maybe Prelude.Natural,
    -- | The completion time of the export task, expressed as the number of
    -- milliseconds after Jan 1, 1970 00:00:00 UTC.
    ExportTaskExecutionInfo -> Maybe Natural
completionTime :: Prelude.Maybe Prelude.Natural
  }
  deriving (ExportTaskExecutionInfo -> ExportTaskExecutionInfo -> Bool
(ExportTaskExecutionInfo -> ExportTaskExecutionInfo -> Bool)
-> (ExportTaskExecutionInfo -> ExportTaskExecutionInfo -> Bool)
-> Eq ExportTaskExecutionInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportTaskExecutionInfo -> ExportTaskExecutionInfo -> Bool
$c/= :: ExportTaskExecutionInfo -> ExportTaskExecutionInfo -> Bool
== :: ExportTaskExecutionInfo -> ExportTaskExecutionInfo -> Bool
$c== :: ExportTaskExecutionInfo -> ExportTaskExecutionInfo -> Bool
Prelude.Eq, ReadPrec [ExportTaskExecutionInfo]
ReadPrec ExportTaskExecutionInfo
Int -> ReadS ExportTaskExecutionInfo
ReadS [ExportTaskExecutionInfo]
(Int -> ReadS ExportTaskExecutionInfo)
-> ReadS [ExportTaskExecutionInfo]
-> ReadPrec ExportTaskExecutionInfo
-> ReadPrec [ExportTaskExecutionInfo]
-> Read ExportTaskExecutionInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportTaskExecutionInfo]
$creadListPrec :: ReadPrec [ExportTaskExecutionInfo]
readPrec :: ReadPrec ExportTaskExecutionInfo
$creadPrec :: ReadPrec ExportTaskExecutionInfo
readList :: ReadS [ExportTaskExecutionInfo]
$creadList :: ReadS [ExportTaskExecutionInfo]
readsPrec :: Int -> ReadS ExportTaskExecutionInfo
$creadsPrec :: Int -> ReadS ExportTaskExecutionInfo
Prelude.Read, Int -> ExportTaskExecutionInfo -> ShowS
[ExportTaskExecutionInfo] -> ShowS
ExportTaskExecutionInfo -> String
(Int -> ExportTaskExecutionInfo -> ShowS)
-> (ExportTaskExecutionInfo -> String)
-> ([ExportTaskExecutionInfo] -> ShowS)
-> Show ExportTaskExecutionInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportTaskExecutionInfo] -> ShowS
$cshowList :: [ExportTaskExecutionInfo] -> ShowS
show :: ExportTaskExecutionInfo -> String
$cshow :: ExportTaskExecutionInfo -> String
showsPrec :: Int -> ExportTaskExecutionInfo -> ShowS
$cshowsPrec :: Int -> ExportTaskExecutionInfo -> ShowS
Prelude.Show, (forall x.
 ExportTaskExecutionInfo -> Rep ExportTaskExecutionInfo x)
-> (forall x.
    Rep ExportTaskExecutionInfo x -> ExportTaskExecutionInfo)
-> Generic ExportTaskExecutionInfo
forall x. Rep ExportTaskExecutionInfo x -> ExportTaskExecutionInfo
forall x. ExportTaskExecutionInfo -> Rep ExportTaskExecutionInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportTaskExecutionInfo x -> ExportTaskExecutionInfo
$cfrom :: forall x. ExportTaskExecutionInfo -> Rep ExportTaskExecutionInfo x
Prelude.Generic)

-- |
-- Create a value of 'ExportTaskExecutionInfo' 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:
--
-- 'creationTime', 'exportTaskExecutionInfo_creationTime' - The creation time of the export task, expressed as the number of
-- milliseconds after Jan 1, 1970 00:00:00 UTC.
--
-- 'completionTime', 'exportTaskExecutionInfo_completionTime' - The completion time of the export task, expressed as the number of
-- milliseconds after Jan 1, 1970 00:00:00 UTC.
newExportTaskExecutionInfo ::
  ExportTaskExecutionInfo
newExportTaskExecutionInfo :: ExportTaskExecutionInfo
newExportTaskExecutionInfo =
  ExportTaskExecutionInfo' :: Maybe Natural -> Maybe Natural -> ExportTaskExecutionInfo
ExportTaskExecutionInfo'
    { $sel:creationTime:ExportTaskExecutionInfo' :: Maybe Natural
creationTime =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:completionTime:ExportTaskExecutionInfo' :: Maybe Natural
completionTime = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The creation time of the export task, expressed as the number of
-- milliseconds after Jan 1, 1970 00:00:00 UTC.
exportTaskExecutionInfo_creationTime :: Lens.Lens' ExportTaskExecutionInfo (Prelude.Maybe Prelude.Natural)
exportTaskExecutionInfo_creationTime :: (Maybe Natural -> f (Maybe Natural))
-> ExportTaskExecutionInfo -> f ExportTaskExecutionInfo
exportTaskExecutionInfo_creationTime = (ExportTaskExecutionInfo -> Maybe Natural)
-> (ExportTaskExecutionInfo
    -> Maybe Natural -> ExportTaskExecutionInfo)
-> Lens
     ExportTaskExecutionInfo
     ExportTaskExecutionInfo
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTaskExecutionInfo' {Maybe Natural
creationTime :: Maybe Natural
$sel:creationTime:ExportTaskExecutionInfo' :: ExportTaskExecutionInfo -> Maybe Natural
creationTime} -> Maybe Natural
creationTime) (\s :: ExportTaskExecutionInfo
s@ExportTaskExecutionInfo' {} Maybe Natural
a -> ExportTaskExecutionInfo
s {$sel:creationTime:ExportTaskExecutionInfo' :: Maybe Natural
creationTime = Maybe Natural
a} :: ExportTaskExecutionInfo)

-- | The completion time of the export task, expressed as the number of
-- milliseconds after Jan 1, 1970 00:00:00 UTC.
exportTaskExecutionInfo_completionTime :: Lens.Lens' ExportTaskExecutionInfo (Prelude.Maybe Prelude.Natural)
exportTaskExecutionInfo_completionTime :: (Maybe Natural -> f (Maybe Natural))
-> ExportTaskExecutionInfo -> f ExportTaskExecutionInfo
exportTaskExecutionInfo_completionTime = (ExportTaskExecutionInfo -> Maybe Natural)
-> (ExportTaskExecutionInfo
    -> Maybe Natural -> ExportTaskExecutionInfo)
-> Lens
     ExportTaskExecutionInfo
     ExportTaskExecutionInfo
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTaskExecutionInfo' {Maybe Natural
completionTime :: Maybe Natural
$sel:completionTime:ExportTaskExecutionInfo' :: ExportTaskExecutionInfo -> Maybe Natural
completionTime} -> Maybe Natural
completionTime) (\s :: ExportTaskExecutionInfo
s@ExportTaskExecutionInfo' {} Maybe Natural
a -> ExportTaskExecutionInfo
s {$sel:completionTime:ExportTaskExecutionInfo' :: Maybe Natural
completionTime = Maybe Natural
a} :: ExportTaskExecutionInfo)

instance Core.FromJSON ExportTaskExecutionInfo where
  parseJSON :: Value -> Parser ExportTaskExecutionInfo
parseJSON =
    String
-> (Object -> Parser ExportTaskExecutionInfo)
-> Value
-> Parser ExportTaskExecutionInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExportTaskExecutionInfo"
      ( \Object
x ->
          Maybe Natural -> Maybe Natural -> ExportTaskExecutionInfo
ExportTaskExecutionInfo'
            (Maybe Natural -> Maybe Natural -> ExportTaskExecutionInfo)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> ExportTaskExecutionInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTime")
            Parser (Maybe Natural -> ExportTaskExecutionInfo)
-> Parser (Maybe Natural) -> Parser ExportTaskExecutionInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"completionTime")
      )

instance Prelude.Hashable ExportTaskExecutionInfo

instance Prelude.NFData ExportTaskExecutionInfo