{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.EnvironmentTemplate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Proton.Types.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.Provisioning

-- | The environment template data.
--
-- /See:/ 'newEnvironmentTemplate' smart constructor.
data EnvironmentTemplate = EnvironmentTemplate'
  { -- | A description of the environment template.
    EnvironmentTemplate -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The name of the environment template as displayed in the developer
    -- interface.
    EnvironmentTemplate -> Maybe (Sensitive Text)
displayName :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The customer provided encryption key for the environment template.
    EnvironmentTemplate -> Maybe Text
encryptionKey :: Prelude.Maybe Prelude.Text,
    -- | When included, indicates that the environment template is for customer
    -- provisioned and managed infrastructure.
    EnvironmentTemplate -> Maybe Provisioning
provisioning :: Prelude.Maybe Provisioning,
    -- | The ID of the recommended version of the environment template.
    EnvironmentTemplate -> Maybe Text
recommendedVersion :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the environment template.
    EnvironmentTemplate -> Text
arn :: Prelude.Text,
    -- | The time when the environment template was created.
    EnvironmentTemplate -> POSIX
createdAt :: Data.POSIX,
    -- | The time when the environment template was last modified.
    EnvironmentTemplate -> POSIX
lastModifiedAt :: Data.POSIX,
    -- | The name of the environment template.
    EnvironmentTemplate -> Text
name :: Prelude.Text
  }
  deriving (EnvironmentTemplate -> EnvironmentTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnvironmentTemplate -> EnvironmentTemplate -> Bool
$c/= :: EnvironmentTemplate -> EnvironmentTemplate -> Bool
== :: EnvironmentTemplate -> EnvironmentTemplate -> Bool
$c== :: EnvironmentTemplate -> EnvironmentTemplate -> Bool
Prelude.Eq, Int -> EnvironmentTemplate -> ShowS
[EnvironmentTemplate] -> ShowS
EnvironmentTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnvironmentTemplate] -> ShowS
$cshowList :: [EnvironmentTemplate] -> ShowS
show :: EnvironmentTemplate -> String
$cshow :: EnvironmentTemplate -> String
showsPrec :: Int -> EnvironmentTemplate -> ShowS
$cshowsPrec :: Int -> EnvironmentTemplate -> ShowS
Prelude.Show, forall x. Rep EnvironmentTemplate x -> EnvironmentTemplate
forall x. EnvironmentTemplate -> Rep EnvironmentTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnvironmentTemplate x -> EnvironmentTemplate
$cfrom :: forall x. EnvironmentTemplate -> Rep EnvironmentTemplate x
Prelude.Generic)

-- |
-- Create a value of 'EnvironmentTemplate' 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', 'environmentTemplate_description' - A description of the environment template.
--
-- 'displayName', 'environmentTemplate_displayName' - The name of the environment template as displayed in the developer
-- interface.
--
-- 'encryptionKey', 'environmentTemplate_encryptionKey' - The customer provided encryption key for the environment template.
--
-- 'provisioning', 'environmentTemplate_provisioning' - When included, indicates that the environment template is for customer
-- provisioned and managed infrastructure.
--
-- 'recommendedVersion', 'environmentTemplate_recommendedVersion' - The ID of the recommended version of the environment template.
--
-- 'arn', 'environmentTemplate_arn' - The Amazon Resource Name (ARN) of the environment template.
--
-- 'createdAt', 'environmentTemplate_createdAt' - The time when the environment template was created.
--
-- 'lastModifiedAt', 'environmentTemplate_lastModifiedAt' - The time when the environment template was last modified.
--
-- 'name', 'environmentTemplate_name' - The name of the environment template.
newEnvironmentTemplate ::
  -- | 'arn'
  Prelude.Text ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'lastModifiedAt'
  Prelude.UTCTime ->
  -- | 'name'
  Prelude.Text ->
  EnvironmentTemplate
newEnvironmentTemplate :: Text -> UTCTime -> UTCTime -> Text -> EnvironmentTemplate
newEnvironmentTemplate
  Text
pArn_
  UTCTime
pCreatedAt_
  UTCTime
pLastModifiedAt_
  Text
pName_ =
    EnvironmentTemplate'
      { $sel:description:EnvironmentTemplate' :: Maybe (Sensitive Text)
description = forall a. Maybe a
Prelude.Nothing,
        $sel:displayName:EnvironmentTemplate' :: Maybe (Sensitive Text)
displayName = forall a. Maybe a
Prelude.Nothing,
        $sel:encryptionKey:EnvironmentTemplate' :: Maybe Text
encryptionKey = forall a. Maybe a
Prelude.Nothing,
        $sel:provisioning:EnvironmentTemplate' :: Maybe Provisioning
provisioning = forall a. Maybe a
Prelude.Nothing,
        $sel:recommendedVersion:EnvironmentTemplate' :: Maybe Text
recommendedVersion = forall a. Maybe a
Prelude.Nothing,
        $sel:arn:EnvironmentTemplate' :: Text
arn = Text
pArn_,
        $sel:createdAt:EnvironmentTemplate' :: POSIX
createdAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
        $sel:lastModifiedAt:EnvironmentTemplate' :: POSIX
lastModifiedAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedAt_,
        $sel:name:EnvironmentTemplate' :: Text
name = Text
pName_
      }

-- | A description of the environment template.
environmentTemplate_description :: Lens.Lens' EnvironmentTemplate (Prelude.Maybe Prelude.Text)
environmentTemplate_description :: Lens' EnvironmentTemplate (Maybe Text)
environmentTemplate_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentTemplate' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:EnvironmentTemplate' :: EnvironmentTemplate -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: EnvironmentTemplate
s@EnvironmentTemplate' {} Maybe (Sensitive Text)
a -> EnvironmentTemplate
s {$sel:description:EnvironmentTemplate' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: EnvironmentTemplate) 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 name of the environment template as displayed in the developer
-- interface.
environmentTemplate_displayName :: Lens.Lens' EnvironmentTemplate (Prelude.Maybe Prelude.Text)
environmentTemplate_displayName :: Lens' EnvironmentTemplate (Maybe Text)
environmentTemplate_displayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentTemplate' {Maybe (Sensitive Text)
displayName :: Maybe (Sensitive Text)
$sel:displayName:EnvironmentTemplate' :: EnvironmentTemplate -> Maybe (Sensitive Text)
displayName} -> Maybe (Sensitive Text)
displayName) (\s :: EnvironmentTemplate
s@EnvironmentTemplate' {} Maybe (Sensitive Text)
a -> EnvironmentTemplate
s {$sel:displayName:EnvironmentTemplate' :: Maybe (Sensitive Text)
displayName = Maybe (Sensitive Text)
a} :: EnvironmentTemplate) 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 customer provided encryption key for the environment template.
environmentTemplate_encryptionKey :: Lens.Lens' EnvironmentTemplate (Prelude.Maybe Prelude.Text)
environmentTemplate_encryptionKey :: Lens' EnvironmentTemplate (Maybe Text)
environmentTemplate_encryptionKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentTemplate' {Maybe Text
encryptionKey :: Maybe Text
$sel:encryptionKey:EnvironmentTemplate' :: EnvironmentTemplate -> Maybe Text
encryptionKey} -> Maybe Text
encryptionKey) (\s :: EnvironmentTemplate
s@EnvironmentTemplate' {} Maybe Text
a -> EnvironmentTemplate
s {$sel:encryptionKey:EnvironmentTemplate' :: Maybe Text
encryptionKey = Maybe Text
a} :: EnvironmentTemplate)

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

-- | The ID of the recommended version of the environment template.
environmentTemplate_recommendedVersion :: Lens.Lens' EnvironmentTemplate (Prelude.Maybe Prelude.Text)
environmentTemplate_recommendedVersion :: Lens' EnvironmentTemplate (Maybe Text)
environmentTemplate_recommendedVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentTemplate' {Maybe Text
recommendedVersion :: Maybe Text
$sel:recommendedVersion:EnvironmentTemplate' :: EnvironmentTemplate -> Maybe Text
recommendedVersion} -> Maybe Text
recommendedVersion) (\s :: EnvironmentTemplate
s@EnvironmentTemplate' {} Maybe Text
a -> EnvironmentTemplate
s {$sel:recommendedVersion:EnvironmentTemplate' :: Maybe Text
recommendedVersion = Maybe Text
a} :: EnvironmentTemplate)

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

-- | The time when the environment template was created.
environmentTemplate_createdAt :: Lens.Lens' EnvironmentTemplate Prelude.UTCTime
environmentTemplate_createdAt :: Lens' EnvironmentTemplate UTCTime
environmentTemplate_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentTemplate' {POSIX
createdAt :: POSIX
$sel:createdAt:EnvironmentTemplate' :: EnvironmentTemplate -> POSIX
createdAt} -> POSIX
createdAt) (\s :: EnvironmentTemplate
s@EnvironmentTemplate' {} POSIX
a -> EnvironmentTemplate
s {$sel:createdAt:EnvironmentTemplate' :: POSIX
createdAt = POSIX
a} :: EnvironmentTemplate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The time when the environment template was last modified.
environmentTemplate_lastModifiedAt :: Lens.Lens' EnvironmentTemplate Prelude.UTCTime
environmentTemplate_lastModifiedAt :: Lens' EnvironmentTemplate UTCTime
environmentTemplate_lastModifiedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentTemplate' {POSIX
lastModifiedAt :: POSIX
$sel:lastModifiedAt:EnvironmentTemplate' :: EnvironmentTemplate -> POSIX
lastModifiedAt} -> POSIX
lastModifiedAt) (\s :: EnvironmentTemplate
s@EnvironmentTemplate' {} POSIX
a -> EnvironmentTemplate
s {$sel:lastModifiedAt:EnvironmentTemplate' :: POSIX
lastModifiedAt = POSIX
a} :: EnvironmentTemplate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

instance Data.FromJSON EnvironmentTemplate where
  parseJSON :: Value -> Parser EnvironmentTemplate
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EnvironmentTemplate"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Provisioning
-> Maybe Text
-> Text
-> POSIX
-> POSIX
-> Text
-> EnvironmentTemplate
EnvironmentTemplate'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"displayName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"encryptionKey")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"provisioning")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"recommendedVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"createdAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"lastModifiedAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
      )

instance Prelude.Hashable EnvironmentTemplate where
  hashWithSalt :: Int -> EnvironmentTemplate -> Int
hashWithSalt Int
_salt EnvironmentTemplate' {Maybe Text
Maybe (Sensitive Text)
Maybe Provisioning
Text
POSIX
name :: Text
lastModifiedAt :: POSIX
createdAt :: POSIX
arn :: Text
recommendedVersion :: Maybe Text
provisioning :: Maybe Provisioning
encryptionKey :: Maybe Text
displayName :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:name:EnvironmentTemplate' :: EnvironmentTemplate -> Text
$sel:lastModifiedAt:EnvironmentTemplate' :: EnvironmentTemplate -> POSIX
$sel:createdAt:EnvironmentTemplate' :: EnvironmentTemplate -> POSIX
$sel:arn:EnvironmentTemplate' :: EnvironmentTemplate -> Text
$sel:recommendedVersion:EnvironmentTemplate' :: EnvironmentTemplate -> Maybe Text
$sel:provisioning:EnvironmentTemplate' :: EnvironmentTemplate -> Maybe Provisioning
$sel:encryptionKey:EnvironmentTemplate' :: EnvironmentTemplate -> Maybe Text
$sel:displayName:EnvironmentTemplate' :: EnvironmentTemplate -> Maybe (Sensitive Text)
$sel:description:EnvironmentTemplate' :: EnvironmentTemplate -> 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 Text
recommendedVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
lastModifiedAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData EnvironmentTemplate where
  rnf :: EnvironmentTemplate -> ()
rnf EnvironmentTemplate' {Maybe Text
Maybe (Sensitive Text)
Maybe Provisioning
Text
POSIX
name :: Text
lastModifiedAt :: POSIX
createdAt :: POSIX
arn :: Text
recommendedVersion :: Maybe Text
provisioning :: Maybe Provisioning
encryptionKey :: Maybe Text
displayName :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:name:EnvironmentTemplate' :: EnvironmentTemplate -> Text
$sel:lastModifiedAt:EnvironmentTemplate' :: EnvironmentTemplate -> POSIX
$sel:createdAt:EnvironmentTemplate' :: EnvironmentTemplate -> POSIX
$sel:arn:EnvironmentTemplate' :: EnvironmentTemplate -> Text
$sel:recommendedVersion:EnvironmentTemplate' :: EnvironmentTemplate -> Maybe Text
$sel:provisioning:EnvironmentTemplate' :: EnvironmentTemplate -> Maybe Provisioning
$sel:encryptionKey:EnvironmentTemplate' :: EnvironmentTemplate -> Maybe Text
$sel:displayName:EnvironmentTemplate' :: EnvironmentTemplate -> Maybe (Sensitive Text)
$sel:description:EnvironmentTemplate' :: EnvironmentTemplate -> 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 Text
recommendedVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
lastModifiedAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name