{-# 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.Forecast.Types.DatasetGroupSummary
-- 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.Forecast.Types.DatasetGroupSummary where

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

-- | Provides a summary of the dataset group properties used in the
-- ListDatasetGroups operation. To get the complete set of properties, call
-- the DescribeDatasetGroup operation, and provide the @DatasetGroupArn@.
--
-- /See:/ 'newDatasetGroupSummary' smart constructor.
data DatasetGroupSummary = DatasetGroupSummary'
  { -- | When the dataset group was created.
    DatasetGroupSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the dataset group.
    DatasetGroupSummary -> Maybe Text
datasetGroupName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the dataset group.
    DatasetGroupSummary -> Maybe Text
datasetGroupArn :: Prelude.Maybe Prelude.Text,
    -- | When the dataset group was created or last updated from a call to the
    -- UpdateDatasetGroup operation. While the dataset group is being updated,
    -- @LastModificationTime@ is the current time of the @ListDatasetGroups@
    -- call.
    DatasetGroupSummary -> Maybe POSIX
lastModificationTime :: Prelude.Maybe Core.POSIX
  }
  deriving (DatasetGroupSummary -> DatasetGroupSummary -> Bool
(DatasetGroupSummary -> DatasetGroupSummary -> Bool)
-> (DatasetGroupSummary -> DatasetGroupSummary -> Bool)
-> Eq DatasetGroupSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatasetGroupSummary -> DatasetGroupSummary -> Bool
$c/= :: DatasetGroupSummary -> DatasetGroupSummary -> Bool
== :: DatasetGroupSummary -> DatasetGroupSummary -> Bool
$c== :: DatasetGroupSummary -> DatasetGroupSummary -> Bool
Prelude.Eq, ReadPrec [DatasetGroupSummary]
ReadPrec DatasetGroupSummary
Int -> ReadS DatasetGroupSummary
ReadS [DatasetGroupSummary]
(Int -> ReadS DatasetGroupSummary)
-> ReadS [DatasetGroupSummary]
-> ReadPrec DatasetGroupSummary
-> ReadPrec [DatasetGroupSummary]
-> Read DatasetGroupSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatasetGroupSummary]
$creadListPrec :: ReadPrec [DatasetGroupSummary]
readPrec :: ReadPrec DatasetGroupSummary
$creadPrec :: ReadPrec DatasetGroupSummary
readList :: ReadS [DatasetGroupSummary]
$creadList :: ReadS [DatasetGroupSummary]
readsPrec :: Int -> ReadS DatasetGroupSummary
$creadsPrec :: Int -> ReadS DatasetGroupSummary
Prelude.Read, Int -> DatasetGroupSummary -> ShowS
[DatasetGroupSummary] -> ShowS
DatasetGroupSummary -> String
(Int -> DatasetGroupSummary -> ShowS)
-> (DatasetGroupSummary -> String)
-> ([DatasetGroupSummary] -> ShowS)
-> Show DatasetGroupSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatasetGroupSummary] -> ShowS
$cshowList :: [DatasetGroupSummary] -> ShowS
show :: DatasetGroupSummary -> String
$cshow :: DatasetGroupSummary -> String
showsPrec :: Int -> DatasetGroupSummary -> ShowS
$cshowsPrec :: Int -> DatasetGroupSummary -> ShowS
Prelude.Show, (forall x. DatasetGroupSummary -> Rep DatasetGroupSummary x)
-> (forall x. Rep DatasetGroupSummary x -> DatasetGroupSummary)
-> Generic DatasetGroupSummary
forall x. Rep DatasetGroupSummary x -> DatasetGroupSummary
forall x. DatasetGroupSummary -> Rep DatasetGroupSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DatasetGroupSummary x -> DatasetGroupSummary
$cfrom :: forall x. DatasetGroupSummary -> Rep DatasetGroupSummary x
Prelude.Generic)

-- |
-- Create a value of 'DatasetGroupSummary' 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', 'datasetGroupSummary_creationTime' - When the dataset group was created.
--
-- 'datasetGroupName', 'datasetGroupSummary_datasetGroupName' - The name of the dataset group.
--
-- 'datasetGroupArn', 'datasetGroupSummary_datasetGroupArn' - The Amazon Resource Name (ARN) of the dataset group.
--
-- 'lastModificationTime', 'datasetGroupSummary_lastModificationTime' - When the dataset group was created or last updated from a call to the
-- UpdateDatasetGroup operation. While the dataset group is being updated,
-- @LastModificationTime@ is the current time of the @ListDatasetGroups@
-- call.
newDatasetGroupSummary ::
  DatasetGroupSummary
newDatasetGroupSummary :: DatasetGroupSummary
newDatasetGroupSummary =
  DatasetGroupSummary' :: Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe POSIX -> DatasetGroupSummary
DatasetGroupSummary'
    { $sel:creationTime:DatasetGroupSummary' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetGroupName:DatasetGroupSummary' :: Maybe Text
datasetGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetGroupArn:DatasetGroupSummary' :: Maybe Text
datasetGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModificationTime:DatasetGroupSummary' :: Maybe POSIX
lastModificationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
    }

-- | When the dataset group was created.
datasetGroupSummary_creationTime :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.UTCTime)
datasetGroupSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetGroupSummary -> f DatasetGroupSummary
datasetGroupSummary_creationTime = (DatasetGroupSummary -> Maybe POSIX)
-> (DatasetGroupSummary -> Maybe POSIX -> DatasetGroupSummary)
-> Lens
     DatasetGroupSummary DatasetGroupSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetGroupSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DatasetGroupSummary
s@DatasetGroupSummary' {} Maybe POSIX
a -> DatasetGroupSummary
s {$sel:creationTime:DatasetGroupSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DatasetGroupSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> DatasetGroupSummary -> f DatasetGroupSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetGroupSummary
-> f DatasetGroupSummary
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 name of the dataset group.
datasetGroupSummary_datasetGroupName :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.Text)
datasetGroupSummary_datasetGroupName :: (Maybe Text -> f (Maybe Text))
-> DatasetGroupSummary -> f DatasetGroupSummary
datasetGroupSummary_datasetGroupName = (DatasetGroupSummary -> Maybe Text)
-> (DatasetGroupSummary -> Maybe Text -> DatasetGroupSummary)
-> Lens
     DatasetGroupSummary DatasetGroupSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetGroupSummary' {Maybe Text
datasetGroupName :: Maybe Text
$sel:datasetGroupName:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
datasetGroupName} -> Maybe Text
datasetGroupName) (\s :: DatasetGroupSummary
s@DatasetGroupSummary' {} Maybe Text
a -> DatasetGroupSummary
s {$sel:datasetGroupName:DatasetGroupSummary' :: Maybe Text
datasetGroupName = Maybe Text
a} :: DatasetGroupSummary)

-- | The Amazon Resource Name (ARN) of the dataset group.
datasetGroupSummary_datasetGroupArn :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.Text)
datasetGroupSummary_datasetGroupArn :: (Maybe Text -> f (Maybe Text))
-> DatasetGroupSummary -> f DatasetGroupSummary
datasetGroupSummary_datasetGroupArn = (DatasetGroupSummary -> Maybe Text)
-> (DatasetGroupSummary -> Maybe Text -> DatasetGroupSummary)
-> Lens
     DatasetGroupSummary DatasetGroupSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetGroupSummary' {Maybe Text
datasetGroupArn :: Maybe Text
$sel:datasetGroupArn:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
datasetGroupArn} -> Maybe Text
datasetGroupArn) (\s :: DatasetGroupSummary
s@DatasetGroupSummary' {} Maybe Text
a -> DatasetGroupSummary
s {$sel:datasetGroupArn:DatasetGroupSummary' :: Maybe Text
datasetGroupArn = Maybe Text
a} :: DatasetGroupSummary)

-- | When the dataset group was created or last updated from a call to the
-- UpdateDatasetGroup operation. While the dataset group is being updated,
-- @LastModificationTime@ is the current time of the @ListDatasetGroups@
-- call.
datasetGroupSummary_lastModificationTime :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.UTCTime)
datasetGroupSummary_lastModificationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetGroupSummary -> f DatasetGroupSummary
datasetGroupSummary_lastModificationTime = (DatasetGroupSummary -> Maybe POSIX)
-> (DatasetGroupSummary -> Maybe POSIX -> DatasetGroupSummary)
-> Lens
     DatasetGroupSummary DatasetGroupSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetGroupSummary' {Maybe POSIX
lastModificationTime :: Maybe POSIX
$sel:lastModificationTime:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe POSIX
lastModificationTime} -> Maybe POSIX
lastModificationTime) (\s :: DatasetGroupSummary
s@DatasetGroupSummary' {} Maybe POSIX
a -> DatasetGroupSummary
s {$sel:lastModificationTime:DatasetGroupSummary' :: Maybe POSIX
lastModificationTime = Maybe POSIX
a} :: DatasetGroupSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> DatasetGroupSummary -> f DatasetGroupSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetGroupSummary
-> f DatasetGroupSummary
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

instance Core.FromJSON DatasetGroupSummary where
  parseJSON :: Value -> Parser DatasetGroupSummary
parseJSON =
    String
-> (Object -> Parser DatasetGroupSummary)
-> Value
-> Parser DatasetGroupSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DatasetGroupSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe POSIX -> DatasetGroupSummary
DatasetGroupSummary'
            (Maybe POSIX
 -> Maybe Text -> Maybe Text -> Maybe POSIX -> DatasetGroupSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe POSIX -> DatasetGroupSummary)
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 Text -> Maybe Text -> Maybe POSIX -> DatasetGroupSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> DatasetGroupSummary)
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
"DatasetGroupName")
            Parser (Maybe Text -> Maybe POSIX -> DatasetGroupSummary)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> DatasetGroupSummary)
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
"DatasetGroupArn")
            Parser (Maybe POSIX -> DatasetGroupSummary)
-> Parser (Maybe POSIX) -> Parser DatasetGroupSummary
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
"LastModificationTime")
      )

instance Prelude.Hashable DatasetGroupSummary

instance Prelude.NFData DatasetGroupSummary