{-# 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.IoTAnalytics.Types.ReprocessingSummary
-- 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.IoTAnalytics.Types.ReprocessingSummary where

import qualified Amazonka.Core as Core
import Amazonka.IoTAnalytics.Types.ReprocessingStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about pipeline reprocessing.
--
-- /See:/ 'newReprocessingSummary' smart constructor.
data ReprocessingSummary = ReprocessingSummary'
  { -- | The time the pipeline reprocessing was created.
    ReprocessingSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status of the pipeline reprocessing.
    ReprocessingSummary -> Maybe ReprocessingStatus
status :: Prelude.Maybe ReprocessingStatus,
    -- | The @reprocessingId@ returned by @StartPipelineReprocessing@.
    ReprocessingSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (ReprocessingSummary -> ReprocessingSummary -> Bool
(ReprocessingSummary -> ReprocessingSummary -> Bool)
-> (ReprocessingSummary -> ReprocessingSummary -> Bool)
-> Eq ReprocessingSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReprocessingSummary -> ReprocessingSummary -> Bool
$c/= :: ReprocessingSummary -> ReprocessingSummary -> Bool
== :: ReprocessingSummary -> ReprocessingSummary -> Bool
$c== :: ReprocessingSummary -> ReprocessingSummary -> Bool
Prelude.Eq, ReadPrec [ReprocessingSummary]
ReadPrec ReprocessingSummary
Int -> ReadS ReprocessingSummary
ReadS [ReprocessingSummary]
(Int -> ReadS ReprocessingSummary)
-> ReadS [ReprocessingSummary]
-> ReadPrec ReprocessingSummary
-> ReadPrec [ReprocessingSummary]
-> Read ReprocessingSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReprocessingSummary]
$creadListPrec :: ReadPrec [ReprocessingSummary]
readPrec :: ReadPrec ReprocessingSummary
$creadPrec :: ReadPrec ReprocessingSummary
readList :: ReadS [ReprocessingSummary]
$creadList :: ReadS [ReprocessingSummary]
readsPrec :: Int -> ReadS ReprocessingSummary
$creadsPrec :: Int -> ReadS ReprocessingSummary
Prelude.Read, Int -> ReprocessingSummary -> ShowS
[ReprocessingSummary] -> ShowS
ReprocessingSummary -> String
(Int -> ReprocessingSummary -> ShowS)
-> (ReprocessingSummary -> String)
-> ([ReprocessingSummary] -> ShowS)
-> Show ReprocessingSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReprocessingSummary] -> ShowS
$cshowList :: [ReprocessingSummary] -> ShowS
show :: ReprocessingSummary -> String
$cshow :: ReprocessingSummary -> String
showsPrec :: Int -> ReprocessingSummary -> ShowS
$cshowsPrec :: Int -> ReprocessingSummary -> ShowS
Prelude.Show, (forall x. ReprocessingSummary -> Rep ReprocessingSummary x)
-> (forall x. Rep ReprocessingSummary x -> ReprocessingSummary)
-> Generic ReprocessingSummary
forall x. Rep ReprocessingSummary x -> ReprocessingSummary
forall x. ReprocessingSummary -> Rep ReprocessingSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReprocessingSummary x -> ReprocessingSummary
$cfrom :: forall x. ReprocessingSummary -> Rep ReprocessingSummary x
Prelude.Generic)

-- |
-- Create a value of 'ReprocessingSummary' 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', 'reprocessingSummary_creationTime' - The time the pipeline reprocessing was created.
--
-- 'status', 'reprocessingSummary_status' - The status of the pipeline reprocessing.
--
-- 'id', 'reprocessingSummary_id' - The @reprocessingId@ returned by @StartPipelineReprocessing@.
newReprocessingSummary ::
  ReprocessingSummary
newReprocessingSummary :: ReprocessingSummary
newReprocessingSummary =
  ReprocessingSummary' :: Maybe POSIX
-> Maybe ReprocessingStatus -> Maybe Text -> ReprocessingSummary
ReprocessingSummary'
    { $sel:creationTime:ReprocessingSummary' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ReprocessingSummary' :: Maybe ReprocessingStatus
status = Maybe ReprocessingStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ReprocessingSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The time the pipeline reprocessing was created.
reprocessingSummary_creationTime :: Lens.Lens' ReprocessingSummary (Prelude.Maybe Prelude.UTCTime)
reprocessingSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ReprocessingSummary -> f ReprocessingSummary
reprocessingSummary_creationTime = (ReprocessingSummary -> Maybe POSIX)
-> (ReprocessingSummary -> Maybe POSIX -> ReprocessingSummary)
-> Lens
     ReprocessingSummary ReprocessingSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReprocessingSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:ReprocessingSummary' :: ReprocessingSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: ReprocessingSummary
s@ReprocessingSummary' {} Maybe POSIX
a -> ReprocessingSummary
s {$sel:creationTime:ReprocessingSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: ReprocessingSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ReprocessingSummary -> f ReprocessingSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ReprocessingSummary
-> f ReprocessingSummary
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 status of the pipeline reprocessing.
reprocessingSummary_status :: Lens.Lens' ReprocessingSummary (Prelude.Maybe ReprocessingStatus)
reprocessingSummary_status :: (Maybe ReprocessingStatus -> f (Maybe ReprocessingStatus))
-> ReprocessingSummary -> f ReprocessingSummary
reprocessingSummary_status = (ReprocessingSummary -> Maybe ReprocessingStatus)
-> (ReprocessingSummary
    -> Maybe ReprocessingStatus -> ReprocessingSummary)
-> Lens
     ReprocessingSummary
     ReprocessingSummary
     (Maybe ReprocessingStatus)
     (Maybe ReprocessingStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReprocessingSummary' {Maybe ReprocessingStatus
status :: Maybe ReprocessingStatus
$sel:status:ReprocessingSummary' :: ReprocessingSummary -> Maybe ReprocessingStatus
status} -> Maybe ReprocessingStatus
status) (\s :: ReprocessingSummary
s@ReprocessingSummary' {} Maybe ReprocessingStatus
a -> ReprocessingSummary
s {$sel:status:ReprocessingSummary' :: Maybe ReprocessingStatus
status = Maybe ReprocessingStatus
a} :: ReprocessingSummary)

-- | The @reprocessingId@ returned by @StartPipelineReprocessing@.
reprocessingSummary_id :: Lens.Lens' ReprocessingSummary (Prelude.Maybe Prelude.Text)
reprocessingSummary_id :: (Maybe Text -> f (Maybe Text))
-> ReprocessingSummary -> f ReprocessingSummary
reprocessingSummary_id = (ReprocessingSummary -> Maybe Text)
-> (ReprocessingSummary -> Maybe Text -> ReprocessingSummary)
-> Lens
     ReprocessingSummary ReprocessingSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReprocessingSummary' {Maybe Text
id :: Maybe Text
$sel:id:ReprocessingSummary' :: ReprocessingSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ReprocessingSummary
s@ReprocessingSummary' {} Maybe Text
a -> ReprocessingSummary
s {$sel:id:ReprocessingSummary' :: Maybe Text
id = Maybe Text
a} :: ReprocessingSummary)

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

instance Prelude.Hashable ReprocessingSummary

instance Prelude.NFData ReprocessingSummary