{-# 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.Personalize.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.Personalize.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 properties of a dataset group. For a complete
-- listing, call the DescribeDatasetGroup API.
--
-- /See:/ 'newDatasetGroupSummary' smart constructor.
data DatasetGroupSummary = DatasetGroupSummary'
  { -- | If creating a dataset group fails, the reason behind the failure.
    DatasetGroupSummary -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The status of the dataset group.
    --
    -- A dataset group can be in one of the following states:
    --
    -- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
    --
    -- -   DELETE PENDING
    DatasetGroupSummary -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The date and time (in Unix time) that the dataset group was last
    -- updated.
    DatasetGroupSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the dataset group.
    DatasetGroupSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The date and time (in Unix time) that the dataset group was created.
    DatasetGroupSummary -> Maybe POSIX
creationDateTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the dataset group.
    DatasetGroupSummary -> Maybe Text
datasetGroupArn :: Prelude.Maybe Prelude.Text
  }
  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:
--
-- 'failureReason', 'datasetGroupSummary_failureReason' - If creating a dataset group fails, the reason behind the failure.
--
-- 'status', 'datasetGroupSummary_status' - The status of the dataset group.
--
-- A dataset group can be in one of the following states:
--
-- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
--
-- -   DELETE PENDING
--
-- 'lastUpdatedDateTime', 'datasetGroupSummary_lastUpdatedDateTime' - The date and time (in Unix time) that the dataset group was last
-- updated.
--
-- 'name', 'datasetGroupSummary_name' - The name of the dataset group.
--
-- 'creationDateTime', 'datasetGroupSummary_creationDateTime' - The date and time (in Unix time) that the dataset group was created.
--
-- 'datasetGroupArn', 'datasetGroupSummary_datasetGroupArn' - The Amazon Resource Name (ARN) of the dataset group.
newDatasetGroupSummary ::
  DatasetGroupSummary
newDatasetGroupSummary :: DatasetGroupSummary
newDatasetGroupSummary =
  DatasetGroupSummary' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> DatasetGroupSummary
DatasetGroupSummary'
    { $sel:failureReason:DatasetGroupSummary' :: Maybe Text
failureReason =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DatasetGroupSummary' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:DatasetGroupSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DatasetGroupSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDateTime:DatasetGroupSummary' :: Maybe POSIX
creationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetGroupArn:DatasetGroupSummary' :: Maybe Text
datasetGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | If creating a dataset group fails, the reason behind the failure.
datasetGroupSummary_failureReason :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.Text)
datasetGroupSummary_failureReason :: (Maybe Text -> f (Maybe Text))
-> DatasetGroupSummary -> f DatasetGroupSummary
datasetGroupSummary_failureReason = (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
failureReason :: Maybe Text
$sel:failureReason:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: DatasetGroupSummary
s@DatasetGroupSummary' {} Maybe Text
a -> DatasetGroupSummary
s {$sel:failureReason:DatasetGroupSummary' :: Maybe Text
failureReason = Maybe Text
a} :: DatasetGroupSummary)

-- | The status of the dataset group.
--
-- A dataset group can be in one of the following states:
--
-- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
--
-- -   DELETE PENDING
datasetGroupSummary_status :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.Text)
datasetGroupSummary_status :: (Maybe Text -> f (Maybe Text))
-> DatasetGroupSummary -> f DatasetGroupSummary
datasetGroupSummary_status = (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
status :: Maybe Text
$sel:status:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
status} -> Maybe Text
status) (\s :: DatasetGroupSummary
s@DatasetGroupSummary' {} Maybe Text
a -> DatasetGroupSummary
s {$sel:status:DatasetGroupSummary' :: Maybe Text
status = Maybe Text
a} :: DatasetGroupSummary)

-- | The date and time (in Unix time) that the dataset group was last
-- updated.
datasetGroupSummary_lastUpdatedDateTime :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.UTCTime)
datasetGroupSummary_lastUpdatedDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetGroupSummary -> f DatasetGroupSummary
datasetGroupSummary_lastUpdatedDateTime = (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
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: DatasetGroupSummary
s@DatasetGroupSummary' {} Maybe POSIX
a -> DatasetGroupSummary
s {$sel:lastUpdatedDateTime:DatasetGroupSummary' :: Maybe POSIX
lastUpdatedDateTime = 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_name :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.Text)
datasetGroupSummary_name :: (Maybe Text -> f (Maybe Text))
-> DatasetGroupSummary -> f DatasetGroupSummary
datasetGroupSummary_name = (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
name :: Maybe Text
$sel:name:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: DatasetGroupSummary
s@DatasetGroupSummary' {} Maybe Text
a -> DatasetGroupSummary
s {$sel:name:DatasetGroupSummary' :: Maybe Text
name = Maybe Text
a} :: DatasetGroupSummary)

-- | The date and time (in Unix time) that the dataset group was created.
datasetGroupSummary_creationDateTime :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.UTCTime)
datasetGroupSummary_creationDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DatasetGroupSummary -> f DatasetGroupSummary
datasetGroupSummary_creationDateTime = (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
creationDateTime :: Maybe POSIX
$sel:creationDateTime:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: DatasetGroupSummary
s@DatasetGroupSummary' {} Maybe POSIX
a -> DatasetGroupSummary
s {$sel:creationDateTime:DatasetGroupSummary' :: Maybe POSIX
creationDateTime = 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 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)

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 Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> DatasetGroupSummary
DatasetGroupSummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> DatasetGroupSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> DatasetGroupSummary)
forall (f :: * -> *) a b. Functor 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
"failureReason")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> DatasetGroupSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe POSIX -> Maybe Text -> 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
"status")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe POSIX -> Maybe Text -> DatasetGroupSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe POSIX -> Maybe Text -> 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
"lastUpdatedDateTime")
            Parser
  (Maybe Text -> Maybe POSIX -> Maybe Text -> DatasetGroupSummary)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> 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
"name")
            Parser (Maybe POSIX -> Maybe Text -> DatasetGroupSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> 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
"creationDateTime")
            Parser (Maybe Text -> DatasetGroupSummary)
-> Parser (Maybe Text) -> Parser 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")
      )

instance Prelude.Hashable DatasetGroupSummary

instance Prelude.NFData DatasetGroupSummary