{-# 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.Proton.CreateEnvironmentTemplate
-- 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)
--
-- Create an environment template for AWS Proton. For more information, see
-- <https://docs.aws.amazon.com/proton/latest/adminguide/ag-templates.html Environment Templates>
-- in the /AWS Proton Administrator Guide/.
--
-- You can create an environment template in one of the two following ways:
--
-- -   Register and publish a /standard/ environment template that
--     instructs AWS Proton to deploy and manage environment
--     infrastructure.
--
-- -   Register and publish a /customer managed/ environment template that
--     connects AWS Proton to your existing provisioned infrastructure that
--     you manage. AWS Proton /doesn\'t/ manage your existing provisioned
--     infrastructure. To create an environment template for customer
--     provisioned and managed infrastructure, include the @provisioning@
--     parameter and set the value to @CUSTOMER_MANAGED@. For more
--     information, see
--     <https://docs.aws.amazon.com/proton/latest/adminguide/template-create.html Register and publish an environment template>
--     in the /AWS Proton Administrator Guide/.
module Amazonka.Proton.CreateEnvironmentTemplate
  ( -- * Creating a Request
    CreateEnvironmentTemplate (..),
    newCreateEnvironmentTemplate,

    -- * Request Lenses
    createEnvironmentTemplate_provisioning,
    createEnvironmentTemplate_displayName,
    createEnvironmentTemplate_encryptionKey,
    createEnvironmentTemplate_description,
    createEnvironmentTemplate_tags,
    createEnvironmentTemplate_name,

    -- * Destructuring the Response
    CreateEnvironmentTemplateResponse (..),
    newCreateEnvironmentTemplateResponse,

    -- * Response Lenses
    createEnvironmentTemplateResponse_httpStatus,
    createEnvironmentTemplateResponse_environmentTemplate,
  )
where

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

-- | /See:/ 'newCreateEnvironmentTemplate' smart constructor.
data CreateEnvironmentTemplate = CreateEnvironmentTemplate'
  { -- | When included, indicates that the environment template is for customer
    -- provisioned and managed infrastructure.
    CreateEnvironmentTemplate -> Maybe Provisioning
provisioning :: Prelude.Maybe Provisioning,
    -- | The environment template name as displayed in the developer interface.
    CreateEnvironmentTemplate -> Maybe (Sensitive Text)
displayName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | A customer provided encryption key that AWS Proton uses to encrypt data.
    CreateEnvironmentTemplate -> Maybe Text
encryptionKey :: Prelude.Maybe Prelude.Text,
    -- | A description of the environment template.
    CreateEnvironmentTemplate -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Create tags for your environment template. For more information, see
    -- /AWS Proton resources and tagging/ in the
    -- <https://docs.aws.amazon.com/proton/latest/adminguide/resources.html AWS Proton Administrator Guide>
    -- or
    -- <https://docs.aws.amazon.com/proton/latest/userguide/resources.html AWS Proton User Guide>.
    CreateEnvironmentTemplate -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the environment template.
    CreateEnvironmentTemplate -> Text
name :: Prelude.Text
  }
  deriving (CreateEnvironmentTemplate -> CreateEnvironmentTemplate -> Bool
(CreateEnvironmentTemplate -> CreateEnvironmentTemplate -> Bool)
-> (CreateEnvironmentTemplate -> CreateEnvironmentTemplate -> Bool)
-> Eq CreateEnvironmentTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEnvironmentTemplate -> CreateEnvironmentTemplate -> Bool
$c/= :: CreateEnvironmentTemplate -> CreateEnvironmentTemplate -> Bool
== :: CreateEnvironmentTemplate -> CreateEnvironmentTemplate -> Bool
$c== :: CreateEnvironmentTemplate -> CreateEnvironmentTemplate -> Bool
Prelude.Eq, Int -> CreateEnvironmentTemplate -> ShowS
[CreateEnvironmentTemplate] -> ShowS
CreateEnvironmentTemplate -> String
(Int -> CreateEnvironmentTemplate -> ShowS)
-> (CreateEnvironmentTemplate -> String)
-> ([CreateEnvironmentTemplate] -> ShowS)
-> Show CreateEnvironmentTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEnvironmentTemplate] -> ShowS
$cshowList :: [CreateEnvironmentTemplate] -> ShowS
show :: CreateEnvironmentTemplate -> String
$cshow :: CreateEnvironmentTemplate -> String
showsPrec :: Int -> CreateEnvironmentTemplate -> ShowS
$cshowsPrec :: Int -> CreateEnvironmentTemplate -> ShowS
Prelude.Show, (forall x.
 CreateEnvironmentTemplate -> Rep CreateEnvironmentTemplate x)
-> (forall x.
    Rep CreateEnvironmentTemplate x -> CreateEnvironmentTemplate)
-> Generic CreateEnvironmentTemplate
forall x.
Rep CreateEnvironmentTemplate x -> CreateEnvironmentTemplate
forall x.
CreateEnvironmentTemplate -> Rep CreateEnvironmentTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateEnvironmentTemplate x -> CreateEnvironmentTemplate
$cfrom :: forall x.
CreateEnvironmentTemplate -> Rep CreateEnvironmentTemplate x
Prelude.Generic)

-- |
-- Create a value of 'CreateEnvironmentTemplate' 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:
--
-- 'provisioning', 'createEnvironmentTemplate_provisioning' - When included, indicates that the environment template is for customer
-- provisioned and managed infrastructure.
--
-- 'displayName', 'createEnvironmentTemplate_displayName' - The environment template name as displayed in the developer interface.
--
-- 'encryptionKey', 'createEnvironmentTemplate_encryptionKey' - A customer provided encryption key that AWS Proton uses to encrypt data.
--
-- 'description', 'createEnvironmentTemplate_description' - A description of the environment template.
--
-- 'tags', 'createEnvironmentTemplate_tags' - Create tags for your environment template. For more information, see
-- /AWS Proton resources and tagging/ in the
-- <https://docs.aws.amazon.com/proton/latest/adminguide/resources.html AWS Proton Administrator Guide>
-- or
-- <https://docs.aws.amazon.com/proton/latest/userguide/resources.html AWS Proton User Guide>.
--
-- 'name', 'createEnvironmentTemplate_name' - The name of the environment template.
newCreateEnvironmentTemplate ::
  -- | 'name'
  Prelude.Text ->
  CreateEnvironmentTemplate
newCreateEnvironmentTemplate :: Text -> CreateEnvironmentTemplate
newCreateEnvironmentTemplate Text
pName_ =
  CreateEnvironmentTemplate' :: Maybe Provisioning
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe [Tag]
-> Text
-> CreateEnvironmentTemplate
CreateEnvironmentTemplate'
    { $sel:provisioning:CreateEnvironmentTemplate' :: Maybe Provisioning
provisioning =
        Maybe Provisioning
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:CreateEnvironmentTemplate' :: Maybe (Sensitive Text)
displayName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionKey:CreateEnvironmentTemplate' :: Maybe Text
encryptionKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateEnvironmentTemplate' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateEnvironmentTemplate' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateEnvironmentTemplate' :: Text
name = Text
pName_
    }

-- | When included, indicates that the environment template is for customer
-- provisioned and managed infrastructure.
createEnvironmentTemplate_provisioning :: Lens.Lens' CreateEnvironmentTemplate (Prelude.Maybe Provisioning)
createEnvironmentTemplate_provisioning :: (Maybe Provisioning -> f (Maybe Provisioning))
-> CreateEnvironmentTemplate -> f CreateEnvironmentTemplate
createEnvironmentTemplate_provisioning = (CreateEnvironmentTemplate -> Maybe Provisioning)
-> (CreateEnvironmentTemplate
    -> Maybe Provisioning -> CreateEnvironmentTemplate)
-> Lens
     CreateEnvironmentTemplate
     CreateEnvironmentTemplate
     (Maybe Provisioning)
     (Maybe Provisioning)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentTemplate' {Maybe Provisioning
provisioning :: Maybe Provisioning
$sel:provisioning:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe Provisioning
provisioning} -> Maybe Provisioning
provisioning) (\s :: CreateEnvironmentTemplate
s@CreateEnvironmentTemplate' {} Maybe Provisioning
a -> CreateEnvironmentTemplate
s {$sel:provisioning:CreateEnvironmentTemplate' :: Maybe Provisioning
provisioning = Maybe Provisioning
a} :: CreateEnvironmentTemplate)

-- | The environment template name as displayed in the developer interface.
createEnvironmentTemplate_displayName :: Lens.Lens' CreateEnvironmentTemplate (Prelude.Maybe Prelude.Text)
createEnvironmentTemplate_displayName :: (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentTemplate -> f CreateEnvironmentTemplate
createEnvironmentTemplate_displayName = (CreateEnvironmentTemplate -> Maybe (Sensitive Text))
-> (CreateEnvironmentTemplate
    -> Maybe (Sensitive Text) -> CreateEnvironmentTemplate)
-> Lens
     CreateEnvironmentTemplate
     CreateEnvironmentTemplate
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentTemplate' {Maybe (Sensitive Text)
displayName :: Maybe (Sensitive Text)
$sel:displayName:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe (Sensitive Text)
displayName} -> Maybe (Sensitive Text)
displayName) (\s :: CreateEnvironmentTemplate
s@CreateEnvironmentTemplate' {} Maybe (Sensitive Text)
a -> CreateEnvironmentTemplate
s {$sel:displayName:CreateEnvironmentTemplate' :: Maybe (Sensitive Text)
displayName = Maybe (Sensitive Text)
a} :: CreateEnvironmentTemplate) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CreateEnvironmentTemplate -> f CreateEnvironmentTemplate)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentTemplate
-> f CreateEnvironmentTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | A customer provided encryption key that AWS Proton uses to encrypt data.
createEnvironmentTemplate_encryptionKey :: Lens.Lens' CreateEnvironmentTemplate (Prelude.Maybe Prelude.Text)
createEnvironmentTemplate_encryptionKey :: (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentTemplate -> f CreateEnvironmentTemplate
createEnvironmentTemplate_encryptionKey = (CreateEnvironmentTemplate -> Maybe Text)
-> (CreateEnvironmentTemplate
    -> Maybe Text -> CreateEnvironmentTemplate)
-> Lens
     CreateEnvironmentTemplate
     CreateEnvironmentTemplate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentTemplate' {Maybe Text
encryptionKey :: Maybe Text
$sel:encryptionKey:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe Text
encryptionKey} -> Maybe Text
encryptionKey) (\s :: CreateEnvironmentTemplate
s@CreateEnvironmentTemplate' {} Maybe Text
a -> CreateEnvironmentTemplate
s {$sel:encryptionKey:CreateEnvironmentTemplate' :: Maybe Text
encryptionKey = Maybe Text
a} :: CreateEnvironmentTemplate)

-- | A description of the environment template.
createEnvironmentTemplate_description :: Lens.Lens' CreateEnvironmentTemplate (Prelude.Maybe Prelude.Text)
createEnvironmentTemplate_description :: (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentTemplate -> f CreateEnvironmentTemplate
createEnvironmentTemplate_description = (CreateEnvironmentTemplate -> Maybe (Sensitive Text))
-> (CreateEnvironmentTemplate
    -> Maybe (Sensitive Text) -> CreateEnvironmentTemplate)
-> Lens
     CreateEnvironmentTemplate
     CreateEnvironmentTemplate
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentTemplate' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: CreateEnvironmentTemplate
s@CreateEnvironmentTemplate' {} Maybe (Sensitive Text)
a -> CreateEnvironmentTemplate
s {$sel:description:CreateEnvironmentTemplate' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: CreateEnvironmentTemplate) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CreateEnvironmentTemplate -> f CreateEnvironmentTemplate)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentTemplate
-> f CreateEnvironmentTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Create tags for your environment template. For more information, see
-- /AWS Proton resources and tagging/ in the
-- <https://docs.aws.amazon.com/proton/latest/adminguide/resources.html AWS Proton Administrator Guide>
-- or
-- <https://docs.aws.amazon.com/proton/latest/userguide/resources.html AWS Proton User Guide>.
createEnvironmentTemplate_tags :: Lens.Lens' CreateEnvironmentTemplate (Prelude.Maybe [Tag])
createEnvironmentTemplate_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateEnvironmentTemplate -> f CreateEnvironmentTemplate
createEnvironmentTemplate_tags = (CreateEnvironmentTemplate -> Maybe [Tag])
-> (CreateEnvironmentTemplate
    -> Maybe [Tag] -> CreateEnvironmentTemplate)
-> Lens
     CreateEnvironmentTemplate
     CreateEnvironmentTemplate
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentTemplate' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateEnvironmentTemplate
s@CreateEnvironmentTemplate' {} Maybe [Tag]
a -> CreateEnvironmentTemplate
s {$sel:tags:CreateEnvironmentTemplate' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateEnvironmentTemplate) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateEnvironmentTemplate -> f CreateEnvironmentTemplate)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateEnvironmentTemplate
-> f CreateEnvironmentTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Core.AWSRequest CreateEnvironmentTemplate where
  type
    AWSResponse CreateEnvironmentTemplate =
      CreateEnvironmentTemplateResponse
  request :: CreateEnvironmentTemplate -> Request CreateEnvironmentTemplate
request = Service
-> CreateEnvironmentTemplate -> Request CreateEnvironmentTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateEnvironmentTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateEnvironmentTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateEnvironmentTemplate))
-> Logger
-> Service
-> Proxy CreateEnvironmentTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateEnvironmentTemplate)))
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 ->
          Int -> EnvironmentTemplate -> CreateEnvironmentTemplateResponse
CreateEnvironmentTemplateResponse'
            (Int -> EnvironmentTemplate -> CreateEnvironmentTemplateResponse)
-> Either String Int
-> Either
     String (EnvironmentTemplate -> CreateEnvironmentTemplateResponse)
forall (f :: * -> *) a b. Functor 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))
            Either
  String (EnvironmentTemplate -> CreateEnvironmentTemplateResponse)
-> Either String EnvironmentTemplate
-> Either String CreateEnvironmentTemplateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String EnvironmentTemplate
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"environmentTemplate")
      )

instance Prelude.Hashable CreateEnvironmentTemplate

instance Prelude.NFData CreateEnvironmentTemplate

instance Core.ToHeaders CreateEnvironmentTemplate where
  toHeaders :: CreateEnvironmentTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateEnvironmentTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AwsProton20200720.CreateEnvironmentTemplate" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateEnvironmentTemplate where
  toJSON :: CreateEnvironmentTemplate -> Value
toJSON CreateEnvironmentTemplate' {Maybe [Tag]
Maybe Text
Maybe (Sensitive Text)
Maybe Provisioning
Text
name :: Text
tags :: Maybe [Tag]
description :: Maybe (Sensitive Text)
encryptionKey :: Maybe Text
displayName :: Maybe (Sensitive Text)
provisioning :: Maybe Provisioning
$sel:name:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Text
$sel:tags:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe [Tag]
$sel:description:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe (Sensitive Text)
$sel:encryptionKey:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe Text
$sel:displayName:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe (Sensitive Text)
$sel:provisioning:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe Provisioning
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"provisioning" Text -> Provisioning -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Provisioning -> Pair) -> Maybe Provisioning -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Provisioning
provisioning,
            (Text
"displayName" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
displayName,
            (Text
"encryptionKey" 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
encryptionKey,
            (Text
"description" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
description,
            (Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

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

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

-- | /See:/ 'newCreateEnvironmentTemplateResponse' smart constructor.
data CreateEnvironmentTemplateResponse = CreateEnvironmentTemplateResponse'
  { -- | The response's http status code.
    CreateEnvironmentTemplateResponse -> Int
httpStatus :: Prelude.Int,
    -- | The environment template detail data that\'s returned by AWS Proton.
    CreateEnvironmentTemplateResponse -> EnvironmentTemplate
environmentTemplate :: EnvironmentTemplate
  }
  deriving (CreateEnvironmentTemplateResponse
-> CreateEnvironmentTemplateResponse -> Bool
(CreateEnvironmentTemplateResponse
 -> CreateEnvironmentTemplateResponse -> Bool)
-> (CreateEnvironmentTemplateResponse
    -> CreateEnvironmentTemplateResponse -> Bool)
-> Eq CreateEnvironmentTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEnvironmentTemplateResponse
-> CreateEnvironmentTemplateResponse -> Bool
$c/= :: CreateEnvironmentTemplateResponse
-> CreateEnvironmentTemplateResponse -> Bool
== :: CreateEnvironmentTemplateResponse
-> CreateEnvironmentTemplateResponse -> Bool
$c== :: CreateEnvironmentTemplateResponse
-> CreateEnvironmentTemplateResponse -> Bool
Prelude.Eq, Int -> CreateEnvironmentTemplateResponse -> ShowS
[CreateEnvironmentTemplateResponse] -> ShowS
CreateEnvironmentTemplateResponse -> String
(Int -> CreateEnvironmentTemplateResponse -> ShowS)
-> (CreateEnvironmentTemplateResponse -> String)
-> ([CreateEnvironmentTemplateResponse] -> ShowS)
-> Show CreateEnvironmentTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEnvironmentTemplateResponse] -> ShowS
$cshowList :: [CreateEnvironmentTemplateResponse] -> ShowS
show :: CreateEnvironmentTemplateResponse -> String
$cshow :: CreateEnvironmentTemplateResponse -> String
showsPrec :: Int -> CreateEnvironmentTemplateResponse -> ShowS
$cshowsPrec :: Int -> CreateEnvironmentTemplateResponse -> ShowS
Prelude.Show, (forall x.
 CreateEnvironmentTemplateResponse
 -> Rep CreateEnvironmentTemplateResponse x)
-> (forall x.
    Rep CreateEnvironmentTemplateResponse x
    -> CreateEnvironmentTemplateResponse)
-> Generic CreateEnvironmentTemplateResponse
forall x.
Rep CreateEnvironmentTemplateResponse x
-> CreateEnvironmentTemplateResponse
forall x.
CreateEnvironmentTemplateResponse
-> Rep CreateEnvironmentTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateEnvironmentTemplateResponse x
-> CreateEnvironmentTemplateResponse
$cfrom :: forall x.
CreateEnvironmentTemplateResponse
-> Rep CreateEnvironmentTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateEnvironmentTemplateResponse' 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:
--
-- 'httpStatus', 'createEnvironmentTemplateResponse_httpStatus' - The response's http status code.
--
-- 'environmentTemplate', 'createEnvironmentTemplateResponse_environmentTemplate' - The environment template detail data that\'s returned by AWS Proton.
newCreateEnvironmentTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'environmentTemplate'
  EnvironmentTemplate ->
  CreateEnvironmentTemplateResponse
newCreateEnvironmentTemplateResponse :: Int -> EnvironmentTemplate -> CreateEnvironmentTemplateResponse
newCreateEnvironmentTemplateResponse
  Int
pHttpStatus_
  EnvironmentTemplate
pEnvironmentTemplate_ =
    CreateEnvironmentTemplateResponse' :: Int -> EnvironmentTemplate -> CreateEnvironmentTemplateResponse
CreateEnvironmentTemplateResponse'
      { $sel:httpStatus:CreateEnvironmentTemplateResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:environmentTemplate:CreateEnvironmentTemplateResponse' :: EnvironmentTemplate
environmentTemplate =
          EnvironmentTemplate
pEnvironmentTemplate_
      }

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

-- | The environment template detail data that\'s returned by AWS Proton.
createEnvironmentTemplateResponse_environmentTemplate :: Lens.Lens' CreateEnvironmentTemplateResponse EnvironmentTemplate
createEnvironmentTemplateResponse_environmentTemplate :: (EnvironmentTemplate -> f EnvironmentTemplate)
-> CreateEnvironmentTemplateResponse
-> f CreateEnvironmentTemplateResponse
createEnvironmentTemplateResponse_environmentTemplate = (CreateEnvironmentTemplateResponse -> EnvironmentTemplate)
-> (CreateEnvironmentTemplateResponse
    -> EnvironmentTemplate -> CreateEnvironmentTemplateResponse)
-> Lens
     CreateEnvironmentTemplateResponse
     CreateEnvironmentTemplateResponse
     EnvironmentTemplate
     EnvironmentTemplate
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentTemplateResponse' {EnvironmentTemplate
environmentTemplate :: EnvironmentTemplate
$sel:environmentTemplate:CreateEnvironmentTemplateResponse' :: CreateEnvironmentTemplateResponse -> EnvironmentTemplate
environmentTemplate} -> EnvironmentTemplate
environmentTemplate) (\s :: CreateEnvironmentTemplateResponse
s@CreateEnvironmentTemplateResponse' {} EnvironmentTemplate
a -> CreateEnvironmentTemplateResponse
s {$sel:environmentTemplate:CreateEnvironmentTemplateResponse' :: EnvironmentTemplate
environmentTemplate = EnvironmentTemplate
a} :: CreateEnvironmentTemplateResponse)

instance
  Prelude.NFData
    CreateEnvironmentTemplateResponse