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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RobOMaker.Types.WorldExportJobStatus

-- | Information about a world export job.
--
-- /See:/ 'newWorldExportJobSummary' smart constructor.
data WorldExportJobSummary = WorldExportJobSummary'
  { -- | The status of the world export job.
    --
    -- [Pending]
    --     The world export job request is pending.
    --
    -- [Running]
    --     The world export job is running.
    --
    -- [Completed]
    --     The world export job completed.
    --
    -- [Failed]
    --     The world export job failed. See @failureCode@ for more information.
    --
    -- [Canceled]
    --     The world export job was cancelled.
    --
    -- [Canceling]
    --     The world export job is being cancelled.
    WorldExportJobSummary -> Maybe WorldExportJobStatus
status :: Prelude.Maybe WorldExportJobStatus,
    -- | The Amazon Resource Name (ARN) of the world export job.
    WorldExportJobSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the world export job was
    -- created.
    WorldExportJobSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | A list of worlds.
    WorldExportJobSummary -> Maybe (NonEmpty Text)
worlds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
  }
  deriving (WorldExportJobSummary -> WorldExportJobSummary -> Bool
(WorldExportJobSummary -> WorldExportJobSummary -> Bool)
-> (WorldExportJobSummary -> WorldExportJobSummary -> Bool)
-> Eq WorldExportJobSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorldExportJobSummary -> WorldExportJobSummary -> Bool
$c/= :: WorldExportJobSummary -> WorldExportJobSummary -> Bool
== :: WorldExportJobSummary -> WorldExportJobSummary -> Bool
$c== :: WorldExportJobSummary -> WorldExportJobSummary -> Bool
Prelude.Eq, ReadPrec [WorldExportJobSummary]
ReadPrec WorldExportJobSummary
Int -> ReadS WorldExportJobSummary
ReadS [WorldExportJobSummary]
(Int -> ReadS WorldExportJobSummary)
-> ReadS [WorldExportJobSummary]
-> ReadPrec WorldExportJobSummary
-> ReadPrec [WorldExportJobSummary]
-> Read WorldExportJobSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorldExportJobSummary]
$creadListPrec :: ReadPrec [WorldExportJobSummary]
readPrec :: ReadPrec WorldExportJobSummary
$creadPrec :: ReadPrec WorldExportJobSummary
readList :: ReadS [WorldExportJobSummary]
$creadList :: ReadS [WorldExportJobSummary]
readsPrec :: Int -> ReadS WorldExportJobSummary
$creadsPrec :: Int -> ReadS WorldExportJobSummary
Prelude.Read, Int -> WorldExportJobSummary -> ShowS
[WorldExportJobSummary] -> ShowS
WorldExportJobSummary -> String
(Int -> WorldExportJobSummary -> ShowS)
-> (WorldExportJobSummary -> String)
-> ([WorldExportJobSummary] -> ShowS)
-> Show WorldExportJobSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorldExportJobSummary] -> ShowS
$cshowList :: [WorldExportJobSummary] -> ShowS
show :: WorldExportJobSummary -> String
$cshow :: WorldExportJobSummary -> String
showsPrec :: Int -> WorldExportJobSummary -> ShowS
$cshowsPrec :: Int -> WorldExportJobSummary -> ShowS
Prelude.Show, (forall x. WorldExportJobSummary -> Rep WorldExportJobSummary x)
-> (forall x. Rep WorldExportJobSummary x -> WorldExportJobSummary)
-> Generic WorldExportJobSummary
forall x. Rep WorldExportJobSummary x -> WorldExportJobSummary
forall x. WorldExportJobSummary -> Rep WorldExportJobSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorldExportJobSummary x -> WorldExportJobSummary
$cfrom :: forall x. WorldExportJobSummary -> Rep WorldExportJobSummary x
Prelude.Generic)

-- |
-- Create a value of 'WorldExportJobSummary' 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:
--
-- 'status', 'worldExportJobSummary_status' - The status of the world export job.
--
-- [Pending]
--     The world export job request is pending.
--
-- [Running]
--     The world export job is running.
--
-- [Completed]
--     The world export job completed.
--
-- [Failed]
--     The world export job failed. See @failureCode@ for more information.
--
-- [Canceled]
--     The world export job was cancelled.
--
-- [Canceling]
--     The world export job is being cancelled.
--
-- 'arn', 'worldExportJobSummary_arn' - The Amazon Resource Name (ARN) of the world export job.
--
-- 'createdAt', 'worldExportJobSummary_createdAt' - The time, in milliseconds since the epoch, when the world export job was
-- created.
--
-- 'worlds', 'worldExportJobSummary_worlds' - A list of worlds.
newWorldExportJobSummary ::
  WorldExportJobSummary
newWorldExportJobSummary :: WorldExportJobSummary
newWorldExportJobSummary =
  WorldExportJobSummary' :: Maybe WorldExportJobStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe (NonEmpty Text)
-> WorldExportJobSummary
WorldExportJobSummary'
    { $sel:status:WorldExportJobSummary' :: Maybe WorldExportJobStatus
status = Maybe WorldExportJobStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:WorldExportJobSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:WorldExportJobSummary' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:worlds:WorldExportJobSummary' :: Maybe (NonEmpty Text)
worlds = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the world export job.
--
-- [Pending]
--     The world export job request is pending.
--
-- [Running]
--     The world export job is running.
--
-- [Completed]
--     The world export job completed.
--
-- [Failed]
--     The world export job failed. See @failureCode@ for more information.
--
-- [Canceled]
--     The world export job was cancelled.
--
-- [Canceling]
--     The world export job is being cancelled.
worldExportJobSummary_status :: Lens.Lens' WorldExportJobSummary (Prelude.Maybe WorldExportJobStatus)
worldExportJobSummary_status :: (Maybe WorldExportJobStatus -> f (Maybe WorldExportJobStatus))
-> WorldExportJobSummary -> f WorldExportJobSummary
worldExportJobSummary_status = (WorldExportJobSummary -> Maybe WorldExportJobStatus)
-> (WorldExportJobSummary
    -> Maybe WorldExportJobStatus -> WorldExportJobSummary)
-> Lens
     WorldExportJobSummary
     WorldExportJobSummary
     (Maybe WorldExportJobStatus)
     (Maybe WorldExportJobStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldExportJobSummary' {Maybe WorldExportJobStatus
status :: Maybe WorldExportJobStatus
$sel:status:WorldExportJobSummary' :: WorldExportJobSummary -> Maybe WorldExportJobStatus
status} -> Maybe WorldExportJobStatus
status) (\s :: WorldExportJobSummary
s@WorldExportJobSummary' {} Maybe WorldExportJobStatus
a -> WorldExportJobSummary
s {$sel:status:WorldExportJobSummary' :: Maybe WorldExportJobStatus
status = Maybe WorldExportJobStatus
a} :: WorldExportJobSummary)

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

-- | The time, in milliseconds since the epoch, when the world export job was
-- created.
worldExportJobSummary_createdAt :: Lens.Lens' WorldExportJobSummary (Prelude.Maybe Prelude.UTCTime)
worldExportJobSummary_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> WorldExportJobSummary -> f WorldExportJobSummary
worldExportJobSummary_createdAt = (WorldExportJobSummary -> Maybe POSIX)
-> (WorldExportJobSummary -> Maybe POSIX -> WorldExportJobSummary)
-> Lens
     WorldExportJobSummary
     WorldExportJobSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldExportJobSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:WorldExportJobSummary' :: WorldExportJobSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: WorldExportJobSummary
s@WorldExportJobSummary' {} Maybe POSIX
a -> WorldExportJobSummary
s {$sel:createdAt:WorldExportJobSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: WorldExportJobSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> WorldExportJobSummary -> f WorldExportJobSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> WorldExportJobSummary
-> f WorldExportJobSummary
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

-- | A list of worlds.
worldExportJobSummary_worlds :: Lens.Lens' WorldExportJobSummary (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
worldExportJobSummary_worlds :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> WorldExportJobSummary -> f WorldExportJobSummary
worldExportJobSummary_worlds = (WorldExportJobSummary -> Maybe (NonEmpty Text))
-> (WorldExportJobSummary
    -> Maybe (NonEmpty Text) -> WorldExportJobSummary)
-> Lens
     WorldExportJobSummary
     WorldExportJobSummary
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldExportJobSummary' {Maybe (NonEmpty Text)
worlds :: Maybe (NonEmpty Text)
$sel:worlds:WorldExportJobSummary' :: WorldExportJobSummary -> Maybe (NonEmpty Text)
worlds} -> Maybe (NonEmpty Text)
worlds) (\s :: WorldExportJobSummary
s@WorldExportJobSummary' {} Maybe (NonEmpty Text)
a -> WorldExportJobSummary
s {$sel:worlds:WorldExportJobSummary' :: Maybe (NonEmpty Text)
worlds = Maybe (NonEmpty Text)
a} :: WorldExportJobSummary) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> WorldExportJobSummary -> f WorldExportJobSummary)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> WorldExportJobSummary
-> f WorldExportJobSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON WorldExportJobSummary where
  parseJSON :: Value -> Parser WorldExportJobSummary
parseJSON =
    String
-> (Object -> Parser WorldExportJobSummary)
-> Value
-> Parser WorldExportJobSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WorldExportJobSummary"
      ( \Object
x ->
          Maybe WorldExportJobStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe (NonEmpty Text)
-> WorldExportJobSummary
WorldExportJobSummary'
            (Maybe WorldExportJobStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe (NonEmpty Text)
 -> WorldExportJobSummary)
-> Parser (Maybe WorldExportJobStatus)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe (NonEmpty Text) -> WorldExportJobSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe WorldExportJobStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe (NonEmpty Text) -> WorldExportJobSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe (NonEmpty Text) -> WorldExportJobSummary)
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
"arn")
            Parser
  (Maybe POSIX -> Maybe (NonEmpty Text) -> WorldExportJobSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe (NonEmpty Text) -> WorldExportJobSummary)
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 (NonEmpty Text) -> WorldExportJobSummary)
-> Parser (Maybe (NonEmpty Text)) -> Parser WorldExportJobSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"worlds")
      )

instance Prelude.Hashable WorldExportJobSummary

instance Prelude.NFData WorldExportJobSummary