{-# 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.BatchSegmentJobSummary
-- 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.BatchSegmentJobSummary where

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

-- | A truncated version of the
-- <https://docs.aws.amazon.com/personalize/latest/dg/API_BatchSegmentJob.html BatchSegmentJob>
-- datatype.
-- <https://docs.aws.amazon.com/personalize/latest/dg/API_ListBatchSegmentJobs.html ListBatchSegmentJobs>
-- operation returns a list of batch segment job summaries.
--
-- /See:/ 'newBatchSegmentJobSummary' smart constructor.
data BatchSegmentJobSummary = BatchSegmentJobSummary'
  { -- | The Amazon Resource Name (ARN) of the batch segment job.
    BatchSegmentJobSummary -> Maybe Text
batchSegmentJobArn :: Prelude.Maybe Prelude.Text,
    -- | The time at which the batch segment job was created.
    BatchSegmentJobSummary -> Maybe POSIX
creationDateTime :: Prelude.Maybe Data.POSIX,
    -- | If the batch segment job failed, the reason for the failure.
    BatchSegmentJobSummary -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The name of the batch segment job.
    BatchSegmentJobSummary -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
    -- | The time at which the batch segment job was last updated.
    BatchSegmentJobSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of the solution version used by the batch
    -- segment job to generate batch segments.
    BatchSegmentJobSummary -> Maybe Text
solutionVersionArn :: Prelude.Maybe Prelude.Text,
    -- | The status of the batch segment job. The status is one of the following
    -- values:
    --
    -- -   PENDING
    --
    -- -   IN PROGRESS
    --
    -- -   ACTIVE
    --
    -- -   CREATE FAILED
    BatchSegmentJobSummary -> Maybe Text
status :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchSegmentJobSummary -> BatchSegmentJobSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchSegmentJobSummary -> BatchSegmentJobSummary -> Bool
$c/= :: BatchSegmentJobSummary -> BatchSegmentJobSummary -> Bool
== :: BatchSegmentJobSummary -> BatchSegmentJobSummary -> Bool
$c== :: BatchSegmentJobSummary -> BatchSegmentJobSummary -> Bool
Prelude.Eq, ReadPrec [BatchSegmentJobSummary]
ReadPrec BatchSegmentJobSummary
Int -> ReadS BatchSegmentJobSummary
ReadS [BatchSegmentJobSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchSegmentJobSummary]
$creadListPrec :: ReadPrec [BatchSegmentJobSummary]
readPrec :: ReadPrec BatchSegmentJobSummary
$creadPrec :: ReadPrec BatchSegmentJobSummary
readList :: ReadS [BatchSegmentJobSummary]
$creadList :: ReadS [BatchSegmentJobSummary]
readsPrec :: Int -> ReadS BatchSegmentJobSummary
$creadsPrec :: Int -> ReadS BatchSegmentJobSummary
Prelude.Read, Int -> BatchSegmentJobSummary -> ShowS
[BatchSegmentJobSummary] -> ShowS
BatchSegmentJobSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchSegmentJobSummary] -> ShowS
$cshowList :: [BatchSegmentJobSummary] -> ShowS
show :: BatchSegmentJobSummary -> String
$cshow :: BatchSegmentJobSummary -> String
showsPrec :: Int -> BatchSegmentJobSummary -> ShowS
$cshowsPrec :: Int -> BatchSegmentJobSummary -> ShowS
Prelude.Show, forall x. Rep BatchSegmentJobSummary x -> BatchSegmentJobSummary
forall x. BatchSegmentJobSummary -> Rep BatchSegmentJobSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchSegmentJobSummary x -> BatchSegmentJobSummary
$cfrom :: forall x. BatchSegmentJobSummary -> Rep BatchSegmentJobSummary x
Prelude.Generic)

-- |
-- Create a value of 'BatchSegmentJobSummary' 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:
--
-- 'batchSegmentJobArn', 'batchSegmentJobSummary_batchSegmentJobArn' - The Amazon Resource Name (ARN) of the batch segment job.
--
-- 'creationDateTime', 'batchSegmentJobSummary_creationDateTime' - The time at which the batch segment job was created.
--
-- 'failureReason', 'batchSegmentJobSummary_failureReason' - If the batch segment job failed, the reason for the failure.
--
-- 'jobName', 'batchSegmentJobSummary_jobName' - The name of the batch segment job.
--
-- 'lastUpdatedDateTime', 'batchSegmentJobSummary_lastUpdatedDateTime' - The time at which the batch segment job was last updated.
--
-- 'solutionVersionArn', 'batchSegmentJobSummary_solutionVersionArn' - The Amazon Resource Name (ARN) of the solution version used by the batch
-- segment job to generate batch segments.
--
-- 'status', 'batchSegmentJobSummary_status' - The status of the batch segment job. The status is one of the following
-- values:
--
-- -   PENDING
--
-- -   IN PROGRESS
--
-- -   ACTIVE
--
-- -   CREATE FAILED
newBatchSegmentJobSummary ::
  BatchSegmentJobSummary
newBatchSegmentJobSummary :: BatchSegmentJobSummary
newBatchSegmentJobSummary =
  BatchSegmentJobSummary'
    { $sel:batchSegmentJobArn:BatchSegmentJobSummary' :: Maybe Text
batchSegmentJobArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:creationDateTime:BatchSegmentJobSummary' :: Maybe POSIX
creationDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:failureReason:BatchSegmentJobSummary' :: Maybe Text
failureReason = forall a. Maybe a
Prelude.Nothing,
      $sel:jobName:BatchSegmentJobSummary' :: Maybe Text
jobName = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:BatchSegmentJobSummary' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:solutionVersionArn:BatchSegmentJobSummary' :: Maybe Text
solutionVersionArn = forall a. Maybe a
Prelude.Nothing,
      $sel:status:BatchSegmentJobSummary' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the batch segment job.
batchSegmentJobSummary_batchSegmentJobArn :: Lens.Lens' BatchSegmentJobSummary (Prelude.Maybe Prelude.Text)
batchSegmentJobSummary_batchSegmentJobArn :: Lens' BatchSegmentJobSummary (Maybe Text)
batchSegmentJobSummary_batchSegmentJobArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchSegmentJobSummary' {Maybe Text
batchSegmentJobArn :: Maybe Text
$sel:batchSegmentJobArn:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe Text
batchSegmentJobArn} -> Maybe Text
batchSegmentJobArn) (\s :: BatchSegmentJobSummary
s@BatchSegmentJobSummary' {} Maybe Text
a -> BatchSegmentJobSummary
s {$sel:batchSegmentJobArn:BatchSegmentJobSummary' :: Maybe Text
batchSegmentJobArn = Maybe Text
a} :: BatchSegmentJobSummary)

-- | The time at which the batch segment job was created.
batchSegmentJobSummary_creationDateTime :: Lens.Lens' BatchSegmentJobSummary (Prelude.Maybe Prelude.UTCTime)
batchSegmentJobSummary_creationDateTime :: Lens' BatchSegmentJobSummary (Maybe UTCTime)
batchSegmentJobSummary_creationDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchSegmentJobSummary' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: BatchSegmentJobSummary
s@BatchSegmentJobSummary' {} Maybe POSIX
a -> BatchSegmentJobSummary
s {$sel:creationDateTime:BatchSegmentJobSummary' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: BatchSegmentJobSummary) 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

-- | If the batch segment job failed, the reason for the failure.
batchSegmentJobSummary_failureReason :: Lens.Lens' BatchSegmentJobSummary (Prelude.Maybe Prelude.Text)
batchSegmentJobSummary_failureReason :: Lens' BatchSegmentJobSummary (Maybe Text)
batchSegmentJobSummary_failureReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchSegmentJobSummary' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: BatchSegmentJobSummary
s@BatchSegmentJobSummary' {} Maybe Text
a -> BatchSegmentJobSummary
s {$sel:failureReason:BatchSegmentJobSummary' :: Maybe Text
failureReason = Maybe Text
a} :: BatchSegmentJobSummary)

-- | The name of the batch segment job.
batchSegmentJobSummary_jobName :: Lens.Lens' BatchSegmentJobSummary (Prelude.Maybe Prelude.Text)
batchSegmentJobSummary_jobName :: Lens' BatchSegmentJobSummary (Maybe Text)
batchSegmentJobSummary_jobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchSegmentJobSummary' {Maybe Text
jobName :: Maybe Text
$sel:jobName:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe Text
jobName} -> Maybe Text
jobName) (\s :: BatchSegmentJobSummary
s@BatchSegmentJobSummary' {} Maybe Text
a -> BatchSegmentJobSummary
s {$sel:jobName:BatchSegmentJobSummary' :: Maybe Text
jobName = Maybe Text
a} :: BatchSegmentJobSummary)

-- | The time at which the batch segment job was last updated.
batchSegmentJobSummary_lastUpdatedDateTime :: Lens.Lens' BatchSegmentJobSummary (Prelude.Maybe Prelude.UTCTime)
batchSegmentJobSummary_lastUpdatedDateTime :: Lens' BatchSegmentJobSummary (Maybe UTCTime)
batchSegmentJobSummary_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchSegmentJobSummary' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: BatchSegmentJobSummary
s@BatchSegmentJobSummary' {} Maybe POSIX
a -> BatchSegmentJobSummary
s {$sel:lastUpdatedDateTime:BatchSegmentJobSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: BatchSegmentJobSummary) 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 solution version used by the batch
-- segment job to generate batch segments.
batchSegmentJobSummary_solutionVersionArn :: Lens.Lens' BatchSegmentJobSummary (Prelude.Maybe Prelude.Text)
batchSegmentJobSummary_solutionVersionArn :: Lens' BatchSegmentJobSummary (Maybe Text)
batchSegmentJobSummary_solutionVersionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchSegmentJobSummary' {Maybe Text
solutionVersionArn :: Maybe Text
$sel:solutionVersionArn:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe Text
solutionVersionArn} -> Maybe Text
solutionVersionArn) (\s :: BatchSegmentJobSummary
s@BatchSegmentJobSummary' {} Maybe Text
a -> BatchSegmentJobSummary
s {$sel:solutionVersionArn:BatchSegmentJobSummary' :: Maybe Text
solutionVersionArn = Maybe Text
a} :: BatchSegmentJobSummary)

-- | The status of the batch segment job. The status is one of the following
-- values:
--
-- -   PENDING
--
-- -   IN PROGRESS
--
-- -   ACTIVE
--
-- -   CREATE FAILED
batchSegmentJobSummary_status :: Lens.Lens' BatchSegmentJobSummary (Prelude.Maybe Prelude.Text)
batchSegmentJobSummary_status :: Lens' BatchSegmentJobSummary (Maybe Text)
batchSegmentJobSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchSegmentJobSummary' {Maybe Text
status :: Maybe Text
$sel:status:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe Text
status} -> Maybe Text
status) (\s :: BatchSegmentJobSummary
s@BatchSegmentJobSummary' {} Maybe Text
a -> BatchSegmentJobSummary
s {$sel:status:BatchSegmentJobSummary' :: Maybe Text
status = Maybe Text
a} :: BatchSegmentJobSummary)

instance Data.FromJSON BatchSegmentJobSummary where
  parseJSON :: Value -> Parser BatchSegmentJobSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchSegmentJobSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> BatchSegmentJobSummary
BatchSegmentJobSummary'
            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
"batchSegmentJobArn")
            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
"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
"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
"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
"solutionVersionArn")
            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 BatchSegmentJobSummary where
  hashWithSalt :: Int -> BatchSegmentJobSummary -> Int
hashWithSalt Int
_salt BatchSegmentJobSummary' {Maybe Text
Maybe POSIX
status :: Maybe Text
solutionVersionArn :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
jobName :: Maybe Text
failureReason :: Maybe Text
creationDateTime :: Maybe POSIX
batchSegmentJobArn :: Maybe Text
$sel:status:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe Text
$sel:solutionVersionArn:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe Text
$sel:lastUpdatedDateTime:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe POSIX
$sel:jobName:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe Text
$sel:failureReason:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe Text
$sel:creationDateTime:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe POSIX
$sel:batchSegmentJobArn:BatchSegmentJobSummary' :: BatchSegmentJobSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
batchSegmentJobArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
failureReason
      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
solutionVersionArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status

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