{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateWorldExportJob
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a world export job.
module Amazonka.RobOMaker.CreateWorldExportJob
  ( -- * Creating a Request
    CreateWorldExportJob (..),
    newCreateWorldExportJob,

    -- * Request Lenses
    createWorldExportJob_clientRequestToken,
    createWorldExportJob_tags,
    createWorldExportJob_worlds,
    createWorldExportJob_outputLocation,
    createWorldExportJob_iamRole,

    -- * Destructuring the Response
    CreateWorldExportJobResponse (..),
    newCreateWorldExportJobResponse,

    -- * Response Lenses
    createWorldExportJobResponse_arn,
    createWorldExportJobResponse_clientRequestToken,
    createWorldExportJobResponse_createdAt,
    createWorldExportJobResponse_failureCode,
    createWorldExportJobResponse_iamRole,
    createWorldExportJobResponse_outputLocation,
    createWorldExportJobResponse_status,
    createWorldExportJobResponse_tags,
    createWorldExportJobResponse_httpStatus,
  )
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.RobOMaker.Types

-- | /See:/ 'newCreateWorldExportJob' smart constructor.
data CreateWorldExportJob = CreateWorldExportJob'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CreateWorldExportJob -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | A map that contains tag keys and tag values that are attached to the
    -- world export job.
    CreateWorldExportJob -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A list of Amazon Resource Names (arns) that correspond to worlds to
    -- export.
    CreateWorldExportJob -> NonEmpty Text
worlds :: Prelude.NonEmpty Prelude.Text,
    CreateWorldExportJob -> OutputLocation
outputLocation :: OutputLocation,
    -- | The IAM role that the world export process uses to access the Amazon S3
    -- bucket and put the export.
    CreateWorldExportJob -> Text
iamRole :: Prelude.Text
  }
  deriving (CreateWorldExportJob -> CreateWorldExportJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorldExportJob -> CreateWorldExportJob -> Bool
$c/= :: CreateWorldExportJob -> CreateWorldExportJob -> Bool
== :: CreateWorldExportJob -> CreateWorldExportJob -> Bool
$c== :: CreateWorldExportJob -> CreateWorldExportJob -> Bool
Prelude.Eq, ReadPrec [CreateWorldExportJob]
ReadPrec CreateWorldExportJob
Int -> ReadS CreateWorldExportJob
ReadS [CreateWorldExportJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorldExportJob]
$creadListPrec :: ReadPrec [CreateWorldExportJob]
readPrec :: ReadPrec CreateWorldExportJob
$creadPrec :: ReadPrec CreateWorldExportJob
readList :: ReadS [CreateWorldExportJob]
$creadList :: ReadS [CreateWorldExportJob]
readsPrec :: Int -> ReadS CreateWorldExportJob
$creadsPrec :: Int -> ReadS CreateWorldExportJob
Prelude.Read, Int -> CreateWorldExportJob -> ShowS
[CreateWorldExportJob] -> ShowS
CreateWorldExportJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorldExportJob] -> ShowS
$cshowList :: [CreateWorldExportJob] -> ShowS
show :: CreateWorldExportJob -> String
$cshow :: CreateWorldExportJob -> String
showsPrec :: Int -> CreateWorldExportJob -> ShowS
$cshowsPrec :: Int -> CreateWorldExportJob -> ShowS
Prelude.Show, forall x. Rep CreateWorldExportJob x -> CreateWorldExportJob
forall x. CreateWorldExportJob -> Rep CreateWorldExportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWorldExportJob x -> CreateWorldExportJob
$cfrom :: forall x. CreateWorldExportJob -> Rep CreateWorldExportJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorldExportJob' 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:
--
-- 'clientRequestToken', 'createWorldExportJob_clientRequestToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'tags', 'createWorldExportJob_tags' - A map that contains tag keys and tag values that are attached to the
-- world export job.
--
-- 'worlds', 'createWorldExportJob_worlds' - A list of Amazon Resource Names (arns) that correspond to worlds to
-- export.
--
-- 'outputLocation', 'createWorldExportJob_outputLocation' - Undocumented member.
--
-- 'iamRole', 'createWorldExportJob_iamRole' - The IAM role that the world export process uses to access the Amazon S3
-- bucket and put the export.
newCreateWorldExportJob ::
  -- | 'worlds'
  Prelude.NonEmpty Prelude.Text ->
  -- | 'outputLocation'
  OutputLocation ->
  -- | 'iamRole'
  Prelude.Text ->
  CreateWorldExportJob
newCreateWorldExportJob :: NonEmpty Text -> OutputLocation -> Text -> CreateWorldExportJob
newCreateWorldExportJob
  NonEmpty Text
pWorlds_
  OutputLocation
pOutputLocation_
  Text
pIamRole_ =
    CreateWorldExportJob'
      { $sel:clientRequestToken:CreateWorldExportJob' :: Maybe Text
clientRequestToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateWorldExportJob' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:worlds:CreateWorldExportJob' :: NonEmpty Text
worlds = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pWorlds_,
        $sel:outputLocation:CreateWorldExportJob' :: OutputLocation
outputLocation = OutputLocation
pOutputLocation_,
        $sel:iamRole:CreateWorldExportJob' :: Text
iamRole = Text
pIamRole_
      }

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
createWorldExportJob_clientRequestToken :: Lens.Lens' CreateWorldExportJob (Prelude.Maybe Prelude.Text)
createWorldExportJob_clientRequestToken :: Lens' CreateWorldExportJob (Maybe Text)
createWorldExportJob_clientRequestToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJob' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateWorldExportJob' :: CreateWorldExportJob -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateWorldExportJob
s@CreateWorldExportJob' {} Maybe Text
a -> CreateWorldExportJob
s {$sel:clientRequestToken:CreateWorldExportJob' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateWorldExportJob)

-- | A map that contains tag keys and tag values that are attached to the
-- world export job.
createWorldExportJob_tags :: Lens.Lens' CreateWorldExportJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createWorldExportJob_tags :: Lens' CreateWorldExportJob (Maybe (HashMap Text Text))
createWorldExportJob_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJob' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateWorldExportJob' :: CreateWorldExportJob -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateWorldExportJob
s@CreateWorldExportJob' {} Maybe (HashMap Text Text)
a -> CreateWorldExportJob
s {$sel:tags:CreateWorldExportJob' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateWorldExportJob) 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

-- | A list of Amazon Resource Names (arns) that correspond to worlds to
-- export.
createWorldExportJob_worlds :: Lens.Lens' CreateWorldExportJob (Prelude.NonEmpty Prelude.Text)
createWorldExportJob_worlds :: Lens' CreateWorldExportJob (NonEmpty Text)
createWorldExportJob_worlds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJob' {NonEmpty Text
worlds :: NonEmpty Text
$sel:worlds:CreateWorldExportJob' :: CreateWorldExportJob -> NonEmpty Text
worlds} -> NonEmpty Text
worlds) (\s :: CreateWorldExportJob
s@CreateWorldExportJob' {} NonEmpty Text
a -> CreateWorldExportJob
s {$sel:worlds:CreateWorldExportJob' :: NonEmpty Text
worlds = NonEmpty Text
a} :: CreateWorldExportJob) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
createWorldExportJob_outputLocation :: Lens.Lens' CreateWorldExportJob OutputLocation
createWorldExportJob_outputLocation :: Lens' CreateWorldExportJob OutputLocation
createWorldExportJob_outputLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJob' {OutputLocation
outputLocation :: OutputLocation
$sel:outputLocation:CreateWorldExportJob' :: CreateWorldExportJob -> OutputLocation
outputLocation} -> OutputLocation
outputLocation) (\s :: CreateWorldExportJob
s@CreateWorldExportJob' {} OutputLocation
a -> CreateWorldExportJob
s {$sel:outputLocation:CreateWorldExportJob' :: OutputLocation
outputLocation = OutputLocation
a} :: CreateWorldExportJob)

-- | The IAM role that the world export process uses to access the Amazon S3
-- bucket and put the export.
createWorldExportJob_iamRole :: Lens.Lens' CreateWorldExportJob Prelude.Text
createWorldExportJob_iamRole :: Lens' CreateWorldExportJob Text
createWorldExportJob_iamRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJob' {Text
iamRole :: Text
$sel:iamRole:CreateWorldExportJob' :: CreateWorldExportJob -> Text
iamRole} -> Text
iamRole) (\s :: CreateWorldExportJob
s@CreateWorldExportJob' {} Text
a -> CreateWorldExportJob
s {$sel:iamRole:CreateWorldExportJob' :: Text
iamRole = Text
a} :: CreateWorldExportJob)

instance Core.AWSRequest CreateWorldExportJob where
  type
    AWSResponse CreateWorldExportJob =
      CreateWorldExportJobResponse
  request :: (Service -> Service)
-> CreateWorldExportJob -> Request CreateWorldExportJob
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateWorldExportJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateWorldExportJob)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe WorldExportJobErrorCode
-> Maybe Text
-> Maybe OutputLocation
-> Maybe WorldExportJobStatus
-> Maybe (HashMap Text Text)
-> Int
-> CreateWorldExportJobResponse
CreateWorldExportJobResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"clientRequestToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"failureCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"iamRole")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (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 -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateWorldExportJob where
  hashWithSalt :: Int -> CreateWorldExportJob -> Int
hashWithSalt Int
_salt CreateWorldExportJob' {Maybe Text
Maybe (HashMap Text Text)
NonEmpty Text
Text
OutputLocation
iamRole :: Text
outputLocation :: OutputLocation
worlds :: NonEmpty Text
tags :: Maybe (HashMap Text Text)
clientRequestToken :: Maybe Text
$sel:iamRole:CreateWorldExportJob' :: CreateWorldExportJob -> Text
$sel:outputLocation:CreateWorldExportJob' :: CreateWorldExportJob -> OutputLocation
$sel:worlds:CreateWorldExportJob' :: CreateWorldExportJob -> NonEmpty Text
$sel:tags:CreateWorldExportJob' :: CreateWorldExportJob -> Maybe (HashMap Text Text)
$sel:clientRequestToken:CreateWorldExportJob' :: CreateWorldExportJob -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientRequestToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
worlds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` OutputLocation
outputLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
iamRole

instance Prelude.NFData CreateWorldExportJob where
  rnf :: CreateWorldExportJob -> ()
rnf CreateWorldExportJob' {Maybe Text
Maybe (HashMap Text Text)
NonEmpty Text
Text
OutputLocation
iamRole :: Text
outputLocation :: OutputLocation
worlds :: NonEmpty Text
tags :: Maybe (HashMap Text Text)
clientRequestToken :: Maybe Text
$sel:iamRole:CreateWorldExportJob' :: CreateWorldExportJob -> Text
$sel:outputLocation:CreateWorldExportJob' :: CreateWorldExportJob -> OutputLocation
$sel:worlds:CreateWorldExportJob' :: CreateWorldExportJob -> NonEmpty Text
$sel:tags:CreateWorldExportJob' :: CreateWorldExportJob -> Maybe (HashMap Text Text)
$sel:clientRequestToken:CreateWorldExportJob' :: CreateWorldExportJob -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientRequestToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
worlds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf OutputLocation
outputLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
iamRole

instance Data.ToHeaders CreateWorldExportJob where
  toHeaders :: CreateWorldExportJob -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateWorldExportJob where
  toJSON :: CreateWorldExportJob -> Value
toJSON CreateWorldExportJob' {Maybe Text
Maybe (HashMap Text Text)
NonEmpty Text
Text
OutputLocation
iamRole :: Text
outputLocation :: OutputLocation
worlds :: NonEmpty Text
tags :: Maybe (HashMap Text Text)
clientRequestToken :: Maybe Text
$sel:iamRole:CreateWorldExportJob' :: CreateWorldExportJob -> Text
$sel:outputLocation:CreateWorldExportJob' :: CreateWorldExportJob -> OutputLocation
$sel:worlds:CreateWorldExportJob' :: CreateWorldExportJob -> NonEmpty Text
$sel:tags:CreateWorldExportJob' :: CreateWorldExportJob -> Maybe (HashMap Text Text)
$sel:clientRequestToken:CreateWorldExportJob' :: CreateWorldExportJob -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"clientRequestToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"worlds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
worlds),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"outputLocation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= OutputLocation
outputLocation),
            forall a. a -> Maybe a
Prelude.Just (Key
"iamRole" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
iamRole)
          ]
      )

instance Data.ToPath CreateWorldExportJob where
  toPath :: CreateWorldExportJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/createWorldExportJob"

instance Data.ToQuery CreateWorldExportJob where
  toQuery :: CreateWorldExportJob -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateWorldExportJobResponse' smart constructor.
data CreateWorldExportJobResponse = CreateWorldExportJobResponse'
  { -- | The Amazon Resource Name (ARN) of the world export job.
    CreateWorldExportJobResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CreateWorldExportJobResponse -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the world export job was
    -- created.
    CreateWorldExportJobResponse -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
    -- | The failure code of the world export job if it failed:
    --
    -- [InternalServiceError]
    --     Internal service error.
    --
    -- [LimitExceeded]
    --     The requested resource exceeds the maximum number allowed, or the
    --     number of concurrent stream requests exceeds the maximum number
    --     allowed.
    --
    -- [ResourceNotFound]
    --     The specified resource could not be found.
    --
    -- [RequestThrottled]
    --     The request was throttled.
    --
    -- [InvalidInput]
    --     An input parameter in the request is not valid.
    --
    -- [AllWorldGenerationFailed]
    --     All of the worlds in the world generation job failed. This can
    --     happen if your @worldCount@ is greater than 50 or less than 1.
    --
    -- For more information about troubleshooting WorldForge, see
    -- <https://docs.aws.amazon.com/robomaker/latest/dg/troubleshooting-worldforge.html Troubleshooting Simulation WorldForge>.
    CreateWorldExportJobResponse -> Maybe WorldExportJobErrorCode
failureCode :: Prelude.Maybe WorldExportJobErrorCode,
    -- | The IAM role that the world export process uses to access the Amazon S3
    -- bucket and put the export.
    CreateWorldExportJobResponse -> Maybe Text
iamRole :: Prelude.Maybe Prelude.Text,
    CreateWorldExportJobResponse -> 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.
    CreateWorldExportJobResponse -> Maybe WorldExportJobStatus
status :: Prelude.Maybe WorldExportJobStatus,
    -- | A map that contains tag keys and tag values that are attached to the
    -- world export job.
    CreateWorldExportJobResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    CreateWorldExportJobResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateWorldExportJobResponse
-> CreateWorldExportJobResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorldExportJobResponse
-> CreateWorldExportJobResponse -> Bool
$c/= :: CreateWorldExportJobResponse
-> CreateWorldExportJobResponse -> Bool
== :: CreateWorldExportJobResponse
-> CreateWorldExportJobResponse -> Bool
$c== :: CreateWorldExportJobResponse
-> CreateWorldExportJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateWorldExportJobResponse]
ReadPrec CreateWorldExportJobResponse
Int -> ReadS CreateWorldExportJobResponse
ReadS [CreateWorldExportJobResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorldExportJobResponse]
$creadListPrec :: ReadPrec [CreateWorldExportJobResponse]
readPrec :: ReadPrec CreateWorldExportJobResponse
$creadPrec :: ReadPrec CreateWorldExportJobResponse
readList :: ReadS [CreateWorldExportJobResponse]
$creadList :: ReadS [CreateWorldExportJobResponse]
readsPrec :: Int -> ReadS CreateWorldExportJobResponse
$creadsPrec :: Int -> ReadS CreateWorldExportJobResponse
Prelude.Read, Int -> CreateWorldExportJobResponse -> ShowS
[CreateWorldExportJobResponse] -> ShowS
CreateWorldExportJobResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorldExportJobResponse] -> ShowS
$cshowList :: [CreateWorldExportJobResponse] -> ShowS
show :: CreateWorldExportJobResponse -> String
$cshow :: CreateWorldExportJobResponse -> String
showsPrec :: Int -> CreateWorldExportJobResponse -> ShowS
$cshowsPrec :: Int -> CreateWorldExportJobResponse -> ShowS
Prelude.Show, forall x.
Rep CreateWorldExportJobResponse x -> CreateWorldExportJobResponse
forall x.
CreateWorldExportJobResponse -> Rep CreateWorldExportJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWorldExportJobResponse x -> CreateWorldExportJobResponse
$cfrom :: forall x.
CreateWorldExportJobResponse -> Rep CreateWorldExportJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorldExportJobResponse' 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', 'createWorldExportJobResponse_arn' - The Amazon Resource Name (ARN) of the world export job.
--
-- 'clientRequestToken', 'createWorldExportJobResponse_clientRequestToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'createdAt', 'createWorldExportJobResponse_createdAt' - The time, in milliseconds since the epoch, when the world export job was
-- created.
--
-- 'failureCode', 'createWorldExportJobResponse_failureCode' - The failure code of the world export job if it failed:
--
-- [InternalServiceError]
--     Internal service error.
--
-- [LimitExceeded]
--     The requested resource exceeds the maximum number allowed, or the
--     number of concurrent stream requests exceeds the maximum number
--     allowed.
--
-- [ResourceNotFound]
--     The specified resource could not be found.
--
-- [RequestThrottled]
--     The request was throttled.
--
-- [InvalidInput]
--     An input parameter in the request is not valid.
--
-- [AllWorldGenerationFailed]
--     All of the worlds in the world generation job failed. This can
--     happen if your @worldCount@ is greater than 50 or less than 1.
--
-- For more information about troubleshooting WorldForge, see
-- <https://docs.aws.amazon.com/robomaker/latest/dg/troubleshooting-worldforge.html Troubleshooting Simulation WorldForge>.
--
-- 'iamRole', 'createWorldExportJobResponse_iamRole' - The IAM role that the world export process uses to access the Amazon S3
-- bucket and put the export.
--
-- 'outputLocation', 'createWorldExportJobResponse_outputLocation' - Undocumented member.
--
-- 'status', 'createWorldExportJobResponse_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.
--
-- 'tags', 'createWorldExportJobResponse_tags' - A map that contains tag keys and tag values that are attached to the
-- world export job.
--
-- 'httpStatus', 'createWorldExportJobResponse_httpStatus' - The response's http status code.
newCreateWorldExportJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWorldExportJobResponse
newCreateWorldExportJobResponse :: Int -> CreateWorldExportJobResponse
newCreateWorldExportJobResponse Int
pHttpStatus_ =
  CreateWorldExportJobResponse'
    { $sel:arn:CreateWorldExportJobResponse' :: Maybe Text
arn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:CreateWorldExportJobResponse' :: Maybe Text
clientRequestToken = forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:CreateWorldExportJobResponse' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:failureCode:CreateWorldExportJobResponse' :: Maybe WorldExportJobErrorCode
failureCode = forall a. Maybe a
Prelude.Nothing,
      $sel:iamRole:CreateWorldExportJobResponse' :: Maybe Text
iamRole = forall a. Maybe a
Prelude.Nothing,
      $sel:outputLocation:CreateWorldExportJobResponse' :: Maybe OutputLocation
outputLocation = forall a. Maybe a
Prelude.Nothing,
      $sel:status:CreateWorldExportJobResponse' :: Maybe WorldExportJobStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateWorldExportJobResponse' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWorldExportJobResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
createWorldExportJobResponse_clientRequestToken :: Lens.Lens' CreateWorldExportJobResponse (Prelude.Maybe Prelude.Text)
createWorldExportJobResponse_clientRequestToken :: Lens' CreateWorldExportJobResponse (Maybe Text)
createWorldExportJobResponse_clientRequestToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJobResponse' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateWorldExportJobResponse
s@CreateWorldExportJobResponse' {} Maybe Text
a -> CreateWorldExportJobResponse
s {$sel:clientRequestToken:CreateWorldExportJobResponse' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateWorldExportJobResponse)

-- | The time, in milliseconds since the epoch, when the world export job was
-- created.
createWorldExportJobResponse_createdAt :: Lens.Lens' CreateWorldExportJobResponse (Prelude.Maybe Prelude.UTCTime)
createWorldExportJobResponse_createdAt :: Lens' CreateWorldExportJobResponse (Maybe UTCTime)
createWorldExportJobResponse_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJobResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: CreateWorldExportJobResponse
s@CreateWorldExportJobResponse' {} Maybe POSIX
a -> CreateWorldExportJobResponse
s {$sel:createdAt:CreateWorldExportJobResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: CreateWorldExportJobResponse) 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 failure code of the world export job if it failed:
--
-- [InternalServiceError]
--     Internal service error.
--
-- [LimitExceeded]
--     The requested resource exceeds the maximum number allowed, or the
--     number of concurrent stream requests exceeds the maximum number
--     allowed.
--
-- [ResourceNotFound]
--     The specified resource could not be found.
--
-- [RequestThrottled]
--     The request was throttled.
--
-- [InvalidInput]
--     An input parameter in the request is not valid.
--
-- [AllWorldGenerationFailed]
--     All of the worlds in the world generation job failed. This can
--     happen if your @worldCount@ is greater than 50 or less than 1.
--
-- For more information about troubleshooting WorldForge, see
-- <https://docs.aws.amazon.com/robomaker/latest/dg/troubleshooting-worldforge.html Troubleshooting Simulation WorldForge>.
createWorldExportJobResponse_failureCode :: Lens.Lens' CreateWorldExportJobResponse (Prelude.Maybe WorldExportJobErrorCode)
createWorldExportJobResponse_failureCode :: Lens' CreateWorldExportJobResponse (Maybe WorldExportJobErrorCode)
createWorldExportJobResponse_failureCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJobResponse' {Maybe WorldExportJobErrorCode
failureCode :: Maybe WorldExportJobErrorCode
$sel:failureCode:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe WorldExportJobErrorCode
failureCode} -> Maybe WorldExportJobErrorCode
failureCode) (\s :: CreateWorldExportJobResponse
s@CreateWorldExportJobResponse' {} Maybe WorldExportJobErrorCode
a -> CreateWorldExportJobResponse
s {$sel:failureCode:CreateWorldExportJobResponse' :: Maybe WorldExportJobErrorCode
failureCode = Maybe WorldExportJobErrorCode
a} :: CreateWorldExportJobResponse)

-- | The IAM role that the world export process uses to access the Amazon S3
-- bucket and put the export.
createWorldExportJobResponse_iamRole :: Lens.Lens' CreateWorldExportJobResponse (Prelude.Maybe Prelude.Text)
createWorldExportJobResponse_iamRole :: Lens' CreateWorldExportJobResponse (Maybe Text)
createWorldExportJobResponse_iamRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJobResponse' {Maybe Text
iamRole :: Maybe Text
$sel:iamRole:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe Text
iamRole} -> Maybe Text
iamRole) (\s :: CreateWorldExportJobResponse
s@CreateWorldExportJobResponse' {} Maybe Text
a -> CreateWorldExportJobResponse
s {$sel:iamRole:CreateWorldExportJobResponse' :: Maybe Text
iamRole = Maybe Text
a} :: CreateWorldExportJobResponse)

-- | Undocumented member.
createWorldExportJobResponse_outputLocation :: Lens.Lens' CreateWorldExportJobResponse (Prelude.Maybe OutputLocation)
createWorldExportJobResponse_outputLocation :: Lens' CreateWorldExportJobResponse (Maybe OutputLocation)
createWorldExportJobResponse_outputLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJobResponse' {Maybe OutputLocation
outputLocation :: Maybe OutputLocation
$sel:outputLocation:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe OutputLocation
outputLocation} -> Maybe OutputLocation
outputLocation) (\s :: CreateWorldExportJobResponse
s@CreateWorldExportJobResponse' {} Maybe OutputLocation
a -> CreateWorldExportJobResponse
s {$sel:outputLocation:CreateWorldExportJobResponse' :: Maybe OutputLocation
outputLocation = Maybe OutputLocation
a} :: CreateWorldExportJobResponse)

-- | 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.
createWorldExportJobResponse_status :: Lens.Lens' CreateWorldExportJobResponse (Prelude.Maybe WorldExportJobStatus)
createWorldExportJobResponse_status :: Lens' CreateWorldExportJobResponse (Maybe WorldExportJobStatus)
createWorldExportJobResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJobResponse' {Maybe WorldExportJobStatus
status :: Maybe WorldExportJobStatus
$sel:status:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe WorldExportJobStatus
status} -> Maybe WorldExportJobStatus
status) (\s :: CreateWorldExportJobResponse
s@CreateWorldExportJobResponse' {} Maybe WorldExportJobStatus
a -> CreateWorldExportJobResponse
s {$sel:status:CreateWorldExportJobResponse' :: Maybe WorldExportJobStatus
status = Maybe WorldExportJobStatus
a} :: CreateWorldExportJobResponse)

-- | A map that contains tag keys and tag values that are attached to the
-- world export job.
createWorldExportJobResponse_tags :: Lens.Lens' CreateWorldExportJobResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createWorldExportJobResponse_tags :: Lens' CreateWorldExportJobResponse (Maybe (HashMap Text Text))
createWorldExportJobResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJobResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateWorldExportJobResponse
s@CreateWorldExportJobResponse' {} Maybe (HashMap Text Text)
a -> CreateWorldExportJobResponse
s {$sel:tags:CreateWorldExportJobResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateWorldExportJobResponse) 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

-- | The response's http status code.
createWorldExportJobResponse_httpStatus :: Lens.Lens' CreateWorldExportJobResponse Prelude.Int
createWorldExportJobResponse_httpStatus :: Lens' CreateWorldExportJobResponse Int
createWorldExportJobResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldExportJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateWorldExportJobResponse
s@CreateWorldExportJobResponse' {} Int
a -> CreateWorldExportJobResponse
s {$sel:httpStatus:CreateWorldExportJobResponse' :: Int
httpStatus = Int
a} :: CreateWorldExportJobResponse)

instance Prelude.NFData CreateWorldExportJobResponse where
  rnf :: CreateWorldExportJobResponse -> ()
rnf CreateWorldExportJobResponse' {Int
Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe OutputLocation
Maybe WorldExportJobErrorCode
Maybe WorldExportJobStatus
httpStatus :: Int
tags :: Maybe (HashMap Text Text)
status :: Maybe WorldExportJobStatus
outputLocation :: Maybe OutputLocation
iamRole :: Maybe Text
failureCode :: Maybe WorldExportJobErrorCode
createdAt :: Maybe POSIX
clientRequestToken :: Maybe Text
arn :: Maybe Text
$sel:httpStatus:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Int
$sel:tags:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe (HashMap Text Text)
$sel:status:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe WorldExportJobStatus
$sel:outputLocation:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe OutputLocation
$sel:iamRole:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe Text
$sel:failureCode:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe WorldExportJobErrorCode
$sel:createdAt:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe POSIX
$sel:clientRequestToken:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> Maybe Text
$sel:arn:CreateWorldExportJobResponse' :: CreateWorldExportJobResponse -> 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 Text
clientRequestToken
      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 WorldExportJobErrorCode
failureCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
iamRole
      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 (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus