{-# 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.DatasetContentSummary
-- 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.DatasetContentSummary where

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

-- | Summary information about dataset contents.
--
-- /See:/ 'newDatasetContentSummary' smart constructor.
data DatasetContentSummary = DatasetContentSummary'
  { -- | The actual time the creation of the dataset contents was started.
    DatasetContentSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status of the dataset contents.
    DatasetContentSummary -> Maybe DatasetContentStatus
status :: Prelude.Maybe DatasetContentStatus,
    -- | The time the creation of the dataset contents was scheduled to start.
    DatasetContentSummary -> Maybe POSIX
scheduleTime :: Prelude.Maybe Core.POSIX,
    -- | The time the dataset content status was updated to SUCCEEDED or FAILED.
    DatasetContentSummary -> Maybe POSIX
completionTime :: Prelude.Maybe Core.POSIX,
    -- | The version of the dataset contents.
    DatasetContentSummary -> Maybe Text
version :: Prelude.Maybe Prelude.Text
  }
  deriving (DatasetContentSummary -> DatasetContentSummary -> Bool
(DatasetContentSummary -> DatasetContentSummary -> Bool)
-> (DatasetContentSummary -> DatasetContentSummary -> Bool)
-> Eq DatasetContentSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatasetContentSummary -> DatasetContentSummary -> Bool
$c/= :: DatasetContentSummary -> DatasetContentSummary -> Bool
== :: DatasetContentSummary -> DatasetContentSummary -> Bool
$c== :: DatasetContentSummary -> DatasetContentSummary -> Bool
Prelude.Eq, ReadPrec [DatasetContentSummary]
ReadPrec DatasetContentSummary
Int -> ReadS DatasetContentSummary
ReadS [DatasetContentSummary]
(Int -> ReadS DatasetContentSummary)
-> ReadS [DatasetContentSummary]
-> ReadPrec DatasetContentSummary
-> ReadPrec [DatasetContentSummary]
-> Read DatasetContentSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatasetContentSummary]
$creadListPrec :: ReadPrec [DatasetContentSummary]
readPrec :: ReadPrec DatasetContentSummary
$creadPrec :: ReadPrec DatasetContentSummary
readList :: ReadS [DatasetContentSummary]
$creadList :: ReadS [DatasetContentSummary]
readsPrec :: Int -> ReadS DatasetContentSummary
$creadsPrec :: Int -> ReadS DatasetContentSummary
Prelude.Read, Int -> DatasetContentSummary -> ShowS
[DatasetContentSummary] -> ShowS
DatasetContentSummary -> String
(Int -> DatasetContentSummary -> ShowS)
-> (DatasetContentSummary -> String)
-> ([DatasetContentSummary] -> ShowS)
-> Show DatasetContentSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatasetContentSummary] -> ShowS
$cshowList :: [DatasetContentSummary] -> ShowS
show :: DatasetContentSummary -> String
$cshow :: DatasetContentSummary -> String
showsPrec :: Int -> DatasetContentSummary -> ShowS
$cshowsPrec :: Int -> DatasetContentSummary -> ShowS
Prelude.Show, (forall x. DatasetContentSummary -> Rep DatasetContentSummary x)
-> (forall x. Rep DatasetContentSummary x -> DatasetContentSummary)
-> Generic DatasetContentSummary
forall x. Rep DatasetContentSummary x -> DatasetContentSummary
forall x. DatasetContentSummary -> Rep DatasetContentSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DatasetContentSummary x -> DatasetContentSummary
$cfrom :: forall x. DatasetContentSummary -> Rep DatasetContentSummary x
Prelude.Generic)

-- |
-- Create a value of 'DatasetContentSummary' 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', 'datasetContentSummary_creationTime' - The actual time the creation of the dataset contents was started.
--
-- 'status', 'datasetContentSummary_status' - The status of the dataset contents.
--
-- 'scheduleTime', 'datasetContentSummary_scheduleTime' - The time the creation of the dataset contents was scheduled to start.
--
-- 'completionTime', 'datasetContentSummary_completionTime' - The time the dataset content status was updated to SUCCEEDED or FAILED.
--
-- 'version', 'datasetContentSummary_version' - The version of the dataset contents.
newDatasetContentSummary ::
  DatasetContentSummary
newDatasetContentSummary :: DatasetContentSummary
newDatasetContentSummary =
  DatasetContentSummary' :: Maybe POSIX
-> Maybe DatasetContentStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> DatasetContentSummary
DatasetContentSummary'
    { $sel:creationTime:DatasetContentSummary' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DatasetContentSummary' :: Maybe DatasetContentStatus
status = Maybe DatasetContentStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleTime:DatasetContentSummary' :: Maybe POSIX
scheduleTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:completionTime:DatasetContentSummary' :: Maybe POSIX
completionTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:version:DatasetContentSummary' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The actual time the creation of the dataset contents was started.
datasetContentSummary_creationTime :: Lens.Lens' DatasetContentSummary (Prelude.Maybe Prelude.UTCTime)
datasetContentSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetContentSummary -> f DatasetContentSummary
datasetContentSummary_creationTime = (DatasetContentSummary -> Maybe POSIX)
-> (DatasetContentSummary -> Maybe POSIX -> DatasetContentSummary)
-> Lens
     DatasetContentSummary
     DatasetContentSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetContentSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DatasetContentSummary' :: DatasetContentSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DatasetContentSummary
s@DatasetContentSummary' {} Maybe POSIX
a -> DatasetContentSummary
s {$sel:creationTime:DatasetContentSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DatasetContentSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> DatasetContentSummary -> f DatasetContentSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetContentSummary
-> f DatasetContentSummary
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 dataset contents.
datasetContentSummary_status :: Lens.Lens' DatasetContentSummary (Prelude.Maybe DatasetContentStatus)
datasetContentSummary_status :: (Maybe DatasetContentStatus -> f (Maybe DatasetContentStatus))
-> DatasetContentSummary -> f DatasetContentSummary
datasetContentSummary_status = (DatasetContentSummary -> Maybe DatasetContentStatus)
-> (DatasetContentSummary
    -> Maybe DatasetContentStatus -> DatasetContentSummary)
-> Lens
     DatasetContentSummary
     DatasetContentSummary
     (Maybe DatasetContentStatus)
     (Maybe DatasetContentStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetContentSummary' {Maybe DatasetContentStatus
status :: Maybe DatasetContentStatus
$sel:status:DatasetContentSummary' :: DatasetContentSummary -> Maybe DatasetContentStatus
status} -> Maybe DatasetContentStatus
status) (\s :: DatasetContentSummary
s@DatasetContentSummary' {} Maybe DatasetContentStatus
a -> DatasetContentSummary
s {$sel:status:DatasetContentSummary' :: Maybe DatasetContentStatus
status = Maybe DatasetContentStatus
a} :: DatasetContentSummary)

-- | The time the creation of the dataset contents was scheduled to start.
datasetContentSummary_scheduleTime :: Lens.Lens' DatasetContentSummary (Prelude.Maybe Prelude.UTCTime)
datasetContentSummary_scheduleTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetContentSummary -> f DatasetContentSummary
datasetContentSummary_scheduleTime = (DatasetContentSummary -> Maybe POSIX)
-> (DatasetContentSummary -> Maybe POSIX -> DatasetContentSummary)
-> Lens
     DatasetContentSummary
     DatasetContentSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetContentSummary' {Maybe POSIX
scheduleTime :: Maybe POSIX
$sel:scheduleTime:DatasetContentSummary' :: DatasetContentSummary -> Maybe POSIX
scheduleTime} -> Maybe POSIX
scheduleTime) (\s :: DatasetContentSummary
s@DatasetContentSummary' {} Maybe POSIX
a -> DatasetContentSummary
s {$sel:scheduleTime:DatasetContentSummary' :: Maybe POSIX
scheduleTime = Maybe POSIX
a} :: DatasetContentSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> DatasetContentSummary -> f DatasetContentSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetContentSummary
-> f DatasetContentSummary
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 time the dataset content status was updated to SUCCEEDED or FAILED.
datasetContentSummary_completionTime :: Lens.Lens' DatasetContentSummary (Prelude.Maybe Prelude.UTCTime)
datasetContentSummary_completionTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetContentSummary -> f DatasetContentSummary
datasetContentSummary_completionTime = (DatasetContentSummary -> Maybe POSIX)
-> (DatasetContentSummary -> Maybe POSIX -> DatasetContentSummary)
-> Lens
     DatasetContentSummary
     DatasetContentSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetContentSummary' {Maybe POSIX
completionTime :: Maybe POSIX
$sel:completionTime:DatasetContentSummary' :: DatasetContentSummary -> Maybe POSIX
completionTime} -> Maybe POSIX
completionTime) (\s :: DatasetContentSummary
s@DatasetContentSummary' {} Maybe POSIX
a -> DatasetContentSummary
s {$sel:completionTime:DatasetContentSummary' :: Maybe POSIX
completionTime = Maybe POSIX
a} :: DatasetContentSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> DatasetContentSummary -> f DatasetContentSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetContentSummary
-> f DatasetContentSummary
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 version of the dataset contents.
datasetContentSummary_version :: Lens.Lens' DatasetContentSummary (Prelude.Maybe Prelude.Text)
datasetContentSummary_version :: (Maybe Text -> f (Maybe Text))
-> DatasetContentSummary -> f DatasetContentSummary
datasetContentSummary_version = (DatasetContentSummary -> Maybe Text)
-> (DatasetContentSummary -> Maybe Text -> DatasetContentSummary)
-> Lens
     DatasetContentSummary
     DatasetContentSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetContentSummary' {Maybe Text
version :: Maybe Text
$sel:version:DatasetContentSummary' :: DatasetContentSummary -> Maybe Text
version} -> Maybe Text
version) (\s :: DatasetContentSummary
s@DatasetContentSummary' {} Maybe Text
a -> DatasetContentSummary
s {$sel:version:DatasetContentSummary' :: Maybe Text
version = Maybe Text
a} :: DatasetContentSummary)

instance Core.FromJSON DatasetContentSummary where
  parseJSON :: Value -> Parser DatasetContentSummary
parseJSON =
    String
-> (Object -> Parser DatasetContentSummary)
-> Value
-> Parser DatasetContentSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DatasetContentSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe DatasetContentStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> DatasetContentSummary
DatasetContentSummary'
            (Maybe POSIX
 -> Maybe DatasetContentStatus
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> DatasetContentSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe DatasetContentStatus
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> DatasetContentSummary)
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 DatasetContentStatus
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> DatasetContentSummary)
-> Parser (Maybe DatasetContentStatus)
-> Parser
     (Maybe POSIX -> Maybe POSIX -> Maybe Text -> DatasetContentSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DatasetContentStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe POSIX -> Maybe POSIX -> Maybe Text -> DatasetContentSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> Maybe Text -> DatasetContentSummary)
forall (f :: * -> *) a b. Applicative f => 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
"scheduleTime")
            Parser (Maybe POSIX -> Maybe Text -> DatasetContentSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> DatasetContentSummary)
forall (f :: * -> *) a b. Applicative f => 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
"completionTime")
            Parser (Maybe Text -> DatasetContentSummary)
-> Parser (Maybe Text) -> Parser DatasetContentSummary
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
"version")
      )

instance Prelude.Hashable DatasetContentSummary

instance Prelude.NFData DatasetContentSummary