{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Create an environment template for Proton. For more information, see
-- <https://docs.aws.amazon.com/proton/latest/userguide/ag-templates.html Environment Templates>
-- in the /Proton User Guide/.
--
-- You can create an environment template in one of the two following ways:
--
-- -   Register and publish a /standard/ environment template that
--     instructs Proton to deploy and manage environment infrastructure.
--
-- -   Register and publish a /customer managed/ environment template that
--     connects Proton to your existing provisioned infrastructure that you
--     manage. 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/userguide/template-create.html Register and publish an environment template>
--     in the /Proton User Guide/.
module Amazonka.Proton.CreateEnvironmentTemplate
  ( -- * Creating a Request
    CreateEnvironmentTemplate (..),
    newCreateEnvironmentTemplate,

    -- * Request Lenses
    createEnvironmentTemplate_description,
    createEnvironmentTemplate_displayName,
    createEnvironmentTemplate_encryptionKey,
    createEnvironmentTemplate_provisioning,
    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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | A description of the environment template.
    CreateEnvironmentTemplate -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The environment template name as displayed in the developer interface.
    CreateEnvironmentTemplate -> Maybe (Sensitive Text)
displayName :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | A customer provided encryption key that Proton uses to encrypt data.
    CreateEnvironmentTemplate -> Maybe Text
encryptionKey :: Prelude.Maybe Prelude.Text,
    -- | When included, indicates that the environment template is for customer
    -- provisioned and managed infrastructure.
    CreateEnvironmentTemplate -> Maybe Provisioning
provisioning :: Prelude.Maybe Provisioning,
    -- | An optional list of metadata items that you can associate with the
    -- Proton environment template. A tag is a key-value pair.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/proton/latest/userguide/resources.html Proton resources and tagging>
    -- in the /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
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
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.
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:
--
-- 'description', 'createEnvironmentTemplate_description' - A description of the environment template.
--
-- 'displayName', 'createEnvironmentTemplate_displayName' - The environment template name as displayed in the developer interface.
--
-- 'encryptionKey', 'createEnvironmentTemplate_encryptionKey' - A customer provided encryption key that Proton uses to encrypt data.
--
-- 'provisioning', 'createEnvironmentTemplate_provisioning' - When included, indicates that the environment template is for customer
-- provisioned and managed infrastructure.
--
-- 'tags', 'createEnvironmentTemplate_tags' - An optional list of metadata items that you can associate with the
-- Proton environment template. A tag is a key-value pair.
--
-- For more information, see
-- <https://docs.aws.amazon.com/proton/latest/userguide/resources.html Proton resources and tagging>
-- in the /Proton User Guide/.
--
-- 'name', 'createEnvironmentTemplate_name' - The name of the environment template.
newCreateEnvironmentTemplate ::
  -- | 'name'
  Prelude.Text ->
  CreateEnvironmentTemplate
newCreateEnvironmentTemplate :: Text -> CreateEnvironmentTemplate
newCreateEnvironmentTemplate Text
pName_ =
  CreateEnvironmentTemplate'
    { $sel:description:CreateEnvironmentTemplate' :: Maybe (Sensitive Text)
description =
        forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:CreateEnvironmentTemplate' :: Maybe (Sensitive Text)
displayName = forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionKey:CreateEnvironmentTemplate' :: Maybe Text
encryptionKey = forall a. Maybe a
Prelude.Nothing,
      $sel:provisioning:CreateEnvironmentTemplate' :: Maybe Provisioning
provisioning = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateEnvironmentTemplate' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateEnvironmentTemplate' :: Text
name = Text
pName_
    }

-- | A description of the environment template.
createEnvironmentTemplate_description :: Lens.Lens' CreateEnvironmentTemplate (Prelude.Maybe Prelude.Text)
createEnvironmentTemplate_description :: Lens' CreateEnvironmentTemplate (Maybe Text)
createEnvironmentTemplate_description = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The environment template name as displayed in the developer interface.
createEnvironmentTemplate_displayName :: Lens.Lens' CreateEnvironmentTemplate (Prelude.Maybe Prelude.Text)
createEnvironmentTemplate_displayName :: Lens' CreateEnvironmentTemplate (Maybe Text)
createEnvironmentTemplate_displayName = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | A customer provided encryption key that Proton uses to encrypt data.
createEnvironmentTemplate_encryptionKey :: Lens.Lens' CreateEnvironmentTemplate (Prelude.Maybe Prelude.Text)
createEnvironmentTemplate_encryptionKey :: Lens' CreateEnvironmentTemplate (Maybe Text)
createEnvironmentTemplate_encryptionKey = 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)

-- | When included, indicates that the environment template is for customer
-- provisioned and managed infrastructure.
createEnvironmentTemplate_provisioning :: Lens.Lens' CreateEnvironmentTemplate (Prelude.Maybe Provisioning)
createEnvironmentTemplate_provisioning :: Lens' CreateEnvironmentTemplate (Maybe Provisioning)
createEnvironmentTemplate_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)

-- | An optional list of metadata items that you can associate with the
-- Proton environment template. A tag is a key-value pair.
--
-- For more information, see
-- <https://docs.aws.amazon.com/proton/latest/userguide/resources.html Proton resources and tagging>
-- in the /Proton User Guide/.
createEnvironmentTemplate_tags :: Lens.Lens' CreateEnvironmentTemplate (Prelude.Maybe [Tag])
createEnvironmentTemplate_tags :: Lens' CreateEnvironmentTemplate (Maybe [Tag])
createEnvironmentTemplate_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the environment template.
createEnvironmentTemplate_name :: Lens.Lens' CreateEnvironmentTemplate Prelude.Text
createEnvironmentTemplate_name :: Lens' CreateEnvironmentTemplate Text
createEnvironmentTemplate_name = 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 :: (Service -> Service)
-> CreateEnvironmentTemplate -> Request CreateEnvironmentTemplate
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateEnvironmentTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateEnvironmentTemplate)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> EnvironmentTemplate -> CreateEnvironmentTemplateResponse
CreateEnvironmentTemplateResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"environmentTemplate")
      )

instance Prelude.Hashable CreateEnvironmentTemplate where
  hashWithSalt :: Int -> CreateEnvironmentTemplate -> Int
hashWithSalt Int
_salt CreateEnvironmentTemplate' {Maybe [Tag]
Maybe Text
Maybe (Sensitive Text)
Maybe Provisioning
Text
name :: Text
tags :: Maybe [Tag]
provisioning :: Maybe Provisioning
encryptionKey :: Maybe Text
displayName :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:name:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Text
$sel:tags:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe [Tag]
$sel:provisioning:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe Provisioning
$sel:encryptionKey:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe Text
$sel:displayName:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe (Sensitive Text)
$sel:description:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
displayName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
encryptionKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Provisioning
provisioning
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData CreateEnvironmentTemplate where
  rnf :: CreateEnvironmentTemplate -> ()
rnf CreateEnvironmentTemplate' {Maybe [Tag]
Maybe Text
Maybe (Sensitive Text)
Maybe Provisioning
Text
name :: Text
tags :: Maybe [Tag]
provisioning :: Maybe Provisioning
encryptionKey :: Maybe Text
displayName :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:name:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Text
$sel:tags:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe [Tag]
$sel:provisioning:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe Provisioning
$sel:encryptionKey:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe Text
$sel:displayName:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe (Sensitive Text)
$sel:description:CreateEnvironmentTemplate' :: CreateEnvironmentTemplate -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
displayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
encryptionKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Provisioning
provisioning
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

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

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

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

instance Data.ToQuery CreateEnvironmentTemplate where
  toQuery :: CreateEnvironmentTemplate -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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 Proton.
    CreateEnvironmentTemplateResponse -> EnvironmentTemplate
environmentTemplate :: EnvironmentTemplate
  }
  deriving (CreateEnvironmentTemplateResponse
-> CreateEnvironmentTemplateResponse -> Bool
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
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.
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 Proton.
newCreateEnvironmentTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'environmentTemplate'
  EnvironmentTemplate ->
  CreateEnvironmentTemplateResponse
newCreateEnvironmentTemplateResponse :: Int -> EnvironmentTemplate -> CreateEnvironmentTemplateResponse
newCreateEnvironmentTemplateResponse
  Int
pHttpStatus_
  EnvironmentTemplate
pEnvironmentTemplate_ =
    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 :: Lens' CreateEnvironmentTemplateResponse Int
createEnvironmentTemplateResponse_httpStatus = 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 Proton.
createEnvironmentTemplateResponse_environmentTemplate :: Lens.Lens' CreateEnvironmentTemplateResponse EnvironmentTemplate
createEnvironmentTemplateResponse_environmentTemplate :: Lens' CreateEnvironmentTemplateResponse EnvironmentTemplate
createEnvironmentTemplateResponse_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
  where
  rnf :: CreateEnvironmentTemplateResponse -> ()
rnf CreateEnvironmentTemplateResponse' {Int
EnvironmentTemplate
environmentTemplate :: EnvironmentTemplate
httpStatus :: Int
$sel:environmentTemplate:CreateEnvironmentTemplateResponse' :: CreateEnvironmentTemplateResponse -> EnvironmentTemplate
$sel:httpStatus:CreateEnvironmentTemplateResponse' :: CreateEnvironmentTemplateResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EnvironmentTemplate
environmentTemplate