{-# 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.CreateWorldGenerationJob
-- 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)
--
-- Creates worlds using the specified template.
module Amazonka.RobOMaker.CreateWorldGenerationJob
  ( -- * Creating a Request
    CreateWorldGenerationJob (..),
    newCreateWorldGenerationJob,

    -- * Request Lenses
    createWorldGenerationJob_worldTags,
    createWorldGenerationJob_clientRequestToken,
    createWorldGenerationJob_tags,
    createWorldGenerationJob_template,
    createWorldGenerationJob_worldCount,

    -- * Destructuring the Response
    CreateWorldGenerationJobResponse (..),
    newCreateWorldGenerationJobResponse,

    -- * Response Lenses
    createWorldGenerationJobResponse_status,
    createWorldGenerationJobResponse_arn,
    createWorldGenerationJobResponse_createdAt,
    createWorldGenerationJobResponse_failureCode,
    createWorldGenerationJobResponse_worldCount,
    createWorldGenerationJobResponse_template,
    createWorldGenerationJobResponse_worldTags,
    createWorldGenerationJobResponse_clientRequestToken,
    createWorldGenerationJobResponse_tags,
    createWorldGenerationJobResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.RobOMaker.Types

-- | /See:/ 'newCreateWorldGenerationJob' smart constructor.
data CreateWorldGenerationJob = CreateWorldGenerationJob'
  { -- | A map that contains tag keys and tag values that are attached to the
    -- generated worlds.
    CreateWorldGenerationJob -> Maybe (HashMap Text Text)
worldTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CreateWorldGenerationJob -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | A map that contains tag keys and tag values that are attached to the
    -- world generator job.
    CreateWorldGenerationJob -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (arn) of the world template describing the
    -- worlds you want to create.
    CreateWorldGenerationJob -> Text
template :: Prelude.Text,
    -- | Information about the world count.
    CreateWorldGenerationJob -> WorldCount
worldCount :: WorldCount
  }
  deriving (CreateWorldGenerationJob -> CreateWorldGenerationJob -> Bool
(CreateWorldGenerationJob -> CreateWorldGenerationJob -> Bool)
-> (CreateWorldGenerationJob -> CreateWorldGenerationJob -> Bool)
-> Eq CreateWorldGenerationJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorldGenerationJob -> CreateWorldGenerationJob -> Bool
$c/= :: CreateWorldGenerationJob -> CreateWorldGenerationJob -> Bool
== :: CreateWorldGenerationJob -> CreateWorldGenerationJob -> Bool
$c== :: CreateWorldGenerationJob -> CreateWorldGenerationJob -> Bool
Prelude.Eq, ReadPrec [CreateWorldGenerationJob]
ReadPrec CreateWorldGenerationJob
Int -> ReadS CreateWorldGenerationJob
ReadS [CreateWorldGenerationJob]
(Int -> ReadS CreateWorldGenerationJob)
-> ReadS [CreateWorldGenerationJob]
-> ReadPrec CreateWorldGenerationJob
-> ReadPrec [CreateWorldGenerationJob]
-> Read CreateWorldGenerationJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorldGenerationJob]
$creadListPrec :: ReadPrec [CreateWorldGenerationJob]
readPrec :: ReadPrec CreateWorldGenerationJob
$creadPrec :: ReadPrec CreateWorldGenerationJob
readList :: ReadS [CreateWorldGenerationJob]
$creadList :: ReadS [CreateWorldGenerationJob]
readsPrec :: Int -> ReadS CreateWorldGenerationJob
$creadsPrec :: Int -> ReadS CreateWorldGenerationJob
Prelude.Read, Int -> CreateWorldGenerationJob -> ShowS
[CreateWorldGenerationJob] -> ShowS
CreateWorldGenerationJob -> String
(Int -> CreateWorldGenerationJob -> ShowS)
-> (CreateWorldGenerationJob -> String)
-> ([CreateWorldGenerationJob] -> ShowS)
-> Show CreateWorldGenerationJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorldGenerationJob] -> ShowS
$cshowList :: [CreateWorldGenerationJob] -> ShowS
show :: CreateWorldGenerationJob -> String
$cshow :: CreateWorldGenerationJob -> String
showsPrec :: Int -> CreateWorldGenerationJob -> ShowS
$cshowsPrec :: Int -> CreateWorldGenerationJob -> ShowS
Prelude.Show, (forall x.
 CreateWorldGenerationJob -> Rep CreateWorldGenerationJob x)
-> (forall x.
    Rep CreateWorldGenerationJob x -> CreateWorldGenerationJob)
-> Generic CreateWorldGenerationJob
forall x.
Rep CreateWorldGenerationJob x -> CreateWorldGenerationJob
forall x.
CreateWorldGenerationJob -> Rep CreateWorldGenerationJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWorldGenerationJob x -> CreateWorldGenerationJob
$cfrom :: forall x.
CreateWorldGenerationJob -> Rep CreateWorldGenerationJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorldGenerationJob' 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:
--
-- 'worldTags', 'createWorldGenerationJob_worldTags' - A map that contains tag keys and tag values that are attached to the
-- generated worlds.
--
-- 'clientRequestToken', 'createWorldGenerationJob_clientRequestToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'tags', 'createWorldGenerationJob_tags' - A map that contains tag keys and tag values that are attached to the
-- world generator job.
--
-- 'template', 'createWorldGenerationJob_template' - The Amazon Resource Name (arn) of the world template describing the
-- worlds you want to create.
--
-- 'worldCount', 'createWorldGenerationJob_worldCount' - Information about the world count.
newCreateWorldGenerationJob ::
  -- | 'template'
  Prelude.Text ->
  -- | 'worldCount'
  WorldCount ->
  CreateWorldGenerationJob
newCreateWorldGenerationJob :: Text -> WorldCount -> CreateWorldGenerationJob
newCreateWorldGenerationJob Text
pTemplate_ WorldCount
pWorldCount_ =
  CreateWorldGenerationJob' :: Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> WorldCount
-> CreateWorldGenerationJob
CreateWorldGenerationJob'
    { $sel:worldTags:CreateWorldGenerationJob' :: Maybe (HashMap Text Text)
worldTags =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:CreateWorldGenerationJob' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateWorldGenerationJob' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:template:CreateWorldGenerationJob' :: Text
template = Text
pTemplate_,
      $sel:worldCount:CreateWorldGenerationJob' :: WorldCount
worldCount = WorldCount
pWorldCount_
    }

-- | A map that contains tag keys and tag values that are attached to the
-- generated worlds.
createWorldGenerationJob_worldTags :: Lens.Lens' CreateWorldGenerationJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createWorldGenerationJob_worldTags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorldGenerationJob -> f CreateWorldGenerationJob
createWorldGenerationJob_worldTags = (CreateWorldGenerationJob -> Maybe (HashMap Text Text))
-> (CreateWorldGenerationJob
    -> Maybe (HashMap Text Text) -> CreateWorldGenerationJob)
-> Lens
     CreateWorldGenerationJob
     CreateWorldGenerationJob
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldGenerationJob' {Maybe (HashMap Text Text)
worldTags :: Maybe (HashMap Text Text)
$sel:worldTags:CreateWorldGenerationJob' :: CreateWorldGenerationJob -> Maybe (HashMap Text Text)
worldTags} -> Maybe (HashMap Text Text)
worldTags) (\s :: CreateWorldGenerationJob
s@CreateWorldGenerationJob' {} Maybe (HashMap Text Text)
a -> CreateWorldGenerationJob
s {$sel:worldTags:CreateWorldGenerationJob' :: Maybe (HashMap Text Text)
worldTags = Maybe (HashMap Text Text)
a} :: CreateWorldGenerationJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateWorldGenerationJob -> f CreateWorldGenerationJob)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorldGenerationJob
-> f CreateWorldGenerationJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | A map that contains tag keys and tag values that are attached to the
-- world generator job.
createWorldGenerationJob_tags :: Lens.Lens' CreateWorldGenerationJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createWorldGenerationJob_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorldGenerationJob -> f CreateWorldGenerationJob
createWorldGenerationJob_tags = (CreateWorldGenerationJob -> Maybe (HashMap Text Text))
-> (CreateWorldGenerationJob
    -> Maybe (HashMap Text Text) -> CreateWorldGenerationJob)
-> Lens
     CreateWorldGenerationJob
     CreateWorldGenerationJob
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldGenerationJob' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateWorldGenerationJob' :: CreateWorldGenerationJob -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateWorldGenerationJob
s@CreateWorldGenerationJob' {} Maybe (HashMap Text Text)
a -> CreateWorldGenerationJob
s {$sel:tags:CreateWorldGenerationJob' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateWorldGenerationJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateWorldGenerationJob -> f CreateWorldGenerationJob)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorldGenerationJob
-> f CreateWorldGenerationJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (arn) of the world template describing the
-- worlds you want to create.
createWorldGenerationJob_template :: Lens.Lens' CreateWorldGenerationJob Prelude.Text
createWorldGenerationJob_template :: (Text -> f Text)
-> CreateWorldGenerationJob -> f CreateWorldGenerationJob
createWorldGenerationJob_template = (CreateWorldGenerationJob -> Text)
-> (CreateWorldGenerationJob -> Text -> CreateWorldGenerationJob)
-> Lens CreateWorldGenerationJob CreateWorldGenerationJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldGenerationJob' {Text
template :: Text
$sel:template:CreateWorldGenerationJob' :: CreateWorldGenerationJob -> Text
template} -> Text
template) (\s :: CreateWorldGenerationJob
s@CreateWorldGenerationJob' {} Text
a -> CreateWorldGenerationJob
s {$sel:template:CreateWorldGenerationJob' :: Text
template = Text
a} :: CreateWorldGenerationJob)

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

instance Core.AWSRequest CreateWorldGenerationJob where
  type
    AWSResponse CreateWorldGenerationJob =
      CreateWorldGenerationJobResponse
  request :: CreateWorldGenerationJob -> Request CreateWorldGenerationJob
request = Service
-> CreateWorldGenerationJob -> Request CreateWorldGenerationJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateWorldGenerationJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateWorldGenerationJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateWorldGenerationJob))
-> Logger
-> Service
-> Proxy CreateWorldGenerationJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateWorldGenerationJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe WorldGenerationJobStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe WorldGenerationJobErrorCode
-> Maybe WorldCount
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> CreateWorldGenerationJobResponse
CreateWorldGenerationJobResponse'
            (Maybe WorldGenerationJobStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe WorldGenerationJobErrorCode
 -> Maybe WorldCount
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Int
 -> CreateWorldGenerationJobResponse)
-> Either String (Maybe WorldGenerationJobStatus)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe WorldGenerationJobErrorCode
      -> Maybe WorldCount
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateWorldGenerationJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe WorldGenerationJobStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe WorldGenerationJobErrorCode
   -> Maybe WorldCount
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateWorldGenerationJobResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe WorldGenerationJobErrorCode
      -> Maybe WorldCount
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateWorldGenerationJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"arn")
            Either
  String
  (Maybe POSIX
   -> Maybe WorldGenerationJobErrorCode
   -> Maybe WorldCount
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateWorldGenerationJobResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe WorldGenerationJobErrorCode
      -> Maybe WorldCount
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateWorldGenerationJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"createdAt")
            Either
  String
  (Maybe WorldGenerationJobErrorCode
   -> Maybe WorldCount
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateWorldGenerationJobResponse)
-> Either String (Maybe WorldGenerationJobErrorCode)
-> Either
     String
     (Maybe WorldCount
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateWorldGenerationJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe WorldGenerationJobErrorCode)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failureCode")
            Either
  String
  (Maybe WorldCount
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateWorldGenerationJobResponse)
-> Either String (Maybe WorldCount)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateWorldGenerationJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe WorldCount)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"worldCount")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateWorldGenerationJobResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateWorldGenerationJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"template")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateWorldGenerationJobResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateWorldGenerationJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"worldTags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateWorldGenerationJobResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Int -> CreateWorldGenerationJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"clientRequestToken")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Int -> CreateWorldGenerationJobResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> CreateWorldGenerationJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> CreateWorldGenerationJobResponse)
-> Either String Int
-> Either String CreateWorldGenerationJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateWorldGenerationJob

instance Prelude.NFData CreateWorldGenerationJob

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

instance Core.ToJSON CreateWorldGenerationJob where
  toJSON :: CreateWorldGenerationJob -> Value
toJSON CreateWorldGenerationJob' {Maybe Text
Maybe (HashMap Text Text)
Text
WorldCount
worldCount :: WorldCount
template :: Text
tags :: Maybe (HashMap Text Text)
clientRequestToken :: Maybe Text
worldTags :: Maybe (HashMap Text Text)
$sel:worldCount:CreateWorldGenerationJob' :: CreateWorldGenerationJob -> WorldCount
$sel:template:CreateWorldGenerationJob' :: CreateWorldGenerationJob -> Text
$sel:tags:CreateWorldGenerationJob' :: CreateWorldGenerationJob -> Maybe (HashMap Text Text)
$sel:clientRequestToken:CreateWorldGenerationJob' :: CreateWorldGenerationJob -> Maybe Text
$sel:worldTags:CreateWorldGenerationJob' :: CreateWorldGenerationJob -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"worldTags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
worldTags,
            (Text
"clientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"template" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
template),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"worldCount" Text -> WorldCount -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= WorldCount
worldCount)
          ]
      )

instance Core.ToPath CreateWorldGenerationJob where
  toPath :: CreateWorldGenerationJob -> ByteString
toPath = ByteString -> CreateWorldGenerationJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/createWorldGenerationJob"

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

-- | /See:/ 'newCreateWorldGenerationJobResponse' smart constructor.
data CreateWorldGenerationJobResponse = CreateWorldGenerationJobResponse'
  { -- | 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.
    CreateWorldGenerationJobResponse -> Maybe WorldGenerationJobStatus
status :: Prelude.Maybe WorldGenerationJobStatus,
    -- | The Amazon Resource Name (ARN) of the world generator job.
    CreateWorldGenerationJobResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the world generator job
    -- was created.
    CreateWorldGenerationJobResponse -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The failure code of the world generator 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.
    CreateWorldGenerationJobResponse
-> Maybe WorldGenerationJobErrorCode
failureCode :: Prelude.Maybe WorldGenerationJobErrorCode,
    -- | Information about the world count.
    CreateWorldGenerationJobResponse -> Maybe WorldCount
worldCount :: Prelude.Maybe WorldCount,
    -- | The Amazon Resource Name (arn) of the world template.
    CreateWorldGenerationJobResponse -> Maybe Text
template :: Prelude.Maybe Prelude.Text,
    -- | A map that contains tag keys and tag values that are attached to the
    -- generated worlds.
    CreateWorldGenerationJobResponse -> Maybe (HashMap Text Text)
worldTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CreateWorldGenerationJobResponse -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | A map that contains tag keys and tag values that are attached to the
    -- world generator job.
    CreateWorldGenerationJobResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    CreateWorldGenerationJobResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateWorldGenerationJobResponse
-> CreateWorldGenerationJobResponse -> Bool
(CreateWorldGenerationJobResponse
 -> CreateWorldGenerationJobResponse -> Bool)
-> (CreateWorldGenerationJobResponse
    -> CreateWorldGenerationJobResponse -> Bool)
-> Eq CreateWorldGenerationJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorldGenerationJobResponse
-> CreateWorldGenerationJobResponse -> Bool
$c/= :: CreateWorldGenerationJobResponse
-> CreateWorldGenerationJobResponse -> Bool
== :: CreateWorldGenerationJobResponse
-> CreateWorldGenerationJobResponse -> Bool
$c== :: CreateWorldGenerationJobResponse
-> CreateWorldGenerationJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateWorldGenerationJobResponse]
ReadPrec CreateWorldGenerationJobResponse
Int -> ReadS CreateWorldGenerationJobResponse
ReadS [CreateWorldGenerationJobResponse]
(Int -> ReadS CreateWorldGenerationJobResponse)
-> ReadS [CreateWorldGenerationJobResponse]
-> ReadPrec CreateWorldGenerationJobResponse
-> ReadPrec [CreateWorldGenerationJobResponse]
-> Read CreateWorldGenerationJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorldGenerationJobResponse]
$creadListPrec :: ReadPrec [CreateWorldGenerationJobResponse]
readPrec :: ReadPrec CreateWorldGenerationJobResponse
$creadPrec :: ReadPrec CreateWorldGenerationJobResponse
readList :: ReadS [CreateWorldGenerationJobResponse]
$creadList :: ReadS [CreateWorldGenerationJobResponse]
readsPrec :: Int -> ReadS CreateWorldGenerationJobResponse
$creadsPrec :: Int -> ReadS CreateWorldGenerationJobResponse
Prelude.Read, Int -> CreateWorldGenerationJobResponse -> ShowS
[CreateWorldGenerationJobResponse] -> ShowS
CreateWorldGenerationJobResponse -> String
(Int -> CreateWorldGenerationJobResponse -> ShowS)
-> (CreateWorldGenerationJobResponse -> String)
-> ([CreateWorldGenerationJobResponse] -> ShowS)
-> Show CreateWorldGenerationJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorldGenerationJobResponse] -> ShowS
$cshowList :: [CreateWorldGenerationJobResponse] -> ShowS
show :: CreateWorldGenerationJobResponse -> String
$cshow :: CreateWorldGenerationJobResponse -> String
showsPrec :: Int -> CreateWorldGenerationJobResponse -> ShowS
$cshowsPrec :: Int -> CreateWorldGenerationJobResponse -> ShowS
Prelude.Show, (forall x.
 CreateWorldGenerationJobResponse
 -> Rep CreateWorldGenerationJobResponse x)
-> (forall x.
    Rep CreateWorldGenerationJobResponse x
    -> CreateWorldGenerationJobResponse)
-> Generic CreateWorldGenerationJobResponse
forall x.
Rep CreateWorldGenerationJobResponse x
-> CreateWorldGenerationJobResponse
forall x.
CreateWorldGenerationJobResponse
-> Rep CreateWorldGenerationJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWorldGenerationJobResponse x
-> CreateWorldGenerationJobResponse
$cfrom :: forall x.
CreateWorldGenerationJobResponse
-> Rep CreateWorldGenerationJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorldGenerationJobResponse' 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', 'createWorldGenerationJobResponse_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.
--
-- 'arn', 'createWorldGenerationJobResponse_arn' - The Amazon Resource Name (ARN) of the world generator job.
--
-- 'createdAt', 'createWorldGenerationJobResponse_createdAt' - The time, in milliseconds since the epoch, when the world generator job
-- was created.
--
-- 'failureCode', 'createWorldGenerationJobResponse_failureCode' - The failure code of the world generator 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.
--
-- 'worldCount', 'createWorldGenerationJobResponse_worldCount' - Information about the world count.
--
-- 'template', 'createWorldGenerationJobResponse_template' - The Amazon Resource Name (arn) of the world template.
--
-- 'worldTags', 'createWorldGenerationJobResponse_worldTags' - A map that contains tag keys and tag values that are attached to the
-- generated worlds.
--
-- 'clientRequestToken', 'createWorldGenerationJobResponse_clientRequestToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'tags', 'createWorldGenerationJobResponse_tags' - A map that contains tag keys and tag values that are attached to the
-- world generator job.
--
-- 'httpStatus', 'createWorldGenerationJobResponse_httpStatus' - The response's http status code.
newCreateWorldGenerationJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWorldGenerationJobResponse
newCreateWorldGenerationJobResponse :: Int -> CreateWorldGenerationJobResponse
newCreateWorldGenerationJobResponse Int
pHttpStatus_ =
  CreateWorldGenerationJobResponse' :: Maybe WorldGenerationJobStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe WorldGenerationJobErrorCode
-> Maybe WorldCount
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> CreateWorldGenerationJobResponse
CreateWorldGenerationJobResponse'
    { $sel:status:CreateWorldGenerationJobResponse' :: Maybe WorldGenerationJobStatus
status =
        Maybe WorldGenerationJobStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CreateWorldGenerationJobResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:CreateWorldGenerationJobResponse' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:failureCode:CreateWorldGenerationJobResponse' :: Maybe WorldGenerationJobErrorCode
failureCode = Maybe WorldGenerationJobErrorCode
forall a. Maybe a
Prelude.Nothing,
      $sel:worldCount:CreateWorldGenerationJobResponse' :: Maybe WorldCount
worldCount = Maybe WorldCount
forall a. Maybe a
Prelude.Nothing,
      $sel:template:CreateWorldGenerationJobResponse' :: Maybe Text
template = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:worldTags:CreateWorldGenerationJobResponse' :: Maybe (HashMap Text Text)
worldTags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:CreateWorldGenerationJobResponse' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateWorldGenerationJobResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWorldGenerationJobResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

-- | The time, in milliseconds since the epoch, when the world generator job
-- was created.
createWorldGenerationJobResponse_createdAt :: Lens.Lens' CreateWorldGenerationJobResponse (Prelude.Maybe Prelude.UTCTime)
createWorldGenerationJobResponse_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateWorldGenerationJobResponse
-> f CreateWorldGenerationJobResponse
createWorldGenerationJobResponse_createdAt = (CreateWorldGenerationJobResponse -> Maybe POSIX)
-> (CreateWorldGenerationJobResponse
    -> Maybe POSIX -> CreateWorldGenerationJobResponse)
-> Lens
     CreateWorldGenerationJobResponse
     CreateWorldGenerationJobResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldGenerationJobResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:CreateWorldGenerationJobResponse' :: CreateWorldGenerationJobResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: CreateWorldGenerationJobResponse
s@CreateWorldGenerationJobResponse' {} Maybe POSIX
a -> CreateWorldGenerationJobResponse
s {$sel:createdAt:CreateWorldGenerationJobResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: CreateWorldGenerationJobResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> CreateWorldGenerationJobResponse
 -> f CreateWorldGenerationJobResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateWorldGenerationJobResponse
-> f CreateWorldGenerationJobResponse
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 failure code of the world generator 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.
createWorldGenerationJobResponse_failureCode :: Lens.Lens' CreateWorldGenerationJobResponse (Prelude.Maybe WorldGenerationJobErrorCode)
createWorldGenerationJobResponse_failureCode :: (Maybe WorldGenerationJobErrorCode
 -> f (Maybe WorldGenerationJobErrorCode))
-> CreateWorldGenerationJobResponse
-> f CreateWorldGenerationJobResponse
createWorldGenerationJobResponse_failureCode = (CreateWorldGenerationJobResponse
 -> Maybe WorldGenerationJobErrorCode)
-> (CreateWorldGenerationJobResponse
    -> Maybe WorldGenerationJobErrorCode
    -> CreateWorldGenerationJobResponse)
-> Lens
     CreateWorldGenerationJobResponse
     CreateWorldGenerationJobResponse
     (Maybe WorldGenerationJobErrorCode)
     (Maybe WorldGenerationJobErrorCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldGenerationJobResponse' {Maybe WorldGenerationJobErrorCode
failureCode :: Maybe WorldGenerationJobErrorCode
$sel:failureCode:CreateWorldGenerationJobResponse' :: CreateWorldGenerationJobResponse
-> Maybe WorldGenerationJobErrorCode
failureCode} -> Maybe WorldGenerationJobErrorCode
failureCode) (\s :: CreateWorldGenerationJobResponse
s@CreateWorldGenerationJobResponse' {} Maybe WorldGenerationJobErrorCode
a -> CreateWorldGenerationJobResponse
s {$sel:failureCode:CreateWorldGenerationJobResponse' :: Maybe WorldGenerationJobErrorCode
failureCode = Maybe WorldGenerationJobErrorCode
a} :: CreateWorldGenerationJobResponse)

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

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

-- | A map that contains tag keys and tag values that are attached to the
-- generated worlds.
createWorldGenerationJobResponse_worldTags :: Lens.Lens' CreateWorldGenerationJobResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createWorldGenerationJobResponse_worldTags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorldGenerationJobResponse
-> f CreateWorldGenerationJobResponse
createWorldGenerationJobResponse_worldTags = (CreateWorldGenerationJobResponse -> Maybe (HashMap Text Text))
-> (CreateWorldGenerationJobResponse
    -> Maybe (HashMap Text Text) -> CreateWorldGenerationJobResponse)
-> Lens
     CreateWorldGenerationJobResponse
     CreateWorldGenerationJobResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldGenerationJobResponse' {Maybe (HashMap Text Text)
worldTags :: Maybe (HashMap Text Text)
$sel:worldTags:CreateWorldGenerationJobResponse' :: CreateWorldGenerationJobResponse -> Maybe (HashMap Text Text)
worldTags} -> Maybe (HashMap Text Text)
worldTags) (\s :: CreateWorldGenerationJobResponse
s@CreateWorldGenerationJobResponse' {} Maybe (HashMap Text Text)
a -> CreateWorldGenerationJobResponse
s {$sel:worldTags:CreateWorldGenerationJobResponse' :: Maybe (HashMap Text Text)
worldTags = Maybe (HashMap Text Text)
a} :: CreateWorldGenerationJobResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateWorldGenerationJobResponse
 -> f CreateWorldGenerationJobResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorldGenerationJobResponse
-> f CreateWorldGenerationJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | A map that contains tag keys and tag values that are attached to the
-- world generator job.
createWorldGenerationJobResponse_tags :: Lens.Lens' CreateWorldGenerationJobResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createWorldGenerationJobResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorldGenerationJobResponse
-> f CreateWorldGenerationJobResponse
createWorldGenerationJobResponse_tags = (CreateWorldGenerationJobResponse -> Maybe (HashMap Text Text))
-> (CreateWorldGenerationJobResponse
    -> Maybe (HashMap Text Text) -> CreateWorldGenerationJobResponse)
-> Lens
     CreateWorldGenerationJobResponse
     CreateWorldGenerationJobResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldGenerationJobResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateWorldGenerationJobResponse' :: CreateWorldGenerationJobResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateWorldGenerationJobResponse
s@CreateWorldGenerationJobResponse' {} Maybe (HashMap Text Text)
a -> CreateWorldGenerationJobResponse
s {$sel:tags:CreateWorldGenerationJobResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateWorldGenerationJobResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateWorldGenerationJobResponse
 -> f CreateWorldGenerationJobResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorldGenerationJobResponse
-> f CreateWorldGenerationJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    CreateWorldGenerationJobResponse