{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Personalize.Types.DatasetGroupSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Personalize.Types.Domain
import qualified Amazonka.Prelude as Prelude

-- | Provides a summary of the properties of a dataset group. For a complete
-- listing, call the
-- <https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeDatasetGroup.html DescribeDatasetGroup>
-- API.
--
-- /See:/ 'newDatasetGroupSummary' smart constructor.
data DatasetGroupSummary = DatasetGroupSummary'
  { -- | The date and time (in Unix time) that the dataset group was created.
    DatasetGroupSummary -> Maybe POSIX
creationDateTime :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of the dataset group.
    DatasetGroupSummary -> Maybe Text
datasetGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The domain of a Domain dataset group.
    DatasetGroupSummary -> Maybe Domain
domain :: Prelude.Maybe Domain,
    -- | If creating a dataset group fails, the reason behind the failure.
    DatasetGroupSummary -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The date and time (in Unix time) that the dataset group was last
    -- updated.
    DatasetGroupSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX,
    -- | The name of the dataset group.
    DatasetGroupSummary -> Maybe Text
name :: 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
  }
  deriving (DatasetGroupSummary -> DatasetGroupSummary -> Bool
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]
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
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. 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:
--
-- '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.
--
-- 'domain', 'datasetGroupSummary_domain' - The domain of a Domain dataset group.
--
-- 'failureReason', 'datasetGroupSummary_failureReason' - If creating a dataset group fails, the reason behind the failure.
--
-- '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.
--
-- '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
newDatasetGroupSummary ::
  DatasetGroupSummary
newDatasetGroupSummary :: DatasetGroupSummary
newDatasetGroupSummary =
  DatasetGroupSummary'
    { $sel:creationDateTime:DatasetGroupSummary' :: Maybe POSIX
creationDateTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:datasetGroupArn:DatasetGroupSummary' :: Maybe Text
datasetGroupArn = forall a. Maybe a
Prelude.Nothing,
      $sel:domain:DatasetGroupSummary' :: Maybe Domain
domain = forall a. Maybe a
Prelude.Nothing,
      $sel:failureReason:DatasetGroupSummary' :: Maybe Text
failureReason = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:DatasetGroupSummary' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DatasetGroupSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DatasetGroupSummary' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time (in Unix time) that the dataset group was created.
datasetGroupSummary_creationDateTime :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.UTCTime)
datasetGroupSummary_creationDateTime :: Lens' DatasetGroupSummary (Maybe UTCTime)
datasetGroupSummary_creationDateTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The Amazon Resource Name (ARN) of the dataset group.
datasetGroupSummary_datasetGroupArn :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.Text)
datasetGroupSummary_datasetGroupArn :: Lens' DatasetGroupSummary (Maybe Text)
datasetGroupSummary_datasetGroupArn = 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)

-- | The domain of a Domain dataset group.
datasetGroupSummary_domain :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Domain)
datasetGroupSummary_domain :: Lens' DatasetGroupSummary (Maybe Domain)
datasetGroupSummary_domain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetGroupSummary' {Maybe Domain
domain :: Maybe Domain
$sel:domain:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Domain
domain} -> Maybe Domain
domain) (\s :: DatasetGroupSummary
s@DatasetGroupSummary' {} Maybe Domain
a -> DatasetGroupSummary
s {$sel:domain:DatasetGroupSummary' :: Maybe Domain
domain = Maybe Domain
a} :: DatasetGroupSummary)

-- | If creating a dataset group fails, the reason behind the failure.
datasetGroupSummary_failureReason :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.Text)
datasetGroupSummary_failureReason :: Lens' DatasetGroupSummary (Maybe Text)
datasetGroupSummary_failureReason = 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 date and time (in Unix time) that the dataset group was last
-- updated.
datasetGroupSummary_lastUpdatedDateTime :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.UTCTime)
datasetGroupSummary_lastUpdatedDateTime :: Lens' DatasetGroupSummary (Maybe UTCTime)
datasetGroupSummary_lastUpdatedDateTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the dataset group.
datasetGroupSummary_name :: Lens.Lens' DatasetGroupSummary (Prelude.Maybe Prelude.Text)
datasetGroupSummary_name :: Lens' DatasetGroupSummary (Maybe Text)
datasetGroupSummary_name = 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 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 :: Lens' DatasetGroupSummary (Maybe Text)
datasetGroupSummary_status = 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)

instance Data.FromJSON DatasetGroupSummary where
  parseJSON :: Value -> Parser DatasetGroupSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DatasetGroupSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Domain
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> DatasetGroupSummary
DatasetGroupSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"creationDateTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"datasetGroupArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"domain")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"failureReason")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastUpdatedDateTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"status")
      )

instance Prelude.Hashable DatasetGroupSummary where
  hashWithSalt :: Int -> DatasetGroupSummary -> Int
hashWithSalt Int
_salt DatasetGroupSummary' {Maybe Text
Maybe POSIX
Maybe Domain
status :: Maybe Text
name :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
failureReason :: Maybe Text
domain :: Maybe Domain
datasetGroupArn :: Maybe Text
creationDateTime :: Maybe POSIX
$sel:status:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
$sel:name:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
$sel:lastUpdatedDateTime:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe POSIX
$sel:failureReason:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
$sel:domain:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Domain
$sel:datasetGroupArn:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
$sel:creationDateTime:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
datasetGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Domain
domain
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
failureReason
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status

instance Prelude.NFData DatasetGroupSummary where
  rnf :: DatasetGroupSummary -> ()
rnf DatasetGroupSummary' {Maybe Text
Maybe POSIX
Maybe Domain
status :: Maybe Text
name :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
failureReason :: Maybe Text
domain :: Maybe Domain
datasetGroupArn :: Maybe Text
creationDateTime :: Maybe POSIX
$sel:status:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
$sel:name:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
$sel:lastUpdatedDateTime:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe POSIX
$sel:failureReason:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
$sel:domain:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Domain
$sel:datasetGroupArn:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe Text
$sel:creationDateTime:DatasetGroupSummary' :: DatasetGroupSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
datasetGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Domain
domain
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
failureReason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status