{-# 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.DatasetImportJobSummary
-- 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.DatasetImportJobSummary 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.ImportMode
import qualified Amazonka.Prelude as Prelude

-- | Provides a summary of the properties of a dataset import job. For a
-- complete listing, call the
-- <https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeDatasetImportJob.html DescribeDatasetImportJob>
-- API.
--
-- /See:/ 'newDatasetImportJobSummary' smart constructor.
data DatasetImportJobSummary = DatasetImportJobSummary'
  { -- | The date and time (in Unix time) that the dataset import job was
    -- created.
    DatasetImportJobSummary -> Maybe POSIX
creationDateTime :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of the dataset import job.
    DatasetImportJobSummary -> Maybe Text
datasetImportJobArn :: Prelude.Maybe Prelude.Text,
    -- | If a dataset import job fails, the reason behind the failure.
    DatasetImportJobSummary -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The import mode the dataset import job used to update the data in the
    -- dataset. For more information see
    -- <https://docs.aws.amazon.com/personalize/latest/dg/updating-existing-bulk-data.html Updating existing bulk data>.
    DatasetImportJobSummary -> Maybe ImportMode
importMode :: Prelude.Maybe ImportMode,
    -- | The name of the dataset import job.
    DatasetImportJobSummary -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
    -- | The date and time (in Unix time) that the dataset import job status was
    -- last updated.
    DatasetImportJobSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX,
    -- | The status of the dataset import job.
    --
    -- A dataset import job can be in one of the following states:
    --
    -- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
    DatasetImportJobSummary -> Maybe Text
status :: Prelude.Maybe Prelude.Text
  }
  deriving (DatasetImportJobSummary -> DatasetImportJobSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatasetImportJobSummary -> DatasetImportJobSummary -> Bool
$c/= :: DatasetImportJobSummary -> DatasetImportJobSummary -> Bool
== :: DatasetImportJobSummary -> DatasetImportJobSummary -> Bool
$c== :: DatasetImportJobSummary -> DatasetImportJobSummary -> Bool
Prelude.Eq, ReadPrec [DatasetImportJobSummary]
ReadPrec DatasetImportJobSummary
Int -> ReadS DatasetImportJobSummary
ReadS [DatasetImportJobSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatasetImportJobSummary]
$creadListPrec :: ReadPrec [DatasetImportJobSummary]
readPrec :: ReadPrec DatasetImportJobSummary
$creadPrec :: ReadPrec DatasetImportJobSummary
readList :: ReadS [DatasetImportJobSummary]
$creadList :: ReadS [DatasetImportJobSummary]
readsPrec :: Int -> ReadS DatasetImportJobSummary
$creadsPrec :: Int -> ReadS DatasetImportJobSummary
Prelude.Read, Int -> DatasetImportJobSummary -> ShowS
[DatasetImportJobSummary] -> ShowS
DatasetImportJobSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatasetImportJobSummary] -> ShowS
$cshowList :: [DatasetImportJobSummary] -> ShowS
show :: DatasetImportJobSummary -> String
$cshow :: DatasetImportJobSummary -> String
showsPrec :: Int -> DatasetImportJobSummary -> ShowS
$cshowsPrec :: Int -> DatasetImportJobSummary -> ShowS
Prelude.Show, forall x. Rep DatasetImportJobSummary x -> DatasetImportJobSummary
forall x. DatasetImportJobSummary -> Rep DatasetImportJobSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DatasetImportJobSummary x -> DatasetImportJobSummary
$cfrom :: forall x. DatasetImportJobSummary -> Rep DatasetImportJobSummary x
Prelude.Generic)

-- |
-- Create a value of 'DatasetImportJobSummary' 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', 'datasetImportJobSummary_creationDateTime' - The date and time (in Unix time) that the dataset import job was
-- created.
--
-- 'datasetImportJobArn', 'datasetImportJobSummary_datasetImportJobArn' - The Amazon Resource Name (ARN) of the dataset import job.
--
-- 'failureReason', 'datasetImportJobSummary_failureReason' - If a dataset import job fails, the reason behind the failure.
--
-- 'importMode', 'datasetImportJobSummary_importMode' - The import mode the dataset import job used to update the data in the
-- dataset. For more information see
-- <https://docs.aws.amazon.com/personalize/latest/dg/updating-existing-bulk-data.html Updating existing bulk data>.
--
-- 'jobName', 'datasetImportJobSummary_jobName' - The name of the dataset import job.
--
-- 'lastUpdatedDateTime', 'datasetImportJobSummary_lastUpdatedDateTime' - The date and time (in Unix time) that the dataset import job status was
-- last updated.
--
-- 'status', 'datasetImportJobSummary_status' - The status of the dataset import job.
--
-- A dataset import job can be in one of the following states:
--
-- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
newDatasetImportJobSummary ::
  DatasetImportJobSummary
newDatasetImportJobSummary :: DatasetImportJobSummary
newDatasetImportJobSummary =
  DatasetImportJobSummary'
    { $sel:creationDateTime:DatasetImportJobSummary' :: Maybe POSIX
creationDateTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:datasetImportJobArn:DatasetImportJobSummary' :: Maybe Text
datasetImportJobArn = forall a. Maybe a
Prelude.Nothing,
      $sel:failureReason:DatasetImportJobSummary' :: Maybe Text
failureReason = forall a. Maybe a
Prelude.Nothing,
      $sel:importMode:DatasetImportJobSummary' :: Maybe ImportMode
importMode = forall a. Maybe a
Prelude.Nothing,
      $sel:jobName:DatasetImportJobSummary' :: Maybe Text
jobName = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:DatasetImportJobSummary' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DatasetImportJobSummary' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time (in Unix time) that the dataset import job was
-- created.
datasetImportJobSummary_creationDateTime :: Lens.Lens' DatasetImportJobSummary (Prelude.Maybe Prelude.UTCTime)
datasetImportJobSummary_creationDateTime :: Lens' DatasetImportJobSummary (Maybe UTCTime)
datasetImportJobSummary_creationDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetImportJobSummary' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: DatasetImportJobSummary
s@DatasetImportJobSummary' {} Maybe POSIX
a -> DatasetImportJobSummary
s {$sel:creationDateTime:DatasetImportJobSummary' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: DatasetImportJobSummary) 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 import job.
datasetImportJobSummary_datasetImportJobArn :: Lens.Lens' DatasetImportJobSummary (Prelude.Maybe Prelude.Text)
datasetImportJobSummary_datasetImportJobArn :: Lens' DatasetImportJobSummary (Maybe Text)
datasetImportJobSummary_datasetImportJobArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetImportJobSummary' {Maybe Text
datasetImportJobArn :: Maybe Text
$sel:datasetImportJobArn:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe Text
datasetImportJobArn} -> Maybe Text
datasetImportJobArn) (\s :: DatasetImportJobSummary
s@DatasetImportJobSummary' {} Maybe Text
a -> DatasetImportJobSummary
s {$sel:datasetImportJobArn:DatasetImportJobSummary' :: Maybe Text
datasetImportJobArn = Maybe Text
a} :: DatasetImportJobSummary)

-- | If a dataset import job fails, the reason behind the failure.
datasetImportJobSummary_failureReason :: Lens.Lens' DatasetImportJobSummary (Prelude.Maybe Prelude.Text)
datasetImportJobSummary_failureReason :: Lens' DatasetImportJobSummary (Maybe Text)
datasetImportJobSummary_failureReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetImportJobSummary' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: DatasetImportJobSummary
s@DatasetImportJobSummary' {} Maybe Text
a -> DatasetImportJobSummary
s {$sel:failureReason:DatasetImportJobSummary' :: Maybe Text
failureReason = Maybe Text
a} :: DatasetImportJobSummary)

-- | The import mode the dataset import job used to update the data in the
-- dataset. For more information see
-- <https://docs.aws.amazon.com/personalize/latest/dg/updating-existing-bulk-data.html Updating existing bulk data>.
datasetImportJobSummary_importMode :: Lens.Lens' DatasetImportJobSummary (Prelude.Maybe ImportMode)
datasetImportJobSummary_importMode :: Lens' DatasetImportJobSummary (Maybe ImportMode)
datasetImportJobSummary_importMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetImportJobSummary' {Maybe ImportMode
importMode :: Maybe ImportMode
$sel:importMode:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe ImportMode
importMode} -> Maybe ImportMode
importMode) (\s :: DatasetImportJobSummary
s@DatasetImportJobSummary' {} Maybe ImportMode
a -> DatasetImportJobSummary
s {$sel:importMode:DatasetImportJobSummary' :: Maybe ImportMode
importMode = Maybe ImportMode
a} :: DatasetImportJobSummary)

-- | The name of the dataset import job.
datasetImportJobSummary_jobName :: Lens.Lens' DatasetImportJobSummary (Prelude.Maybe Prelude.Text)
datasetImportJobSummary_jobName :: Lens' DatasetImportJobSummary (Maybe Text)
datasetImportJobSummary_jobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetImportJobSummary' {Maybe Text
jobName :: Maybe Text
$sel:jobName:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe Text
jobName} -> Maybe Text
jobName) (\s :: DatasetImportJobSummary
s@DatasetImportJobSummary' {} Maybe Text
a -> DatasetImportJobSummary
s {$sel:jobName:DatasetImportJobSummary' :: Maybe Text
jobName = Maybe Text
a} :: DatasetImportJobSummary)

-- | The date and time (in Unix time) that the dataset import job status was
-- last updated.
datasetImportJobSummary_lastUpdatedDateTime :: Lens.Lens' DatasetImportJobSummary (Prelude.Maybe Prelude.UTCTime)
datasetImportJobSummary_lastUpdatedDateTime :: Lens' DatasetImportJobSummary (Maybe UTCTime)
datasetImportJobSummary_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetImportJobSummary' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: DatasetImportJobSummary
s@DatasetImportJobSummary' {} Maybe POSIX
a -> DatasetImportJobSummary
s {$sel:lastUpdatedDateTime:DatasetImportJobSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: DatasetImportJobSummary) 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 status of the dataset import job.
--
-- A dataset import job can be in one of the following states:
--
-- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
datasetImportJobSummary_status :: Lens.Lens' DatasetImportJobSummary (Prelude.Maybe Prelude.Text)
datasetImportJobSummary_status :: Lens' DatasetImportJobSummary (Maybe Text)
datasetImportJobSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetImportJobSummary' {Maybe Text
status :: Maybe Text
$sel:status:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe Text
status} -> Maybe Text
status) (\s :: DatasetImportJobSummary
s@DatasetImportJobSummary' {} Maybe Text
a -> DatasetImportJobSummary
s {$sel:status:DatasetImportJobSummary' :: Maybe Text
status = Maybe Text
a} :: DatasetImportJobSummary)

instance Data.FromJSON DatasetImportJobSummary where
  parseJSON :: Value -> Parser DatasetImportJobSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DatasetImportJobSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ImportMode
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> DatasetImportJobSummary
DatasetImportJobSummary'
            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
"datasetImportJobArn")
            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
"importMode")
            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
"jobName")
            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
"status")
      )

instance Prelude.Hashable DatasetImportJobSummary where
  hashWithSalt :: Int -> DatasetImportJobSummary -> Int
hashWithSalt Int
_salt DatasetImportJobSummary' {Maybe Text
Maybe POSIX
Maybe ImportMode
status :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
jobName :: Maybe Text
importMode :: Maybe ImportMode
failureReason :: Maybe Text
datasetImportJobArn :: Maybe Text
creationDateTime :: Maybe POSIX
$sel:status:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe Text
$sel:lastUpdatedDateTime:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe POSIX
$sel:jobName:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe Text
$sel:importMode:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe ImportMode
$sel:failureReason:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe Text
$sel:datasetImportJobArn:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe Text
$sel:creationDateTime:DatasetImportJobSummary' :: DatasetImportJobSummary -> 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
datasetImportJobArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
failureReason
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ImportMode
importMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
jobName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status

instance Prelude.NFData DatasetImportJobSummary where
  rnf :: DatasetImportJobSummary -> ()
rnf DatasetImportJobSummary' {Maybe Text
Maybe POSIX
Maybe ImportMode
status :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
jobName :: Maybe Text
importMode :: Maybe ImportMode
failureReason :: Maybe Text
datasetImportJobArn :: Maybe Text
creationDateTime :: Maybe POSIX
$sel:status:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe Text
$sel:lastUpdatedDateTime:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe POSIX
$sel:jobName:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe Text
$sel:importMode:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe ImportMode
$sel:failureReason:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe Text
$sel:datasetImportJobArn:DatasetImportJobSummary' :: DatasetImportJobSummary -> Maybe Text
$sel:creationDateTime:DatasetImportJobSummary' :: DatasetImportJobSummary -> 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
datasetImportJobArn
      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 ImportMode
importMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobName
      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
status