{-# 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.WorldSummary
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.RobOMaker.Types.WorldSummary where

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

-- | Information about a world.
--
-- /See:/ 'newWorldSummary' smart constructor.
data WorldSummary = WorldSummary'
  { -- | The Amazon Resource Name (ARN) of the world.
    WorldSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the world was created.
    WorldSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (arn) of the world template.
    WorldSummary -> Maybe Text
template :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (arn) of the world generation job.
    WorldSummary -> Maybe Text
generationJob :: Prelude.Maybe Prelude.Text
  }
  deriving (WorldSummary -> WorldSummary -> Bool
(WorldSummary -> WorldSummary -> Bool)
-> (WorldSummary -> WorldSummary -> Bool) -> Eq WorldSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorldSummary -> WorldSummary -> Bool
$c/= :: WorldSummary -> WorldSummary -> Bool
== :: WorldSummary -> WorldSummary -> Bool
$c== :: WorldSummary -> WorldSummary -> Bool
Prelude.Eq, ReadPrec [WorldSummary]
ReadPrec WorldSummary
Int -> ReadS WorldSummary
ReadS [WorldSummary]
(Int -> ReadS WorldSummary)
-> ReadS [WorldSummary]
-> ReadPrec WorldSummary
-> ReadPrec [WorldSummary]
-> Read WorldSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorldSummary]
$creadListPrec :: ReadPrec [WorldSummary]
readPrec :: ReadPrec WorldSummary
$creadPrec :: ReadPrec WorldSummary
readList :: ReadS [WorldSummary]
$creadList :: ReadS [WorldSummary]
readsPrec :: Int -> ReadS WorldSummary
$creadsPrec :: Int -> ReadS WorldSummary
Prelude.Read, Int -> WorldSummary -> ShowS
[WorldSummary] -> ShowS
WorldSummary -> String
(Int -> WorldSummary -> ShowS)
-> (WorldSummary -> String)
-> ([WorldSummary] -> ShowS)
-> Show WorldSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorldSummary] -> ShowS
$cshowList :: [WorldSummary] -> ShowS
show :: WorldSummary -> String
$cshow :: WorldSummary -> String
showsPrec :: Int -> WorldSummary -> ShowS
$cshowsPrec :: Int -> WorldSummary -> ShowS
Prelude.Show, (forall x. WorldSummary -> Rep WorldSummary x)
-> (forall x. Rep WorldSummary x -> WorldSummary)
-> Generic WorldSummary
forall x. Rep WorldSummary x -> WorldSummary
forall x. WorldSummary -> Rep WorldSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorldSummary x -> WorldSummary
$cfrom :: forall x. WorldSummary -> Rep WorldSummary x
Prelude.Generic)

-- |
-- Create a value of 'WorldSummary' 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', 'worldSummary_arn' - The Amazon Resource Name (ARN) of the world.
--
-- 'createdAt', 'worldSummary_createdAt' - The time, in milliseconds since the epoch, when the world was created.
--
-- 'template', 'worldSummary_template' - The Amazon Resource Name (arn) of the world template.
--
-- 'generationJob', 'worldSummary_generationJob' - The Amazon Resource Name (arn) of the world generation job.
newWorldSummary ::
  WorldSummary
newWorldSummary :: WorldSummary
newWorldSummary =
  WorldSummary' :: Maybe Text
-> Maybe POSIX -> Maybe Text -> Maybe Text -> WorldSummary
WorldSummary'
    { $sel:arn:WorldSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:WorldSummary' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:template:WorldSummary' :: Maybe Text
template = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:generationJob:WorldSummary' :: Maybe Text
generationJob = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The time, in milliseconds since the epoch, when the world was created.
worldSummary_createdAt :: Lens.Lens' WorldSummary (Prelude.Maybe Prelude.UTCTime)
worldSummary_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> WorldSummary -> f WorldSummary
worldSummary_createdAt = (WorldSummary -> Maybe POSIX)
-> (WorldSummary -> Maybe POSIX -> WorldSummary)
-> Lens WorldSummary WorldSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:WorldSummary' :: WorldSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: WorldSummary
s@WorldSummary' {} Maybe POSIX
a -> WorldSummary
s {$sel:createdAt:WorldSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: WorldSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> WorldSummary -> f WorldSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> WorldSummary
-> f WorldSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

-- | The Amazon Resource Name (arn) of the world generation job.
worldSummary_generationJob :: Lens.Lens' WorldSummary (Prelude.Maybe Prelude.Text)
worldSummary_generationJob :: (Maybe Text -> f (Maybe Text)) -> WorldSummary -> f WorldSummary
worldSummary_generationJob = (WorldSummary -> Maybe Text)
-> (WorldSummary -> Maybe Text -> WorldSummary)
-> Lens WorldSummary WorldSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldSummary' {Maybe Text
generationJob :: Maybe Text
$sel:generationJob:WorldSummary' :: WorldSummary -> Maybe Text
generationJob} -> Maybe Text
generationJob) (\s :: WorldSummary
s@WorldSummary' {} Maybe Text
a -> WorldSummary
s {$sel:generationJob:WorldSummary' :: Maybe Text
generationJob = Maybe Text
a} :: WorldSummary)

instance Core.FromJSON WorldSummary where
  parseJSON :: Value -> Parser WorldSummary
parseJSON =
    String
-> (Object -> Parser WorldSummary) -> Value -> Parser WorldSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WorldSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX -> Maybe Text -> Maybe Text -> WorldSummary
WorldSummary'
            (Maybe Text
 -> Maybe POSIX -> Maybe Text -> Maybe Text -> WorldSummary)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> WorldSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arn")
            Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> WorldSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> WorldSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
            Parser (Maybe Text -> Maybe Text -> WorldSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> WorldSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"template")
            Parser (Maybe Text -> WorldSummary)
-> Parser (Maybe Text) -> Parser WorldSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"generationJob")
      )

instance Prelude.Hashable WorldSummary

instance Prelude.NFData WorldSummary