{-# 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.CreateWorldTemplate
-- 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 a world template.
module Amazonka.RobOMaker.CreateWorldTemplate
  ( -- * Creating a Request
    CreateWorldTemplate (..),
    newCreateWorldTemplate,

    -- * Request Lenses
    createWorldTemplate_name,
    createWorldTemplate_templateLocation,
    createWorldTemplate_templateBody,
    createWorldTemplate_clientRequestToken,
    createWorldTemplate_tags,

    -- * Destructuring the Response
    CreateWorldTemplateResponse (..),
    newCreateWorldTemplateResponse,

    -- * Response Lenses
    createWorldTemplateResponse_arn,
    createWorldTemplateResponse_createdAt,
    createWorldTemplateResponse_name,
    createWorldTemplateResponse_clientRequestToken,
    createWorldTemplateResponse_tags,
    createWorldTemplateResponse_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:/ 'newCreateWorldTemplate' smart constructor.
data CreateWorldTemplate = CreateWorldTemplate'
  { -- | The name of the world template.
    CreateWorldTemplate -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The location of the world template.
    CreateWorldTemplate -> Maybe TemplateLocation
templateLocation :: Prelude.Maybe TemplateLocation,
    -- | The world template body.
    CreateWorldTemplate -> Maybe Text
templateBody :: Prelude.Maybe Prelude.Text,
    -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CreateWorldTemplate -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | A map that contains tag keys and tag values that are attached to the
    -- world template.
    CreateWorldTemplate -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (CreateWorldTemplate -> CreateWorldTemplate -> Bool
(CreateWorldTemplate -> CreateWorldTemplate -> Bool)
-> (CreateWorldTemplate -> CreateWorldTemplate -> Bool)
-> Eq CreateWorldTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorldTemplate -> CreateWorldTemplate -> Bool
$c/= :: CreateWorldTemplate -> CreateWorldTemplate -> Bool
== :: CreateWorldTemplate -> CreateWorldTemplate -> Bool
$c== :: CreateWorldTemplate -> CreateWorldTemplate -> Bool
Prelude.Eq, ReadPrec [CreateWorldTemplate]
ReadPrec CreateWorldTemplate
Int -> ReadS CreateWorldTemplate
ReadS [CreateWorldTemplate]
(Int -> ReadS CreateWorldTemplate)
-> ReadS [CreateWorldTemplate]
-> ReadPrec CreateWorldTemplate
-> ReadPrec [CreateWorldTemplate]
-> Read CreateWorldTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorldTemplate]
$creadListPrec :: ReadPrec [CreateWorldTemplate]
readPrec :: ReadPrec CreateWorldTemplate
$creadPrec :: ReadPrec CreateWorldTemplate
readList :: ReadS [CreateWorldTemplate]
$creadList :: ReadS [CreateWorldTemplate]
readsPrec :: Int -> ReadS CreateWorldTemplate
$creadsPrec :: Int -> ReadS CreateWorldTemplate
Prelude.Read, Int -> CreateWorldTemplate -> ShowS
[CreateWorldTemplate] -> ShowS
CreateWorldTemplate -> String
(Int -> CreateWorldTemplate -> ShowS)
-> (CreateWorldTemplate -> String)
-> ([CreateWorldTemplate] -> ShowS)
-> Show CreateWorldTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorldTemplate] -> ShowS
$cshowList :: [CreateWorldTemplate] -> ShowS
show :: CreateWorldTemplate -> String
$cshow :: CreateWorldTemplate -> String
showsPrec :: Int -> CreateWorldTemplate -> ShowS
$cshowsPrec :: Int -> CreateWorldTemplate -> ShowS
Prelude.Show, (forall x. CreateWorldTemplate -> Rep CreateWorldTemplate x)
-> (forall x. Rep CreateWorldTemplate x -> CreateWorldTemplate)
-> Generic CreateWorldTemplate
forall x. Rep CreateWorldTemplate x -> CreateWorldTemplate
forall x. CreateWorldTemplate -> Rep CreateWorldTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWorldTemplate x -> CreateWorldTemplate
$cfrom :: forall x. CreateWorldTemplate -> Rep CreateWorldTemplate x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorldTemplate' 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:
--
-- 'name', 'createWorldTemplate_name' - The name of the world template.
--
-- 'templateLocation', 'createWorldTemplate_templateLocation' - The location of the world template.
--
-- 'templateBody', 'createWorldTemplate_templateBody' - The world template body.
--
-- 'clientRequestToken', 'createWorldTemplate_clientRequestToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'tags', 'createWorldTemplate_tags' - A map that contains tag keys and tag values that are attached to the
-- world template.
newCreateWorldTemplate ::
  CreateWorldTemplate
newCreateWorldTemplate :: CreateWorldTemplate
newCreateWorldTemplate =
  CreateWorldTemplate' :: Maybe Text
-> Maybe TemplateLocation
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> CreateWorldTemplate
CreateWorldTemplate'
    { $sel:name:CreateWorldTemplate' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateLocation:CreateWorldTemplate' :: Maybe TemplateLocation
templateLocation = Maybe TemplateLocation
forall a. Maybe a
Prelude.Nothing,
      $sel:templateBody:CreateWorldTemplate' :: Maybe Text
templateBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:CreateWorldTemplate' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateWorldTemplate' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the world template.
createWorldTemplate_name :: Lens.Lens' CreateWorldTemplate (Prelude.Maybe Prelude.Text)
createWorldTemplate_name :: (Maybe Text -> f (Maybe Text))
-> CreateWorldTemplate -> f CreateWorldTemplate
createWorldTemplate_name = (CreateWorldTemplate -> Maybe Text)
-> (CreateWorldTemplate -> Maybe Text -> CreateWorldTemplate)
-> Lens
     CreateWorldTemplate CreateWorldTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldTemplate' {Maybe Text
name :: Maybe Text
$sel:name:CreateWorldTemplate' :: CreateWorldTemplate -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateWorldTemplate
s@CreateWorldTemplate' {} Maybe Text
a -> CreateWorldTemplate
s {$sel:name:CreateWorldTemplate' :: Maybe Text
name = Maybe Text
a} :: CreateWorldTemplate)

-- | The location of the world template.
createWorldTemplate_templateLocation :: Lens.Lens' CreateWorldTemplate (Prelude.Maybe TemplateLocation)
createWorldTemplate_templateLocation :: (Maybe TemplateLocation -> f (Maybe TemplateLocation))
-> CreateWorldTemplate -> f CreateWorldTemplate
createWorldTemplate_templateLocation = (CreateWorldTemplate -> Maybe TemplateLocation)
-> (CreateWorldTemplate
    -> Maybe TemplateLocation -> CreateWorldTemplate)
-> Lens
     CreateWorldTemplate
     CreateWorldTemplate
     (Maybe TemplateLocation)
     (Maybe TemplateLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldTemplate' {Maybe TemplateLocation
templateLocation :: Maybe TemplateLocation
$sel:templateLocation:CreateWorldTemplate' :: CreateWorldTemplate -> Maybe TemplateLocation
templateLocation} -> Maybe TemplateLocation
templateLocation) (\s :: CreateWorldTemplate
s@CreateWorldTemplate' {} Maybe TemplateLocation
a -> CreateWorldTemplate
s {$sel:templateLocation:CreateWorldTemplate' :: Maybe TemplateLocation
templateLocation = Maybe TemplateLocation
a} :: CreateWorldTemplate)

-- | The world template body.
createWorldTemplate_templateBody :: Lens.Lens' CreateWorldTemplate (Prelude.Maybe Prelude.Text)
createWorldTemplate_templateBody :: (Maybe Text -> f (Maybe Text))
-> CreateWorldTemplate -> f CreateWorldTemplate
createWorldTemplate_templateBody = (CreateWorldTemplate -> Maybe Text)
-> (CreateWorldTemplate -> Maybe Text -> CreateWorldTemplate)
-> Lens
     CreateWorldTemplate CreateWorldTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorldTemplate' {Maybe Text
templateBody :: Maybe Text
$sel:templateBody:CreateWorldTemplate' :: CreateWorldTemplate -> Maybe Text
templateBody} -> Maybe Text
templateBody) (\s :: CreateWorldTemplate
s@CreateWorldTemplate' {} Maybe Text
a -> CreateWorldTemplate
s {$sel:templateBody:CreateWorldTemplate' :: Maybe Text
templateBody = Maybe Text
a} :: CreateWorldTemplate)

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

-- | A map that contains tag keys and tag values that are attached to the
-- world template.
createWorldTemplate_tags :: Lens.Lens' CreateWorldTemplate (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createWorldTemplate_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorldTemplate -> f CreateWorldTemplate
createWorldTemplate_tags = (CreateWorldTemplate -> Maybe (HashMap Text Text))
-> (CreateWorldTemplate
    -> Maybe (HashMap Text Text) -> CreateWorldTemplate)
-> Lens
     CreateWorldTemplate
     CreateWorldTemplate
     (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 (\CreateWorldTemplate' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateWorldTemplate' :: CreateWorldTemplate -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateWorldTemplate
s@CreateWorldTemplate' {} Maybe (HashMap Text Text)
a -> CreateWorldTemplate
s {$sel:tags:CreateWorldTemplate' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateWorldTemplate) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateWorldTemplate -> f CreateWorldTemplate)
-> ((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)))
-> CreateWorldTemplate
-> f CreateWorldTemplate
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

instance Core.AWSRequest CreateWorldTemplate where
  type
    AWSResponse CreateWorldTemplate =
      CreateWorldTemplateResponse
  request :: CreateWorldTemplate -> Request CreateWorldTemplate
request = Service -> CreateWorldTemplate -> Request CreateWorldTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateWorldTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateWorldTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateWorldTemplate))
-> Logger
-> Service
-> Proxy CreateWorldTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateWorldTemplate)))
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 Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> CreateWorldTemplateResponse
CreateWorldTemplateResponse'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Int
 -> CreateWorldTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateWorldTemplateResponse)
forall (f :: * -> *) a b. Functor 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 Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateWorldTemplateResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateWorldTemplateResponse)
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 Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateWorldTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text) -> Int -> CreateWorldTemplateResponse)
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
"name")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text) -> Int -> CreateWorldTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text) -> Int -> CreateWorldTemplateResponse)
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 -> CreateWorldTemplateResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> CreateWorldTemplateResponse)
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 -> CreateWorldTemplateResponse)
-> Either String Int -> Either String CreateWorldTemplateResponse
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 CreateWorldTemplate

instance Prelude.NFData CreateWorldTemplate

instance Core.ToHeaders CreateWorldTemplate where
  toHeaders :: CreateWorldTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateWorldTemplate -> 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 CreateWorldTemplate where
  toJSON :: CreateWorldTemplate -> Value
toJSON CreateWorldTemplate' {Maybe Text
Maybe (HashMap Text Text)
Maybe TemplateLocation
tags :: Maybe (HashMap Text Text)
clientRequestToken :: Maybe Text
templateBody :: Maybe Text
templateLocation :: Maybe TemplateLocation
name :: Maybe Text
$sel:tags:CreateWorldTemplate' :: CreateWorldTemplate -> Maybe (HashMap Text Text)
$sel:clientRequestToken:CreateWorldTemplate' :: CreateWorldTemplate -> Maybe Text
$sel:templateBody:CreateWorldTemplate' :: CreateWorldTemplate -> Maybe Text
$sel:templateLocation:CreateWorldTemplate' :: CreateWorldTemplate -> Maybe TemplateLocation
$sel:name:CreateWorldTemplate' :: CreateWorldTemplate -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"name" 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
name,
            (Text
"templateLocation" Text -> TemplateLocation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (TemplateLocation -> Pair) -> Maybe TemplateLocation -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TemplateLocation
templateLocation,
            (Text
"templateBody" 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
templateBody,
            (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
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateWorldTemplateResponse' 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', 'createWorldTemplateResponse_arn' - The Amazon Resource Name (ARN) of the world template.
--
-- 'createdAt', 'createWorldTemplateResponse_createdAt' - The time, in milliseconds since the epoch, when the world template was
-- created.
--
-- 'name', 'createWorldTemplateResponse_name' - The name of the world template.
--
-- 'clientRequestToken', 'createWorldTemplateResponse_clientRequestToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'tags', 'createWorldTemplateResponse_tags' - A map that contains tag keys and tag values that are attached to the
-- world template.
--
-- 'httpStatus', 'createWorldTemplateResponse_httpStatus' - The response's http status code.
newCreateWorldTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWorldTemplateResponse
newCreateWorldTemplateResponse :: Int -> CreateWorldTemplateResponse
newCreateWorldTemplateResponse Int
pHttpStatus_ =
  CreateWorldTemplateResponse' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Int
-> CreateWorldTemplateResponse
CreateWorldTemplateResponse'
    { $sel:arn:CreateWorldTemplateResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:CreateWorldTemplateResponse' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateWorldTemplateResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:CreateWorldTemplateResponse' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateWorldTemplateResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWorldTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

instance Prelude.NFData CreateWorldTemplateResponse