{-# 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.RobOMaker.Types.WorldGenerationJobSummary
-- 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.RobOMaker.Types.WorldGenerationJobSummary 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
import Amazonka.RobOMaker.Types.WorldCount
import Amazonka.RobOMaker.Types.WorldGenerationJobStatus

-- | Information about a world generator job.
--
-- /See:/ 'newWorldGenerationJobSummary' smart constructor.
data WorldGenerationJobSummary = WorldGenerationJobSummary'
  { -- | The Amazon Resource Name (ARN) of the world generator job.
    WorldGenerationJobSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the world generator job
    -- was created.
    WorldGenerationJobSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
    -- | The number of worlds that failed.
    WorldGenerationJobSummary -> Maybe Int
failedWorldCount :: Prelude.Maybe Prelude.Int,
    -- | The status of the world generator job:
    --
    -- [Pending]
    --     The world generator job request is pending.
    --
    -- [Running]
    --     The world generator job is running.
    --
    -- [Completed]
    --     The world generator job completed.
    --
    -- [Failed]
    --     The world generator job failed. See @failureCode@ for more
    --     information.
    --
    -- [PartialFailed]
    --     Some worlds did not generate.
    --
    -- [Canceled]
    --     The world generator job was cancelled.
    --
    -- [Canceling]
    --     The world generator job is being cancelled.
    WorldGenerationJobSummary -> Maybe WorldGenerationJobStatus
status :: Prelude.Maybe WorldGenerationJobStatus,
    -- | The number of worlds that were generated.
    WorldGenerationJobSummary -> Maybe Int
succeededWorldCount :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Resource Name (arn) of the world template.
    WorldGenerationJobSummary -> Maybe Text
template :: Prelude.Maybe Prelude.Text,
    -- | Information about the world count.
    WorldGenerationJobSummary -> Maybe WorldCount
worldCount :: Prelude.Maybe WorldCount
  }
  deriving (WorldGenerationJobSummary -> WorldGenerationJobSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorldGenerationJobSummary -> WorldGenerationJobSummary -> Bool
$c/= :: WorldGenerationJobSummary -> WorldGenerationJobSummary -> Bool
== :: WorldGenerationJobSummary -> WorldGenerationJobSummary -> Bool
$c== :: WorldGenerationJobSummary -> WorldGenerationJobSummary -> Bool
Prelude.Eq, ReadPrec [WorldGenerationJobSummary]
ReadPrec WorldGenerationJobSummary
Int -> ReadS WorldGenerationJobSummary
ReadS [WorldGenerationJobSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorldGenerationJobSummary]
$creadListPrec :: ReadPrec [WorldGenerationJobSummary]
readPrec :: ReadPrec WorldGenerationJobSummary
$creadPrec :: ReadPrec WorldGenerationJobSummary
readList :: ReadS [WorldGenerationJobSummary]
$creadList :: ReadS [WorldGenerationJobSummary]
readsPrec :: Int -> ReadS WorldGenerationJobSummary
$creadsPrec :: Int -> ReadS WorldGenerationJobSummary
Prelude.Read, Int -> WorldGenerationJobSummary -> ShowS
[WorldGenerationJobSummary] -> ShowS
WorldGenerationJobSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorldGenerationJobSummary] -> ShowS
$cshowList :: [WorldGenerationJobSummary] -> ShowS
show :: WorldGenerationJobSummary -> String
$cshow :: WorldGenerationJobSummary -> String
showsPrec :: Int -> WorldGenerationJobSummary -> ShowS
$cshowsPrec :: Int -> WorldGenerationJobSummary -> ShowS
Prelude.Show, forall x.
Rep WorldGenerationJobSummary x -> WorldGenerationJobSummary
forall x.
WorldGenerationJobSummary -> Rep WorldGenerationJobSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorldGenerationJobSummary x -> WorldGenerationJobSummary
$cfrom :: forall x.
WorldGenerationJobSummary -> Rep WorldGenerationJobSummary x
Prelude.Generic)

-- |
-- Create a value of 'WorldGenerationJobSummary' 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:
--
-- 'arn', 'worldGenerationJobSummary_arn' - The Amazon Resource Name (ARN) of the world generator job.
--
-- 'createdAt', 'worldGenerationJobSummary_createdAt' - The time, in milliseconds since the epoch, when the world generator job
-- was created.
--
-- 'failedWorldCount', 'worldGenerationJobSummary_failedWorldCount' - The number of worlds that failed.
--
-- 'status', 'worldGenerationJobSummary_status' - The status of the world generator job:
--
-- [Pending]
--     The world generator job request is pending.
--
-- [Running]
--     The world generator job is running.
--
-- [Completed]
--     The world generator job completed.
--
-- [Failed]
--     The world generator job failed. See @failureCode@ for more
--     information.
--
-- [PartialFailed]
--     Some worlds did not generate.
--
-- [Canceled]
--     The world generator job was cancelled.
--
-- [Canceling]
--     The world generator job is being cancelled.
--
-- 'succeededWorldCount', 'worldGenerationJobSummary_succeededWorldCount' - The number of worlds that were generated.
--
-- 'template', 'worldGenerationJobSummary_template' - The Amazon Resource Name (arn) of the world template.
--
-- 'worldCount', 'worldGenerationJobSummary_worldCount' - Information about the world count.
newWorldGenerationJobSummary ::
  WorldGenerationJobSummary
newWorldGenerationJobSummary :: WorldGenerationJobSummary
newWorldGenerationJobSummary =
  WorldGenerationJobSummary'
    { $sel:arn:WorldGenerationJobSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:WorldGenerationJobSummary' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:failedWorldCount:WorldGenerationJobSummary' :: Maybe Int
failedWorldCount = forall a. Maybe a
Prelude.Nothing,
      $sel:status:WorldGenerationJobSummary' :: Maybe WorldGenerationJobStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:succeededWorldCount:WorldGenerationJobSummary' :: Maybe Int
succeededWorldCount = forall a. Maybe a
Prelude.Nothing,
      $sel:template:WorldGenerationJobSummary' :: Maybe Text
template = forall a. Maybe a
Prelude.Nothing,
      $sel:worldCount:WorldGenerationJobSummary' :: Maybe WorldCount
worldCount = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the world generator job.
worldGenerationJobSummary_arn :: Lens.Lens' WorldGenerationJobSummary (Prelude.Maybe Prelude.Text)
worldGenerationJobSummary_arn :: Lens' WorldGenerationJobSummary (Maybe Text)
worldGenerationJobSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldGenerationJobSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: WorldGenerationJobSummary
s@WorldGenerationJobSummary' {} Maybe Text
a -> WorldGenerationJobSummary
s {$sel:arn:WorldGenerationJobSummary' :: Maybe Text
arn = Maybe Text
a} :: WorldGenerationJobSummary)

-- | The time, in milliseconds since the epoch, when the world generator job
-- was created.
worldGenerationJobSummary_createdAt :: Lens.Lens' WorldGenerationJobSummary (Prelude.Maybe Prelude.UTCTime)
worldGenerationJobSummary_createdAt :: Lens' WorldGenerationJobSummary (Maybe UTCTime)
worldGenerationJobSummary_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldGenerationJobSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: WorldGenerationJobSummary
s@WorldGenerationJobSummary' {} Maybe POSIX
a -> WorldGenerationJobSummary
s {$sel:createdAt:WorldGenerationJobSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: WorldGenerationJobSummary) 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 number of worlds that failed.
worldGenerationJobSummary_failedWorldCount :: Lens.Lens' WorldGenerationJobSummary (Prelude.Maybe Prelude.Int)
worldGenerationJobSummary_failedWorldCount :: Lens' WorldGenerationJobSummary (Maybe Int)
worldGenerationJobSummary_failedWorldCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldGenerationJobSummary' {Maybe Int
failedWorldCount :: Maybe Int
$sel:failedWorldCount:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe Int
failedWorldCount} -> Maybe Int
failedWorldCount) (\s :: WorldGenerationJobSummary
s@WorldGenerationJobSummary' {} Maybe Int
a -> WorldGenerationJobSummary
s {$sel:failedWorldCount:WorldGenerationJobSummary' :: Maybe Int
failedWorldCount = Maybe Int
a} :: WorldGenerationJobSummary)

-- | The status of the world generator job:
--
-- [Pending]
--     The world generator job request is pending.
--
-- [Running]
--     The world generator job is running.
--
-- [Completed]
--     The world generator job completed.
--
-- [Failed]
--     The world generator job failed. See @failureCode@ for more
--     information.
--
-- [PartialFailed]
--     Some worlds did not generate.
--
-- [Canceled]
--     The world generator job was cancelled.
--
-- [Canceling]
--     The world generator job is being cancelled.
worldGenerationJobSummary_status :: Lens.Lens' WorldGenerationJobSummary (Prelude.Maybe WorldGenerationJobStatus)
worldGenerationJobSummary_status :: Lens' WorldGenerationJobSummary (Maybe WorldGenerationJobStatus)
worldGenerationJobSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldGenerationJobSummary' {Maybe WorldGenerationJobStatus
status :: Maybe WorldGenerationJobStatus
$sel:status:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe WorldGenerationJobStatus
status} -> Maybe WorldGenerationJobStatus
status) (\s :: WorldGenerationJobSummary
s@WorldGenerationJobSummary' {} Maybe WorldGenerationJobStatus
a -> WorldGenerationJobSummary
s {$sel:status:WorldGenerationJobSummary' :: Maybe WorldGenerationJobStatus
status = Maybe WorldGenerationJobStatus
a} :: WorldGenerationJobSummary)

-- | The number of worlds that were generated.
worldGenerationJobSummary_succeededWorldCount :: Lens.Lens' WorldGenerationJobSummary (Prelude.Maybe Prelude.Int)
worldGenerationJobSummary_succeededWorldCount :: Lens' WorldGenerationJobSummary (Maybe Int)
worldGenerationJobSummary_succeededWorldCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldGenerationJobSummary' {Maybe Int
succeededWorldCount :: Maybe Int
$sel:succeededWorldCount:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe Int
succeededWorldCount} -> Maybe Int
succeededWorldCount) (\s :: WorldGenerationJobSummary
s@WorldGenerationJobSummary' {} Maybe Int
a -> WorldGenerationJobSummary
s {$sel:succeededWorldCount:WorldGenerationJobSummary' :: Maybe Int
succeededWorldCount = Maybe Int
a} :: WorldGenerationJobSummary)

-- | The Amazon Resource Name (arn) of the world template.
worldGenerationJobSummary_template :: Lens.Lens' WorldGenerationJobSummary (Prelude.Maybe Prelude.Text)
worldGenerationJobSummary_template :: Lens' WorldGenerationJobSummary (Maybe Text)
worldGenerationJobSummary_template = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldGenerationJobSummary' {Maybe Text
template :: Maybe Text
$sel:template:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe Text
template} -> Maybe Text
template) (\s :: WorldGenerationJobSummary
s@WorldGenerationJobSummary' {} Maybe Text
a -> WorldGenerationJobSummary
s {$sel:template:WorldGenerationJobSummary' :: Maybe Text
template = Maybe Text
a} :: WorldGenerationJobSummary)

-- | Information about the world count.
worldGenerationJobSummary_worldCount :: Lens.Lens' WorldGenerationJobSummary (Prelude.Maybe WorldCount)
worldGenerationJobSummary_worldCount :: Lens' WorldGenerationJobSummary (Maybe WorldCount)
worldGenerationJobSummary_worldCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldGenerationJobSummary' {Maybe WorldCount
worldCount :: Maybe WorldCount
$sel:worldCount:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe WorldCount
worldCount} -> Maybe WorldCount
worldCount) (\s :: WorldGenerationJobSummary
s@WorldGenerationJobSummary' {} Maybe WorldCount
a -> WorldGenerationJobSummary
s {$sel:worldCount:WorldGenerationJobSummary' :: Maybe WorldCount
worldCount = Maybe WorldCount
a} :: WorldGenerationJobSummary)

instance Data.FromJSON WorldGenerationJobSummary where
  parseJSON :: Value -> Parser WorldGenerationJobSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WorldGenerationJobSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Int
-> Maybe WorldGenerationJobStatus
-> Maybe Int
-> Maybe Text
-> Maybe WorldCount
-> WorldGenerationJobSummary
WorldGenerationJobSummary'
            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
"arn")
            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
"createdAt")
            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
"failedWorldCount")
            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")
            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
"succeededWorldCount")
            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
"template")
            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
"worldCount")
      )

instance Prelude.Hashable WorldGenerationJobSummary where
  hashWithSalt :: Int -> WorldGenerationJobSummary -> Int
hashWithSalt Int
_salt WorldGenerationJobSummary' {Maybe Int
Maybe Text
Maybe POSIX
Maybe WorldCount
Maybe WorldGenerationJobStatus
worldCount :: Maybe WorldCount
template :: Maybe Text
succeededWorldCount :: Maybe Int
status :: Maybe WorldGenerationJobStatus
failedWorldCount :: Maybe Int
createdAt :: Maybe POSIX
arn :: Maybe Text
$sel:worldCount:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe WorldCount
$sel:template:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe Text
$sel:succeededWorldCount:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe Int
$sel:status:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe WorldGenerationJobStatus
$sel:failedWorldCount:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe Int
$sel:createdAt:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe POSIX
$sel:arn:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
failedWorldCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorldGenerationJobStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
succeededWorldCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
template
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorldCount
worldCount

instance Prelude.NFData WorldGenerationJobSummary where
  rnf :: WorldGenerationJobSummary -> ()
rnf WorldGenerationJobSummary' {Maybe Int
Maybe Text
Maybe POSIX
Maybe WorldCount
Maybe WorldGenerationJobStatus
worldCount :: Maybe WorldCount
template :: Maybe Text
succeededWorldCount :: Maybe Int
status :: Maybe WorldGenerationJobStatus
failedWorldCount :: Maybe Int
createdAt :: Maybe POSIX
arn :: Maybe Text
$sel:worldCount:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe WorldCount
$sel:template:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe Text
$sel:succeededWorldCount:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe Int
$sel:status:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe WorldGenerationJobStatus
$sel:failedWorldCount:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe Int
$sel:createdAt:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe POSIX
$sel:arn:WorldGenerationJobSummary' :: WorldGenerationJobSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
failedWorldCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WorldGenerationJobStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
succeededWorldCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
template
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WorldCount
worldCount