{-# 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-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.WorldExportJobSummary 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.OutputLocation
import Amazonka.RobOMaker.Types.WorldExportJobStatus

-- | Information about a world export job.
--
-- /See:/ 'newWorldExportJobSummary' smart constructor.
data WorldExportJobSummary = WorldExportJobSummary'
  { -- | 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 Data.POSIX,
    WorldExportJobSummary -> Maybe OutputLocation
outputLocation :: Prelude.Maybe OutputLocation,
    -- | 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,
    -- | A list of worlds.
    WorldExportJobSummary -> Maybe (NonEmpty Text)
worlds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
  }
  deriving (WorldExportJobSummary -> WorldExportJobSummary -> Bool
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]
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
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. 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:
--
-- '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.
--
-- 'outputLocation', 'worldExportJobSummary_outputLocation' - Undocumented member.
--
-- '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.
--
-- 'worlds', 'worldExportJobSummary_worlds' - A list of worlds.
newWorldExportJobSummary ::
  WorldExportJobSummary
newWorldExportJobSummary :: WorldExportJobSummary
newWorldExportJobSummary =
  WorldExportJobSummary'
    { $sel:arn:WorldExportJobSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:WorldExportJobSummary' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:outputLocation:WorldExportJobSummary' :: Maybe OutputLocation
outputLocation = forall a. Maybe a
Prelude.Nothing,
      $sel:status:WorldExportJobSummary' :: Maybe WorldExportJobStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:worlds:WorldExportJobSummary' :: Maybe (NonEmpty Text)
worlds = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the world export job.
worldExportJobSummary_arn :: Lens.Lens' WorldExportJobSummary (Prelude.Maybe Prelude.Text)
worldExportJobSummary_arn :: Lens' WorldExportJobSummary (Maybe Text)
worldExportJobSummary_arn = 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 :: Lens' WorldExportJobSummary (Maybe UTCTime)
worldExportJobSummary_createdAt = 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) 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

-- | Undocumented member.
worldExportJobSummary_outputLocation :: Lens.Lens' WorldExportJobSummary (Prelude.Maybe OutputLocation)
worldExportJobSummary_outputLocation :: Lens' WorldExportJobSummary (Maybe OutputLocation)
worldExportJobSummary_outputLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorldExportJobSummary' {Maybe OutputLocation
outputLocation :: Maybe OutputLocation
$sel:outputLocation:WorldExportJobSummary' :: WorldExportJobSummary -> Maybe OutputLocation
outputLocation} -> Maybe OutputLocation
outputLocation) (\s :: WorldExportJobSummary
s@WorldExportJobSummary' {} Maybe OutputLocation
a -> WorldExportJobSummary
s {$sel:outputLocation:WorldExportJobSummary' :: Maybe OutputLocation
outputLocation = Maybe OutputLocation
a} :: 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_status :: Lens.Lens' WorldExportJobSummary (Prelude.Maybe WorldExportJobStatus)
worldExportJobSummary_status :: Lens' WorldExportJobSummary (Maybe WorldExportJobStatus)
worldExportJobSummary_status = 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)

-- | A list of worlds.
worldExportJobSummary_worlds :: Lens.Lens' WorldExportJobSummary (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
worldExportJobSummary_worlds :: Lens' WorldExportJobSummary (Maybe (NonEmpty Text))
worldExportJobSummary_worlds = 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) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON WorldExportJobSummary where
  parseJSON :: Value -> Parser WorldExportJobSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WorldExportJobSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe OutputLocation
-> Maybe WorldExportJobStatus
-> Maybe (NonEmpty Text)
-> WorldExportJobSummary
WorldExportJobSummary'
            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
"outputLocation")
            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
"worlds")
      )

instance Prelude.Hashable WorldExportJobSummary where
  hashWithSalt :: Int -> WorldExportJobSummary -> Int
hashWithSalt Int
_salt WorldExportJobSummary' {Maybe (NonEmpty Text)
Maybe Text
Maybe POSIX
Maybe OutputLocation
Maybe WorldExportJobStatus
worlds :: Maybe (NonEmpty Text)
status :: Maybe WorldExportJobStatus
outputLocation :: Maybe OutputLocation
createdAt :: Maybe POSIX
arn :: Maybe Text
$sel:worlds:WorldExportJobSummary' :: WorldExportJobSummary -> Maybe (NonEmpty Text)
$sel:status:WorldExportJobSummary' :: WorldExportJobSummary -> Maybe WorldExportJobStatus
$sel:outputLocation:WorldExportJobSummary' :: WorldExportJobSummary -> Maybe OutputLocation
$sel:createdAt:WorldExportJobSummary' :: WorldExportJobSummary -> Maybe POSIX
$sel:arn:WorldExportJobSummary' :: WorldExportJobSummary -> 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 OutputLocation
outputLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorldExportJobStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
worlds

instance Prelude.NFData WorldExportJobSummary where
  rnf :: WorldExportJobSummary -> ()
rnf WorldExportJobSummary' {Maybe (NonEmpty Text)
Maybe Text
Maybe POSIX
Maybe OutputLocation
Maybe WorldExportJobStatus
worlds :: Maybe (NonEmpty Text)
status :: Maybe WorldExportJobStatus
outputLocation :: Maybe OutputLocation
createdAt :: Maybe POSIX
arn :: Maybe Text
$sel:worlds:WorldExportJobSummary' :: WorldExportJobSummary -> Maybe (NonEmpty Text)
$sel:status:WorldExportJobSummary' :: WorldExportJobSummary -> Maybe WorldExportJobStatus
$sel:outputLocation:WorldExportJobSummary' :: WorldExportJobSummary -> Maybe OutputLocation
$sel:createdAt:WorldExportJobSummary' :: WorldExportJobSummary -> Maybe POSIX
$sel:arn:WorldExportJobSummary' :: WorldExportJobSummary -> 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 OutputLocation
outputLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WorldExportJobStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
worlds