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

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

-- | Provides a summary of the dataset properties used in the
-- <https://docs.aws.amazon.com/forecast/latest/dg/API_ListDatasets.html ListDatasets>
-- operation. To get the complete set of properties, call the
-- <https://docs.aws.amazon.com/forecast/latest/dg/API_DescribeDataset.html DescribeDataset>
-- operation, and provide the @DatasetArn@.
--
-- /See:/ 'newDatasetSummary' smart constructor.
data DatasetSummary = DatasetSummary'
  { -- | When the dataset was created.
    DatasetSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of the dataset.
    DatasetSummary -> Maybe Text
datasetArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the dataset.
    DatasetSummary -> Maybe Text
datasetName :: Prelude.Maybe Prelude.Text,
    -- | The dataset type.
    DatasetSummary -> Maybe DatasetType
datasetType :: Prelude.Maybe DatasetType,
    -- | The domain associated with the dataset.
    DatasetSummary -> Maybe Domain
domain :: Prelude.Maybe Domain,
    -- | When you create a dataset, @LastModificationTime@ is the same as
    -- @CreationTime@. While data is being imported to the dataset,
    -- @LastModificationTime@ is the current time of the @ListDatasets@ call.
    -- After a
    -- <https://docs.aws.amazon.com/forecast/latest/dg/API_CreateDatasetImportJob.html CreateDatasetImportJob>
    -- operation has finished, @LastModificationTime@ is when the import job
    -- completed or failed.
    DatasetSummary -> Maybe POSIX
lastModificationTime :: Prelude.Maybe Data.POSIX
  }
  deriving (DatasetSummary -> DatasetSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatasetSummary -> DatasetSummary -> Bool
$c/= :: DatasetSummary -> DatasetSummary -> Bool
== :: DatasetSummary -> DatasetSummary -> Bool
$c== :: DatasetSummary -> DatasetSummary -> Bool
Prelude.Eq, ReadPrec [DatasetSummary]
ReadPrec DatasetSummary
Int -> ReadS DatasetSummary
ReadS [DatasetSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatasetSummary]
$creadListPrec :: ReadPrec [DatasetSummary]
readPrec :: ReadPrec DatasetSummary
$creadPrec :: ReadPrec DatasetSummary
readList :: ReadS [DatasetSummary]
$creadList :: ReadS [DatasetSummary]
readsPrec :: Int -> ReadS DatasetSummary
$creadsPrec :: Int -> ReadS DatasetSummary
Prelude.Read, Int -> DatasetSummary -> ShowS
[DatasetSummary] -> ShowS
DatasetSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatasetSummary] -> ShowS
$cshowList :: [DatasetSummary] -> ShowS
show :: DatasetSummary -> String
$cshow :: DatasetSummary -> String
showsPrec :: Int -> DatasetSummary -> ShowS
$cshowsPrec :: Int -> DatasetSummary -> ShowS
Prelude.Show, forall x. Rep DatasetSummary x -> DatasetSummary
forall x. DatasetSummary -> Rep DatasetSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DatasetSummary x -> DatasetSummary
$cfrom :: forall x. DatasetSummary -> Rep DatasetSummary x
Prelude.Generic)

-- |
-- Create a value of 'DatasetSummary' 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', 'datasetSummary_creationTime' - When the dataset was created.
--
-- 'datasetArn', 'datasetSummary_datasetArn' - The Amazon Resource Name (ARN) of the dataset.
--
-- 'datasetName', 'datasetSummary_datasetName' - The name of the dataset.
--
-- 'datasetType', 'datasetSummary_datasetType' - The dataset type.
--
-- 'domain', 'datasetSummary_domain' - The domain associated with the dataset.
--
-- 'lastModificationTime', 'datasetSummary_lastModificationTime' - When you create a dataset, @LastModificationTime@ is the same as
-- @CreationTime@. While data is being imported to the dataset,
-- @LastModificationTime@ is the current time of the @ListDatasets@ call.
-- After a
-- <https://docs.aws.amazon.com/forecast/latest/dg/API_CreateDatasetImportJob.html CreateDatasetImportJob>
-- operation has finished, @LastModificationTime@ is when the import job
-- completed or failed.
newDatasetSummary ::
  DatasetSummary
newDatasetSummary :: DatasetSummary
newDatasetSummary =
  DatasetSummary'
    { $sel:creationTime:DatasetSummary' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:datasetArn:DatasetSummary' :: Maybe Text
datasetArn = forall a. Maybe a
Prelude.Nothing,
      $sel:datasetName:DatasetSummary' :: Maybe Text
datasetName = forall a. Maybe a
Prelude.Nothing,
      $sel:datasetType:DatasetSummary' :: Maybe DatasetType
datasetType = forall a. Maybe a
Prelude.Nothing,
      $sel:domain:DatasetSummary' :: Maybe Domain
domain = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModificationTime:DatasetSummary' :: Maybe POSIX
lastModificationTime = forall a. Maybe a
Prelude.Nothing
    }

-- | When the dataset was created.
datasetSummary_creationTime :: Lens.Lens' DatasetSummary (Prelude.Maybe Prelude.UTCTime)
datasetSummary_creationTime :: Lens' DatasetSummary (Maybe UTCTime)
datasetSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DatasetSummary' :: DatasetSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DatasetSummary
s@DatasetSummary' {} Maybe POSIX
a -> DatasetSummary
s {$sel:creationTime:DatasetSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DatasetSummary) 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.
datasetSummary_datasetArn :: Lens.Lens' DatasetSummary (Prelude.Maybe Prelude.Text)
datasetSummary_datasetArn :: Lens' DatasetSummary (Maybe Text)
datasetSummary_datasetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetSummary' {Maybe Text
datasetArn :: Maybe Text
$sel:datasetArn:DatasetSummary' :: DatasetSummary -> Maybe Text
datasetArn} -> Maybe Text
datasetArn) (\s :: DatasetSummary
s@DatasetSummary' {} Maybe Text
a -> DatasetSummary
s {$sel:datasetArn:DatasetSummary' :: Maybe Text
datasetArn = Maybe Text
a} :: DatasetSummary)

-- | The name of the dataset.
datasetSummary_datasetName :: Lens.Lens' DatasetSummary (Prelude.Maybe Prelude.Text)
datasetSummary_datasetName :: Lens' DatasetSummary (Maybe Text)
datasetSummary_datasetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetSummary' {Maybe Text
datasetName :: Maybe Text
$sel:datasetName:DatasetSummary' :: DatasetSummary -> Maybe Text
datasetName} -> Maybe Text
datasetName) (\s :: DatasetSummary
s@DatasetSummary' {} Maybe Text
a -> DatasetSummary
s {$sel:datasetName:DatasetSummary' :: Maybe Text
datasetName = Maybe Text
a} :: DatasetSummary)

-- | The dataset type.
datasetSummary_datasetType :: Lens.Lens' DatasetSummary (Prelude.Maybe DatasetType)
datasetSummary_datasetType :: Lens' DatasetSummary (Maybe DatasetType)
datasetSummary_datasetType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetSummary' {Maybe DatasetType
datasetType :: Maybe DatasetType
$sel:datasetType:DatasetSummary' :: DatasetSummary -> Maybe DatasetType
datasetType} -> Maybe DatasetType
datasetType) (\s :: DatasetSummary
s@DatasetSummary' {} Maybe DatasetType
a -> DatasetSummary
s {$sel:datasetType:DatasetSummary' :: Maybe DatasetType
datasetType = Maybe DatasetType
a} :: DatasetSummary)

-- | The domain associated with the dataset.
datasetSummary_domain :: Lens.Lens' DatasetSummary (Prelude.Maybe Domain)
datasetSummary_domain :: Lens' DatasetSummary (Maybe Domain)
datasetSummary_domain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetSummary' {Maybe Domain
domain :: Maybe Domain
$sel:domain:DatasetSummary' :: DatasetSummary -> Maybe Domain
domain} -> Maybe Domain
domain) (\s :: DatasetSummary
s@DatasetSummary' {} Maybe Domain
a -> DatasetSummary
s {$sel:domain:DatasetSummary' :: Maybe Domain
domain = Maybe Domain
a} :: DatasetSummary)

-- | When you create a dataset, @LastModificationTime@ is the same as
-- @CreationTime@. While data is being imported to the dataset,
-- @LastModificationTime@ is the current time of the @ListDatasets@ call.
-- After a
-- <https://docs.aws.amazon.com/forecast/latest/dg/API_CreateDatasetImportJob.html CreateDatasetImportJob>
-- operation has finished, @LastModificationTime@ is when the import job
-- completed or failed.
datasetSummary_lastModificationTime :: Lens.Lens' DatasetSummary (Prelude.Maybe Prelude.UTCTime)
datasetSummary_lastModificationTime :: Lens' DatasetSummary (Maybe UTCTime)
datasetSummary_lastModificationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetSummary' {Maybe POSIX
lastModificationTime :: Maybe POSIX
$sel:lastModificationTime:DatasetSummary' :: DatasetSummary -> Maybe POSIX
lastModificationTime} -> Maybe POSIX
lastModificationTime) (\s :: DatasetSummary
s@DatasetSummary' {} Maybe POSIX
a -> DatasetSummary
s {$sel:lastModificationTime:DatasetSummary' :: Maybe POSIX
lastModificationTime = Maybe POSIX
a} :: DatasetSummary) 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

instance Data.FromJSON DatasetSummary where
  parseJSON :: Value -> Parser DatasetSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DatasetSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe DatasetType
-> Maybe Domain
-> Maybe POSIX
-> DatasetSummary
DatasetSummary'
            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
"CreationTime")
            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
"DatasetArn")
            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
"DatasetName")
            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
"DatasetType")
            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
"LastModificationTime")
      )

instance Prelude.Hashable DatasetSummary where
  hashWithSalt :: Int -> DatasetSummary -> Int
hashWithSalt Int
_salt DatasetSummary' {Maybe Text
Maybe POSIX
Maybe DatasetType
Maybe Domain
lastModificationTime :: Maybe POSIX
domain :: Maybe Domain
datasetType :: Maybe DatasetType
datasetName :: Maybe Text
datasetArn :: Maybe Text
creationTime :: Maybe POSIX
$sel:lastModificationTime:DatasetSummary' :: DatasetSummary -> Maybe POSIX
$sel:domain:DatasetSummary' :: DatasetSummary -> Maybe Domain
$sel:datasetType:DatasetSummary' :: DatasetSummary -> Maybe DatasetType
$sel:datasetName:DatasetSummary' :: DatasetSummary -> Maybe Text
$sel:datasetArn:DatasetSummary' :: DatasetSummary -> Maybe Text
$sel:creationTime:DatasetSummary' :: DatasetSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
datasetArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
datasetName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DatasetType
datasetType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Domain
domain
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModificationTime

instance Prelude.NFData DatasetSummary where
  rnf :: DatasetSummary -> ()
rnf DatasetSummary' {Maybe Text
Maybe POSIX
Maybe DatasetType
Maybe Domain
lastModificationTime :: Maybe POSIX
domain :: Maybe Domain
datasetType :: Maybe DatasetType
datasetName :: Maybe Text
datasetArn :: Maybe Text
creationTime :: Maybe POSIX
$sel:lastModificationTime:DatasetSummary' :: DatasetSummary -> Maybe POSIX
$sel:domain:DatasetSummary' :: DatasetSummary -> Maybe Domain
$sel:datasetType:DatasetSummary' :: DatasetSummary -> Maybe DatasetType
$sel:datasetName:DatasetSummary' :: DatasetSummary -> Maybe Text
$sel:datasetArn:DatasetSummary' :: DatasetSummary -> Maybe Text
$sel:creationTime:DatasetSummary' :: DatasetSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
datasetArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
datasetName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DatasetType
datasetType
      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 POSIX
lastModificationTime